You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2011/03/21 08:41:52 UTC

svn commit: r1083693 - in /tuscany/sca-cpp/trunk/modules/js: eval.hpp json-test.js

Author: jsdelfino
Date: Mon Mar 21 07:41:52 2011
New Revision: 1083693

URL: http://svn.apache.org/viewvc?rev=1083693&view=rev
Log:
Fix Javascript test case. Enable Javascript error reporting on non-debug build.

Modified:
    tuscany/sca-cpp/trunk/modules/js/eval.hpp
    tuscany/sca-cpp/trunk/modules/js/json-test.js

Modified: tuscany/sca-cpp/trunk/modules/js/eval.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/eval.hpp?rev=1083693&r1=1083692&r2=1083693&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/js/eval.hpp Mon Mar 21 07:41:52 2011
@@ -44,6 +44,9 @@ void reportError(unused ::JSContext *cx,
 #ifdef WANT_MAINTAINER_MODE
     cdebug << (const char*)(report->filename? report->filename : "<no filename>") << ":"
             << (int)report->lineno << ":" << message << endl;
+#else
+    cerr << (const char*)(report->filename? report->filename : "<no filename>") << ":"
+            << (int)report->lineno << ":" << message << endl;
 #endif
 }
 

Modified: tuscany/sca-cpp/trunk/modules/js/json-test.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/json-test.js?rev=1083693&r1=1083692&r2=1083693&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/json-test.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/json-test.js Mon Mar 21 07:41:52 2011
@@ -35,7 +35,7 @@ function testJSON() {
 
     var r = json.readJSON(s2);
     var w = json.writeJSON(r);
-    assert(car(w) == "{\"@firstName\": \"test1\", \"lastName\": \"test\\ttab\", \"phones\": [\"408-1234\", \"650-1234\"]}");
+    assert(car(w) == "{\"phones\": [\"408-1234\", \"650-1234\"], \"lastName\": \"test\\ttab\", \"@firstName\": \"test1\"}");
 
     var l4 = mklist(mklist("'ns1:echoString", mklist("'@xmlns:ns1", "http://ws.apache.org/axis2/services/echo"), mklist("'text", "Hello World!")));
     var s4 = json.writeJSON(valuesToElements(l4));
@@ -43,7 +43,7 @@ function testJSON() {
 
     var r5 = elementsToValues(json.readJSON(s4));
     var s5 = json.writeJSON(valuesToElements(r5));
-    assert(car(s5) == "{\"ns1:echoString\": {\"text\": \"Hello World!\", \"@xmlns:ns1\": \"http://ws.apache.org/axis2/services/echo\"}}");
+    assert(car(s5) == "{\"ns1:echoString\": {\"@xmlns:ns1\": \"http://ws.apache.org/axis2/services/echo\", \"text\": \"Hello World!\"}}");
     return true;
 }