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: #25380
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: Yang Guo <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
nornagon authored and addaleax committed Jan 28, 2019
1 parent 29002ce commit bc81fef
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 @@ -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_);

Expand Down

0 comments on commit bc81fef

Please sign in to comment.