From f32c492fc7b604955e6eeee8ce99d3a959b94689 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Thu, 9 Dec 1999 22:05:09 +0000 Subject: [PATCH] fixes case where an InterpretedFunction has both a closure and needs an activation. --- js/rhino/org/mozilla/javascript/InterpretedFunction.java | 9 ++++----- .../src/org/mozilla/javascript/InterpretedFunction.java | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/js/rhino/org/mozilla/javascript/InterpretedFunction.java b/js/rhino/org/mozilla/javascript/InterpretedFunction.java index 271122416600..ee0dea783aba 100644 --- a/js/rhino/org/mozilla/javascript/InterpretedFunction.java +++ b/js/rhino/org/mozilla/javascript/InterpretedFunction.java @@ -71,13 +71,12 @@ class InterpretedFunction extends NativeFunction { Object[] args) throws JavaScriptException { + itsData.itsCX = cx; + if (itsClosure != null) + scope = itsClosure; if (itsData.itsNeedsActivation) scope = ScriptRuntime.initVarObj(cx, scope, this, thisObj, args); - itsData.itsCX = cx; - if (itsClosure == null) - itsData.itsScope = scope; - else - itsData.itsScope = itsClosure; + itsData.itsScope = scope; itsData.itsThisObj = thisObj; itsData.itsInArgs = args; return Interpreter.interpret(itsData); diff --git a/js/rhino/src/org/mozilla/javascript/InterpretedFunction.java b/js/rhino/src/org/mozilla/javascript/InterpretedFunction.java index 271122416600..ee0dea783aba 100644 --- a/js/rhino/src/org/mozilla/javascript/InterpretedFunction.java +++ b/js/rhino/src/org/mozilla/javascript/InterpretedFunction.java @@ -71,13 +71,12 @@ class InterpretedFunction extends NativeFunction { Object[] args) throws JavaScriptException { + itsData.itsCX = cx; + if (itsClosure != null) + scope = itsClosure; if (itsData.itsNeedsActivation) scope = ScriptRuntime.initVarObj(cx, scope, this, thisObj, args); - itsData.itsCX = cx; - if (itsClosure == null) - itsData.itsScope = scope; - else - itsData.itsScope = itsClosure; + itsData.itsScope = scope; itsData.itsThisObj = thisObj; itsData.itsInArgs = args; return Interpreter.interpret(itsData);