Exit HandleScope before snapshotting (#4168)

The V8 documentation explicitly states that SnapshotCreator::CreateBlob()
should not be called from within a HandleScope.

Additionally, this patch removes some non-functional error handling code
from the deno_core::Isolate::snapshot() method.
This commit is contained in:
Bert Belder 2020-02-27 23:28:33 -08:00
parent 9075daa2e3
commit bc7dbfafff
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
2 changed files with 13 additions and 13 deletions

View file

@ -232,7 +232,7 @@ fn write_snapshot(
snapshot_filename: &Path,
) -> Result<(), ErrBox> {
println!("Creating snapshot...");
let snapshot = runtime_isolate.snapshot()?;
let snapshot = runtime_isolate.snapshot();
let snapshot_slice: &[u8] = &*snapshot;
println!("Snapshot size: {}", snapshot_slice.len());
fs::write(&snapshot_filename, snapshot_slice)?;