quickjs-2024-01-13.tar.xz

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4765 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2024-01-13 13:04:19 +00:00
parent 10d438e723
commit 2b7077ca70
35 changed files with 3799 additions and 1453 deletions

View File

@@ -167,6 +167,29 @@ function test_for_in2()
assert(tab.toString() == "x,y");
}
function test_for_in_proxy() {
let removed_key = "";
let target = {}
let proxy = new Proxy(target, {
ownKeys: function() {
return ["a", "b", "c"];
},
getOwnPropertyDescriptor: function(target, key) {
if (removed_key != "" && key == removed_key)
return undefined;
else
return { enumerable: true, configurable: true, value: this[key] };
}
});
let str = "";
for(let o in proxy) {
str += " " + o;
if (o == "a")
removed_key = "b";
}
assert(str == " a c");
}
function test_for_break()
{
var i, c;
@@ -357,6 +380,7 @@ test_switch1();
test_switch2();
test_for_in();
test_for_in2();
test_for_in_proxy();
test_try_catch1();
test_try_catch2();