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

Function runInContext

lib/vm.js:291–303  ·  view source on GitHub ↗
(code, contextifiedObject, options)

Source from the content-addressed store, hash-verified

289}
290
291function runInContext(code, contextifiedObject, options) {
292 validateContext(contextifiedObject);
293 if (typeof options === 'string') {
294 options = {
295 filename: options,
296 [kParsingContext]: contextifiedObject,
297 };
298 } else {
299 options = { ...options, [kParsingContext]: contextifiedObject };
300 }
301 return createScript(code, options)
302 .runInContext(contextifiedObject, options);
303}
304
305function runInNewContext(code, contextObject, options) {
306 if (typeof options === 'string') {

Callers 2

readFileMethod · 0.85
test-vm-codegen.jsFile · 0.85

Calls 3

validateContextFunction · 0.85
createScriptFunction · 0.85
runInContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…