Skip to content

Commit bc81fef

Browse files
nornagonaddaleax
authored andcommitted
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>
1 parent 29002ce commit bc81fef

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/module_wrap.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
148148
ScriptOrigin origin(url,
149149
line_offset, // line offset
150150
column_offset, // column offset
151-
False(isolate), // is cross origin
151+
True(isolate), // is cross origin
152152
Local<Integer>(), // script id
153153
Local<Value>(), // source map URL
154154
False(isolate), // is opaque (?)

src/node_contextify.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
692692
ScriptOrigin origin(filename,
693693
line_offset, // line offset
694694
column_offset, // column offset
695-
False(isolate), // is cross origin
695+
True(isolate), // is cross origin
696696
Local<Integer>(), // script id
697697
Local<Value>(), // source map URL
698698
False(isolate), // is opaque (?)
@@ -1004,7 +1004,7 @@ void ContextifyContext::CompileFunction(
10041004
data + cached_data_buf->ByteOffset(), cached_data_buf->ByteLength());
10051005
}
10061006

1007-
ScriptOrigin origin(filename, line_offset, column_offset);
1007+
ScriptOrigin origin(filename, line_offset, column_offset, True(isolate));
10081008
ScriptCompiler::Source source(code, origin, cached_data);
10091009
ScriptCompiler::CompileOptions options;
10101010
if (source.GetCachedData() == nullptr) {

src/node_native_module.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ MaybeLocal<Function> NativeModuleLoader::LookupAndCompile(
218218
OneByteString(isolate, filename_s.c_str(), filename_s.size());
219219
Local<Integer> line_offset = Integer::New(isolate, 0);
220220
Local<Integer> column_offset = Integer::New(isolate, 0);
221-
ScriptOrigin origin(filename, line_offset, column_offset);
221+
ScriptOrigin origin(filename, line_offset, column_offset, True(isolate));
222222

223223
Mutex::ScopedLock lock(code_cache_mutex_);
224224

0 commit comments

Comments
 (0)