Changeset 201681 in webkit
- Timestamp:
- Jun 4, 2016 12:10:24 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r201679 r201681 1 2016-06-04 Chris Dumez <cdumez@apple.com> 2 3 Avoid redundant isUndefined() check for parameters that are both optional and nullable in overloads 4 https://bugs.webkit.org/show_bug.cgi?id=158380 5 6 Reviewed by Brady Eidson. 7 8 * bindings/scripts/CodeGeneratorJS.pm: 9 (GenerateParametersCheckExpression): 10 * bindings/scripts/test/JS/JSTestObj.cpp: 11 (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter): 12 1 13 2016-06-04 Brent Fulgham <bfulgham@apple.com> 2 14 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r201627 r201681 1686 1686 } elsif ($codeGenerator->GetArrayOrSequenceType($type) || $codeGenerator->IsTypedArrayType($type) || $codeGenerator->IsWrapperType($type)) { 1687 1687 my $condition = ""; 1688 $condition .= "${value}.isUndefined() || " if $parameter->isOptional; 1689 1690 # http://heycam.github.io/webidl/#es-nullable-type 1691 $condition .= "${value}.isUndefinedOrNull() || " if $parameter->isNullable; 1688 1689 if ($parameter->isNullable) { 1690 $condition .= "${value}.isUndefinedOrNull() || "; 1691 } elsif ($parameter->isOptional) { 1692 $condition .= "${value}.isUndefined() || "; 1693 } 1692 1694 1693 1695 if ($codeGenerator->GetArrayOrSequenceType($type)) { -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r201627 r201681 5468 5468 JSValue arg0(state->argument(0)); 5469 5469 JSValue arg1(state->argument(1)); 5470 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))) || (argsCount == 2 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info()))) && (arg1.isUndefined () || arg1.isUndefinedOrNull() || (arg1.isObject() && asObject(arg1)->inherits(JSTestObj::info())))))5470 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))) || (argsCount == 2 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info()))) && (arg1.isUndefinedOrNull() || (arg1.isObject() && asObject(arg1)->inherits(JSTestObj::info()))))) 5471 5471 return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1(state); 5472 5472 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))) || (argsCount == 2 && (arg0.isUndefinedOrNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))))
Note: See TracChangeset
for help on using the changeset viewer.