mirror of
https://github.com/tc39/test262.git
synced 2025-09-25 11:08:49 +02:00
Fix strict mode violations in sm/Array
This commit is contained in:
parent
e3c64eeb6b
commit
286f73c6e9
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
includes: [deepEqual.js]
|
includes: [deepEqual.js]
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
pending
|
pending
|
||||||
esid: pending
|
esid: pending
|
||||||
@ -90,8 +88,8 @@ Object.defineProperty(Object.prototype, "foo", {
|
|||||||
Object.groupBy([1, 2, 3], () => 'foo');
|
Object.groupBy([1, 2, 3], () => 'foo');
|
||||||
|
|
||||||
// Ensure property key is correctly accessed
|
// Ensure property key is correctly accessed
|
||||||
count = 0;
|
let count = 0;
|
||||||
p = Object.groupBy([1], () => ({ toString() { count++; return 10 } }));
|
const p = Object.groupBy([1], () => ({ toString() { count++; return 10 } }));
|
||||||
assert.sameValue(count, 1);
|
assert.sameValue(count, 1);
|
||||||
Map.groupBy([1], () => ({ toString() { count++; return 10 } }));
|
Map.groupBy([1], () => ({ toString() { count++; return 10 } }));
|
||||||
assert.sameValue(count, 1);
|
assert.sameValue(count, 1);
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
Array.reduce should ignore holes
|
Array.reduce should ignore holes
|
||||||
esid: pending
|
esid: pending
|
||||||
@ -21,6 +19,8 @@ function test()
|
|||||||
function add(a, b) { return a + b; }
|
function add(a, b) { return a + b; }
|
||||||
function testreduce(v) { return v == 3 ? "PASS" : "FAIL"; }
|
function testreduce(v) { return v == 3 ? "PASS" : "FAIL"; }
|
||||||
|
|
||||||
|
var a;
|
||||||
|
|
||||||
expect = 'PASS';
|
expect = 'PASS';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
Array.prototype.toLocaleString
|
Array.prototype.toLocaleString
|
||||||
esid: pending
|
esid: pending
|
||||||
@ -20,7 +18,7 @@ o = {};
|
|||||||
assert.sameValue(Array.prototype.toLocaleString.call(o), "");
|
assert.sameValue(Array.prototype.toLocaleString.call(o), "");
|
||||||
|
|
||||||
var log = '';
|
var log = '';
|
||||||
arr = {length: {valueOf: function () { log += "L"; return 2; }},
|
var arr = {length: {valueOf: function () { log += "L"; return 2; }},
|
||||||
0: "x", 1: "z"};
|
0: "x", 1: "z"};
|
||||||
assert.sameValue(Array.prototype.toLocaleString.call(arr), "x,z");
|
assert.sameValue(Array.prototype.toLocaleString.call(arr), "x,z");
|
||||||
assert.sameValue(log, "L");
|
assert.sameValue(log, "L");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user