Commit e89eef30 authored by jgruber's avatar jgruber Committed by Commit bot

[regexp] Fix fallback path in RegExpExec

This fixes the code-path in RegExpExec in which both the passed exec
argument and regexp.exec are not callable and regexp is a JSRegExp.

In this case, we fall back to the default RegExp.prototype.exec
implementation. The arguments for Execution::call were incorrect.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2415073002
Cr-Commit-Position: refs/heads/master@{#40249}
parent 2325ad7e
......@@ -154,7 +154,7 @@ MaybeHandle<Object> RegExpUtils::RegExpExec(Isolate* isolate,
ScopedVector<Handle<Object>> argv(argc);
argv[0] = string;
return Execution::Call(isolate, exec, regexp_exec, argc, argv.start());
return Execution::Call(isolate, regexp_exec, regexp, argc, argv.start());
}
}
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Test that the fallback path in RegExpExec executes the default exec
// implementation.
delete RegExp.prototype.exec;
assertEquals("b", "aba".replace(/a/g, ""));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment