@@ -787,6 +787,7 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsCusto
787787#if ENABLE(CONDITION1) || ENABLE(CONDITION2)
788788JSC ::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalOverload (JSC ::ExecState*);
789789#endif
790+ JSC ::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSingleConditionalOverload (JSC ::ExecState*);
790791JSC ::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAttachShadowRoot (JSC ::ExecState*);
791792JSC ::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionToString (JSC ::ExecState*);
792793
@@ -1387,6 +1388,7 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
13871388#else
13881389 { 0 , 0 , NoIntrinsic, { 0 , 0 } },
13891390#endif
1391+ { " singleConditionalOverload" , JSC ::Function, NoIntrinsic, { (intptr_t )static_cast <NativeFunction>(jsTestObjPrototypeFunctionSingleConditionalOverload), (intptr_t ) (1 ) } },
13901392 { " attachShadowRoot" , JSC ::Function, NoIntrinsic, { (intptr_t )static_cast <NativeFunction>(jsTestObjPrototypeFunctionAttachShadowRoot), (intptr_t ) (1 ) } },
13911393 { " toString" , JSC ::Function, NoIntrinsic, { (intptr_t )static_cast <NativeFunction>(jsTestObjPrototypeFunctionToString), (intptr_t ) (0 ) } },
13921394#if ENABLE(Condition1)
@@ -6591,6 +6593,57 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalOverload(ExecS
65916593}
65926594#endif
65936595
6596+ static inline EncodedJSValue jsTestObjPrototypeFunctionSingleConditionalOverload1 (ExecState* state)
6597+ {
6598+ JSValue thisValue = state->thisValue ();
6599+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
6600+ if (UNLIKELY (!castedThis))
6601+ return throwThisTypeError (*state, " TestObject" , " singleConditionalOverload" );
6602+ ASSERT_GC_OBJECT_INHERITS (castedThis, JSTestObj::info ());
6603+ auto & impl = castedThis->wrapped ();
6604+ if (UNLIKELY (state->argumentCount () < 1 ))
6605+ return throwVMError (state, createNotEnoughArgumentsError (state));
6606+ auto str = state->argument (0 ).toWTFString (state);
6607+ if (UNLIKELY (state->hadException ()))
6608+ return JSValue::encode (jsUndefined ());
6609+ impl.singleConditionalOverload (WTFMove (str));
6610+ return JSValue::encode (jsUndefined ());
6611+ }
6612+
6613+ #if ENABLE(CONDITION)
6614+ static inline EncodedJSValue jsTestObjPrototypeFunctionSingleConditionalOverload2 (ExecState* state)
6615+ {
6616+ JSValue thisValue = state->thisValue ();
6617+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
6618+ if (UNLIKELY (!castedThis))
6619+ return throwThisTypeError (*state, " TestObject" , " singleConditionalOverload" );
6620+ ASSERT_GC_OBJECT_INHERITS (castedThis, JSTestObj::info ());
6621+ auto & impl = castedThis->wrapped ();
6622+ if (UNLIKELY (state->argumentCount () < 1 ))
6623+ return throwVMError (state, createNotEnoughArgumentsError (state));
6624+ auto a = convert<int32_t >(*state, state->argument (0 ), NormalConversion);
6625+ if (UNLIKELY (state->hadException ()))
6626+ return JSValue::encode (jsUndefined ());
6627+ impl.singleConditionalOverload (WTFMove (a));
6628+ return JSValue::encode (jsUndefined ());
6629+ }
6630+
6631+ #endif
6632+
6633+ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSingleConditionalOverload (ExecState* state)
6634+ {
6635+ size_t argsCount = std::min<size_t >(1 , state->argumentCount ());
6636+ if (argsCount == 1 ) {
6637+ JSValue distinguishingArg = state->uncheckedArgument (0 );
6638+ #if ENABLE(CONDITION)
6639+ if (distinguishingArg.isNumber ())
6640+ return jsTestObjPrototypeFunctionSingleConditionalOverload2 (state);
6641+ #endif
6642+ return jsTestObjPrototypeFunctionSingleConditionalOverload1 (state);
6643+ }
6644+ return argsCount < 1 ? throwVMError (state, createNotEnoughArgumentsError (state)) : throwVMTypeError (state);
6645+ }
6646+
65946647EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAttachShadowRoot (ExecState* state)
65956648{
65966649 JSValue thisValue = state->thisValue ();
0 commit comments