0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/message/stdin_messages.js
Ben Noordhuis c2b8b30836 test: remove stray copyright notices
Commit 3e1b1dd ("Remove excessive copyright/license boilerplate") left
in a few lines of boilerplate here and there.  This commit removes them.

PR-URL: https://github.com/nodejs/io.js/pull/1793
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-05-26 17:17:40 +02:00

35 lines
735 B
JavaScript

'use strict';
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();