Changeset 116486 in webkit
- Timestamp:
- May 8, 2012 8:20:14 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r116482 r116486 1 2012-05-08 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] Regression: addEventListener() and removeEventListener() raise an exception on missing args 4 https://bugs.webkit.org/show_bug.cgi?id=85928 5 6 Reviewed by Geoffrey Garen. 7 8 * fast/dom/Window/window-legacy-event-listener-expected.txt: Added. 9 * fast/dom/Window/window-legacy-event-listener.html: Added. 10 * fast/dom/XMLHttpRequest-legacy-event-listener-expected.txt: Added. 11 * fast/dom/XMLHttpRequest-legacy-event-listener.html: Added. 12 * fast/dom/node-legacy-event-listener-expected.txt: Added. 13 * fast/dom/node-legacy-event-listener.html: Added. 14 1 15 2012-05-08 Raphael Kubo da Costa <rakuco@webkit.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r116485 r116486 1 2012-05-08 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] Regression: addEventListener() and removeEventListener() raise an exception on missing args 4 https://bugs.webkit.org/show_bug.cgi?id=85928 5 6 Reviewed by Geoffrey Garen. 7 8 The functions addEventListener() and removeEventListener() raise an exception if there are missin arguments. 9 This behavior breaks existing content. 10 11 This patch change the code generator of JavaScript core to have an exception for addEventListener() and removeEventListener(). 12 For those function, we do not raise an exception on missin argument. 13 14 This patch does not modify the V8 code generator because such exceptions are already in place there. 15 16 Tests: fast/dom/Window/window-legacy-event-listener.html 17 fast/dom/XMLHttpRequest-legacy-event-listener.html 18 fast/dom/node-legacy-event-listener.html 19 20 * bindings/scripts/CodeGeneratorJS.pm: 21 (GenerateImplementation): 22 1 23 2012-05-08 Chris Rogers <crogers@google.com> 2 24 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r115536 r116486 2120 2120 } 2121 2121 2122 GenerateArgumentsCountCheck(\@implContent, $function, $dataNode); 2123 2124 if (@{$function->raisesExceptions}) { 2125 push(@implContent, " ExceptionCode ec = 0;\n"); 2126 } 2127 2128 if ($function->signature->extendedAttributes->{"CheckSecurityForNode"}) { 2129 push(@implContent, " if (!shouldAllowAccessToNode(exec, impl->" . $function->signature->name . "(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n"); 2130 push(@implContent, " return JSValue::encode(jsNull());\n"); 2131 $implIncludes{"JSDOMBinding.h"} = 1; 2132 } 2133 2122 # For compatibility with legacy content, the EventListener calls are generated without GenerateArgumentsCountCheck. 2134 2123 if ($function->signature->name eq "addEventListener") { 2135 2124 push(@implContent, GenerateEventListenerCall($className, "add")); … … 2137 2126 push(@implContent, GenerateEventListenerCall($className, "remove")); 2138 2127 } else { 2128 GenerateArgumentsCountCheck(\@implContent, $function, $dataNode); 2129 2130 if (@{$function->raisesExceptions}) { 2131 push(@implContent, " ExceptionCode ec = 0;\n"); 2132 } 2133 2134 if ($function->signature->extendedAttributes->{"CheckSecurityForNode"}) { 2135 push(@implContent, " if (!shouldAllowAccessToNode(exec, impl->" . $function->signature->name . "(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n"); 2136 push(@implContent, " return JSValue::encode(jsNull());\n"); 2137 $implIncludes{"JSDOMBinding.h"} = 1; 2138 } 2139 2139 2140 my $numParameters = @{$function->parameters}; 2140 2141 my ($functionString, $dummy) = GenerateParametersCheck(\@implContent, $function, $dataNode, $numParameters, $implClassName, $functionImplementationName, $svgPropertyType, $svgPropertyOrListPropertyType, $svgListPropertyType);
Note: See TracChangeset
for help on using the changeset viewer.