From 0504d72851630805ebdc06b9ecc82579077a2bbb Mon Sep 17 00:00:00 2001 From: "rogerl%netscape.com" Date: Thu, 20 Sep 2001 01:41:03 +0000 Subject: [PATCH] Added 'version' function for test suite. git-svn-id: svn://10.0.0.236/trunk@103257 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js2/tests/cpp/DikDik_Shell.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mozilla/js2/tests/cpp/DikDik_Shell.cpp b/mozilla/js2/tests/cpp/DikDik_Shell.cpp index d62315ea1e9..466d4c03719 100644 --- a/mozilla/js2/tests/cpp/DikDik_Shell.cpp +++ b/mozilla/js2/tests/cpp/DikDik_Shell.cpp @@ -120,6 +120,11 @@ static JSValue print(Context *, const JSValue& /*thisValue*/, JSValue *argv, uin return kUndefinedValue; } +static JSValue version(Context *, const JSValue& /*thisValue*/, JSValue * /*argv*/, uint32 /*argc*/) +{ + return JSValue(2.0); +} + static JSValue debug(Context *cx, const JSValue& /*thisValue*/, JSValue * /*argv*/, uint32 /*argc*/) { cx->mDebugFlag = !cx->mDebugFlag; @@ -223,6 +228,7 @@ static bool processArgs(Context *cx, int argc, char **argv, int *result) } catch (Exception &e) { stdOut << '\n' << e.fullMessage(); *result = EXITCODE_RUNTIME_ERROR; + return false; } doInteractive = false; } @@ -256,6 +262,7 @@ int main(int argc, char **argv) globalObject->defineVariable(&cx, widenCString("debug"), (NamespaceList *)(NULL), NULL, JSValue(new JSFunction(debug, NULL))); globalObject->defineVariable(&cx, widenCString("trace"), (NamespaceList *)(NULL), NULL, JSValue(new JSFunction(trace, NULL))); globalObject->defineVariable(&cx, widenCString("dikdik"), (NamespaceList *)(NULL), NULL, JSValue(new JSFunction(dikdik, NULL))); + globalObject->defineVariable(&cx, widenCString("version"), (NamespaceList *)(NULL), NULL, JSValue(new JSFunction(version, NULL))); bool doInteractive = true; int result = 0;