fix: 修复 for-in 语法原型链丢失属性问题

This commit is contained in:
爱特每羊队
2026-06-07 19:47:49 +08:00
parent 77bf00233b
commit 3f41fe9d71
2 changed files with 35 additions and 16 deletions
@@ -64,3 +64,12 @@ fn regression_throw_statement_errors() {
"compile error: throw statement not supported"
);
}
#[test]
fn regression_for_in_prototype_chain() {
assert_eq!(
eval("var c=0;for(var k in {a:1}){c=c+1;}c"),
"2",
"for-in should include inherited constructor from prototype"
);
}