21 lines
392 B
JavaScript
21 lines
392 B
JavaScript
description(
|
|
"Tests that the specific value optimization does not break when the relevant structure is a dictionary."
|
|
)
|
|
|
|
function foo() {
|
|
return x;
|
|
}
|
|
|
|
x = function() { };
|
|
|
|
var expected = "\"function () { }\"";
|
|
|
|
for (var i = 0; i < 1000; ++i) {
|
|
eval("i" + i + " = " + i);
|
|
if (i == 200) {
|
|
x = 42;
|
|
expected = "\"42\"";
|
|
}
|
|
shouldBe("\"\" + foo()", expected);
|
|
}
|