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:
parent
079973b96a
commit
9968941797
@ -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:*:*)
|
||||||
|
@ -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() {
|
||||||
|
@ -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');
|
||||||
|
@ -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);
|
Loading…
x
Reference in New Issue
Block a user