mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
672 B
32 lines
672 B
'use strict';
|
|
|
|
require('../common');
|
|
|
|
var spawn = require('child_process').spawn;
|
|
|
|
function run(cmd, strict, cb) {
|
|
var args = [];
|
|
if (strict) args.push('--use_strict');
|
|
args.push('-pe', cmd);
|
|
var child = spawn(process.execPath, args);
|
|
child.stdout.pipe(process.stdout);
|
|
child.stderr.pipe(process.stdout);
|
|
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();
|
|
|