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

Unified Diff: Source/bindings/scripts/CodeGeneratorV8.pm

Issue 14447006: Global constructors should be configurable and not enumerable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clean rebase on master Created 7 years, 8 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 | « LayoutTests/fast/js/script-tests/global-constructors-attributes.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/CodeGeneratorV8.pm
diff --git a/Source/bindings/scripts/CodeGeneratorV8.pm b/Source/bindings/scripts/CodeGeneratorV8.pm
index 3c312c89fa49c235a8fc2eaea7a89d767ca086ee..888692c040e9433ba389e0c191eda16c2fa12e19 100644
--- a/Source/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/bindings/scripts/CodeGeneratorV8.pm
@@ -2630,11 +2630,15 @@ sub GenerateSingleBatchedAttribute
my $setterForMainWorld;
my $propAttr = "v8::None";
+ my $isConstructor = ($attribute->signature->type =~ /Constructor$/);
+
# Check attributes.
- if ($attrExt->{"NotEnumerable"}) {
+ # As per Web IDL specification, constructor properties on the ECMAScript global object should be
+ # configurable and should not be enumerable.
+ if ($attrExt->{"NotEnumerable"} || $isConstructor) {
$propAttr .= " | v8::DontEnum";
}
- if ($attrExt->{"Unforgeable"}) {
+ if ($attrExt->{"Unforgeable"} && !$isConstructor) {
$propAttr .= " | v8::DontDelete";
}
@@ -2642,7 +2646,7 @@ sub GenerateSingleBatchedAttribute
my $data = "0 /* no data */";
# Constructor
- if ($attribute->signature->type =~ /Constructor$/) {
+ if ($isConstructor) {
my $constructorType = $attribute->signature->type;
$constructorType =~ s/Constructor$//;
# $constructorType ~= /Constructor$/ indicates that it is NamedConstructor.
« no previous file with comments | « LayoutTests/fast/js/script-tests/global-constructors-attributes.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698