v8/test/mjsunit/regress/regress-800538.js
Jakob Gruber 4e14a2a4e6 [regexp] Fix fast/slow-path dispatch in RegExp.p.get flags
Flag getters (e.g. RegExp.p.get global) are defined on the prototype and
thus we need to use the more general BranchIfFastRegExp here instead of
IsFastRegExpNoPrototype.

Bug: chromium:800538
Change-Id: Ib6bc8a4fd3bf2f7dd31538c8dbb61814106c184b
Reviewed-on: https://chromium-review.googlesource.com/859767
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50538}
2018-01-12 14:06:09 +00:00

7 lines
265 B
JavaScript

// Copyright 2018 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.
RegExp.prototype.__defineGetter__("global", () => true);
assertEquals("/()/g", /()/.toString());