mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
14 lines
481 B
JavaScript
14 lines
481 B
JavaScript
|
'use strict';
|
||
|
require('../common');
|
||
|
const { findByRetainingPath } = require('../common/heap');
|
||
|
const source = 'const foo = 123';
|
||
|
const script = require('vm').createScript(source);
|
||
|
|
||
|
findByRetainingPath('Node / ContextifyScript', [
|
||
|
{ node_name: '(shared function info)' }, // This is the UnboundScript referenced by ContextifyScript.
|
||
|
{ edge_name: 'script' },
|
||
|
{ edge_name: 'source', node_type: 'string', node_name: source },
|
||
|
]);
|
||
|
|
||
|
console.log(script); // Keep the script alive.
|