diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-11-26 14:20:16 -0500 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-11-27 11:33:23 -0800 |
commit | 570269b73de713afcff712977d11a3910ed849ad (patch) | |
tree | 2a505eaf6e5f16223fff5bc905ba9f1897990dc0 /libdeno/api.cc | |
parent | a25497fb66b3bc98caeb92b17bb9ab8754b651c2 (diff) |
Don't use snapshot for src/isolate.rs tests.
Diffstat (limited to 'libdeno/api.cc')
-rw-r--r-- | libdeno/api.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libdeno/api.cc b/libdeno/api.cc index 6ee2c934f..c059bb534 100644 --- a/libdeno/api.cc +++ b/libdeno/api.cc @@ -36,6 +36,11 @@ Deno* deno_new(deno_buf snapshot, deno_buf shared, deno_recv_cb cb) { v8::MaybeLocal<v8::Value>(), v8::DeserializeInternalFieldsCallback( deno::DeserializeInternalFields, nullptr)); + if (!snapshot.data_ptr) { + // If no snapshot is provided, we initialize the context with empty + // main source code and source maps. + deno::InitializeContext(isolate, context, "", "", ""); + } d->context_.Reset(isolate, context); } |