Skip to content

Commit

Permalink
vm: mark scripts as shareable cross-origin
Browse files Browse the repository at this point in the history
PR-URL: nodejs#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 28, 2019
1 parent f399b01 commit 817218c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 (?)
Expand Down
4 changes: 2 additions & 2 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 (?)
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/node_native_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,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_);

Expand Down

0 comments on commit 817218c

Please sign in to comment.