Skip to content
Snippets Groups Projects
Commit 70dc3346 authored by test262-automation's avatar test262-automation
Browse files

[javascriptcore-test262-automation] Changes from...

[javascriptcore-test262-automation] Changes from https://github.com/webkit/webkit.git at sha 12df785646 on Mon Aug 27 2018 18:14:52 GMT+0000 (Coordinated Universal Time)
parent 5bb0f4c8
No related branches found
No related tags found
No related merge requests found
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
function reverseInt()
{
var array = [0, 1, 2, 3];
return array.reverse();
}
function reverseDouble()
{
var array = [0.0, 1.1, 2.2, 3.3];
return array.reverse();
}
function reverseContiguous()
{
var array = [0.0, 1.1, 2.2, 'hello'];
return array.reverse();
}
for (var i = 0; i < 1e4; ++i) {
shouldBe(JSON.stringify(reverseInt()), `[3,2,1,0]`);
shouldBe(JSON.stringify(reverseDouble()), `[3.3,2.2,1.1,0]`);
shouldBe(JSON.stringify(reverseContiguous()), `["hello",2.2,1.1,0]`);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment