86b391ecad
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}
18 lines
560 B
JavaScript
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);
|