Title: [207243] trunk/Source/WebCore
Revision
207243
Author
cdu...@apple.com
Date
2016-10-12 14:09:46 -0700 (Wed, 12 Oct 2016)

Log Message

[Web IDL] Generated bindings include the wrong header when ImplementedAs is used on a dictionary
https://bugs.webkit.org/show_bug.cgi?id=163352

Reviewed by Ryosuke Niwa.

Generated bindings include the wrong header when ImplementedAs is used
on a dictionary.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeader):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterCaller):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
(WebCore::convertDictionary<TestStandaloneDictionary>): Deleted.
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/TestStandaloneDictionary.idl:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (207242 => 207243)


--- trunk/Source/WebCore/ChangeLog	2016-10-12 21:02:09 UTC (rev 207242)
+++ trunk/Source/WebCore/ChangeLog	2016-10-12 21:09:46 UTC (rev 207243)
@@ -1,3 +1,23 @@
+2016-10-12  Chris Dumez  <cdu...@apple.com>
+
+        [Web IDL] Generated bindings include the wrong header when ImplementedAs is used on a dictionary
+        https://bugs.webkit.org/show_bug.cgi?id=163352
+
+        Reviewed by Ryosuke Niwa.
+
+        Generated bindings include the wrong header when ImplementedAs is used
+        on a dictionary.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateDictionaryHeader):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterCaller):
+        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
+        (WebCore::convertDictionary<DictionaryImplName>):
+        (WebCore::convertDictionary<TestStandaloneDictionary>): Deleted.
+        * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
+        * bindings/scripts/test/TestStandaloneDictionary.idl:
+
 2016-10-12  Yusuke Suzuki  <utatane....@gmail.com>
 
         [DOMJIT][JSC] Explore the way to embed nodeType into JSC::JSType in WebCore

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (207242 => 207243)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-10-12 21:02:09 UTC (rev 207242)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-10-12 21:09:46 UTC (rev 207243)
@@ -4365,7 +4365,7 @@
     # - Add default header template and header protection.
     push(@headerContentHeader, GenerateHeaderContentHeader($dictionary));
 
-    $headerIncludes{"$dictionaryName.h"} = 1;
+    $headerIncludes{"$className.h"} = 1;
     $headerIncludes{"JSDOMConvert.h"} = 1;
 
     push(@headerContent, "\nnamespace WebCore {\n\n");

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (207242 => 207243)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-10-12 21:02:09 UTC (rev 207242)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-10-12 21:09:46 UTC (rev 207243)
@@ -7713,7 +7713,7 @@
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
-    auto dict = convert<IDLDictionary<TestStandaloneDictionary>>(*state, state->uncheckedArgument(0));
+    auto dict = convert<IDLDictionary<DictionaryImplName>>(*state, state->uncheckedArgument(0));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.operationWithExternalDictionaryParameter(dict.value());
     return JSValue::encode(jsUndefined());

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp (207242 => 207243)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp	2016-10-12 21:02:09 UTC (rev 207242)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp	2016-10-12 21:09:46 UTC (rev 207243)
@@ -26,7 +26,7 @@
 
 namespace WebCore {
 
-template<> Optional<TestStandaloneDictionary> convertDictionary<TestStandaloneDictionary>(ExecState& state, JSValue value)
+template<> Optional<DictionaryImplName> convertDictionary<DictionaryImplName>(ExecState& state, JSValue value)
 {
     VM& vm = state.vm();
     auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -40,7 +40,7 @@
         throwTypeError(&state, throwScope);
         return Nullopt;
     }
-    TestStandaloneDictionary result;
+    DictionaryImplName result;
     JSValue boolMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "boolMember"));
     if (!boolMemberValue.isUndefined()) {
         result.boolMember = convert<IDLBoolean>(state, boolMemberValue);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h (207242 => 207243)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h	2016-10-12 21:02:09 UTC (rev 207242)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h	2016-10-12 21:09:46 UTC (rev 207243)
@@ -20,11 +20,11 @@
 
 #pragma once
 
+#include "DictionaryImplName.h"
 #include "JSDOMConvert.h"
-#include "TestStandaloneDictionary.h"
 
 namespace WebCore {
 
-template<> Optional<TestStandaloneDictionary> convertDictionary<TestStandaloneDictionary>(JSC::ExecState&, JSC::JSValue);
+template<> Optional<DictionaryImplName> convertDictionary<DictionaryImplName>(JSC::ExecState&, JSC::JSValue);
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/test/TestStandaloneDictionary.idl (207242 => 207243)


--- trunk/Source/WebCore/bindings/scripts/test/TestStandaloneDictionary.idl	2016-10-12 21:02:09 UTC (rev 207242)
+++ trunk/Source/WebCore/bindings/scripts/test/TestStandaloneDictionary.idl	2016-10-12 21:09:46 UTC (rev 207243)
@@ -26,7 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-dictionary TestStandaloneDictionary {
+[
+    ImplementedAs=DictionaryImplName,
+] dictionary TestStandaloneDictionary {
     boolean boolMember;
     DOMString stringMember;
 };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to