diff --git a/implementation-contributed/curation_logs/javascriptcore.json b/implementation-contributed/curation_logs/javascriptcore.json index ecafe83d465a668ba6f4da7da55fed27bd6a112b..7e1e764236a028c221fe1de356f540e366dd47e8 100644 --- a/implementation-contributed/curation_logs/javascriptcore.json +++ b/implementation-contributed/curation_logs/javascriptcore.json @@ -1,6 +1,6 @@ { - "sourceRevisionAtLastExport": "12df785646", - "targetRevisionAtLastExport": "5032c509e", + "sourceRevisionAtLastExport": "8a25978f29", + "targetRevisionAtLastExport": "70dc33467", "curatedFiles": { "/stress/Number-isNaN-basics.js": "DELETED_IN_TARGET", "/stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js": "DELETED_IN_TARGET", diff --git a/implementation-contributed/javascriptcore/stress/reverse-with-immutable-butterfly.js b/implementation-contributed/javascriptcore/stress/reverse-with-immutable-butterfly.js new file mode 100644 index 0000000000000000000000000000000000000000..8f5d428ceec7d25d067bbf74e347403231ea7f74 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/reverse-with-immutable-butterfly.js @@ -0,0 +1,28 @@ +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]`); +}