Permalink
Browse files

vm: mark scripts as shareable cross-origin

PR-URL: #25380
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
nornagon authored and addaleax committed Jan 7, 2019
1 parent 29002ce commit bc81fef988a67e6e2007de2aaf6b4d1f5a28a88e
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/module_wrap.cc
  2. +2 −2 src/node_contextify.cc
  3. +1 −1 src/node_native_module.cc
@@ -148,7 +148,7 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
ScriptOrigin origin(url,
line_offset, // line offset
column_offset, // column offset
False(isolate), // is cross origin
True(isolate), // is cross origin
Local<Integer>(), // script id
Local<Value>(), // source map URL
False(isolate), // is opaque (?)
@@ -692,7 +692,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
ScriptOrigin origin(filename,
line_offset, // line offset
column_offset, // column offset
False(isolate), // is cross origin
True(isolate), // is cross origin
Local<Integer>(), // script id
Local<Value>(), // 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) {
@@ -218,7 +218,7 @@ MaybeLocal<Function> NativeModuleLoader::LookupAndCompile(
OneByteString(isolate, filename_s.c_str(), filename_s.size());
Local<Integer> line_offset = Integer::New(isolate, 0);
Local<Integer> 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_);

0 comments on commit bc81fef

Please sign in to comment.