From ca9001f3875e3ffe166aaa66d0755e9895794ad6 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Fri, 23 Jun 2000 05:10:46 +0000 Subject: [PATCH] When using a JSScope that has a parent scope, don't bother defining the standard properties, they will be shared. --- js/js2/interpreter.cpp | 4 ++++ js2/src/interpreter.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/js/js2/interpreter.cpp b/js/js2/interpreter.cpp index b4ced1890039..dea2e03bf643 100644 --- a/js/js2/interpreter.cpp +++ b/js/js2/interpreter.cpp @@ -407,6 +407,10 @@ static JSValue defineAdd(const JSValues& argv) void Context::initContext() { +// if global has a parent, assume it's been initialized already. + if (mGlobal->getParent()) + return; + // predefine the predefined types; mGlobal->defineVariable(widenCString("any"), JSValue(&Any_Type)); diff --git a/js2/src/interpreter.cpp b/js2/src/interpreter.cpp index b4ced1890039..dea2e03bf643 100644 --- a/js2/src/interpreter.cpp +++ b/js2/src/interpreter.cpp @@ -407,6 +407,10 @@ static JSValue defineAdd(const JSValues& argv) void Context::initContext() { +// if global has a parent, assume it's been initialized already. + if (mGlobal->getParent()) + return; + // predefine the predefined types; mGlobal->defineVariable(widenCString("any"), JSValue(&Any_Type));