| Index: src/runtime/runtime-regexp.cc
|
| diff --git a/src/runtime/runtime-regexp.cc b/src/runtime/runtime-regexp.cc
|
| index 986c7365ef46692b035b64bb3ecc6fa813346778..bb70e46164b783f0399e6525bc8772c12d00edcb 100644
|
| --- a/src/runtime/runtime-regexp.cc
|
| +++ b/src/runtime/runtime-regexp.cc
|
| @@ -901,14 +901,10 @@ class MatchInfoBackedMatch : public String::Match {
|
| }
|
|
|
| MaybeHandle<String> GetCapture(int i, bool* capture_exists) override {
|
| - Handle<Object> capture_obj =
|
| - RegExpUtils::GenericCaptureGetter(isolate_, match_info_, i);
|
| - if (capture_obj->IsUndefined(isolate_)) {
|
| - *capture_exists = false;
|
| - return isolate_->factory()->empty_string();
|
| - }
|
| - *capture_exists = true;
|
| - return Object::ToString(isolate_, capture_obj);
|
| + Handle<Object> capture_obj = RegExpUtils::GenericCaptureGetter(
|
| + isolate_, match_info_, i, capture_exists);
|
| + return (*capture_exists) ? Object::ToString(isolate_, capture_obj)
|
| + : isolate_->factory()->empty_string();
|
| }
|
|
|
| Handle<String> GetPrefix() override {
|
|
|