WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-67666-20111122165627.patch (text/plain), 25.64 KB, created by
Erik Arvidsson
on 2011-11-22 16:56:29 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Erik Arvidsson
Created:
2011-11-22 16:56:29 PST
Size:
25.64 KB
patch
obsolete
>Subversion Revision: 100804 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 65e1560ee40592c65f17eeb01469b2f82d5d50a9..e7a7e056be92e5b152d59d278f5e067aadfa35a4 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,38 @@ >+2011-11-22 Erik Arvidsson <arv@chromium.org> >+ >+ Binding CodeGenerators don't support Conditional= on constants >+ https://bugs.webkit.org/show_bug.cgi?id=67666 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Adds support for [Conditional=LABEL] to const IDL fields. >+ >+ * bindings/scripts/CodeGenerator.pm: >+ (GenerateConditionalStringFromAttributeValue): Moved out of CodeGenerator{CPP,JS,V8}.pm. >+ (GenerateCompileTimeCheckForEnumsIfNeeded): Wrap in conditional #if. >+ * bindings/scripts/CodeGeneratorCPP.pm: >+ (GenerateConditionalString): >+ (GenerateHeader): Ditto. >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GenerateConditionalString): >+ (GenerateHeader): Ditto. >+ (GenerateImplementation): Ditto. >+ (GenerateHashTable): >+ (WriteData): >+ * bindings/scripts/CodeGeneratorObjC.pm: >+ (GenerateHeader): Ditto. >+ * bindings/scripts/CodeGeneratorV8.pm: >+ (GenerateConditionalString): Ditto. >+ (GenerateImplementation): >+ (WriteData): >+ * bindings/scripts/test/CPP/WebDOMTestObj.h: Generated code now wraps conditional const in #if. >+ * bindings/scripts/test/JS/JSTestObj.cpp: >+ (WebCore::jsTestObjCONDITIONAL_CONST): Ditto >+ * bindings/scripts/test/JS/JSTestObj.h: Ditto >+ * bindings/scripts/test/ObjC/DOMTestObj.h: Ditto >+ * bindings/scripts/test/TestObj.idl: Added a conditional const. >+ * bindings/scripts/test/V8/V8TestObj.cpp: Generated code now wraps conditional const in #if. >+ > 2011-11-18 Simon Fraser <simon.fraser@apple.com> > > Appearance of compound transform animations under apps linked on SnowLeopard is incorrect >diff --git a/Source/WebCore/bindings/scripts/CodeGenerator.pm b/Source/WebCore/bindings/scripts/CodeGenerator.pm >index 20ddc529b101f295f39bef2a0426ce05cf10105e..8b08f8839d47230d6b12794324da2579ef22e2a3 100644 >--- a/Source/WebCore/bindings/scripts/CodeGenerator.pm >+++ b/Source/WebCore/bindings/scripts/CodeGenerator.pm >@@ -559,9 +559,22 @@ sub ShouldCheckEnums > return not $dataNode->extendedAttributes->{"DontCheckEnums"}; > } > >+sub GenerateConditionalStringFromAttributeValue >+{ >+ my $generator = shift; >+ my $conditional = shift; >+ if ($conditional =~ /&/) { >+ return "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")"; >+ } elsif ($conditional =~ /\|/) { >+ return "ENABLE(" . join(") || ENABLE(", split(/\|/, $conditional)) . ")"; >+ } else { >+ return "ENABLE(" . $conditional . ")"; >+ } >+} >+ > sub GenerateCompileTimeCheckForEnumsIfNeeded > { >- my ($object, $dataNode) = @_; >+ my ($generator, $dataNode) = @_; > my $interfaceName = $dataNode->name; > my @checks = (); > # If necessary, check that all constants are available as enums with the same value. >@@ -571,7 +584,18 @@ sub GenerateCompileTimeCheckForEnumsIfNeeded > my $reflect = $constant->extendedAttributes->{"Reflect"}; > my $name = $reflect ? $reflect : $constant->name; > my $value = $constant->value; >+ my $conditional = $constant->extendedAttributes->{"Conditional"}; >+ >+ if ($conditional) { >+ my $conditionalString = $generator->GenerateConditionalStringFromAttributeValue($conditional); >+ push(@checks, "#if ${conditionalString}\n"); >+ } >+ > push(@checks, "COMPILE_ASSERT($value == ${interfaceName}::$name, ${interfaceName}Enum${name}IsWrongUseDontCheckEnums);\n"); >+ >+ if ($conditional) { >+ push(@checks, "#endif\n"); >+ } > } > push(@checks, "\n"); > } >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm b/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm >index 357271212eb749ffde15cb73a069960204acd071..a5469b1b4246800386c80bab7330e713bdf7a805 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm >@@ -318,24 +318,12 @@ sub AddIncludesForType > $implIncludes{"WebDOM$type.h"} = 1; > } > >-sub GenerateConditionalStringFromAttributeValue >-{ >- my $conditional = shift; >- if ($conditional =~ /&/) { >- return "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")"; >- } elsif ($conditional =~ /\|/) { >- return "ENABLE(" . join(") || ENABLE(", split(/\|/, $conditional)) . ")"; >- } else { >- return "ENABLE(" . $conditional . ")"; >- } >-} >- > sub GenerateConditionalString > { > my $node = shift; > my $conditional = $node->extendedAttributes->{"Conditional"}; > if ($conditional) { >- return GenerateConditionalStringFromAttributeValue($conditional); >+ return $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); > } else { > return ""; > } >@@ -403,18 +391,29 @@ sub GenerateHeader > # - Add constants. > if ($numConstants > 0) { > my @headerConstants = (); >+ my @constants = @{$dataNode->constants}; >+ my $combinedConstants = ""; > > # FIXME: we need a way to include multiple enums. >- foreach my $constant (@{$dataNode->constants}) { >+ foreach my $constant (@constants) { > my $constantName = $constant->name; > my $constantValue = $constant->value; >+ my $conditional = $constant->extendedAttributes->{"Conditional"}; >+ my $notLast = $constant ne $constants[-1]; > >- my $output = "WEBDOM_" . $constantName . " = " . $constantValue; >- push(@headerConstants, " " . $output); >+ if ($conditional) { >+ my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); >+ $combinedConstants .= "#if ${conditionalString}\n"; >+ } >+ $combinedConstants .= " WEBDOM_$constantName = $constantValue"; >+ $combinedConstants .= "," if $notLast; >+ if ($conditional) { >+ $combinedConstants .= "\n#endif\n"; >+ } elsif ($notLast) { >+ $combinedConstants .= "\n"; >+ } > } > >- my $combinedConstants = join(",\n", @headerConstants); >- > push(@headerContent, " "); > push(@headerContent, "enum {\n"); > push(@headerContent, $combinedConstants); >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 88daf3d7c646cd35c50178c5799b94f105c288fa..cc4562c6cb6b77903e3dca4a6de3429ec643d021 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -411,24 +411,12 @@ sub prototypeHashTableAccessor > } > } > >-sub GenerateConditionalStringFromAttributeValue >-{ >- my $conditional = shift; >- if ($conditional =~ /&/) { >- return "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")"; >- } elsif ($conditional =~ /\|/) { >- return "ENABLE(" . join(") || ENABLE(", split(/\|/, $conditional)) . ")"; >- } else { >- return "ENABLE(" . $conditional . ")"; >- } >-} >- > sub GenerateConditionalString > { > my $node = shift; > my $conditional = $node->extendedAttributes->{"Conditional"}; > if ($conditional) { >- return GenerateConditionalStringFromAttributeValue($conditional); >+ return $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); > } else { > return ""; > } >@@ -1123,7 +1111,13 @@ sub GenerateHeader > push(@headerContent,"// Constants\n\n"); > foreach my $constant (@{$dataNode->constants}) { > my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name); >+ my $conditional = $constant->extendedAttributes->{"Conditional"}; >+ if ($conditional) { >+ my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); >+ push(@headerContent, "#if ${conditionalString}\n"); >+ } > push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n"); >+ push(@headerContent, "#endif\n") if $conditional; > } > } > >@@ -1362,19 +1356,27 @@ sub GenerateImplementation > my @hashValue1 = (); > my @hashValue2 = (); > my @hashSpecials = (); >+ my %conditionals = (); > > # FIXME: we should not need a function for every constant. > foreach my $constant (@{$dataNode->constants}) { >- push(@hashKeys, $constant->name); >- my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name); >+ my $name = $constant->name; >+ push(@hashKeys, $name); >+ my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($name); > push(@hashValue1, $getter); > push(@hashValue2, "0"); > push(@hashSpecials, "DontDelete | ReadOnly"); >+ >+ my $conditional = $constant->extendedAttributes->{"Conditional"}; >+ if ($conditional) { >+ $conditionals{$name} = $conditional; >+ } > } > > $object->GenerateHashTable($hashName, $hashSize, > \@hashKeys, \@hashSpecials, >- \@hashValue1, \@hashValue2); >+ \@hashValue1, \@hashValue2, >+ \%conditionals); > > push(@implContent, $codeGenerator->GenerateCompileTimeCheckForEnumsIfNeeded($dataNode)); > >@@ -1394,11 +1396,17 @@ sub GenerateImplementation > > # FIXME: we should not need a function for every constant. > foreach my $constant (@{$dataNode->constants}) { >- push(@hashKeys, $constant->name); >- my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name); >+ my $name = $constant->name; >+ push(@hashKeys, $name); >+ my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($name); > push(@hashValue1, $getter); > push(@hashValue2, "0"); > push(@hashSpecials, "DontDelete | ReadOnly"); >+ >+ my $conditional = $constant->extendedAttributes->{"Conditional"}; >+ if ($conditional) { >+ $conditionals{$name} = $conditional; >+ } > } > > foreach my $function (@{$dataNode->functions}) { >@@ -1983,7 +1991,7 @@ sub GenerateImplementation > > my $conditional = $function->signature->extendedAttributes->{"Conditional"}; > if ($conditional) { >- my $conditionalString = GenerateConditionalStringFromAttributeValue($conditional); >+ my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); > push(@implContent, "#if ${conditionalString}\n"); > } > >@@ -2057,9 +2065,7 @@ sub GenerateImplementation > GenerateOverloadedPrototypeFunction($function, $dataNode, $implClassName); > } > >- if ($conditional) { >- push(@implContent, "#endif\n\n"); >- } >+ push(@implContent, "#endif\n\n") if $conditional; > } > > if ($needsMarkChildren && !$dataNode->extendedAttributes->{"CustomMarkFunction"}) { >@@ -2092,6 +2098,12 @@ sub GenerateImplementation > > foreach my $constant (@{$dataNode->constants}) { > my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name); >+ my $conditional = $constant->extendedAttributes->{"Conditional"}; >+ >+ if ($conditional) { >+ my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); >+ push(@implContent, "#if ${conditionalString}\n"); >+ } > > # FIXME: this casts into int to match our previous behavior which turned 0xFFFFFFFF in -1 for NodeFilter.SHOW_ALL > push(@implContent, "JSValue ${getter}(ExecState* exec, JSValue, const Identifier&)\n"); >@@ -2103,6 +2115,7 @@ sub GenerateImplementation > push(@implContent, " return jsNumber(static_cast<int>(" . $constant->value . "));\n"); > } > push(@implContent, "}\n\n"); >+ push(@implContent, "#endif\n") if $conditional; > } > } > >@@ -3037,7 +3050,7 @@ sub GenerateHashTable > $conditional = $conditionals->{$key}; > } > if ($conditional) { >- my $conditionalString = GenerateConditionalStringFromAttributeValue($conditional); >+ my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); > push(@implContent, "#if ${conditionalString}\n"); > } > >@@ -3047,9 +3060,7 @@ sub GenerateHashTable > $targetType = "static_cast<PropertySlot::GetValueFunc>"; > } > push(@implContent, " { \"$key\", @$specials[$i], (intptr_t)" . $targetType . "(@$value1[$i]), (intptr_t)@$value2[$i] THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },\n"); >- if ($conditional) { >- push(@implContent, "#endif\n"); >- } >+ push(@implContent, "#endif\n") if $conditional; > ++$i; > } > push(@implContent, " { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }\n"); >@@ -3145,7 +3156,7 @@ sub WriteData > print $IMPL "#include $include\n"; > } > foreach my $condition (sort keys %implIncludeConditions) { >- print $IMPL "\n#if " . GenerateConditionalStringFromAttributeValue($condition) . "\n"; >+ print $IMPL "\n#if " . $codeGenerator->GenerateConditionalStringFromAttributeValue($condition) . "\n"; > foreach my $include (sort @{$implIncludeConditions{$condition}}) { > print $IMPL "#include $include\n"; > } >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm >index e635fe06e80871dc668192709e29f1195a175a1e..274102897b591fcd0401bd4f27f70494291759ca 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm >@@ -731,18 +731,29 @@ sub GenerateHeader > # - Add constants. > if ($numConstants > 0) { > my @headerConstants = (); >+ my @constants = @{$dataNode->constants}; >+ my $combinedConstants = ""; > > # FIXME: we need a way to include multiple enums. >- foreach my $constant (@{$dataNode->constants}) { >+ foreach my $constant (@constants) { > my $constantName = $constant->name; > my $constantValue = $constant->value; >+ my $conditional = $constant->extendedAttributes->{"Conditional"}; >+ my $notLast = $constant ne $constants[-1]; > >- my $output = " DOM_" . $constantName . " = " . $constantValue; >- push(@headerConstants, $output); >+ if ($conditional) { >+ my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); >+ $combinedConstants .= "#if ${conditionalString}\n"; >+ } >+ $combinedConstants .= " DOM_$constantName = $constantValue"; >+ $combinedConstants .= "," if $notLast; >+ if ($conditional) { >+ $combinedConstants .= "\n#endif\n"; >+ } elsif ($notLast) { >+ $combinedConstants .= "\n"; >+ } > } > >- my $combinedConstants = join(",\n", @headerConstants); >- > # FIXME: the formatting of the enums should line up the equal signs. > # FIXME: enums are unconditionally placed in the public header. > push(@headerContent, "enum {\n"); >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >index 80a8babda2a559587eef09be0009c35984d4eed7..a860fd1d946b725201a19d528816aa2df4c4a75d 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >@@ -187,25 +187,12 @@ sub AddIncludesForType > } > } > >-# If the node has a [Conditional=XXX] attribute, returns an "ENABLE(XXX)" string for use in an #if. >-sub GenerateConditionalStringFromAttributeValue >-{ >- my $conditional = shift; >- if ($conditional =~ /&/) { >- return "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")"; >- } elsif ($conditional =~ /\|/) { >- return "ENABLE(" . join(") || ENABLE(", split(/\|/, $conditional)) . ")"; >- } else { >- return "ENABLE(" . $conditional . ")"; >- } >-} >- > sub GenerateConditionalString > { > my $node = shift; > my $conditional = $node->extendedAttributes->{"Conditional"}; > if ($conditional) { >- return GenerateConditionalStringFromAttributeValue($conditional); >+ return $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); > } else { > return ""; > } >@@ -2354,15 +2341,21 @@ END > my $name = $constant->name; > my $value = $constant->value; > my $attrExt = $constant->extendedAttributes; >+ my $conditional = $attrExt->{"Conditional"}; > if ($attrExt->{"EnabledAtRuntime"}) { > push(@constantsEnabledAtRuntime, $constant); > } else { > # FIXME: we need the static_cast here only because of one constant, NodeFilter.idl > # defines "const unsigned long SHOW_ALL = 0xFFFFFFFF". It would be better if we > # handled this here, and converted it to a -1 constant in the c++ output. >+ if ($conditional) { >+ my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); >+ push(@implContent, "#if ${conditionalString}\n"); >+ } > push(@implContent, <<END); > {"${name}", static_cast<signed int>($value)}, > END >+ push(@implContent, "#endif\n") if $conditional; > } > } > if ($has_constants) { >@@ -3767,7 +3760,7 @@ sub WriteData > print $IMPL "#include $include\n"; > } > foreach my $condition (sort keys %implIncludeConditions) { >- print $IMPL "\n#if " . GenerateConditionalStringFromAttributeValue($condition) . "\n"; >+ print $IMPL "\n#if " . $codeGenerator->GenerateConditionalStringFromAttributeValue($condition) . "\n"; > foreach my $include (sort @{$implIncludeConditions{$condition}}) { > print $IMPL "#include $include\n"; > } >diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h >index c4abb3c9409f8131e9d75af2edcc573b7532acfc..92d469602170dc722176b617150b58057036aca3 100644 >--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h >+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h >@@ -48,6 +48,9 @@ public: > virtual ~WebDOMTestObj(); > > enum { >+#if ENABLE(Condition1) >+ WEBDOM_CONDITIONAL_CONST = 0, >+#endif > WEBDOM_CONST_VALUE_0 = 0, > WEBDOM_CONST_VALUE_1 = 1, > WEBDOM_CONST_VALUE_2 = 2, >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >index 6f4883e0732d588805b07ae659afb5237f996bab..6721aa6c62d0f6b6ce13dd71073824bc8505bacd 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >@@ -147,6 +147,9 @@ static const HashTable JSTestObjTable = { 135, 127, JSTestObjTableValues, 0 }; > > static const HashTableValue JSTestObjConstructorTableValues[] = > { >+#if ENABLE(Condition1) >+ { "CONDITIONAL_CONST", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }, >+#endif > { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }, > { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }, > { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }, >@@ -165,6 +168,9 @@ static const HashTableValue JSTestObjConstructorTableValues[] = > #undef THUNK_GENERATOR > static const HashTable JSTestObjConstructorTable = { 33, 31, JSTestObjConstructorTableValues, 0 }; > >+#if ENABLE(Condition1) >+COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWrongUseDontCheckEnums); >+#endif > COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums); > COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDontCheckEnums); > COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums); >@@ -229,6 +235,9 @@ ConstructType JSTestObjConstructor::getConstructData(JSCell*, ConstructData& con > > static const HashTableValue JSTestObjPrototypeTableValues[] = > { >+#if ENABLE(Condition1) >+ { "CONDITIONAL_CONST", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }, >+#endif > { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }, > { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }, > { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }, >@@ -1908,6 +1917,14 @@ void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor) > > // Constant getters > >+#if ENABLE(Condition1) >+JSValue jsTestObjCONDITIONAL_CONST(ExecState* exec, JSValue, const Identifier&) >+{ >+ UNUSED_PARAM(exec); >+ return jsNumber(static_cast<int>(0)); >+} >+ >+#endif > JSValue jsTestObjCONST_VALUE_0(ExecState* exec, JSValue, const Identifier&) > { > UNUSED_PARAM(exec); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >index 254827159a65e3d2caeb339ee80376063ce0b820..94f0d15647d315ca859aabfeed2f747cebdb1f51 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >@@ -262,6 +262,9 @@ JSC::JSValue jsTestObjHash(JSC::ExecState*, JSC::JSValue, const JSC::Identifier& > JSC::JSValue jsTestObjConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); > // Constants > >+#if ENABLE(Condition1) >+JSC::JSValue jsTestObjCONDITIONAL_CONST(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); >+#endif > JSC::JSValue jsTestObjCONST_VALUE_0(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); > JSC::JSValue jsTestObjCONST_VALUE_1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); > JSC::JSValue jsTestObjCONST_VALUE_2(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); >diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h >index 6dd11d417bc17f5109c62f8e215aad5783c690df..14fadea299cdb198e4e9ce5cab0663dcb647a892 100644 >--- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h >+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h >@@ -39,6 +39,9 @@ > @protocol DOMEventListener; > > enum { >+#if ENABLE(Condition1) >+ DOM_CONDITIONAL_CONST = 0, >+#endif > DOM_CONST_VALUE_0 = 0, > DOM_CONST_VALUE_1 = 1, > DOM_CONST_VALUE_2 = 2, >diff --git a/Source/WebCore/bindings/scripts/test/TestObj.idl b/Source/WebCore/bindings/scripts/test/TestObj.idl >index 9864a1a33cb834571913b26211b945e84f9cacf8..9c376a20ac9c88322a38ef5dc50ef74bb7abdf69 100644 >--- a/Source/WebCore/bindings/scripts/test/TestObj.idl >+++ b/Source/WebCore/bindings/scripts/test/TestObj.idl >@@ -143,6 +143,8 @@ module test { > attribute [Conditional=Condition1&Condition2] TestObjectBConstructor conditionalAttr5; > attribute [Conditional=Condition1|Condition2] TestObjectCConstructor conditionalAttr6; > >+ const [Conditional=Condition1] unsigned short CONDITIONAL_CONST = 0; >+ > #if defined(TESTING_V8) || defined(TESTING_JS) > readonly attribute [CachedAttribute] any cachedAttribute1; > readonly attribute [CachedAttribute] any cachedAttribute2; >diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp >index 68a95d896de2912e5ddbbe1258f055cc551228e9..908e75c137f4db7397527d7eb3f85c9b39741b14 100644 >--- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp >@@ -1450,6 +1450,9 @@ static const BatchedCallback TestObjCallbacks[] = { > }; > > static const BatchedConstant TestObjConsts[] = { >+#if ENABLE(Condition1) >+ {"CONDITIONAL_CONST", static_cast<signed int>(0)}, >+#endif > {"CONST_VALUE_0", static_cast<signed int>(0)}, > {"CONST_VALUE_1", static_cast<signed int>(1)}, > {"CONST_VALUE_2", static_cast<signed int>(2)}, >@@ -1465,6 +1468,9 @@ static const BatchedConstant TestObjConsts[] = { > }; > > >+#if ENABLE(Condition1) >+COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWrongUseDontCheckEnums); >+#endif > COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums); > COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDontCheckEnums); > COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 67666
:
106472
|
106473
| 116296