summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
authorLeon Clarke <leonclarke@google.com>2010-02-26 09:32:41 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-02-26 09:32:41 -0800
commit2a08ec52b929d53cec8a3529ed5e2d740aabad59 (patch)
tree5856844efdb7eae30410172cb65e2313a1cee3c5 /WebCore
parentd3376c33807e25bd5b6328a0ced9cd25b0eb6f20 (diff)
parent415bfdfb5c693e81bff6b4c4ec2435df6f5aedc3 (diff)
downloadexternal_webkit-2a08ec52b929d53cec8a3529ed5e2d740aabad59.zip
external_webkit-2a08ec52b929d53cec8a3529ed5e2d740aabad59.tar.gz
external_webkit-2a08ec52b929d53cec8a3529ed5e2d740aabad59.tar.bz2
Merge " Don't crash when throwing javascript exceptions from plugins without javascript having been initialised."
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/bindings/v8/NPV8Object.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/WebCore/bindings/v8/NPV8Object.cpp b/WebCore/bindings/v8/NPV8Object.cpp
index 53ceea1..06243d4 100644
--- a/WebCore/bindings/v8/NPV8Object.cpp
+++ b/WebCore/bindings/v8/NPV8Object.cpp
@@ -413,7 +413,11 @@ void _NPN_SetException(NPObject* npObject, const NPUTF8 *message)
if (!npObject || npObject->_class != npScriptObjectClass) {
// We won't be able to find a proper scope for this exception, so just throw it.
// This is consistent with JSC, which throws a global exception all the time.
- V8Proxy::throwError(V8Proxy::GeneralError, message);
+#if PLATFORM(ANDROID)
+ // However, if there isn't a v8 context, throw the error away as there really isn't anything useful to do with it.
+ if (v8::Context::InContext())
+ V8Proxy::throwError(V8Proxy::GeneralError, message);
+#endif
return;
}
v8::HandleScope handleScope;