Changeset 181001 in webkit
- Timestamp:
- Mar 4, 2015 9:30:32 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r181000 r181001 1 2015-03-04 Darin Adler <darin@apple.com> 2 3 Make JavaScript binding get and set legacy event listener attributes directly 4 https://bugs.webkit.org/show_bug.cgi?id=142282 5 6 Reviewed by Sam Weinig. 7 8 Test: fast/dom/legacy-event-handler-attributes.html 9 10 This patch changes the JavaScript getters and setters for these attributes 11 to work directly without requiring any functions in the C++ DOM implementation. 12 A subsequent patch will remove the now-unused C++ DOM implementation. 13 14 * bindings/js/JSEventListener.cpp: 15 (WebCore::legacyEventListenerAttribute): Added. 16 (WebCore::createEventListenerForLegacyAttribute): Added. 17 (WebCore::setLegacyEventListenerAttribute): Added. 18 (WebCore::legacyWindowEventListenerAttribute): Added. 19 (WebCore::setLegacyWindowEventListenerAttribute): Added. 20 21 * bindings/js/JSEventListener.h: 22 (WebCore::createJSEventListenerForAttribute): Deleted. 23 24 * bindings/scripts/CodeGeneratorJS.pm: 25 (GenerateAttributeEventListenerCall): Deleted. 26 (LegacyEventListenerAttributeEventName): Added. 27 (LegacyEventListenerAttributePrefix): Added. 28 (GenerateImplementation): Use "auto" in lots of places to simplify the code 29 generation. Replaced the old inlined code to deal with legacy event listener 30 attributes with code that simply calls the new functions from JSEventLister.h. 31 (GenerateCallWith): Use "auto". 32 (GenerateConstructorDefinition): Ditto. 33 1 34 2015-03-03 Sam Weinig <sam@webkit.org> 2 35 -
trunk/Source/WebCore/bindings/js/JSEventListener.cpp
r179810 r181001 24 24 #include "Event.h" 25 25 #include "Frame.h" 26 #include "HTMLElement.h" 26 27 #include "JSEvent.h" 27 28 #include "JSEventTarget.h" … … 171 172 } 172 173 174 static inline JSC::JSValue eventHandlerAttribute(EventListener* abstractListener, ScriptExecutionContext& context) 175 { 176 if (!abstractListener) 177 return jsNull(); 178 179 auto* listener = JSEventListener::cast(abstractListener); 180 if (!listener) 181 return jsNull(); 182 183 auto* function = listener->jsFunction(&context); 184 if (!function) 185 return jsNull(); 186 187 return function; 188 } 189 190 static inline RefPtr<JSEventListener> createEventListenerForEventHandlerAttribute(JSC::ExecState& state, JSC::JSValue listener, JSC::JSObject& wrapper) 191 { 192 if (!listener.isObject()) 193 return nullptr; 194 return JSEventListener::create(asObject(listener), &wrapper, true, currentWorld(&state)); 195 } 196 197 JSC::JSValue eventHandlerAttribute(EventTarget& target, const AtomicString& eventType) 198 { 199 return eventHandlerAttribute(target.getAttributeEventListener(eventType), *target.scriptExecutionContext()); 200 } 201 202 void setEventHandlerAttribute(JSC::ExecState& state, JSC::JSObject& wrapper, EventTarget& target, const AtomicString& eventType, JSC::JSValue value) 203 { 204 target.setAttributeEventListener(eventType, createEventListenerForEventHandlerAttribute(state, value, wrapper)); 205 } 206 207 JSC::JSValue windowForwardedEventHandlerAttribute(HTMLElement& element, const AtomicString& eventType) 208 { 209 auto& document = element.document(); 210 return eventHandlerAttribute(document.getWindowAttributeEventListener(eventType), document); 211 } 212 213 void setWindowForwardedEventHandlerAttribute(JSC::ExecState& state, JSC::JSObject& wrapper, HTMLElement& element, const AtomicString& eventType, JSC::JSValue value) 214 { 215 ASSERT(wrapper.globalObject()); 216 element.document().setWindowAttributeEventListener(eventType, createEventListenerForEventHandlerAttribute(state, value, *wrapper.globalObject())); 217 } 218 173 219 } // namespace WebCore -
trunk/Source/WebCore/bindings/js/JSEventListener.h
r179812 r181001 30 30 namespace WebCore { 31 31 32 class EventTarget; 33 class HTMLElement; 32 34 class JSDOMGlobalObject; 33 35 … … 76 78 }; 77 79 78 // For "onXXX" event attributes. 79 RefPtr<JSEventListener> createJSEventListenerForAttribute(JSC::ExecState&, JSC::JSValue listener, JSC::JSObject& wrapper); 80 // For "onxxx" attributes that automatically set up JavaScript event listeners. 81 JSC::JSValue eventHandlerAttribute(EventTarget&, const AtomicString& eventType); 82 void setEventHandlerAttribute(JSC::ExecState&, JSC::JSObject&, EventTarget&, const AtomicString& eventType, JSC::JSValue); 83 84 // Like the functions above, but for attributes that forward event handlers to the window object rather than setting them on the target. 85 JSC::JSValue windowForwardedEventHandlerAttribute(HTMLElement&, const AtomicString& eventType); 86 void setWindowForwardedEventHandlerAttribute(JSC::ExecState&, JSC::JSObject&, HTMLElement&, const AtomicString& eventType, JSC::JSValue); 80 87 81 88 Ref<JSEventListener> createJSEventListenerForAdd(JSC::ExecState&, JSC::JSObject& listener, JSC::JSObject& wrapper); … … 113 120 } 114 121 115 inline RefPtr<JSEventListener> createJSEventListenerForAttribute(JSC::ExecState& state, JSC::JSValue listener, JSC::JSObject& wrapper)116 {117 if (!listener.isObject())118 return nullptr;119 return JSEventListener::create(asObject(listener), &wrapper, true, currentWorld(&state));120 }121 122 122 inline Ref<JSEventListener> createJSEventListenerForRemove(JSC::ExecState& state, JSC::JSObject& listener, JSC::JSObject& wrapper) 123 123 { -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r180772 r181001 141 141 } 142 142 143 sub GenerateAttributeEventListenerCall 144 { 145 my $implSetterFunctionName = shift; 146 my $windowEventListener = shift; 147 148 my $wrapperObject = $windowEventListener ? "globalObject" : "castedThis"; 149 my @GenerateEventListenerImpl = (); 150 151 push(@GenerateEventListenerImpl, " impl.set$implSetterFunctionName(createJSEventListenerForAttribute(*exec, value, *$wrapperObject));\n"); 152 return @GenerateEventListenerImpl; 143 sub EventHandlerAttributeEventName 144 { 145 my $attribute = shift; 146 147 # Remove the "on" prefix. 148 my $eventType = substr($attribute->signature->name, 2); 149 150 # FIXME: Consider adding a property in the IDL file instead of hard coding these four event names. 151 # Note: This same hard coded list of property names exists in HTMLElement.cpp. 152 $eventType = "webkitAnimationEnd" if $eventType eq "webkitanimationend"; 153 $eventType = "webkitAnimationIteration" if $eventType eq "webkitanimationiteration"; 154 $eventType = "webkitAnimationStart" if $eventType eq "webkitanimationstart"; 155 $eventType = "webkitTransitionEnd" if $eventType eq "webkittransitionend"; 156 157 return "eventNames().${eventType}Event"; 153 158 } 154 159 … … 1970 1975 push(@implContent, " VM& vm = exec->vm();\n"); 1971 1976 push(@implContent, " UNUSED_PARAM(vm);\n"); 1972 push(@implContent, " ${className}Prototype* thisObject = jsCast<${className}Prototype*>(object);\n");1977 push(@implContent, " auto* thisObject = jsCast<${className}Prototype*>(object);\n"); 1973 1978 1974 1979 if ($numConstants eq 0 && $numFunctions eq 0 && $numPrototypeAttributes eq 0) { … … 2013 2018 push(@implContent, "void ${className}Prototype::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n"); 2014 2019 push(@implContent, "{\n"); 2015 push(@implContent, " ${className}Prototype* thisObject = jsCast<${className}Prototype*>(cell);\n");2020 push(@implContent, " auto* thisObject = jsCast<${className}Prototype*>(cell);\n"); 2016 2021 push(@implContent, " if (thisObject->putDelegate(exec, propertyName, value, slot))\n"); 2017 2022 push(@implContent, " return;\n"); … … 2107 2112 push(@implContent, "bool ${className}::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n"); 2108 2113 push(@implContent, "{\n"); 2109 push(@implContent, " ${className}* thisObject = jsCast<${className}*>(object);\n");2114 push(@implContent, " auto* thisObject = jsCast<${className}*>(object);\n"); 2110 2115 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); 2111 2116 push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numInstanceAttributes > 0, 0)); … … 2118 2123 push(@implContent, "bool ${className}::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot& slot)\n"); 2119 2124 push(@implContent, "{\n"); 2120 push(@implContent, " ${className}* thisObject = jsCast<${className}*>(object);\n");2125 push(@implContent, " auto* thisObject = jsCast<${className}*>(object);\n"); 2121 2126 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); 2122 2127 … … 2191 2196 if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) { 2192 2197 if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) { 2193 push(@implContent, " ${className}* castedThis = to${className}(JSValue::decode(thisValue));\n");2198 push(@implContent, " auto* castedThis = to${className}(JSValue::decode(thisValue));\n"); 2194 2199 } elsif (AttributeShouldBeOnInstance($interface, $attribute)) { 2195 push(@implContent, " ${className}* castedThis = jsCast<JS${interfaceName}*>(slotBase);\n");2200 push(@implContent, " auto* castedThis = jsCast<JS${interfaceName}*>(slotBase);\n"); 2196 2201 if (InterfaceRequiresAttributesOnInstanceForCompatibility($interface)) { 2197 2202 push(@implContent, " ${className}* castedThisObject = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n"); … … 2284 2289 } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) { 2285 2290 $implIncludes{"JSDOMBinding.h"} = 1; 2286 push(@implContent, " $implType& impl = castedThis->impl();\n");2291 push(@implContent, " auto& impl = castedThis->impl();\n"); 2287 2292 push(@implContent, " return JSValue::encode(shouldAllowAccessToNode(exec, impl." . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName()", "castedThis") . " : jsNull());\n"); 2288 2293 } elsif ($type eq "EventListener") { 2289 $implIncludes{"EventListener.h"} = 1; 2294 my $getter = $attribute->signature->extendedAttributes->{"JSWindowEventListener"} ? "windowForwardedEventHandlerAttribute" : "eventHandlerAttribute"; 2295 my $eventName = EventHandlerAttributeEventName($attribute); 2290 2296 push(@implContent, " UNUSED_PARAM(exec);\n"); 2291 push(@implContent, " $implType& impl = castedThis->impl();\n"); 2292 push(@implContent, " if (EventListener* listener = impl.$implGetterFunctionName()) {\n"); 2293 push(@implContent, " if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n"); 2294 if ($interfaceName eq "Document" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) { 2295 push(@implContent, " if (JSObject* jsFunction = jsListener->jsFunction(&impl))\n"); 2296 } else { 2297 push(@implContent, " if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))\n"); 2298 } 2299 push(@implContent, " return JSValue::encode(jsFunction);\n"); 2300 push(@implContent, " }\n"); 2301 push(@implContent, " }\n"); 2302 push(@implContent, " return JSValue::encode(jsNull());\n"); 2297 push(@implContent, " return JSValue::encode($getter(castedThis->impl(), $eventName));\n"); 2303 2298 } elsif ($attribute->signature->type =~ /Constructor$/) { 2304 2299 my $constructorType = $attribute->signature->type; … … 2353 2348 unshift(@arguments, @callWithArgs); 2354 2349 my $jsType = NativeToJSValue($attribute->signature, 0, $interfaceName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis"); 2355 push(@implContent, " $implType& impl = castedThis->impl();\n") if !$attribute->isStatic;2350 push(@implContent, " auto& impl = castedThis->impl();\n") if !$attribute->isStatic; 2356 2351 if ($codeGenerator->IsSVGAnimatedType($type)) { 2357 2352 push(@implContent, " RefPtr<$type> obj = $jsType;\n"); … … 2382 2377 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n"); 2383 2378 } else { 2384 push(@implContent, " $implType& impl = castedThis->impl();\n");2379 push(@implContent, " auto& impl = castedThis->impl();\n"); 2385 2380 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n"); 2386 2381 } … … 2473 2468 push(@implContent, "void ${className}::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n"); 2474 2469 push(@implContent, "{\n"); 2475 push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n");2470 push(@implContent, " auto* thisObject = jsCast<${className}*>(cell);\n"); 2476 2471 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); 2477 2472 if ($interface->extendedAttributes->{"CustomIndexedSetter"}) { … … 2493 2488 push(@implContent, "void ${className}::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSValue value, bool shouldThrow)\n"); 2494 2489 push(@implContent, "{\n"); 2495 push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n");2490 push(@implContent, " auto* thisObject = jsCast<${className}*>(cell);\n"); 2496 2491 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); 2497 2492 … … 2549 2544 } elsif (AttributeShouldBeOnInstance($interface, $attribute)) { 2550 2545 push(@implContent, " UNUSED_PARAM(thisValue);\n"); 2551 push(@implContent, " ${className}* castedThis = jsCast<JS${interfaceName}*>(baseObject);\n");2546 push(@implContent, " auto* castedThis = jsCast<JS${interfaceName}*>(baseObject);\n"); 2552 2547 if (InterfaceRequiresAttributesOnInstanceForCompatibility($interface)) { 2553 2548 push(@implContent, " ${className}* castedThisObject = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n"); … … 2581 2576 push(@implContent, " castedThis->set$implSetterFunctionName(exec, value);\n"); 2582 2577 } elsif ($type eq "EventListener") { 2583 $implIncludes{"JSEventListener.h"} = 1; 2584 push(@implContent, " UNUSED_PARAM(exec);\n"); 2585 my $windowEventListener = $attribute->signature->extendedAttributes->{"JSWindowEventListener"}; 2586 if ($windowEventListener) { 2587 push(@implContent, " JSDOMGlobalObject* globalObject = castedThis->globalObject();\n"); 2588 } 2589 push(@implContent, " $implType& impl = castedThis->impl();\n"); 2578 my $eventName = EventHandlerAttributeEventName($attribute); 2579 # FIXME: Find a way to do this special case without hardcoding the class and attribute names here. 2590 2580 if ((($interfaceName eq "DOMWindow") or ($interfaceName eq "WorkerGlobalScope")) and $name eq "onerror") { 2591 2581 $implIncludes{"JSErrorHandler.h"} = 1; 2592 push(@implContent, " impl.set$implSetterFunctionName(createJSErrorHandler(exec, value, castedThis));\n");2582 push(@implContent, " castedThis->impl().setAttributeEventListener($eventName, createJSErrorHandler(exec, value, castedThis));\n"); 2593 2583 } else { 2594 push(@implContent, GenerateAttributeEventListenerCall($implSetterFunctionName, $windowEventListener)); 2584 $implIncludes{"JSEventListener.h"} = 1; 2585 my $setter = $attribute->signature->extendedAttributes->{"JSWindowEventListener"} ? "setWindowForwardedEventHandlerAttribute" : "setEventHandlerAttribute"; 2586 push(@implContent, " $setter(*exec, *castedThis, castedThis->impl(), $eventName, value);\n"); 2595 2587 } 2596 2588 } elsif ($attribute->signature->type =~ /Constructor$/) { … … 2603 2595 AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{"Conditional"}); 2604 2596 } 2605 push(@implContent, " // Shadowing a built-in constructor \n");2597 push(@implContent, " // Shadowing a built-in constructor.\n"); 2606 2598 push(@implContent, " castedThis->putDirect(exec->vm(), Identifier(exec, \"$name\"), value);\n"); 2607 2599 } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) { 2608 push(@implContent, " // Shadowing a built-in object \n");2600 push(@implContent, " // Shadowing a built-in object.\n"); 2609 2601 push(@implContent, " castedThis->putDirect(exec->vm(), Identifier(exec, \"$name\"), value);\n"); 2610 2602 } else { 2611 2603 if (!$attribute->isStatic) { 2612 push(@implContent, " $implType& impl = castedThis->impl();\n");2604 push(@implContent, " auto& impl = castedThis->impl();\n"); 2613 2605 } 2614 2606 push(@implContent, " ExceptionCode ec = 0;\n") if $setterRaisesException; … … 2713 2705 push(@implContent, "void ${className}::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)\n"); 2714 2706 push(@implContent, "{\n"); 2715 push(@implContent, " ${className}* thisObject = jsCast<${className}*>(object);\n");2707 push(@implContent, " auto* thisObject = jsCast<${className}*>(object);\n"); 2716 2708 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); 2717 2709 push(@implContent, " for (unsigned i = 0, count = thisObject->impl().length(); i < count; ++i)\n"); … … 2820 2812 push(@implContent, " return JSValue::encode(castedThis->" . $functionImplementationName . "(exec));\n"); 2821 2813 } else { 2822 push(@implContent, " $implType& impl = castedThis->impl();\n");2814 push(@implContent, " auto& impl = castedThis->impl();\n"); 2823 2815 if ($svgPropertyType) { 2824 2816 push(@implContent, " if (impl.isReadOnly()) {\n"); … … 2870 2862 push(@implContent, "void ${className}::visitChildren(JSCell* cell, SlotVisitor& visitor)\n"); 2871 2863 push(@implContent, "{\n"); 2872 push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n");2864 push(@implContent, " auto* thisObject = jsCast<${className}*>(cell);\n"); 2873 2865 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); 2874 2866 push(@implContent, " Base::visitChildren(thisObject, visitor);\n"); … … 2914 2906 push(@implContent, "EncodedJSValue ${className}::nameGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName propertyName)\n"); 2915 2907 push(@implContent, "{\n"); 2916 push(@implContent, " ${className}* thisObj= jsCast<$className*>(slotBase);\n");2917 push(@implContent, " return JSValue::encode(toJS(exec, thisObj ->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName))));\n");2908 push(@implContent, " auto* thisObject = jsCast<$className*>(slotBase);\n"); 2909 push(@implContent, " return JSValue::encode(toJS(exec, thisObject->globalObject(), thisObject->impl().namedItem(propertyNameToAtomicString(propertyName))));\n"); 2918 2910 push(@implContent, "}\n\n"); 2919 2911 } … … 2945 2937 my $emittedJSCast = 0; 2946 2938 if ($codeGenerator->InheritsExtendedAttribute($interface, "ActiveDOMObject")) { 2947 push(@implContent, " JS${interfaceName}* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");2939 push(@implContent, " auto* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n"); 2948 2940 $emittedJSCast = 1; 2949 2941 push(@implContent, " if (js${interfaceName}->impl().hasPendingActivity())\n"); … … 2952 2944 if ($codeGenerator->InheritsExtendedAttribute($interface, "EventTarget")) { 2953 2945 if (!$emittedJSCast) { 2954 push(@implContent, " JS${interfaceName}* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");2946 push(@implContent, " auto* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n"); 2955 2947 $emittedJSCast = 1; 2956 2948 } … … 2960 2952 if ($codeGenerator->InheritsInterface($interface, "Node")) { 2961 2953 if (!$emittedJSCast) { 2962 push(@implContent, " JS${interfaceName}* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");2954 push(@implContent, " auto* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n"); 2963 2955 $emittedJSCast = 1; 2964 2956 } … … 2968 2960 if (GetGenerateIsReachable($interface)) { 2969 2961 if (!$emittedJSCast) { 2970 push(@implContent, " JS${interfaceName}* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");2962 push(@implContent, " auto* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n"); 2971 2963 $emittedJSCast = 1; 2972 2964 } … … 3025 3017 push(@implContent, "void JS${interfaceName}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n"); 3026 3018 push(@implContent, "{\n"); 3027 push(@implContent, " JS${interfaceName}* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");3028 push(@implContent, " DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);\n");3019 push(@implContent, " auto* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n"); 3020 push(@implContent, " auto& world = *static_cast<DOMWrapperWorld*>(context);\n"); 3029 3021 push(@implContent, " uncacheWrapper(world, &js${interfaceName}->impl(), js${interfaceName});\n"); 3030 3022 push(@implContent, " js${interfaceName}->releaseImpl();\n"); … … 3133 3125 } 3134 3126 if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptExecutionContext")) { 3135 push(@$outputArray, " ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");3127 push(@$outputArray, " auto* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n"); 3136 3128 push(@$outputArray, " if (!scriptContext)\n"); 3137 3129 push(@$outputArray, " return" . ($returnValue ? " " . $returnValue : "") . ";\n"); … … 4510 4502 EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}(ExecState* exec) 4511 4503 { 4512 ${constructorClassName}* jsConstructor = jsCast<${constructorClassName}*>(exec->callee());4504 auto* jsConstructor = jsCast<${constructorClassName}*>(exec->callee()); 4513 4505 4514 4506 ScriptExecutionContext* executionContext = jsConstructor->scriptExecutionContext(); … … 4577 4569 push(@$outputArray, "EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}${overloadedIndexString}(ExecState* exec)\n"); 4578 4570 push(@$outputArray, "{\n"); 4579 push(@$outputArray, " ${constructorClassName}* castedThis = jsCast<${constructorClassName}*>(exec->callee());\n");4571 push(@$outputArray, " auto* castedThis = jsCast<${constructorClassName}*>(exec->callee());\n"); 4580 4572 4581 4573 my @constructorArgList; … … 4607 4599 push(@$outputArray, " if (!context)\n"); 4608 4600 push(@$outputArray, " return throwConstructorDocumentUnavailableError(*exec, \"${interfaceName}\");\n"); 4609 push(@$outputArray, " Document& document = downcast<Document>(*context);\n");4601 push(@$outputArray, " auto& document = downcast<Document>(*context);\n"); 4610 4602 } 4611 4603 if ($generatingNamedConstructor) {
Note: See TracChangeset
for help on using the changeset viewer.