[webkit-changes] cvs commit: JavaScriptCore/kjs function.cpp
nodes.cpp
Adele
adele at opensource.apple.com
Tue Aug 9 11:22:50 PDT 2005
adele 05/08/09 11:22:49
Modified: . Tag: Safari-2-0-branch ChangeLog
kjs Tag: Safari-2-0-branch function.cpp nodes.cpp
Log:
Merged fix from TOT to Safari-2-0-branch
2005-07-14 Geoffrey Garen <ggaren at apple.com>
-fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3970
throw statements fail inside eval statements
Reviewed by mjs.
* kjs/function.cpp:
(KJS::GlobalFuncImp::call):
Big change since I fixed the tabbing. The important part is:
if (c.complType() == Throw)
exec->setException(c.value());
* kjs/nodes.cpp:
(ThrowNode::execute): removed duplicate KJS_CHECKEXCEPTION
(TryNode::execute):
try now clears the exception state before the finally block executes,
and checks the state after the block executes, so that exceptions in
finally code get caught.
Revision Changes Path
No revision
No revision
1.677.6.23 +24 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.677.6.22
retrieving revision 1.677.6.23
diff -u -r1.677.6.22 -r1.677.6.23
--- ChangeLog 9 Aug 2005 01:14:02 -0000 1.677.6.22
+++ ChangeLog 9 Aug 2005 18:22:47 -0000 1.677.6.23
@@ -1,3 +1,27 @@
+2005-08-09 Adele Peterson <adele at apple.com>
+
+ Merged fix from TOT to Safari-2-0-branch
+
+ 2005-07-14 Geoffrey Garen <ggaren at apple.com>
+
+ -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3970
+ throw statements fail inside eval statements
+
+ Reviewed by mjs.
+
+ * kjs/function.cpp:
+ (KJS::GlobalFuncImp::call):
+ Big change since I fixed the tabbing. The important part is:
+ if (c.complType() == Throw)
+ exec->setException(c.value());
+
+ * kjs/nodes.cpp:
+ (ThrowNode::execute): removed duplicate KJS_CHECKEXCEPTION
+ (TryNode::execute):
+ try now clears the exception state before the finally block executes,
+ and checks the state after the block executes, so that exceptions in
+ finally code get caught.
+
2005-08-08 Adele Peterson <adele at apple.com>
Merged fix from TOT to Safari-2-0-branch
No revision
No revision
1.38.8.3 +8 -13 JavaScriptCore/kjs/function.cpp
Index: function.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/function.cpp,v
retrieving revision 1.38.8.2
retrieving revision 1.38.8.3
diff -u -r1.38.8.2 -r1.38.8.3
--- function.cpp 2 Aug 2005 21:26:20 -0000 1.38.8.2
+++ function.cpp 9 Aug 2005 18:22:48 -0000 1.38.8.3
@@ -681,19 +681,14 @@
if (newExec.hadException())
exec->setException(newExec.exception());
- if ( progNode->deref() )
- delete progNode;
- if (c.complType() == ReturnValue)
- return c.value();
- // ### setException() on throw?
- else if (c.complType() == Normal) {
- if (c.isValueCompletion())
- return c.value();
- else
- return Undefined();
- } else {
- return Undefined();
- }
+ res = Undefined();
+ if (c.complType() == Throw)
+ exec->setException(c.value());
+ else if (c.isValueCompletion())
+ res = c.value();
+
+ if ( progNode->deref() )
+ delete progNode;
}
break;
}
1.52.12.4 +7 -3 JavaScriptCore/kjs/nodes.cpp
Index: nodes.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/nodes.cpp,v
retrieving revision 1.52.12.3
retrieving revision 1.52.12.4
diff -u -r1.52.12.3 -r1.52.12.4
--- nodes.cpp 2 Aug 2005 20:39:12 -0000 1.52.12.3
+++ nodes.cpp 9 Aug 2005 18:22:49 -0000 1.52.12.4
@@ -2522,9 +2522,6 @@
Value v = expr->evaluate(exec);
KJS_CHECKEXCEPTION
- // bail out on error
- KJS_CHECKEXCEPTION
-
return Completion(Throw, v);
}
@@ -2639,7 +2636,14 @@
}
if (!_catch) {
+ Value lastException = exec->exception();
+ exec->clearException();
+
c2 = _final->execute(exec);
+
+ if (!exec->hadException())
+ exec->setException(lastException);
+
return (c2.complType() == Normal) ? c : c2;
}
More information about the webkit-changes
mailing list