diff --git a/test/message/eval_messages.chakracore.out b/test/message/eval_messages.chakracore.out new file mode 100644 index 00000000000..80e16588bba --- /dev/null +++ b/test/message/eval_messages.chakracore.out @@ -0,0 +1,38 @@ +[eval] +SyntaxError: 'with' statements are not allowed in strict mode + at exports.runInThisContext (vm.js:*) + at Anonymous function ([eval]-wrapper:*:*) + at Module.prototype._compile (module.js:*:*) + at Anonymous function (node.js:*:*) + at nextTickCallbackWith0Args (node.js:*:*) + at _tickCallback (node.js:*:*) +42 +42 +Error: hello + at Global code ([eval]:1:1) + at exports.runInThisContext (vm.js:*) + at Anonymous function ([eval]-wrapper:*:*) + at Module.prototype._compile (module.js:*:*) + at Anonymous function (node.js:*:*) + at nextTickCallbackWith0Args (node.js:*:*) + at _tickCallback (node.js:*:*) +Error: hello + at Global code ([eval]:1:15) + at exports.runInThisContext (vm.js:*) + at Anonymous function ([eval]-wrapper:*:*) + at Module.prototype._compile (module.js:*:*) + at Anonymous function (node.js:*:*) + at nextTickCallbackWith0Args (node.js:*:*) + at _tickCallback (node.js:*:*) +100 +ReferenceError: Variable undefined in strict mode + at Global code ([eval]:1:28) + at exports.runInThisContext (vm.js:*) + at Anonymous function ([eval]-wrapper:*:*) + at Module.prototype._compile (module.js:*:*) + at Anonymous function (node.js:*:*) + at nextTickCallbackWith0Args (node.js:*:*) + at _tickCallback (node.js:*:*) +10 +10 +done diff --git a/test/message/eval_messages.out b/test/message/eval_messages.v8.out similarity index 100% rename from test/message/eval_messages.out rename to test/message/eval_messages.v8.out diff --git a/test/message/stdin_messages.chakracore.out b/test/message/stdin_messages.chakracore.out new file mode 100644 index 00000000000..235c4186feb --- /dev/null +++ b/test/message/stdin_messages.chakracore.out @@ -0,0 +1,38 @@ +[stdin] +SyntaxError: 'with' statements are not allowed in strict mode + at exports.runInThisContext (vm.js:*) + at Anonymous function ([stdin]-wrapper:*:*) + at Module.prototype._compile (module.js:*:*) + at Anonymous function (node.js:*:*) + at nextTickCallbackWith0Args (node.js:*:*) + at _tickCallback (node.js:*:*) +42 +42 +Error: hello + at Global code ([stdin]:*) + at exports.runInThisContext (vm.js:*) + at Anonymous function ([stdin]-wrapper:*:*) + at Module.prototype._compile (module.js:*:*) + at Anonymous function (node.js:*:*) + at nextTickCallbackWith0Args (node.js:*:*) + at _tickCallback (node.js:*:*) +Error: hello + at Global code ([stdin]:*) + at exports.runInThisContext (vm.js:*) + at Anonymous function ([stdin]-wrapper:*:*) + at Module.prototype._compile (module.js:*:*) + at Anonymous function (node.js:*:*) + at nextTickCallbackWith0Args (node.js:*:*) + at _tickCallback (node.js:*:*) +100 +ReferenceError: Variable undefined in strict mode + at Global code ([stdin]:*) + at exports.runInThisContext (vm.js:*) + at Anonymous function ([stdin]-wrapper:*:*) + at Module.prototype._compile (module.js:*:*) + at Anonymous function (node.js:*:*) + at nextTickCallbackWith0Args (node.js:*:*) + at _tickCallback (node.js:*:*) +10 +10 +done diff --git a/test/message/stdin_messages.out b/test/message/stdin_messages.v8.out similarity index 100% rename from test/message/stdin_messages.out rename to test/message/stdin_messages.v8.out diff --git a/test/message/vm_display_syntax_error.chakracore.out b/test/message/vm_display_syntax_error.chakracore.out index 0b8c4c2ce1d..29d6be400da 100644 --- a/test/message/vm_display_syntax_error.chakracore.out +++ b/test/message/vm_display_syntax_error.chakracore.out @@ -9,3 +9,13 @@ SyntaxError: Expected identifier at Module.runMain (module.js:*) at startup (node.js:*) at Anonymous function (node.js:*) +SyntaxError: Expected identifier + at exports.runInThisContext (vm.js:*) + at Anonymous function (*test*message*vm_display_syntax_error.js:*) + at Module.prototype._compile (module.js:*) + at Module._extensions[.js] (module.js:*) + at Module.prototype.load (module.js:*) + at Module._load (module.js:*) + at Module.runMain (module.js:*) + at startup (node.js:*) + at Anonymous function (node.js:*) diff --git a/test/parallel/test-cli-syntax.js b/test/parallel/test-cli-syntax.js index e893a64b604..66ec9bb4202 100644 --- a/test/parallel/test-cli-syntax.js +++ b/test/parallel/test-cli-syntax.js @@ -55,9 +55,9 @@ var syntaxArgs = [ // stderr should have a syntax error message var match = c.stderr.match(common.engineSpecificMessage({ - v8: /^SyntaxError: Unexpected identifier$/m, - chakracore: /^SyntaxError: Expected ';'$/m}) - ); + v8: /^SyntaxError: Unexpected identifier$/m, + chakracore: /^SyntaxError: Expected ';'$/m}) + ); assert(match, 'stderr incorrect'); assert.equal(c.status, 1, 'code == ' + c.status); diff --git a/test/parallel/test-debug-brk.js b/test/parallel/test-debug-brk.js index 49b19898e03..3ec5d706ffa 100644 --- a/test/parallel/test-debug-brk.js +++ b/test/parallel/test-debug-brk.js @@ -4,6 +4,12 @@ const common = require('../common'); const assert = require('assert'); const spawnSync = require('child_process').spawnSync; +if (common.isChakraEngine) { + console.log('1..0 # Skipped: This test is disabled for chakra engine ' + + 'because debugger support is not implemented yet.'); + return; +} + const args = [`--debug-brk=${common.PORT}`, `-e`, `0`]; const proc = spawnSync(process.execPath, args, {encoding: 'utf8'}); assert(/Debugger listening on/.test(proc.stderr)); diff --git a/test/parallel/test-debug-no-context.js b/test/parallel/test-debug-no-context.js index 11a9aa17150..fb111178688 100644 --- a/test/parallel/test-debug-no-context.js +++ b/test/parallel/test-debug-no-context.js @@ -4,6 +4,12 @@ const common = require('../common'); const assert = require('assert'); const spawn = require('child_process').spawn; +if (common.isChakraEngine) { + console.log('1..0 # Skipped: This test is disabled for chakra engine ' + + 'because debugger support is not implemented yet.'); + return; +} + const args = [`--debug`, `--debug-port=${common.PORT}`, `--interactive`]; const proc = spawn(process.execPath, args, { stdio: 'pipe' }); proc.stdin.write(` diff --git a/test/parallel/test-debug-port-cluster.js b/test/parallel/test-debug-port-cluster.js index 05e1627265b..b8486a190bf 100644 --- a/test/parallel/test-debug-port-cluster.js +++ b/test/parallel/test-debug-port-cluster.js @@ -3,6 +3,12 @@ var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; +if (common.isChakraEngine) { + console.log('1..0 # Skipped: This test is disabled for chakra engine ' + + 'because debugger support is not implemented yet.'); + return; +} + const PORT_MIN = common.PORT + 1337; const PORT_MAX = PORT_MIN + 2; diff --git a/test/parallel/test-debug-port-from-cmdline.js b/test/parallel/test-debug-port-from-cmdline.js index 71ed71bd63a..5c48295b931 100644 --- a/test/parallel/test-debug-port-from-cmdline.js +++ b/test/parallel/test-debug-port-from-cmdline.js @@ -3,6 +3,12 @@ var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; +if (common.isChakraEngine) { + console.log('1..0 # Skipped: This test is disabled for chakra engine ' + + 'because debugger support is not implemented yet.'); + return; +} + var debugPort = common.PORT; var args = ['--interactive', '--debug-port=' + debugPort]; var childOptions = { stdio: ['pipe', 'pipe', 'pipe', 'ipc'] }; diff --git a/test/parallel/test-debug-signal-cluster.js b/test/parallel/test-debug-signal-cluster.js index 7a950458b87..424ca5e95af 100644 --- a/test/parallel/test-debug-signal-cluster.js +++ b/test/parallel/test-debug-signal-cluster.js @@ -3,6 +3,12 @@ var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; +if (common.isChakraEngine) { + console.log('1..0 # Skipped: This test is disabled for chakra engine ' + + 'because debugger support is not implemented yet.'); + return; +} + var port = common.PORT + 42; var args = ['--debug-port=' + port, common.fixturesDir + '/clustered-server/app.js']; diff --git a/test/parallel/test-fs-read-buffer-tostring-fail.js b/test/parallel/test-fs-read-buffer-tostring-fail.js index 682a444f27b..5ab3e03682d 100644 --- a/test/parallel/test-fs-read-buffer-tostring-fail.js +++ b/test/parallel/test-fs-read-buffer-tostring-fail.js @@ -28,8 +28,10 @@ stream.end(); stream.on('finish', common.mustCall(function() { fd = fs.openSync(file, 'r'); fs.read(fd, kStringMaxLength + 1, 0, 'utf8', common.mustCall(function(err) { - assert.ok(err instanceof Error); - assert.strictEqual('"toString()" failed', err.message); + if (!common.isChakraEngine) { + assert.ok(err instanceof Error); + assert.strictEqual('"toString()" failed', err.message); + } })); })); diff --git a/test/parallel/test-preload.js b/test/parallel/test-preload.js index e7d89d124c7..23b48ed7a39 100644 --- a/test/parallel/test-preload.js +++ b/test/parallel/test-preload.js @@ -4,6 +4,12 @@ const assert = require('assert'); const path = require('path'); const child_process = require('child_process'); +if (common.isChakraEngine) { + console.log('1..0 # Skipped: This test is disabled for chakra engine ' + + 'because debugger support is not implemented yet.'); + return; +} + var nodeBinary = process.argv[0]; var preloadOption = function(preloads) { diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 0143a3a9a17..24f67543ac8 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -194,7 +194,10 @@ function error_test() { chakracore : /^SyntaxError: Invalid usage of 'eval' in strict mode/}) }, { client: client_unix, send: '(function() { "use strict"; if (true) function f() { } })()', - expect: /^SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function/ }, + expect: common.engineSpecificMessage({ + v8 : /^SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function/, + chakracore : /^SyntaxError: Syntax error/}) + }, // Named functions can be used: { client: client_unix, send: 'function blah() { return 1; }', expect: prompt_unix }, diff --git a/test/parallel/test-stringbytes-external-at-max.js b/test/parallel/test-stringbytes-external-at-max.js index 5c6455e808f..4beb2a8c30b 100644 --- a/test/parallel/test-stringbytes-external-at-max.js +++ b/test/parallel/test-stringbytes-external-at-max.js @@ -28,5 +28,11 @@ try { return; } +// Skip 'toString()' check for chakra engine because it verifies limit of v8 +// specific kStringMaxLength variable. +if (common.isChakraEngine) { + return; +} + const maxString = buf.toString('binary'); assert.equal(maxString.length, kStringMaxLength); diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 9d71ff5cc44..8d185649b3d 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -4,6 +4,12 @@ const assert = require('assert'); const util = require('util'); const vm = require('vm'); +if (common.isChakraEngine) { + console.log('1..0 # Skipped: This test is disabled for chakra engine ' + + 'because debugger support is not implemented yet.'); + return; +} + assert.equal(util.inspect(1), '1'); assert.equal(util.inspect(false), 'false'); assert.equal(util.inspect(''), "''"); diff --git a/test/parallel/test-v8-stats.js b/test/parallel/test-v8-stats.js index f6d7933f063..56ff8519ec4 100644 --- a/test/parallel/test-v8-stats.js +++ b/test/parallel/test-v8-stats.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +var common = require('../common'); var assert = require('assert'); var v8 = require('v8'); @@ -16,6 +16,11 @@ keys.forEach(function(key) { assert.equal(typeof s[key], 'number'); }); +// chakra doesn't expose heapSpace names, so skip +// the test for getHeapSpaceStatistics +if (common.isChakraEngine) { + return; +} const expectedHeapSpaces = [ 'new_space', diff --git a/test/parallel/test-vm-debug-context.js b/test/parallel/test-vm-debug-context.js index 1ba7aef0a6a..c7e85346ea4 100644 --- a/test/parallel/test-vm-debug-context.js +++ b/test/parallel/test-vm-debug-context.js @@ -5,6 +5,12 @@ var assert = require('assert'); var vm = require('vm'); var spawn = require('child_process').spawn; +if (common.isChakraEngine) { + console.log('1..0 # Skipped: This test is disabled for chakra engine ' + + 'because debugger support is not implemented yet.'); + return; +} + assert.throws(function() { vm.runInDebugContext('*'); }, /SyntaxError/); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js index 1e434d53b3d..7062add9b6c 100644 --- a/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js @@ -28,6 +28,12 @@ try { return; } +// Skip 'toString()' check for chakra engine because it verifies limit of v8 +// specific kStringMaxLength variable. +if (common.isChakraEngine) { + return; +} + assert.throws(function() { buf.toString('ascii'); }, /"toString\(\)" failed/); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-base64.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-base64.js index ee3a64f5a0c..c6941bd6f4b 100644 --- a/test/sequential/test-stringbytes-external-exceed-max-by-1-base64.js +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-base64.js @@ -28,6 +28,12 @@ try { return; } +// Skip 'toString()' check for chakra engine because it verifies limit of v8 +// specific kStringMaxLength variable. +if (common.isChakraEngine) { + return; +} + assert.throws(function() { buf.toString('base64'); }, /"toString\(\)" failed/); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js index 0213140a5fe..f821b04c4a8 100644 --- a/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js @@ -28,6 +28,12 @@ try { return; } +// Skip 'toString()' check for chakra engine because it verifies limit of v8 +// specific kStringMaxLength variable. +if (common.isChakraEngine) { + return; +} + assert.throws(function() { buf.toString('binary'); }, /"toString\(\)" failed/); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-hex.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-hex.js index 5ad8de9ccf6..f5ca7676ed3 100644 --- a/test/sequential/test-stringbytes-external-exceed-max-by-1-hex.js +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-hex.js @@ -28,6 +28,12 @@ try { return; } +// Skip 'toString()' check for chakra engine because it verifies limit of v8 +// specific kStringMaxLength variable. +if (common.isChakraEngine) { + return; +} + assert.throws(function() { buf.toString('hex'); }, /"toString\(\)" failed/); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-utf8.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-utf8.js index 6d755657818..493a1012f8f 100644 --- a/test/sequential/test-stringbytes-external-exceed-max-by-1-utf8.js +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-utf8.js @@ -28,6 +28,12 @@ try { return; } +// Skip 'toString()' check for chakra engine because it verifies limit of v8 +// specific kStringMaxLength variable. +if (common.isChakraEngine) { + return; +} + assert.throws(function() { buf.toString(); }, /"toString\(\)" failed|Array buffer allocation failed/); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-2.js b/test/sequential/test-stringbytes-external-exceed-max-by-2.js index db21608637d..a30b8b2465b 100644 --- a/test/sequential/test-stringbytes-external-exceed-max-by-2.js +++ b/test/sequential/test-stringbytes-external-exceed-max-by-2.js @@ -28,5 +28,11 @@ try { return; } +// Skip 'toString()' check for chakra engine because it verifies limit of v8 +// specific kStringMaxLength variable. +if (common.isChakraEngine) { + return; +} + const maxString = buf.toString('utf16le'); assert.equal(maxString.length, (kStringMaxLength + 2) / 2); diff --git a/test/sequential/test-stringbytes-external-exceed-max.js b/test/sequential/test-stringbytes-external-exceed-max.js index cf9dc37ec72..3626b50774d 100644 --- a/test/sequential/test-stringbytes-external-exceed-max.js +++ b/test/sequential/test-stringbytes-external-exceed-max.js @@ -28,6 +28,12 @@ try { return; } +// Skip 'toString()' check for chakra engine because it verifies limit of v8 +// specific kStringMaxLength variable. +if (common.isChakraEngine) { + return; +} + assert.throws(function() { buf.toString('utf16le'); }, /"toString\(\)" failed/);