Browse Source

test: fix tests after V8 upgrade

- An error message changed for undefined references
- `let` is now allowed in sloppy mode
- ES2015 proxies are shipped and the `Proxy` global is now a function

PR-URL: https://github.com/nodejs/node/pull/4722
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
process-exit-stdio-flushing
Michaël Zasso 9 years ago
committed by Ali Sheikh
parent
commit
9968941797
  1. 2
      test/message/timeout_throw.out
  2. 3
      test/parallel/test-repl-mode.js
  3. 2
      test/parallel/test-repl-tab-complete.js
  4. 5
      test/parallel/test-vm-proxies.js

2
test/message/timeout_throw.out

@ -2,6 +2,6 @@
undefined_reference_error_maker;
^
ReferenceError: undefined_reference_error_maker is not defined
at null._onTimeout (*test*message*timeout_throw.js:*:*)
at ._onTimeout (*test*message*timeout_throw.js:*:*)
at tryOnTimeout (timers.js:*:*)
at Timer.listOnTimeout (timers.js:*:*)

3
test/parallel/test-repl-mode.js

@ -28,8 +28,7 @@ function testSloppyMode() {
cli.input.emit('data', `
let y = 3
`.trim() + '\n');
assert.ok(/SyntaxError: Block-scoped/.test(
cli.output.accumulator.join('')));
assert.equal(cli.output.accumulator.join(''), 'undefined\n> ');
}
function testStrictMode() {

2
test/parallel/test-repl-tab-complete.js

@ -1,7 +1,5 @@
'use strict';
// Flags: --harmony-proxies
var common = require('../common');
var assert = require('assert');
var repl = require('repl');

5
test/parallel/test-vm-harmony-proxies.js → test/parallel/test-vm-proxies.js

@ -1,5 +1,4 @@
'use strict';
// Flags: --harmony_proxies
require('../common');
var assert = require('assert');
@ -9,11 +8,11 @@ var vm = require('vm');
// context. Make sure that the new context has a Proxy object of its own.
var sandbox = {};
vm.runInNewContext('this.Proxy = Proxy', sandbox);
assert(typeof sandbox.Proxy === 'object');
assert(typeof sandbox.Proxy === 'function');
assert(sandbox.Proxy !== Proxy);
// Unless we copy the Proxy object explicitly, of course.
sandbox = { Proxy: Proxy };
vm.runInNewContext('this.Proxy = Proxy', sandbox);
assert(typeof sandbox.Proxy === 'object');
assert(typeof sandbox.Proxy === 'function');
assert(sandbox.Proxy === Proxy);
Loading…
Cancel
Save