blob: b2a1341e4c3f9df009abea9c2d8181b48dd97cad [file] [log] [blame]
description(
"This tests that for/in statements properly scope a variable that's declared in one. "
+ "In previous versions of JavaScriptCore there were two bugs that caused problems. "
+ "First, the loop variable declaration would not be processed. "
+ "Second, the code to set the loop variable would incorrectly walk the scope chain even after setting the loop variable."
);
var i = "start i";
var j = "start j";
function func() {
var object = new Object;
object.propName = "propValue";
for (var i in object) { j = i; }
}
func();
shouldBe("i", "'start i'");
shouldBe("j", "'propName'");