Index: src/runtime.cc |
=================================================================== |
--- src/runtime.cc (revision 1374) |
+++ src/runtime.cc (working copy) |
@@ -858,14 +858,16 @@ |
static Object* Runtime_RegExpExec(Arguments args) { |
HandleScope scope; |
- ASSERT(args.length() == 3); |
+ ASSERT(args.length() == 4); |
CONVERT_CHECKED(JSRegExp, raw_regexp, args[0]); |
Handle<JSRegExp> regexp(raw_regexp); |
CONVERT_CHECKED(String, raw_subject, args[1]); |
Handle<String> subject(raw_subject); |
- Handle<Object> index(args[2]); |
+ CONVERT_CHECKED(Smi, index, args[2]); |
Christian Plesner Hansen
2009/02/26 15:18:53
This looks suspect -- plain small integers sometim
|
+ CONVERT_CHECKED(JSArray, raw_captures, args[3]); |
+ Handle<JSArray> captures(raw_captures); |
ASSERT(index->IsNumber()); |
- Handle<Object> result = RegExpImpl::Exec(regexp, subject, index); |
+ Handle<Object> result = RegExpImpl::Exec(regexp, subject, index, captures); |
if (result.is_null()) return Failure::Exception(); |
return *result; |
} |
@@ -873,12 +875,15 @@ |
static Object* Runtime_RegExpExecGlobal(Arguments args) { |
HandleScope scope; |
- ASSERT(args.length() == 2); |
+ ASSERT(args.length() == 3); |
CONVERT_CHECKED(JSRegExp, raw_regexp, args[0]); |
Handle<JSRegExp> regexp(raw_regexp); |
CONVERT_CHECKED(String, raw_subject, args[1]); |
Handle<String> subject(raw_subject); |
- Handle<Object> result = RegExpImpl::ExecGlobal(regexp, subject); |
+ CONVERT_CHECKED(JSArray, raw_captures, args[2]); |
+ Handle<JSArray> captures(raw_captures); |
+ Handle<Object> result = |
+ RegExpImpl::ExecGlobal(regexp, subject, captures); |
if (result.is_null()) return Failure::Exception(); |
return *result; |
} |