Fix strict mode violations in sm/Array

This commit is contained in:
André Bargull 2025-04-30 14:16:20 +02:00 committed by Philip Chimento
parent e3c64eeb6b
commit 286f73c6e9
3 changed files with 5 additions and 9 deletions

View File

@ -3,8 +3,6 @@
/*---
includes: [deepEqual.js]
flags:
- noStrict
description: |
pending
esid: pending
@ -90,8 +88,8 @@ Object.defineProperty(Object.prototype, "foo", {
Object.groupBy([1, 2, 3], () => 'foo');
// Ensure property key is correctly accessed
count = 0;
p = Object.groupBy([1], () => ({ toString() { count++; return 10 } }));
let count = 0;
const p = Object.groupBy([1], () => ({ toString() { count++; return 10 } }));
assert.sameValue(count, 1);
Map.groupBy([1], () => ({ toString() { count++; return 10 } }));
assert.sameValue(count, 1);

View File

@ -4,8 +4,6 @@
*/
/*---
flags:
- noStrict
description: |
Array.reduce should ignore holes
esid: pending
@ -21,6 +19,8 @@ function test()
function add(a, b) { return a + b; }
function testreduce(v) { return v == 3 ? "PASS" : "FAIL"; }
var a;
expect = 'PASS';
try {

View File

@ -4,8 +4,6 @@
*/
/*---
flags:
- noStrict
description: |
Array.prototype.toLocaleString
esid: pending
@ -20,7 +18,7 @@ o = {};
assert.sameValue(Array.prototype.toLocaleString.call(o), "");
var log = '';
arr = {length: {valueOf: function () { log += "L"; return 2; }},
var arr = {length: {valueOf: function () { log += "L"; return 2; }},
0: "x", 1: "z"};
assert.sameValue(Array.prototype.toLocaleString.call(arr), "x,z");
assert.sameValue(log, "L");