mirror of
https://github.com/nodejs/node.git
synced 2025-05-20 01:45:06 +00:00

The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
35 lines
763 B
JavaScript
35 lines
763 B
JavaScript
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var spawn = require('child_process').spawn;
|
|
|
|
function run(cmd, strict, cb) {
|
|
var args = [];
|
|
if (strict) args.push('--use_strict');
|
|
args.push('-p');
|
|
var child = spawn(process.execPath, args);
|
|
child.stdout.pipe(process.stdout);
|
|
child.stderr.pipe(process.stdout);
|
|
child.stdin.end(cmd);
|
|
child.on('close', cb);
|
|
}
|
|
|
|
var queue =
|
|
[ 'with(this){__filename}',
|
|
'42',
|
|
'throw new Error("hello")',
|
|
'var x = 100; y = x;',
|
|
'var ______________________________________________; throw 10' ];
|
|
|
|
function go() {
|
|
var c = queue.shift();
|
|
if (!c) return console.log('done');
|
|
run(c, false, function() {
|
|
run(c, true, go);
|
|
});
|
|
}
|
|
|
|
go();
|