[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kjs
From:       Harri Porten <porten () kde ! org>
Date:       2005-04-16 21:37:09
Message-ID: 20050416213709.56FA53CA () office ! kde ! org
[Download RAW message or body]

CVS commit by porten: 

escape() u0000 properly (found in JSC)


  M +2 -0      ChangeLog   1.59
  M +16 -16    function.cpp   1.92


--- kdelibs/kjs/ChangeLog  #1.58:1.59
@@ -1,4 +1,6 @@
 2005-04-16  Harri Porten  <porten@kde.org>
 
+        * function.cpp: escape() u0000 properly (found in JSC)
+
         * nodes.cpp: save some cpu cycles on variable declarations 
 

--- kdelibs/kjs/function.cpp  #1.91:1.92
@@ -335,5 +335,5 @@ Value FunctionImp::call(ExecState *exec,
                  exec->context().imp(), this, &args);
   ExecState newExec(exec->interpreter(), &ctx);
-  newExec._exception = exec->exception(); // could be null
+  newExec.setException(exec->exception()); // could be null
 
   // assign user supplied arguments to parameters
@@ -368,5 +368,5 @@ Value FunctionImp::call(ExecState *exec,
   // if an exception occurred, propogate it back to the previous execution object
   if (newExec.hadException())
-    exec->_exception = newExec.exception();
+    exec->setException(newExec.exception());
 
 #ifdef KJS_VERBOSE
@@ -383,5 +383,5 @@ Value FunctionImp::call(ExecState *exec,
 
   if (comp.complType() == Throw) {
-    exec->_exception = comp.value();
+    exec->setException(comp.value());
     return comp.value();
   }
@@ -756,7 +756,9 @@ Value GlobalFuncImp::call(ExecState *exe
   Value res;
 
-  static const char non_escape[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+  static const char do_not_escape[] =
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                    "abcdefghijklmnopqrstuvwxyz"
-                                   "0123456789@*_+-./";
+    "0123456789"
+    "*+-./@_";
 
   switch (id) {
@@ -838,5 +840,5 @@ Value GlobalFuncImp::call(ExecState *exe
         dbg->imp()->abort();
       else if (newExec.hadException()) // propagate back to parent context
-        exec->_exception = newExec.exception(); 
+        exec->setException(newExec.exception());
       else if (c.complType() == Throw)
         exec->setException(c.value());
@@ -961,5 +963,5 @@ Value GlobalFuncImp::call(ExecState *exe
         sprintf(tmp, "%%u%04X", u);
         s = UString(tmp);
-      } else if (strchr(non_escape, (char)u)) {
+      } else if (u != 0 && strchr(do_not_escape, (char)u)) {
         s = UString(c, 1);
       } else {
@@ -999,12 +1001,10 @@ Value GlobalFuncImp::call(ExecState *exe
     break;
   }
-  case KJSPrint: {
+  case KJSPrint:
 #ifndef NDEBUG
-    UString str = args[0].toString(exec);
-    puts(str.ascii());
+    puts(args[0].toString(exec).ascii());
 #endif
     break;
   }
-  }
 
   return res;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic