Update the Array.prototype.reverse method to support ES6 version (#3676)

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi [email protected]
This commit is contained in:
Szilagyi Adam authored and GitHub committed 2020-05-11 13:42:46 +02:00
1 parent 97a35b0f10
commit 094ba2f30a
2 files changed
+57 -29

No files matched your search

+6
View File
@@ -73,6 +73,12 @@ assert(proxy2.prop === "value 3");
assert(proxy2.nothing === "value 3");
assert(proxy2.handler === "value 3");
var get = [];
var p = new Proxy([0,,2,,4,,], { get: function(o, k) { get.push(k); return o[k]; }});
Array.prototype.reverse.call(p);
assert(get + '' === "length,0,4,2");
// test when get throws an error
var handler = new Proxy({}, {get: function() {throw 42;}});
var proxy = new Proxy ({}, handler);