From bc81fef988a67e6e2007de2aaf6b4d1f5a28a88e Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Mon, 7 Jan 2019 13:39:43 -0800 Subject: [PATCH] vm: mark scripts as shareable cross-origin PR-URL: https://github.com/nodejs/node/pull/25380 Reviewed-By: Joyee Cheung Reviewed-By: Ujjwal Sharma Reviewed-By: Yang Guo Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- src/module_wrap.cc | 2 +- src/node_contextify.cc | 4 ++-- src/node_native_module.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 8599029fea1f9f..4414e874ffa697 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -148,7 +148,7 @@ void ModuleWrap::New(const FunctionCallbackInfo& args) { ScriptOrigin origin(url, line_offset, // line offset column_offset, // column offset - False(isolate), // is cross origin + True(isolate), // is cross origin Local(), // script id Local(), // source map URL False(isolate), // is opaque (?) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index fc89f58f8bef65..fd17ae179f610e 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -692,7 +692,7 @@ void ContextifyScript::New(const FunctionCallbackInfo& args) { ScriptOrigin origin(filename, line_offset, // line offset column_offset, // column offset - False(isolate), // is cross origin + True(isolate), // is cross origin Local(), // script id Local(), // source map URL False(isolate), // is opaque (?) @@ -1004,7 +1004,7 @@ void ContextifyContext::CompileFunction( data + cached_data_buf->ByteOffset(), cached_data_buf->ByteLength()); } - ScriptOrigin origin(filename, line_offset, column_offset); + ScriptOrigin origin(filename, line_offset, column_offset, True(isolate)); ScriptCompiler::Source source(code, origin, cached_data); ScriptCompiler::CompileOptions options; if (source.GetCachedData() == nullptr) { diff --git a/src/node_native_module.cc b/src/node_native_module.cc index fed9cfb139c066..bc911795fba8c7 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -218,7 +218,7 @@ MaybeLocal NativeModuleLoader::LookupAndCompile( OneByteString(isolate, filename_s.c_str(), filename_s.size()); Local line_offset = Integer::New(isolate, 0); Local column_offset = Integer::New(isolate, 0); - ScriptOrigin origin(filename, line_offset, column_offset); + ScriptOrigin origin(filename, line_offset, column_offset, True(isolate)); Mutex::ScopedLock lock(code_cache_mutex_);