forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repl: give repl entries unique names.
This is a workaround for the REPL for a problem when multiple of the entries have the same source text Fixes: nodejs#1337 Refs: https://bugs.chromium.org/p/v8/issues/detail?id=10284
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
require('../common'); | ||
const assert = require('assert'); | ||
const child_process = require('child_process'); | ||
const child = child_process.spawn(process.execPath, [ | ||
'--interactive', | ||
'--expose-gc' | ||
], { | ||
stdio: 'pipe' | ||
}); | ||
child.stdin.write('\nimport("fs");\n_.then(gc);\n'); | ||
// Wait for concurrent GC to finish | ||
setTimeout(() => { | ||
child.stdin.write('\nimport("fs");\n'); | ||
child.stdin.write('\nprocess.exit(0);\n'); | ||
}, 500); | ||
child.on('exit', (code, signal) => { | ||
assert.strictEqual(code, 0); | ||
assert.strictEqual(signal, null); | ||
}); |