| <p>This page tests whether an exception thrown from an eval inside a closure |
| prematurely tears off the closure's activation. |
| <p>If the test passes, you'll see a PASS message below. |
| document.getElementById("console").appendChild(document.createTextNode(s + "\n")); |
| function shouldBe(aDescription, a, b) |
| log("PASS: " + aDescription + " should be " + b + " and is."); |
| log("FAIL: " + aDescription + " should be " + b + " but instead is " + a + "."); |
| // Create a function with an activation. |
| // Throw an exception inside an eval that requires a full scope chain. |
| eval("(function () { throw 'exception'; })()"); |
| // Set "x" by resolving through the activation. |
| // Test the local register for "x", which should have been set to 2 above. |