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>
This commit is contained in:
Michaël Zasso 2016-01-22 09:24:50 +01:00 committed by Ali Sheikh
parent 079973b96a
commit 9968941797
4 changed files with 4 additions and 8 deletions

View File

@ -2,6 +2,6 @@
undefined_reference_error_maker; undefined_reference_error_maker;
^ ^
ReferenceError: undefined_reference_error_maker is not defined 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 tryOnTimeout (timers.js:*:*)
at Timer.listOnTimeout (timers.js:*:*) at Timer.listOnTimeout (timers.js:*:*)

View File

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

View File

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

View File

@ -1,5 +1,4 @@
'use strict'; 'use strict';
// Flags: --harmony_proxies
require('../common'); require('../common');
var assert = require('assert'); 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. // context. Make sure that the new context has a Proxy object of its own.
var sandbox = {}; var sandbox = {};
vm.runInNewContext('this.Proxy = Proxy', sandbox); vm.runInNewContext('this.Proxy = Proxy', sandbox);
assert(typeof sandbox.Proxy === 'object'); assert(typeof sandbox.Proxy === 'function');
assert(sandbox.Proxy !== Proxy); assert(sandbox.Proxy !== Proxy);
// Unless we copy the Proxy object explicitly, of course. // Unless we copy the Proxy object explicitly, of course.
sandbox = { Proxy: Proxy }; sandbox = { Proxy: Proxy };
vm.runInNewContext('this.Proxy = Proxy', sandbox); vm.runInNewContext('this.Proxy = Proxy', sandbox);
assert(typeof sandbox.Proxy === 'object'); assert(typeof sandbox.Proxy === 'function');
assert(sandbox.Proxy === Proxy); assert(sandbox.Proxy === Proxy);