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

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: 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
Index: Source/bindings/scripts/CodeGeneratorV8.pm
diff --git a/Source/bindings/scripts/CodeGeneratorV8.pm b/Source/bindings/scripts/CodeGeneratorV8.pm
index 5ecf344c1e37fbba8a55317ea5aaf65a60004362..f47cf15eb22c6c24f6add8c58c16ab88161b5893 100644
--- a/Source/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/bindings/scripts/CodeGeneratorV8.pm
@@ -2617,11 +2617,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";
}
@@ -2629,7 +2633,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.

Powered by Google App Engine
This is Rietveld 408576698