Browse Source

test: fix parallel/test-repl-harmony with new v8

Assignment to a const var in strict mode is a lazy TypeError now.
Update the test accordingly.

PR-URL: https://github.com/iojs/io.js/pull/243
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
v1.8.0-commit
Ben Noordhuis 10 years ago
parent
commit
58f3a0382b
  1. 6
      test/parallel/test-repl-harmony.js

6
test/parallel/test-repl-harmony.js

@ -23,11 +23,11 @@ var common = require('../common');
var assert = require('assert'); var assert = require('assert');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
var args = ['--harmony', '--use-strict', '-i']; var args = ['--harmony', '--harmony_scoping', '--use-strict', '-i'];
var child = spawn(process.execPath, args); var child = spawn(process.execPath, args);
var input = 'function x(){const y=1;y=2}\n'; var input = '(function(){const y=1;y=2})()\n';
var expectOut = /^> SyntaxError: Assignment to constant variable.\n/; var expectOut = /^> TypeError: Assignment to constant variable.\n/;
child.stderr.setEncoding('utf8'); child.stderr.setEncoding('utf8');
child.stderr.on('data', function(c) { child.stderr.on('data', function(c) {

Loading…
Cancel
Save