From dbb69e2bd5ec9d9e32e875b59b1dcdd8ad435c3e Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Sat, 29 Apr 2000 14:14:28 +0000 Subject: [PATCH] JSNamespace -> JSScope. git-svn-id: svn://10.0.0.236/trunk@67611 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/js2/interpreter.h | 12 ++++++------ mozilla/js/js2/js2.cpp | 11 +++++------ mozilla/js2/src/interpreter.h | 12 ++++++------ mozilla/js2/tests/cpp/js2_shell.cpp | 11 +++++------ 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/mozilla/js/js2/interpreter.h b/mozilla/js/js2/interpreter.h index 0082fb77b7d..953b88b0fcb 100644 --- a/mozilla/js/js2/interpreter.h +++ b/mozilla/js/js2/interpreter.h @@ -44,16 +44,16 @@ namespace Interpreter { class Context : public gc_base { public: - explicit Context(World& world, JSNamespace* aGlobal) + explicit Context(World& world, JSScope* aGlobal) : mWorld(world), mGlobal(aGlobal), mLinkage(0), mActivation(0) {} - JSNamespace* getGlobalObject() { return mGlobal; } + JSScope* getGlobalObject() { return mGlobal; } - JSNamespace* setGlobalObject(JSNamespace* aGlobal) + JSScope* setGlobalObject(JSScope* aGlobal) { - JSNamespace* t = mGlobal; + JSScope* oldGlobal = mGlobal; mGlobal = aGlobal; - return t; + return oldGlobal; } InstructionIterator getPC() @@ -92,7 +92,7 @@ namespace Interpreter { private: World& mWorld; - JSNamespace* mGlobal; + JSScope* mGlobal; Linkage* mLinkage; std::vector mListeners; Activation* mActivation; diff --git a/mozilla/js/js2/js2.cpp b/mozilla/js/js2/js2.cpp index 40acd3f401b..afa424e2fbb 100644 --- a/mozilla/js/js2/js2.cpp +++ b/mozilla/js/js2/js2.cpp @@ -308,7 +308,7 @@ static void testICG(World &world) static float64 testFunctionCall(World &world, float64 n) { - JSNamespace glob; + JSScope glob; Context cx(world, &glob); Tracer t; cx.addListener(&t); @@ -361,7 +361,7 @@ static float64 testFunctionCall(World &world, float64 n) static float64 testFactorial(World &world, float64 n) { - JSNamespace glob; + JSScope glob; Context cx(world, &glob); // generate code for factorial, and interpret it. uint32 position = 0; @@ -426,7 +426,7 @@ static float64 testFactorial(World &world, float64 n) static float64 testObjects(World &world, int32 n) { - JSNamespace glob; + JSScope glob; Context cx(world, &glob); // create some objects, put some properties, and retrieve them. uint32 position = 0; @@ -492,7 +492,7 @@ static float64 testObjects(World &world, int32 n) static float64 testProto(World &world, int32 n) { - JSNamespace glob; + JSScope glob; Context cx(world, &glob); Tracer t; @@ -547,7 +547,7 @@ static float64 testProto(World &world, int32 n) stdOut << initCG; // run initialization code. - JSValues args(1); + JSValues args; cx.interpret(initCode, args); // objects now exist, do real prototype chain manipulation. @@ -565,7 +565,6 @@ static float64 testProto(World &world, int32 n) ICodeModule* callCode = callCG.complete(); // call the increment method some number of times. - args[0] = JSValue(globalObject); while (n-- > 0) (void) cx.interpret(callCode, args); diff --git a/mozilla/js2/src/interpreter.h b/mozilla/js2/src/interpreter.h index 0082fb77b7d..953b88b0fcb 100644 --- a/mozilla/js2/src/interpreter.h +++ b/mozilla/js2/src/interpreter.h @@ -44,16 +44,16 @@ namespace Interpreter { class Context : public gc_base { public: - explicit Context(World& world, JSNamespace* aGlobal) + explicit Context(World& world, JSScope* aGlobal) : mWorld(world), mGlobal(aGlobal), mLinkage(0), mActivation(0) {} - JSNamespace* getGlobalObject() { return mGlobal; } + JSScope* getGlobalObject() { return mGlobal; } - JSNamespace* setGlobalObject(JSNamespace* aGlobal) + JSScope* setGlobalObject(JSScope* aGlobal) { - JSNamespace* t = mGlobal; + JSScope* oldGlobal = mGlobal; mGlobal = aGlobal; - return t; + return oldGlobal; } InstructionIterator getPC() @@ -92,7 +92,7 @@ namespace Interpreter { private: World& mWorld; - JSNamespace* mGlobal; + JSScope* mGlobal; Linkage* mLinkage; std::vector mListeners; Activation* mActivation; diff --git a/mozilla/js2/tests/cpp/js2_shell.cpp b/mozilla/js2/tests/cpp/js2_shell.cpp index 40acd3f401b..afa424e2fbb 100644 --- a/mozilla/js2/tests/cpp/js2_shell.cpp +++ b/mozilla/js2/tests/cpp/js2_shell.cpp @@ -308,7 +308,7 @@ static void testICG(World &world) static float64 testFunctionCall(World &world, float64 n) { - JSNamespace glob; + JSScope glob; Context cx(world, &glob); Tracer t; cx.addListener(&t); @@ -361,7 +361,7 @@ static float64 testFunctionCall(World &world, float64 n) static float64 testFactorial(World &world, float64 n) { - JSNamespace glob; + JSScope glob; Context cx(world, &glob); // generate code for factorial, and interpret it. uint32 position = 0; @@ -426,7 +426,7 @@ static float64 testFactorial(World &world, float64 n) static float64 testObjects(World &world, int32 n) { - JSNamespace glob; + JSScope glob; Context cx(world, &glob); // create some objects, put some properties, and retrieve them. uint32 position = 0; @@ -492,7 +492,7 @@ static float64 testObjects(World &world, int32 n) static float64 testProto(World &world, int32 n) { - JSNamespace glob; + JSScope glob; Context cx(world, &glob); Tracer t; @@ -547,7 +547,7 @@ static float64 testProto(World &world, int32 n) stdOut << initCG; // run initialization code. - JSValues args(1); + JSValues args; cx.interpret(initCode, args); // objects now exist, do real prototype chain manipulation. @@ -565,7 +565,6 @@ static float64 testProto(World &world, int32 n) ICodeModule* callCode = callCG.complete(); // call the increment method some number of times. - args[0] = JSValue(globalObject); while (n-- > 0) (void) cx.interpret(callCode, args);