mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
a030c5cf49
Many test modules load assert but do not use it. This change removes those instances. It also removes a handful of other unused variables when they were nearby. PR-URL: https://github.com/nodejs/node/pull/4438 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
34 lines
690 B
JavaScript
34 lines
690 B
JavaScript
'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('-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();
|