Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1879)

Side by Side Diff: test/mjsunit/regress/regress-5566.js

Issue 2452913002: [regexp] Set static property attributes as in spec proposal (Closed)
Patch Set: Check setters as well Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // https://github.com/tc39/proposal-regexp-legacy-features#additional-properties -of-the-regexp-constructor
6
7 const props = [ "input", "$_"
8 , "lastMatch", "$&"
9 , "lastParen", "$+"
10 , "leftContext", "$`"
11 , "rightContext", "$'"
12 , "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9"
13 ];
14
15 for (let i = 0; i < props.length; i++) {
16 const prop = props[i];
17 const desc = Object.getOwnPropertyDescriptor(RegExp, prop);
18 assertTrue(desc.configurable, prop);
19 assertFalse(desc.enumerable, prop);
20 assertTrue(desc.get !== undefined, prop);
21
22 // TODO(jgruber): Although the spec proposal specifies setting setters to
23 // undefined, we are not sure that this change would be web-compatible, and
24 // we are intentionally sticking with the old behavior for now.
25 assertTrue(desc.set !== undefined, prop);
26 }
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698