Index: src/messages.cc |
diff --git a/src/messages.cc b/src/messages.cc |
index cc6349d73c52cfa15b5fb7aa96250ea84ef9b549..b9a8d977fe7611cf69d04fbd949f7828e2201925 100644 |
--- a/src/messages.cc |
+++ b/src/messages.cc |
@@ -499,7 +499,11 @@ void AppendFileLocation(Isolate* isolate, JSStackFrame* call_site, |
int StringIndexOf(Isolate* isolate, Handle<String> subject, |
Handle<String> pattern) { |
if (pattern->length() > subject->length()) return -1; |
- return String::IndexOf(isolate, subject, pattern, 0); |
+ Object* index = String::IndexOf(isolate, subject, pattern, |
+ isolate->factory()->undefined_value()); |
+ int index_int; |
+ if (index->ToInt32(&index_int)) return index_int; |
+ return -1; |
} |
// Returns true iff |