[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 08:11:32 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 957309473abb7caa0edbd58596d880612d9bb9a7
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 13 22:53:00 2003 +0000
Reviewed by John.
- fixed 3472562 - Null or Undefined variables passed to IN operator cause javascript exceptions
* kjs/nodes.cpp:
(ForInNode::execute): If the in value is null or undefined, bail
out early, since attempting to iterate its properties will throw
an exception.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 2c8ec1e..b958cea 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,14 @@
+2003-11-13 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by John.
+
+ - fixed 3472562 - Null or Undefined variables passed to IN operator cause javascript exceptions
+
+ * kjs/nodes.cpp:
+ (ForInNode::execute): If the in value is null or undefined, bail
+ out early, since attempting to iterate its properties will throw
+ an exception.
+
2003-11-12 Darin Adler <darin at apple.com>
- fixed the build
diff --git a/JavaScriptCore/kjs/nodes.cpp b/JavaScriptCore/kjs/nodes.cpp
index 19c72b3..6c18f84 100644
--- a/JavaScriptCore/kjs/nodes.cpp
+++ b/JavaScriptCore/kjs/nodes.cpp
@@ -2073,6 +2073,15 @@ Completion ForInNode::execute(ExecState *exec)
}
e = expr->evaluate(exec);
+
+ // for Null and Undefined, we want to make sure not to go through
+ // the loop at all, because their object wrappers will have a
+ // property list but will throw an exception if you attempt to
+ // access any property.
+ if (e.type() == UndefinedType || e.type() == NullType) {
+ return Completion(Normal, retval);
+ }
+
KJS_CHECKEXCEPTION
v = e.toObject(exec);
propList = v.propList(exec);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list