v8/test/mjsunit/regress/regress-crbug-467047.js
mstarzinger 86b391ecad Delegate throwing in RegExpExecStub to CEntryStub.
This ensures that there is only one stub that deals with unwinding the
stack. Having more than one place containing that logic is brittle and
error prone, especially when it is a corner case only for RangeErrors.

R=titzer@chromium.org
TEST=mjsunit/regress/regress-crbug-467047
BUG=chromium:467047
LOG=N

Review URL: https://codereview.chromium.org/1012103002

Cr-Commit-Position: refs/heads/master@{#27243}
2015-03-17 15:49:40 +00:00

18 lines
560 B
JavaScript

// Copyright 2015 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.
// Flags: --stack-size=100
function captureMatch(re) {
var local_variable = 0;
"abcd".replace(re, function() { });
assertEquals("abcd", RegExp.input);
assertEquals("a", RegExp.leftContext);
assertEquals("bc", RegExp.lastMatch);
assertEquals("d", RegExp.rightContext);
assertEquals("foo", captureMatch(/^bar/));
}
assertThrows(function() { captureMatch(/(bc)/) }, RangeError);