From ff75833db84ab3d3feb7cf21bc5a83b13e397591 Mon Sep 17 00:00:00 2001 From: "igor%mir2.org" Date: Mon, 23 Dec 2002 15:01:53 +0000 Subject: [PATCH] Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=184107 Always put function expression statements into initial activation object ignoring the with statement to follow SpiderMonkey git-svn-id: svn://10.0.0.236/trunk@135592 18797224-902f-48f8-a5cc-f745e15eee43 --- .../js/rhino/src/org/mozilla/javascript/ScriptRuntime.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mozilla/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java b/mozilla/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java index 966d94aef86..ec493b88828 100644 --- a/mozilla/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java +++ b/mozilla/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java @@ -1951,6 +1951,12 @@ public class ScriptRuntime { } else if (type == FunctionNode.FUNCTION_EXPRESSION_STATEMENT) { String name = function.functionName; if (name != null && name.length() != 0) { + // Always put function expression statements into initial + // activation object ignoring the with statement to follow + // SpiderMonkey + while (scope instanceof NativeWith) { + scope = scope.getParentScope(); + } scope.put(name, scope, function); } }