Changeset 252808 in webkit
- Timestamp:
- Nov 22, 2019 3:10:51 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r252807 r252808 1 2019-11-22 Chris Dumez <cdumez@apple.com> 2 3 Bindings generator fails to add includes for iterable<> key / value types 4 https://bugs.webkit.org/show_bug.cgi?id=204530 5 6 Reviewed by Ryosuke Niwa. 7 8 * bindings/scripts/CodeGeneratorJS.pm: 9 (GenerateIterableDefinition): 10 * bindings/scripts/test/JS/JSTestInterface.cpp: 11 (WebCore::JSTestInterfacePrototype::finishCreation): 12 (WebCore::jsTestInterfacePrototypeFunctionEntriesCaller): 13 (WebCore::jsTestInterfacePrototypeFunctionEntries): 14 (WebCore::jsTestInterfacePrototypeFunctionKeysCaller): 15 (WebCore::jsTestInterfacePrototypeFunctionKeys): 16 (WebCore::jsTestInterfacePrototypeFunctionValuesCaller): 17 (WebCore::jsTestInterfacePrototypeFunctionValues): 18 (WebCore::jsTestInterfacePrototypeFunctionForEachCaller): 19 (WebCore::jsTestInterfacePrototypeFunctionForEach): 20 * bindings/scripts/test/JS/JSTestIterable.cpp: 21 * bindings/scripts/test/JS/JSTestNode.cpp: 22 * bindings/scripts/test/TestInterface.idl: 23 1 24 2019-11-22 Zalan Bujtas <zalan@apple.com> 2 25 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r252480 r252808 6408 6408 my $iteratorTraitsKeyType = $interface->iterable->isKeyValue ? GetIDLType($interface, $interface->iterable->keyType) : "void"; 6409 6409 my $iteratorTraitsValueType = GetIDLType($interface, $interface->iterable->valueType); 6410 6411 AddToImplIncludesForIDLType($interface->iterable->keyType) if $interface->iterable->isKeyValue; 6412 AddToImplIncludesForIDLType($interface->iterable->valueType); 6410 6413 6411 6414 push(@implContent, <<END); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r251425 r252808 32 32 #include "JSDOMConvertInterface.h" 33 33 #include "JSDOMExceptionHandling.h" 34 #include "JSDOMIterator.h" 34 35 #include "JSDOMOperation.h" 35 36 #include "JSDOMWrapperCache.h" 37 #include "JSTestNode.h" 38 #include "JSTestObj.h" 36 39 #include "ScriptExecutionContext.h" 37 40 #include "TestSupplemental.h" 41 #include <JavaScriptCore/BuiltinNames.h> 38 42 #include <JavaScriptCore/FunctionPrototype.h> 39 43 #include <JavaScriptCore/HeapAnalyzer.h> … … 55 59 #include "JSDOMGlobalObject.h" 56 60 #include "JSNode.h" 57 #include "JSTestObj.h"58 61 #endif 59 62 … … 96 99 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(JSC::JSGlobalObject*, JSC::CallFrame*); 97 100 #endif 101 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSymbolIterator(JSC::JSGlobalObject*, JSC::CallFrame*); 102 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionEntries(JSC::JSGlobalObject*, JSC::CallFrame*); 103 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionKeys(JSC::JSGlobalObject*, JSC::CallFrame*); 104 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionValues(JSC::JSGlobalObject*, JSC::CallFrame*); 105 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionForEach(JSC::JSGlobalObject*, JSC::CallFrame*); 98 106 99 107 // Attributes … … 377 385 { 0, 0, NoIntrinsic, { 0, 0 } }, 378 386 #endif 387 { "entries", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunctionEntries), (intptr_t) (0) } }, 388 { "keys", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunctionKeys), (intptr_t) (0) } }, 389 { "values", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunctionValues), (intptr_t) (0) } }, 390 { "forEach", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunctionForEach), (intptr_t) (1) } }, 379 391 #if ENABLE(Condition22) || ENABLE(Condition23) 380 392 { "IMPLEMENTSCONSTANT1", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } }, … … 405 417 Base::finishCreation(vm); 406 418 reifyStaticProperties(vm, JSTestInterface::info(), JSTestInterfacePrototypeTableValues, *this); 419 putDirect(vm, vm.propertyNames->iteratorSymbol, getDirect(vm, vm.propertyNames->builtinNames().entriesPublicName()), static_cast<unsigned>(JSC::PropertyAttribute::DontEnum)); 407 420 } 408 421 … … 1039 1052 #endif 1040 1053 1054 struct TestInterfaceIteratorTraits { 1055 static constexpr JSDOMIteratorType type = JSDOMIteratorType::Map; 1056 using KeyType = IDLInterface<TestNode>; 1057 using ValueType = IDLInterface<TestObj>; 1058 }; 1059 1060 using TestInterfaceIterator = JSDOMIterator<JSTestInterface, TestInterfaceIteratorTraits>; 1061 using TestInterfaceIteratorPrototype = JSDOMIteratorPrototype<JSTestInterface, TestInterfaceIteratorTraits>; 1062 1063 template<> 1064 const JSC::ClassInfo TestInterfaceIterator::s_info = { "TestInterface Iterator", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(TestInterfaceIterator) }; 1065 1066 template<> 1067 const JSC::ClassInfo TestInterfaceIteratorPrototype::s_info = { "TestInterface Iterator", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(TestInterfaceIteratorPrototype) }; 1068 1069 static inline EncodedJSValue jsTestInterfacePrototypeFunctionEntriesCaller(JSGlobalObject*, CallFrame*, JSTestInterface* thisObject, JSC::ThrowScope&) 1070 { 1071 return JSValue::encode(iteratorCreate<TestInterfaceIterator>(*thisObject, IterationKind::KeyValue)); 1072 } 1073 1074 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionEntries(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame) 1075 { 1076 return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunctionEntriesCaller>(*lexicalGlobalObject, *callFrame, "entries"); 1077 } 1078 1079 static inline EncodedJSValue jsTestInterfacePrototypeFunctionKeysCaller(JSGlobalObject*, CallFrame*, JSTestInterface* thisObject, JSC::ThrowScope&) 1080 { 1081 return JSValue::encode(iteratorCreate<TestInterfaceIterator>(*thisObject, IterationKind::Key)); 1082 } 1083 1084 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionKeys(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame) 1085 { 1086 return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunctionKeysCaller>(*lexicalGlobalObject, *callFrame, "keys"); 1087 } 1088 1089 static inline EncodedJSValue jsTestInterfacePrototypeFunctionValuesCaller(JSGlobalObject*, CallFrame*, JSTestInterface* thisObject, JSC::ThrowScope&) 1090 { 1091 return JSValue::encode(iteratorCreate<TestInterfaceIterator>(*thisObject, IterationKind::Value)); 1092 } 1093 1094 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionValues(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame) 1095 { 1096 return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunctionValuesCaller>(*lexicalGlobalObject, *callFrame, "values"); 1097 } 1098 1099 static inline EncodedJSValue jsTestInterfacePrototypeFunctionForEachCaller(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame, JSTestInterface* thisObject, JSC::ThrowScope& throwScope) 1100 { 1101 return JSValue::encode(iteratorForEach<TestInterfaceIterator>(*lexicalGlobalObject, *callFrame, *thisObject, throwScope)); 1102 } 1103 1104 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionForEach(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame) 1105 { 1106 return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunctionForEachCaller>(*lexicalGlobalObject, *callFrame, "forEach"); 1107 } 1108 1041 1109 void JSTestInterface::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) 1042 1110 { -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp
r251425 r252808 25 25 #include "JSDOMBinding.h" 26 26 #include "JSDOMConstructorNotConstructable.h" 27 #include "JSDOMConvertInterface.h" 27 28 #include "JSDOMExceptionHandling.h" 28 29 #include "JSDOMIterator.h" 29 30 #include "JSDOMOperation.h" 30 31 #include "JSDOMWrapperCache.h" 32 #include "JSTestNode.h" 31 33 #include "ScriptExecutionContext.h" 32 34 #include <JavaScriptCore/BuiltinNames.h> -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
r251691 r252808 34 34 #include "JSDOMOperationReturningPromise.h" 35 35 #include "JSDOMWrapperCache.h" 36 #include "JSTestNode.h" 36 37 #include "RuntimeEnabledFeatures.h" 37 38 #include "ScriptExecutionContext.h" -
trunk/Source/WebCore/bindings/scripts/test/TestInterface.idl
r219302 r252808 39 39 ImplementationLacksVTable 40 40 ] interface TestInterface { 41 iterable<TestNode, TestObj>; 41 42 }; 42 43
Note: See TracChangeset
for help on using the changeset viewer.