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

Unified 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, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-5566.js
diff --git a/test/mjsunit/regress/regress-5566.js b/test/mjsunit/regress/regress-5566.js
new file mode 100644
index 0000000000000000000000000000000000000000..98e1f07208fc51ee51c9be4ab68662cd88790eb8
--- /dev/null
+++ b/test/mjsunit/regress/regress-5566.js
@@ -0,0 +1,26 @@
+// 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.
+
+// https://github.com/tc39/proposal-regexp-legacy-features#additional-properties-of-the-regexp-constructor
+
+const props = [ "input", "$_"
+ , "lastMatch", "$&"
+ , "lastParen", "$+"
+ , "leftContext", "$`"
+ , "rightContext", "$'"
+ , "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9"
+ ];
+
+for (let i = 0; i < props.length; i++) {
+ const prop = props[i];
+ const desc = Object.getOwnPropertyDescriptor(RegExp, prop);
+ assertTrue(desc.configurable, prop);
+ assertFalse(desc.enumerable, prop);
+ assertTrue(desc.get !== undefined, prop);
+
+ // TODO(jgruber): Although the spec proposal specifies setting setters to
+ // undefined, we are not sure that this change would be web-compatible, and
+ // we are intentionally sticking with the old behavior for now.
+ assertTrue(desc.set !== undefined, prop);
+}
« 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