2 // Copyright Joyent, Inc. and other Node contributors.
4 // Permission is hereby granted, free of charge, to any person obtaining a
5 // copy of this software and associated documentation files (the
6 // "Software"), to deal in the Software without restriction, including
7 // without limitation the rights to use, copy, modify, merge, publish,
8 // distribute, sublicense, and/or sell copies of the Software, and to permit
9 // persons to whom the Software is furnished to do so, subject to the
10 // following conditions:
12 // The above copyright notice and this permission notice shall be included
13 // in all copies or substantial portions of the Software.
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
18 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 // USE OR OTHER DEALINGS IN THE SOFTWARE.
23 var common = require('../common');
24 var assert = require('assert');
26 var spawn = require('child_process').spawn;
28 function run(cmd, strict, cb) {
30 if (strict) args.push('--use_strict');
32 var child = spawn(process.execPath, args);
33 child.stdout.pipe(process.stdout);
34 child.stderr.pipe(process.stdout);
36 child.on('close', cb);
40 [ 'with(this){__filename}',
42 'throw new Error("hello")',
43 'var x = 100; y = x;',
44 'var ______________________________________________; throw 10' ];
47 var c = queue.shift();
48 if (!c) return console.log('done');
49 run(c, false, function() {