Skip to content

Commit 0a39c8a

Browse files
committed
Fix broken tests, these 2 test cases were wrong:
- spread.js push wrote to arr[1] when proto was getter only - bailOutOfMemOp.js push wrote to arr[5] when proto had writeable:false
1 parent a0d4d49 commit 0a39c8a

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

test/es6/spread.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56

@@ -267,13 +268,15 @@ var tests = [
267268
Object.defineProperty(Array.prototype, 1, {
268269
get: function() {
269270
x.length = 0;
270-
}
271+
},
272+
configurable: true
271273
});
272274

273275
var f = function(){
274276
assert.areEqual(arguments.length, 2, "Changing length of x during spreading should truncate the spread.");
275277
}
276278
f(...x);
279+
delete Array.prototype[1];
277280
}
278281
},
279282
{

test/loop/bailOutOfMemOp.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56

67
function f0() {
78
var printArr = [];
89
Object.prototype.m = {};
9-
Object.defineProperty(Array.prototype, "5", {});
10+
Object.defineProperty(Array.prototype, "5", {writable : true});
1011

1112
for (var iterator = 0; iterator < 10; iterator++) {
1213
var arr0 = [];

0 commit comments

Comments
 (0)