Index: test/mjsunit/regress/regress-1591.js |
diff --git a/test/mjsunit/regress/regress-inlining-function-literal-context.js b/test/mjsunit/regress/regress-1591.js |
similarity index 81% |
copy from test/mjsunit/regress/regress-inlining-function-literal-context.js |
copy to test/mjsunit/regress/regress-1591.js |
index 9b7f7ac76882f09e1cc837373c1bee547c645de3..69efd0bd87f2d49b185c264f3979d7c6bcad9225 100644 |
--- a/test/mjsunit/regress/regress-inlining-function-literal-context.js |
+++ b/test/mjsunit/regress/regress-1591.js |
@@ -25,29 +25,24 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax --expose-gc |
+var stack; |
+var used_custom_lookup = false; |
-function mkbaz(x) { |
- function baz() { |
- return function () { |
- return [x]; |
+({ |
+ __lookupGetter__ : function() { |
+ used_custom_lookup = true; |
+ }, |
+ |
+ test : function() { |
+ try { |
+ f(); |
+ } catch (err) { |
+ stack = err.stack; |
} |
} |
- return baz; |
-} |
- |
-var baz = mkbaz(1); |
- |
-function foo() { |
- var f = baz(); |
- return f(); |
-} |
+}).test(); |
-// Tenure. |
-gc(); |
-gc(); |
+var expected_message = "ReferenceError: f is not defined"; |
+assertTrue(stack.indexOf(expected_message) >= 0); |
+assertFalse(used_custom_lookup); |
-assertArrayEquals([1], foo()); |
-assertArrayEquals([1], foo()); |
-%OptimizeFunctionOnNextCall(foo); |
-assertArrayEquals([1], foo()); |