Changeset 157048 in webkit
- Timestamp:
- Oct 7, 2013 10:45:42 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r157045 r157048 1 2013-10-07 Philippe Normand <pnormand@igalia.com> 2 3 Conditional support in bindings code generator for overloaded functions 4 https://bugs.webkit.org/show_bug.cgi?id=122443 5 6 Reviewed by Darin Adler. 7 8 * bindings/scripts/CodeGeneratorJS.pm: 9 (GenerateOverloadedFunction): Generate conditional for overloaded 10 function, if it's present in the idl. 11 (GenerateImplementation): Close the last overloaded function 12 conditional before generating the distpatch function. 13 * bindings/scripts/test/JS/JSTestObj.cpp: 14 (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): 15 Rebaseline overloaded function tests. 16 1 17 2013-10-07 Tim Horton <timothy_horton@apple.com> 2 18 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r156769 r157048 1287 1287 } 1288 1288 1289 my $conditionalString = $codeGenerator->GenerateConditionalString($overload->signature); 1290 push(@implContent, "#if ${conditionalString}\n") if $conditionalString; 1291 1289 1292 push(@implContent, " if ($parametersCheck)\n"); 1290 1293 push(@implContent, " return ${functionName}$overload->{overloadIndex}(exec);\n"); 1294 push(@implContent, "#endif\n\n") if $conditionalString; 1295 1291 1296 } 1292 1297 if ($leastNumMandatoryParams >= 1) { … … 2433 2438 2434 2439 push(@implContent, "}\n\n"); 2440 push(@implContent, "#endif\n\n") if $conditional; 2435 2441 2436 2442 if (!$isCustom && $isOverloaded && $function->{overloadIndex} == @{$function->{overloads}}) { … … 2439 2445 } 2440 2446 2441 push(@implContent, "#endif\n\n") if $conditional;2442 2447 } 2443 2448 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r156808 r157048 2819 2819 } 2820 2820 2821 #endif 2822 2821 2823 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod1(ExecState* exec) 2822 2824 { 2823 2825 size_t argsCount = exec->argumentCount(); 2826 #if ENABLE(Condition1) 2824 2827 if (argsCount == 1) 2825 2828 return jsTestObjConstructorFunctionOverloadedMethod11(exec); 2829 #endif 2830 2826 2831 JSValue arg0(exec->argument(0)); 2832 #if ENABLE(Condition1) 2827 2833 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject()))) 2828 2834 return jsTestObjConstructorFunctionOverloadedMethod12(exec); 2835 #endif 2836 2829 2837 if (argsCount < 1) 2830 2838 return throwVMError(exec, createNotEnoughArgumentsError(exec)); 2831 2839 return throwVMTypeError(exec); 2832 2840 } 2833 2834 #endif2835 2841 2836 2842 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionClassMethodWithClamp(ExecState* exec)
Note: See TracChangeset
for help on using the changeset viewer.