From 89b42085abd0d7770113a1a6f9e3e40b8266e387 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Fri, 7 Apr 2000 04:59:57 +0000 Subject: [PATCH] printing code in testObjects(). --- js/js2/js2.cpp | 7 +++++-- js2/tests/cpp/js2_shell.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/js/js2/js2.cpp b/js/js2/js2.cpp index 28b0b3e6ac1..7f814fd37f9 100644 --- a/js/js2/js2.cpp +++ b/js/js2/js2.cpp @@ -30,7 +30,6 @@ namespace JS = JavaScript; using namespace JavaScript; - #if defined(XP_MAC) && !defined(XP_MAC_MPW) #include #include @@ -414,6 +413,8 @@ static float64 testObjects(World &world, int32 n) initCG.setProperty(counter, initCG.loadName(global), initCG.loadImmediate(0.0)); InstructionStream* initCode = initCG.complete(); + + std::cout << initCG; // function increment() // { @@ -429,6 +430,8 @@ static float64 testObjects(World &world, int32 n) InstructionStream* incrCode = incrCG.complete(); + std::cout << incrCG; + // run initialization code. JSValues args(32); interpret(*initCode, args); @@ -438,7 +441,7 @@ static float64 testObjects(World &world, int32 n) while (n-- > 0) result = interpret(*incrCode, args); - std::cout << "result =" << result.f64 << std::endl; + std::cout << "result = " << result.f64 << std::endl; return result.f64; } diff --git a/js2/tests/cpp/js2_shell.cpp b/js2/tests/cpp/js2_shell.cpp index 28b0b3e6ac1..7f814fd37f9 100644 --- a/js2/tests/cpp/js2_shell.cpp +++ b/js2/tests/cpp/js2_shell.cpp @@ -30,7 +30,6 @@ namespace JS = JavaScript; using namespace JavaScript; - #if defined(XP_MAC) && !defined(XP_MAC_MPW) #include #include @@ -414,6 +413,8 @@ static float64 testObjects(World &world, int32 n) initCG.setProperty(counter, initCG.loadName(global), initCG.loadImmediate(0.0)); InstructionStream* initCode = initCG.complete(); + + std::cout << initCG; // function increment() // { @@ -429,6 +430,8 @@ static float64 testObjects(World &world, int32 n) InstructionStream* incrCode = incrCG.complete(); + std::cout << incrCG; + // run initialization code. JSValues args(32); interpret(*initCode, args); @@ -438,7 +441,7 @@ static float64 testObjects(World &world, int32 n) while (n-- > 0) result = interpret(*incrCode, args); - std::cout << "result =" << result.f64 << std::endl; + std::cout << "result = " << result.f64 << std::endl; return result.f64; }