Index: Source/bindings/v8/ScriptRegexp.cpp |
diff --git a/Source/bindings/v8/ScriptRegexp.cpp b/Source/bindings/v8/ScriptRegexp.cpp |
index 5f951caee1f54ba5774d657355545f4cc85485f1..98eccc8b5c93cceb86335382b6a041a74d77c1db 100644 |
--- a/Source/bindings/v8/ScriptRegexp.cpp |
+++ b/Source/bindings/v8/ScriptRegexp.cpp |
@@ -80,6 +80,9 @@ int ScriptRegexp::match(const String& string, int startFrom, int* matchLength) c |
v8::Handle<v8::Value> argv[] = { v8String(isolate, string.substring(startFrom)) }; |
v8::Local<v8::Value> returnValue = V8ScriptRunner::callInternalFunction(exec, regex, WTF_ARRAY_LENGTH(argv), argv, isolate); |
+ if (tryCatch.HasCaught()) |
+ return -1; |
+ |
// RegExp#exec returns null if there's no match, otherwise it returns an |
// Array of strings with the first being the whole match string and others |
// being subgroups. The Array also has some random properties tacked on like |
@@ -87,6 +90,7 @@ int ScriptRegexp::match(const String& string, int startFrom, int* matchLength) c |
// |
// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/exec |
+ ASSERT(!returnValue.IsEmpty()); |
if (!returnValue->IsArray()) |
return -1; |