MCPcopy Index your code
hub / github.com/nodejs/node / runInNewContext

Function runInNewContext

lib/vm.js:305–312  ·  view source on GitHub ↗
(code, contextObject, options)

Source from the content-addressed store, hash-verified

303}
304
305function runInNewContext(code, contextObject, options) {
306 if (typeof options === 'string') {
307 options = { filename: options };
308 }
309 contextObject = createContext(contextObject, getContextOptions(options));
310 options = { ...options, [kParsingContext]: contextObject };
311 return createScript(code, options).runInNewContext(contextObject, options);
312}
313
314function runInThisContext(code, options) {
315 if (typeof options === 'string') {

Callers 6

lazyGetStructuredStackFunction · 0.85
getInternalGlobalFunction · 0.85
worker.jsFile · 0.85
test-vm-codegen.jsFile · 0.85

Calls 4

createContextFunction · 0.85
getContextOptionsFunction · 0.85
createScriptFunction · 0.85
runInNewContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…