Modified: trunk/Source/WebCore/ChangeLog (205060 => 205061)
--- trunk/Source/WebCore/ChangeLog 2016-08-27 00:04:08 UTC (rev 205060)
+++ trunk/Source/WebCore/ChangeLog 2016-08-27 00:13:59 UTC (rev 205061)
@@ -1,3 +1,15 @@
+2016-08-26 Chris Dumez <[email protected]>
+
+ Unreviewed, fix Windows build after r205048.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (getConditionalForFunctionConsideringOverloads):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
+ (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
+ (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload):
+ * bindings/scripts/test/TestObj.idl:
+
2016-08-23 Ryosuke Niwa <[email protected]>
Adopted custom element's callbacks should continue to work
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (205060 => 205061)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-08-27 00:04:08 UTC (rev 205060)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-08-27 00:13:59 UTC (rev 205061)
@@ -1839,9 +1839,10 @@
foreach my $overload (@{$function->{overloads}}) {
if ($overload->signature->extendedAttributes->{"Conditional"}) {
$conditions{$overload->signature->extendedAttributes->{"Conditional"}} = 1;
+ } else {
+ return;
}
}
- return undef unless keys %conditions;
return join("|", keys %conditions);
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (205060 => 205061)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-08-27 00:04:08 UTC (rev 205060)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-08-27 00:13:59 UTC (rev 205061)
@@ -787,6 +787,7 @@
#if ENABLE(CONDITION1) || ENABLE(CONDITION2)
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalOverload(JSC::ExecState*);
#endif
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSingleConditionalOverload(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAttachShadowRoot(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionToString(JSC::ExecState*);
@@ -1387,6 +1388,7 @@
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
+ { "singleConditionalOverload", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSingleConditionalOverload), (intptr_t) (1) } },
{ "attachShadowRoot", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAttachShadowRoot), (intptr_t) (1) } },
{ "toString", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionToString), (intptr_t) (0) } },
#if ENABLE(Condition1)
@@ -6591,6 +6593,57 @@
}
#endif
+static inline EncodedJSValue jsTestObjPrototypeFunctionSingleConditionalOverload1(ExecState* state)
+{
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, "TestObject", "singleConditionalOverload");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+ auto& impl = castedThis->wrapped();
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, createNotEnoughArgumentsError(state));
+ auto str = state->argument(0).toWTFString(state);
+ if (UNLIKELY(state->hadException()))
+ return JSValue::encode(jsUndefined());
+ impl.singleConditionalOverload(WTFMove(str));
+ return JSValue::encode(jsUndefined());
+}
+
+#if ENABLE(CONDITION)
+static inline EncodedJSValue jsTestObjPrototypeFunctionSingleConditionalOverload2(ExecState* state)
+{
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, "TestObject", "singleConditionalOverload");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+ auto& impl = castedThis->wrapped();
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, createNotEnoughArgumentsError(state));
+ auto a = convert<int32_t>(*state, state->argument(0), NormalConversion);
+ if (UNLIKELY(state->hadException()))
+ return JSValue::encode(jsUndefined());
+ impl.singleConditionalOverload(WTFMove(a));
+ return JSValue::encode(jsUndefined());
+}
+
+#endif
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSingleConditionalOverload(ExecState* state)
+{
+ size_t argsCount = std::min<size_t>(1, state->argumentCount());
+ if (argsCount == 1) {
+ JSValue distinguishingArg = state->uncheckedArgument(0);
+#if ENABLE(CONDITION)
+ if (distinguishingArg.isNumber())
+ return jsTestObjPrototypeFunctionSingleConditionalOverload2(state);
+#endif
+ return jsTestObjPrototypeFunctionSingleConditionalOverload1(state);
+ }
+ return argsCount < 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state);
+}
+
EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAttachShadowRoot(ExecState* state)
{
JSValue thisValue = state->thisValue();
Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (205060 => 205061)
--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl 2016-08-27 00:04:08 UTC (rev 205060)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl 2016-08-27 00:13:59 UTC (rev 205061)
@@ -401,6 +401,9 @@
// Overloading with conditionals.
[Conditional=CONDITION1] void conditionalOverload(DOMString str);
[Conditional=CONDITION2] void conditionalOverload(long a);
+
+ void singleConditionalOverload(DOMString str);
+ [Conditional=CONDITION] void singleConditionalOverload(long a);
#endif
void attachShadowRoot(TestDictionary init);