test262/implementation-contributed/javascriptcore/stress/double-array-to-array-storage.js
test262-automation e9a5a7f918 [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time) (#1620)
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
2018-07-03 15:59:58 -04:00

34 lines
971 B
JavaScript

"use strict";
function assert(b, msg) {
if (!b)
throw new Error(msg);
}
var arr = [];
function test()
{
arr = [0, 2147483648]; // NOTE: the second number is greater than INT_MAX
assert(arr[0] === 0, "arr[0] should be 0, but is " + arr[0]);
assert(arr[1] === 2147483648, "arr[1] should be 2147483648, but is " + arr[1]);
assert(arr.length === 2, "Length should be 2, but is " + arr.length);
arr.shift();
assert(arr[0] === 2147483648, "arr[0] should be 2147483648, but is " + arr[0]);
assert(arr[1] === undefined, "arr[1] should be undefined, but is " + arr[1]);
assert(arr.length === 1, "Length should be 2, but is " + arr.length);
arr[1] = 1;
assert(arr[0] === 2147483648, "arr[0] should be 2147483648, but is " + arr[0]);
assert(arr[1] === 1, "arr[1] should be 1, but is " + arr[1]);
assert(arr.length === 2, "Length should be 2, but is " + arr.length);
}
for (let i = 0; i < 10000; i++)
test();