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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:40:32 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 72ca22f5c535bbf2900bf1a36322d43aa18d96ed
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed May 19 02:50:21 2004 +0000

    	Added exception logging.  Also check for exception and
    	set results as appropriate.
    
            Reviewed by Maciej (partially reviewed).
    
            * bindings/objc/WebScriptObject.mm:
            (-[WebScriptObject callWebScriptMethod:withArguments:]):
            (-[WebScriptObject evaluateWebScript:]):
            (-[WebScriptObject setValue:forKey:]):
            (-[WebScriptObject valueForKey:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6630 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 79ec588..95f6c76 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,5 +1,18 @@
 2004-05-18  Richard Williamson   <rjw at apple.com>
 
+	Added exception logging.  Also check for exception and
+	set results as appropriate.
+
+        Reviewed by Maciej (partially reviewed).
+
+        * bindings/objc/WebScriptObject.mm:
+        (-[WebScriptObject callWebScriptMethod:withArguments:]):
+        (-[WebScriptObject evaluateWebScript:]):
+        (-[WebScriptObject setValue:forKey:]):
+        (-[WebScriptObject valueForKey:]):
+
+2004-05-18  Richard Williamson   <rjw at apple.com>
+
 	Finsished implementing support for windowScriptObject.
 	Had to make WebScriptObjectPrivate.h accessible from
 	WebCore.
diff --git a/JavaScriptCore/bindings/objc/WebScriptObject.mm b/JavaScriptCore/bindings/objc/WebScriptObject.mm
index 558bd75..3bf919a 100644
--- a/JavaScriptCore/bindings/objc/WebScriptObject.mm
+++ b/JavaScriptCore/bindings/objc/WebScriptObject.mm
@@ -38,6 +38,10 @@
 using namespace KJS;
 using namespace KJS::Bindings;
 
+#define LOG_EXCEPTION(exec) \
+    if (Interpreter::shouldPrintExceptions()) \
+        NSLog (@"%s:%d:  JavaScript exception:  %s\n", __FILE__, __LINE__, exec->exception().toObject(exec).get(exec, messagePropertyName).toString(exec).ascii());
+
 @interface WebScriptObjectPrivate : NSObject
 {
     KJS::ObjectImp *imp;
@@ -128,6 +132,11 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     Value result = funcImp->call (exec, thisObj, argList);
     Interpreter::unlock();
 
+    if (exec->hadException()) {
+        LOG_EXCEPTION (exec);
+        result = Undefined();
+    }
+
     // Convert and return the result of the function call.
     id resultObj = [WebScriptObject _convertValueToObjcValue:result root:_private->root];
 
@@ -145,6 +154,11 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     KJS::Value result = _private->root->interpreter()->evaluate(v.toString(exec)).value();
     Interpreter::unlock();
     
+    if (exec->hadException()) {
+        LOG_EXCEPTION (exec);
+        result = Undefined();
+    }
+
     id resultObj = [WebScriptObject _convertValueToObjcValue:result root:_private->root];
 
     _didExecute(self);
@@ -160,6 +174,10 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
    _private->imp->put (exec, Identifier (v.toString(exec)), (convertObjcValueToValue(exec, &value, ObjcObjectType)));
     Interpreter::unlock();
 
+    if (exec->hadException()) {
+        LOG_EXCEPTION (exec);
+    }
+
     _didExecute(self);
 }
 
@@ -171,6 +189,11 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     Value result = _private->imp->get (exec, Identifier (v.toString(exec)));
     Interpreter::unlock();
     
+    if (exec->hadException()) {
+        LOG_EXCEPTION (exec);
+        result = Undefined();
+    }
+
     id resultObj = [WebScriptObject _convertValueToObjcValue:result root:_private->root];
 
     _didExecute(self);
@@ -186,6 +209,10 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     _private->imp->deleteProperty (exec, Identifier (v.toString(exec)));
     Interpreter::unlock();
 
+    if (exec->hadException()) {
+        LOG_EXCEPTION (exec);
+    }
+
     _didExecute(self);
 }
 
@@ -213,6 +240,11 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     Value result = _private->imp->get (exec, (unsigned)index);
     Interpreter::unlock();
 
+    if (exec->hadException()) {
+        LOG_EXCEPTION (exec);
+        result = Undefined();
+    }
+
     id resultObj = [WebScriptObject _convertValueToObjcValue:result root:_private->root];
 
     _didExecute(self);
@@ -227,6 +259,10 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     _private->imp->put (exec, (unsigned)index, (convertObjcValueToValue(exec, &value, ObjcObjectType)));
     Interpreter::unlock();
 
+    if (exec->hadException()) {
+        LOG_EXCEPTION (exec);
+    }
+
     _didExecute(self);
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list