mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
7a0e462f9f
Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
34 lines
700 B
JavaScript
34 lines
700 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const spawn = require('child_process').spawn;
|
|
|
|
function run(cmd, strict, cb) {
|
|
const args = [];
|
|
if (strict) args.push('--use_strict');
|
|
args.push('-p');
|
|
const child = spawn(process.execPath, args);
|
|
child.stdout.pipe(process.stdout);
|
|
child.stderr.pipe(process.stdout);
|
|
child.stdin.end(cmd);
|
|
child.on('close', cb);
|
|
}
|
|
|
|
const queue =
|
|
[ 'with(this){__filename}',
|
|
'42',
|
|
'throw new Error("hello")',
|
|
'var x = 100; y = x;',
|
|
'var ______________________________________________; throw 10' ];
|
|
|
|
function go() {
|
|
const c = queue.shift();
|
|
if (!c) return console.log('done');
|
|
run(c, false, function() {
|
|
run(c, true, go);
|
|
});
|
|
}
|
|
|
|
go();
|