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

Unified Diff: src/bootstrapper.cc

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 | « no previous file | test/mjsunit/regress/regress-5566.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index c31c48fd660ed4534856e1ca0b93554f8782eb4f..45e478a0c43d4a2e0009acaed998331cebce3e1f 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1874,14 +1874,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
{
// RegExp getters and setters.
- // TODO(jgruber): This should really be DONT_ENUM | DONT_DELETE.
- // However, that currently breaks layout test expectations. Note that
- // Firefox sets a couple of these as enumerable.
- // On the other hand, installing attributes as DONT_ENUM matches the draft
- // specification at
- // https://github.com/claudepache/es-regexp-legacy-static-properties.
- const PropertyAttributes no_enum = DONT_ENUM;
-
SimpleInstallGetter(regexp_fun,
factory->InternalizeUtf8String("[Symbol.species]"),
factory->species_symbol(),
@@ -1889,9 +1881,10 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
// Static properties set by a successful match.
+ const PropertyAttributes no_enum = DONT_ENUM;
SimpleInstallGetterSetter(regexp_fun, factory->input_string(),
Builtins::kRegExpInputGetter,
- Builtins::kRegExpInputSetter, DONT_DELETE);
+ Builtins::kRegExpInputSetter, no_enum);
SimpleInstallGetterSetter(
regexp_fun, factory->InternalizeUtf8String("$_"),
Builtins::kRegExpInputGetter, Builtins::kRegExpInputSetter, no_enum);
@@ -1928,11 +1921,10 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kRegExpRightContextGetter,
Builtins::kEmptyFunction, no_enum);
-#define INSTALL_CAPTURE_GETTER(i) \
- SimpleInstallGetterSetter(regexp_fun, \
- factory->InternalizeUtf8String("$" #i), \
- Builtins::kRegExpCapture##i##Getter, \
- Builtins::kEmptyFunction, DONT_DELETE)
+#define INSTALL_CAPTURE_GETTER(i) \
+ SimpleInstallGetterSetter( \
+ regexp_fun, factory->InternalizeUtf8String("$" #i), \
+ Builtins::kRegExpCapture##i##Getter, Builtins::kEmptyFunction, no_enum)
INSTALL_CAPTURE_GETTER(1);
INSTALL_CAPTURE_GETTER(2);
INSTALL_CAPTURE_GETTER(3);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5566.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698