[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:13:53 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 9132b10b77a04cf57006cd7d35868ff53a7463af
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 12 03:59:24 2002 +0000

            Reviewed by Don.
    
    	- Add kjsprint global function in Development build for ease of	debugging.
    	- Print uncaught JavaScript exceptions to the console in Development.
    	- Improve wording of exception error messages.
    
            * kjs/function.cpp:
            (GlobalFuncImp::call):
            * kjs/function.h:
            * kjs/internal.cpp:
            (InterpreterImp::initGlobalObject):
            * kjs/interpreter.cpp:
            (Interpreter::evaluate):
            * kjs/nodes.cpp:
            (NewExprNode::evaluate):
            (FunctionCallNode::evaluate):
            (RelationalNode::evaluate):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3009 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 5e1a233..2fa117e 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,23 @@
+2002-12-11  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by NOBODY (OOPS!).
+
+	- Add kjsprint global function in Development build for ease of	debugging.
+	- Print uncaught JavaScript exceptions to the console in Development.
+	- Improve wording of exception error messages.
+	
+        * kjs/function.cpp:
+        (GlobalFuncImp::call):
+        * kjs/function.h:
+        * kjs/internal.cpp:
+        (InterpreterImp::initGlobalObject):
+        * kjs/interpreter.cpp:
+        (Interpreter::evaluate):
+        * kjs/nodes.cpp:
+        (NewExprNode::evaluate):
+        (FunctionCallNode::evaluate):
+        (RelationalNode::evaluate):
+
 2002-12-10  John Sullivan  <sullivan at apple.com>
 
 	Fixed more "Alexander"s that were lurking in places I forgot 
diff --git a/JavaScriptCore/ChangeLog-2003-10-25 b/JavaScriptCore/ChangeLog-2003-10-25
index 5e1a233..2fa117e 100644
--- a/JavaScriptCore/ChangeLog-2003-10-25
+++ b/JavaScriptCore/ChangeLog-2003-10-25
@@ -1,3 +1,23 @@
+2002-12-11  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by NOBODY (OOPS!).
+
+	- Add kjsprint global function in Development build for ease of	debugging.
+	- Print uncaught JavaScript exceptions to the console in Development.
+	- Improve wording of exception error messages.
+	
+        * kjs/function.cpp:
+        (GlobalFuncImp::call):
+        * kjs/function.h:
+        * kjs/internal.cpp:
+        (InterpreterImp::initGlobalObject):
+        * kjs/interpreter.cpp:
+        (Interpreter::evaluate):
+        * kjs/nodes.cpp:
+        (NewExprNode::evaluate):
+        (FunctionCallNode::evaluate):
+        (RelationalNode::evaluate):
+
 2002-12-10  John Sullivan  <sullivan at apple.com>
 
 	Fixed more "Alexander"s that were lurking in places I forgot 
diff --git a/JavaScriptCore/kjs/function.cpp b/JavaScriptCore/kjs/function.cpp
index 16b5056..4191436 100644
--- a/JavaScriptCore/kjs/function.cpp
+++ b/JavaScriptCore/kjs/function.cpp
@@ -544,6 +544,12 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
     res = String(s);
     break;
   }
+#if !NDEBUG
+  case KJSPrint: {
+    UString str = args[0].toString(exec);
+    puts(str.ascii());
+  }
+#endif
   }
 
   return res;
diff --git a/JavaScriptCore/kjs/function.h b/JavaScriptCore/kjs/function.h
index bad1711..a32a322 100644
--- a/JavaScriptCore/kjs/function.h
+++ b/JavaScriptCore/kjs/function.h
@@ -126,7 +126,11 @@ namespace KJS {
     virtual bool implementsCall() const;
     virtual Value call(ExecState *exec, Object &thisObj, const List &args);
     virtual CodeType codeType() const;
-    enum { Eval, ParseInt, ParseFloat, IsNaN, IsFinite, Escape, UnEscape };
+    enum { Eval, ParseInt, ParseFloat, IsNaN, IsFinite, Escape, UnEscape 
+#if !NDEBUG
+	   , KJSPrint
+#endif
+};
   private:
     int id;
   };
diff --git a/JavaScriptCore/kjs/internal.cpp b/JavaScriptCore/kjs/internal.cpp
index 502eda3..74971be 100644
--- a/JavaScriptCore/kjs/internal.cpp
+++ b/JavaScriptCore/kjs/internal.cpp
@@ -647,6 +647,9 @@ void InterpreterImp::initGlobalObject()
   global.put(globExec,"isFinite",   Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::IsFinite,   1)), DontEnum);
   global.put(globExec,"escape",     Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::Escape,     1)), DontEnum);
   global.put(globExec,"unescape",   Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::UnEscape,   1)), DontEnum);
+#if !NDEBUG
+  global.put(globExec,"kjsprint",   Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::KJSPrint,   1)), DontEnum);
+#endif
 
   // built-in objects
   global.put(globExec,"Math", Object(new MathObjectImp(globExec,objProto)), DontEnum);
diff --git a/JavaScriptCore/kjs/interpreter.cpp b/JavaScriptCore/kjs/interpreter.cpp
index 628845d..ad6d213 100644
--- a/JavaScriptCore/kjs/interpreter.cpp
+++ b/JavaScriptCore/kjs/interpreter.cpp
@@ -111,7 +111,16 @@ bool Interpreter::checkSyntax(const UString &code)
 
 Completion Interpreter::evaluate(const UString &code, const Value &thisV)
 {
-  return rep->evaluate(code,thisV);
+  Completion comp = rep->evaluate(code,thisV);
+#if !NDEBUG
+  if (comp.complType() == Throw) {
+    lock();
+    ExecState *exec = rep->globalExec();
+    printf("Uncaught exception: %s\n", comp.value().toObject(exec).toString(exec).ascii());
+    unlock();
+  }
+#endif
+  return comp;
 }
 
 InterpreterImp *Interpreter::imp()
diff --git a/JavaScriptCore/kjs/nodes.cpp b/JavaScriptCore/kjs/nodes.cpp
index 5e355a3..f1178aa 100644
--- a/JavaScriptCore/kjs/nodes.cpp
+++ b/JavaScriptCore/kjs/nodes.cpp
@@ -693,12 +693,12 @@ Value NewExprNode::evaluate(ExecState *exec)
   }
 
   if (v.type() != ObjectType) {
-    return throwError(exec, TypeError, "Expression is no object. Cannot be new'ed");
+    return throwError(exec, TypeError, "Value used with new is not object.");
   }
 
   Object constr = Object(static_cast<ObjectImp*>(v.imp()));
   if (!constr.implementsConstruct()) {
-    return throwError(exec, TypeError, "Expression is no constructor.");
+    return throwError(exec, TypeError, "Value asked to construct is not a constructor.");
   }
 
   Value res = constr.construct(exec,argList);
@@ -742,7 +742,7 @@ Value FunctionCallNode::evaluate(ExecState *exec)
 #ifndef NDEBUG
     printInfo(exec, "WARNING: Failed function call attempt on", v, line);
 #endif
-    return throwError(exec, TypeError, "Expression is no object. Cannot be called.");
+    return throwError(exec, TypeError, "Value is not object. Cannot be called.");
   }
 
   Object func = Object(static_cast<ObjectImp*>(v.imp()));
@@ -751,7 +751,7 @@ Value FunctionCallNode::evaluate(ExecState *exec)
 #ifndef NDEBUG
     printInfo(exec, "Failed function call attempt on", v, line);
 #endif
-    return throwError(exec, TypeError, "Expression does not allow calls.");
+    return throwError(exec, TypeError, "Object does not allow calls.");
   }
 
 #if KJS_MAX_STACK > 0
@@ -760,7 +760,7 @@ Value FunctionCallNode::evaluate(ExecState *exec)
 #ifndef NDEBUG
     printInfo(exec, "Exceeded maximum function call depth", v, line);
 #endif
-    return throwError(exec, RangeError, "Exceeded maximum call stack size.");
+    return throwError(exec, RangeError, "Exceeded maximum function call depth.");
   }
 #endif
 
@@ -1229,13 +1229,13 @@ Value RelationalNode::evaluate(ExecState *exec)
       // Is all of this OK for host objects?
       if (v2.type() != ObjectType)
           return throwError(exec,  TypeError,
-                             "Shift expression not an object into IN expression." );
+                             "Used IN expression with non-object." );
       Object o2(static_cast<ObjectImp*>(v2.imp()));
       b = o2.hasProperty(exec, Identifier(v1.toString(exec)));
   } else {
     if (v2.type() != ObjectType)
         return throwError(exec,  TypeError,
-                           "Called instanceof operator on non-object." );
+                           "Used instanceof operator on non-object." );
 
     Object o2(static_cast<ObjectImp*>(v2.imp()));
     if (!o2.implementsHasInstance()) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list