| 1 | /* |
| 2 | * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 3 | * Copyright (C) 2007 Eric Seidel <[email protected]> |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in the |
| 12 | * documentation and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 15 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 17 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 18 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 19 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 20 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 21 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 22 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 | */ |
| 26 | |
| 27 | #include "APIShims.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/APIShims.h`/ |
| 28 | #include "APICast.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/APICast.h`/ |
| 29 | #include "Error.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Error.h`/ |
| 30 | #include "JSCallbackFunction.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.h`/ |
| 31 | #include "JSClassRef.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/JSClassRef.h`/ |
| 32 | #include "JSGlobalObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h`/ |
| 33 | #include "JSLock.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSLock.h`/ |
| 34 | #include "JSObjectRef.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/JSObjectRef.h`/ |
| 35 | #include "JSString.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSString.h`/ |
| 36 | #include "JSStringRef.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/JSStringRef.h`/ |
| 37 | #include "OpaqueJSString.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/OpaqueJSString.h`/ |
| 38 | #include "PropertyNameArray.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertyNameArray.h`/ |
| 39 | #include <wtf/Vector.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h`/ |
| 40 | |
| 41 | namespace JSCcxx . . $ `<built-in>:463:9`! { |
| 42 | |
| 43 | template <class Base> |
| 44 | inline JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>* JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::asCallbackObjectcxx . . $ QTJSC/JSCallbackObject#asCallbackObject(90e037006a47f0a).(JSValuecxx . . $ QTJSC/JSValue# value) |
| 45 | { |
| 46 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(asObject(value)->inherits(&info)); |
| 47 | return static_cast<JSCallbackObject*>(asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(value)); |
| 48 | } |
| 49 | |
| 50 | template <class Base> |
| 51 | JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#`JSCallbackObject<Base>`(499843c09a37f53c).(ExecStatecxx . . $ QTJSC/ExecState#* exec, NonNullPassRefPtrcxx . . $ NonNullPassRefPtr#<Structurecxx . . $ QTJSC/Structure#> structure, JSClassRefcxx . . $ JSClassRef# jsClass, void* data) |
| 52 | : Base(structure) |
| 53 | , m_callbackObjectDatacxx . . $ QTJSC/JSCallbackObject#m_callbackObjectData.(new JSCallbackObjectDatacxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#(data, jsClass)) |
| 54 | { |
| 55 | initcxx . . $ QTJSC/JSCallbackObject#init(d2cb180e190a9680).(exec); |
| 56 | } |
| 57 | |
| 58 | // Global object constructor. |
| 59 | // FIXME: Move this into a separate JSGlobalCallbackObject class derived from this one. |
| 60 | template <class Base> |
| 61 | JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#`JSCallbackObject<Base>`(159998762f31489b).(JSClassRefcxx . . $ JSClassRef# jsClass) |
| 62 | : Base() |
| 63 | , m_callbackObjectDatacxx . . $ QTJSC/JSCallbackObject#m_callbackObjectData.(new JSCallbackObjectDatacxx . . $ QTJSC/JSCallbackObject#JSCallbackObjectData#(0, jsClass)) |
| 64 | { |
| 65 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(Base::isGlobalObject()); |
| 66 | initcxx . . $ QTJSC/JSCallbackObject#init(d2cb180e190a9680).(static_cast<JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#*>(this)->globalExeccxx . . $ QTJSC/JSGlobalObject#globalExec(27c3d7386a195136).()); |
| 67 | } |
| 68 | |
| 69 | template <class Base> |
| 70 | void JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::initcxx . . $ QTJSC/JSCallbackObject#init(d2cb180e190a9680).(ExecStatecxx . . $ QTJSC/ExecState#* exec) |
| 71 | { |
| 72 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(exec); |
| 73 | |
| 74 | Vectorcxx . . $ Vector#<JSObjectInitializeCallback, 16> initRoutines; |
| 75 | JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); |
| 76 | do { |
| 77 | if (JSObjectInitializeCallback initialize = jsClass->initializecxx . . $ OpaqueJSClass#initialize.) |
| 78 | initRoutines.append(initialize); |
| 79 | } while ((jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.)); |
| 80 | |
| 81 | // initialize from base to derived |
| 82 | for (int i = static_cast<int>(initRoutines.size()) - 1; i >= 0; i--) { |
| 83 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 84 | JSObjectInitializeCallback initialize = initRoutines[i]; |
| 85 | initialize(toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec), toRefcxx . . $ toRef(2a1143cc825aac90).(this)); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | template <class Base> |
| 90 | JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::~cxx . . $ QTJSC/JSCallbackObject#`~JSCallbackObject<Base>`(49f6e7a06ebc5aa8).JSCallbackObject() |
| 91 | { |
| 92 | JSObjectRefcxx . . $ JSObjectRef# thisRef = toRefcxx . . $ toRef(2a1143cc825aac90).(this); |
| 93 | |
| 94 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) |
| 95 | if (JSObjectFinalizeCallback finalize = jsClass->finalizecxx . . $ OpaqueJSClass#finalize.) |
| 96 | finalize(thisRef); |
| 97 | } |
| 98 | |
| 99 | template <class Base> |
| 100 | UStringcxx . . $ QTJSC/UString# JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::classNamecxx . . $ QTJSC/JSCallbackObject#className(ba9ec689f7dd9231).() const |
| 101 | { |
| 102 | UStringcxx . . $ QTJSC/UString# thisClassName = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).()->className(); |
| 103 | if (!thisClassName.isEmptycxx . . $ QTJSC/UString#isEmpty(50ce9a9e25b4a850).()) |
| 104 | return thisClassNamecxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d).; |
| 105 | |
| 106 | return Base::className(); |
| 107 | } |
| 108 | |
| 109 | template <class Base> |
| 110 | bool JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::getOwnPropertySlotcxx . . $ QTJSC/JSCallbackObject#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 111 | { |
| 112 | JSContextRefcxx . . $ JSContextRef# ctx = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec); |
| 113 | JSObjectRefcxx . . $ JSObjectRef# thisRef = toRefcxx . . $ toRef(d2164949e0d73831).(this); |
| 114 | RefPtrcxx . . $ RefPtr#<OpaqueJSStringcxx . . $ OpaqueJSString#> propertyNameRef; |
| 115 | |
| 116 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) { |
| 117 | // optional optimization to bypass getProperty in cases when we only need to know if the property exists |
| 118 | if (JSObjectHasPropertyCallback hasProperty = jsClass->hasPropertycxx . . $ OpaqueJSClass#hasProperty.) { |
| 119 | if (!propertyNameRef) |
| 120 | propertyNameRef = OpaqueJSStringcxx . . $ OpaqueJSString#::createcxx . . $ OpaqueJSString#create(66b7c7959bf32be2).(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).()); |
| 121 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 122 | if (hasProperty(ctx, thisRef, propertyNameRef.get())) { |
| 123 | slot.setCustomcxx . . $ QTJSC/PropertySlot#setCustom(201c6ee79e352ec7).(this, callbackGettercxx . . $ QTJSC/JSCallbackObject#callbackGetter(2d50ae1b8ebdc06b).); |
| 124 | return true; |
| 125 | } |
| 126 | } else if (JSObjectGetPropertyCallback getProperty = jsClass->getPropertycxx . . $ OpaqueJSClass#getProperty.) { |
| 127 | if (!propertyNameRef) |
| 128 | propertyNameRef = OpaqueJSStringcxx . . $ OpaqueJSString#::createcxx . . $ OpaqueJSString#create(66b7c7959bf32be2).(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).()); |
| 129 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 130 | JSValueRefcxx . . $ JSValueRef# value; |
| 131 | { |
| 132 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 133 | value = getProperty(ctx, thisRef, propertyNameRef.get(), &exception); |
| 134 | } |
| 135 | if (exception) { |
| 136 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 137 | slot.setValuecxx . . $ QTJSC/PropertySlot#setValue(5c2ac18db087b3e6).(jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).()); |
| 138 | return true; |
| 139 | } |
| 140 | if (value) { |
| 141 | slot.setValuecxx . . $ QTJSC/PropertySlot#setValue(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value)); |
| 142 | return true; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | if (OpaqueJSClassStaticValuesTablecxx . . $ OpaqueJSClassStaticValuesTable#* staticValues = jsClass->staticValuescxx . . $ OpaqueJSClass#staticValues(7d16391faedb28a0).(exec)) { |
| 147 | if (staticValues->contains(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).().repcxx . . $ QTJSC/UString#rep(eff8ac5d0836371c).())) { |
| 148 | slot.setCustomcxx . . $ QTJSC/PropertySlot#setCustom(201c6ee79e352ec7).(this, staticValueGettercxx . . $ QTJSC/JSCallbackObject#staticValueGetter(2d50ae1b8ebdc06b).); |
| 149 | return true; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | if (OpaqueJSClassStaticFunctionsTablecxx . . $ OpaqueJSClassStaticFunctionsTable#* staticFunctions = jsClass->staticFunctionscxx . . $ OpaqueJSClass#staticFunctions(7d16391faedb28a0).(exec)) { |
| 154 | if (staticFunctions->contains(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).().repcxx . . $ QTJSC/UString#rep(eff8ac5d0836371c).())) { |
| 155 | slot.setCustomcxx . . $ QTJSC/PropertySlot#setCustom(201c6ee79e352ec7).(this, staticFunctionGettercxx . . $ QTJSC/JSCallbackObject#staticFunctionGetter(2d50ae1b8ebdc06b).); |
| 156 | return true; |
| 157 | } |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | return Base::getOwnPropertySlot(exec, propertyName, slot); |
| 162 | } |
| 163 | |
| 164 | template <class Base> |
| 165 | bool JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::getOwnPropertySlotcxx . . $ QTJSC/JSCallbackObject#getOwnPropertySlot(d57d1c8d4b24d235).(ExecStatecxx . . $ QTJSC/ExecState#* exec, unsigned propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 166 | { |
| 167 | return getOwnPropertySlotcxx . . $ QTJSC/JSCallbackObject#getOwnPropertySlot(d57d1c8d4b24d235).(exec, Identifiercxx . . $ QTJSC/Identifier#::fromcxx . . $ QTJSC/Identifier#from(d1afedae20629715).(exec, propertyName), slot); |
| 168 | } |
| 169 | |
| 170 | template <class Base> |
| 171 | bool JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::getOwnPropertyDescriptorcxx . . $ QTJSC/JSCallbackObject#getOwnPropertyDescriptor(dce4ef7012294c32).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertyDescriptorcxx . . $ QTJSC/PropertyDescriptor#& descriptor) |
| 172 | { |
| 173 | PropertySlotcxx . . $ QTJSC/PropertySlot# slotcxx . . $ QTJSC/PropertySlot#PropertySlot(49f6e7a06ebc5aa8).; |
| 174 | if (getOwnPropertySlotcxx . . $ QTJSC/JSCallbackObject#getOwnPropertySlot(d57d1c8d4b24d235).(exec, propertyName, slot)) { |
| 175 | // Ideally we should return an access descriptor, but returning a value descriptor is better than nothing. |
| 176 | JSValuecxx . . $ QTJSC/JSValue# value = slot.getValuecxx . . $ QTJSC/PropertySlot#getValue(ccadc8db5e9d2977).(exec, propertyName); |
| 177 | if (!exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 178 | descriptor.setValuecxx . . $ QTJSC/PropertyDescriptor#setValue(5c2ac18db087b3e6).(value); |
| 179 | // We don't know whether the property is configurable, but assume it is. |
| 180 | descriptor.setConfigurablecxx . . $ QTJSC/PropertyDescriptor#setConfigurable(b45ddcbc8423892c).(true); |
| 181 | // We don't know whether the property is enumerable (we could call getOwnPropertyNames() to find out), but assume it isn't. |
| 182 | descriptor.setEnumerablecxx . . $ QTJSC/PropertyDescriptor#setEnumerable(b45ddcbc8423892c).(false); |
| 183 | return true; |
| 184 | } |
| 185 | |
| 186 | return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor); |
| 187 | } |
| 188 | |
| 189 | template <class Base> |
| 190 | void JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::putcxx . . $ QTJSC/JSCallbackObject#put(dfb3133dafbe9ff4).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, JSValuecxx . . $ QTJSC/JSValue# value, PutPropertySlotcxx . . $ QTJSC/PutPropertySlot#& slot) |
| 191 | { |
| 192 | JSContextRefcxx . . $ JSContextRef# ctx = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec); |
| 193 | JSObjectRefcxx . . $ JSObjectRef# thisRef = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(this); |
| 194 | RefPtrcxx . . $ RefPtr#<OpaqueJSStringcxx . . $ OpaqueJSString#> propertyNameRef; |
| 195 | JSValueRefcxx . . $ JSValueRef# valueRef = toRefcxx . . $ toRef(df99c259cd5b7643).(exec, value); |
| 196 | |
| 197 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) { |
| 198 | if (JSObjectSetPropertyCallback setProperty = jsClass->setPropertycxx . . $ OpaqueJSClass#setProperty.) { |
| 199 | if (!propertyNameRef) |
| 200 | propertyNameRef = OpaqueJSStringcxx . . $ OpaqueJSString#::createcxx . . $ OpaqueJSString#create(66b7c7959bf32be2).(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).()); |
| 201 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 202 | bool result; |
| 203 | { |
| 204 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 205 | result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); |
| 206 | } |
| 207 | if (exception) |
| 208 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 209 | if (result || exception) |
| 210 | return; |
| 211 | } |
| 212 | |
| 213 | if (OpaqueJSClassStaticValuesTablecxx . . $ OpaqueJSClassStaticValuesTable#* staticValues = jsClass->staticValuescxx . . $ OpaqueJSClass#staticValues(7d16391faedb28a0).(exec)) { |
| 214 | if (StaticValueEntrycxx . . $ StaticValueEntry#* entry = staticValues->get(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).().repcxx . . $ QTJSC/UString#rep(eff8ac5d0836371c).())) { |
| 215 | if (entry->attributescxx . . $ StaticValueEntry#attributes. & kJSPropertyAttributeReadOnly) |
| 216 | return; |
| 217 | if (JSObjectSetPropertyCallback setProperty = entry->setPropertycxx . . $ StaticValueEntry#setProperty.) { |
| 218 | if (!propertyNameRef) |
| 219 | propertyNameRef = OpaqueJSStringcxx . . $ OpaqueJSString#::createcxx . . $ OpaqueJSString#create(66b7c7959bf32be2).(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).()); |
| 220 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 221 | bool result; |
| 222 | { |
| 223 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 224 | result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); |
| 225 | } |
| 226 | if (exception) |
| 227 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 228 | if (result || exception) |
| 229 | return; |
| 230 | } else |
| 231 | throwErrorcxx . . $ QTJSC/throwError(c8108d54e75f502b).(exec, ReferenceErrorcxx . . $ QTJSC/ReferenceError., "Attempt to set a property that is not settable."); |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | if (OpaqueJSClassStaticFunctionsTablecxx . . $ OpaqueJSClassStaticFunctionsTable#* staticFunctions = jsClass->staticFunctionscxx . . $ OpaqueJSClass#staticFunctions(7d16391faedb28a0).(exec)) { |
| 236 | if (StaticFunctionEntrycxx . . $ StaticFunctionEntry#* entry = staticFunctions->get(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).().repcxx . . $ QTJSC/UString#rep(eff8ac5d0836371c).())) { |
| 237 | if (entry->attributescxx . . $ StaticFunctionEntry#attributes. & kJSPropertyAttributeReadOnly) |
| 238 | return; |
| 239 | JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::putDirect(propertyName, value); // put as override property |
| 240 | return; |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | return Base::put(exec, propertyName, value, slot); |
| 246 | } |
| 247 | |
| 248 | template <class Base> |
| 249 | bool JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::deletePropertycxx . . $ QTJSC/JSCallbackObject#deleteProperty(13154ef9bddc9416).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName) |
| 250 | { |
| 251 | JSContextRefcxx . . $ JSContextRef# ctx = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec); |
| 252 | JSObjectRefcxx . . $ JSObjectRef# thisRef = toRefcxx . . $ toRef(d2164949e0d73831).(this); |
| 253 | RefPtrcxx . . $ RefPtr#<OpaqueJSStringcxx . . $ OpaqueJSString#> propertyNameRef; |
| 254 | |
| 255 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) { |
| 256 | if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deletePropertycxx . . $ OpaqueJSClass#deleteProperty.) { |
| 257 | if (!propertyNameRef) |
| 258 | propertyNameRef = OpaqueJSStringcxx . . $ OpaqueJSString#::createcxx . . $ OpaqueJSString#create(66b7c7959bf32be2).(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).()); |
| 259 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 260 | bool result; |
| 261 | { |
| 262 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 263 | result = deleteProperty(ctx, thisRef, propertyNameRef.get(), &exception); |
| 264 | } |
| 265 | if (exception) |
| 266 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 267 | if (result || exception) |
| 268 | return true; |
| 269 | } |
| 270 | |
| 271 | if (OpaqueJSClassStaticValuesTablecxx . . $ OpaqueJSClassStaticValuesTable#* staticValues = jsClass->staticValuescxx . . $ OpaqueJSClass#staticValues(7d16391faedb28a0).(exec)) { |
| 272 | if (StaticValueEntrycxx . . $ StaticValueEntry#* entry = staticValues->get(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).().repcxx . . $ QTJSC/UString#rep(eff8ac5d0836371c).())) { |
| 273 | if (entry->attributescxx . . $ StaticValueEntry#attributes. & kJSPropertyAttributeDontDelete) |
| 274 | return false; |
| 275 | return true; |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | if (OpaqueJSClassStaticFunctionsTablecxx . . $ OpaqueJSClassStaticFunctionsTable#* staticFunctions = jsClass->staticFunctionscxx . . $ OpaqueJSClass#staticFunctions(7d16391faedb28a0).(exec)) { |
| 280 | if (StaticFunctionEntrycxx . . $ StaticFunctionEntry#* entry = staticFunctions->get(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).().repcxx . . $ QTJSC/UString#rep(eff8ac5d0836371c).())) { |
| 281 | if (entry->attributescxx . . $ StaticFunctionEntry#attributes. & kJSPropertyAttributeDontDelete) |
| 282 | return false; |
| 283 | return true; |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | return Base::deleteProperty(exec, propertyName); |
| 289 | } |
| 290 | |
| 291 | template <class Base> |
| 292 | bool JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::deletePropertycxx . . $ QTJSC/JSCallbackObject#deleteProperty(2f8cbeb04562a47b).(ExecStatecxx . . $ QTJSC/ExecState#* exec, unsigned propertyName) |
| 293 | { |
| 294 | return deletePropertycxx . . $ QTJSC/JSCallbackObject#deleteProperty(2f8cbeb04562a47b).(exec, Identifiercxx . . $ QTJSC/Identifier#::fromcxx . . $ QTJSC/Identifier#from(d1afedae20629715).(exec, propertyName)); |
| 295 | } |
| 296 | |
| 297 | template <class Base> |
| 298 | ConstructTypecxx . . $ QTJSC/ConstructType# JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::getConstructDatacxx . . $ QTJSC/JSCallbackObject#getConstructData(80014d68d6143eea).(ConstructDatacxx . . $ QTJSC/ConstructData#& constructData) |
| 299 | { |
| 300 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) { |
| 301 | if (jsClass->callAsConstructorcxx . . $ OpaqueJSClass#callAsConstructor.) { |
| 302 | constructData.nativecxx . . $ QTJSC/ConstructData#native..functioncxx . . $ QTJSC/ConstructData#$anonymous_type_0#function. =cxx . . $ QTJSC/NativeConstrWrapper#`operator=`(4f61eada803c3ef5). constructcxx . . $ QTJSC/JSCallbackObject#construct(9a9a00b054b701a4).; |
| 303 | return ConstructTypeHostcxx . . $ QTJSC/ConstructTypeHost.; |
| 304 | } |
| 305 | } |
| 306 | return ConstructTypeNonecxx . . $ QTJSC/ConstructTypeNone.; |
| 307 | } |
| 308 | |
| 309 | template <class Base> |
| 310 | JSObjectcxx . . $ QTJSC/JSObject#* JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::constructcxx . . $ QTJSC/JSCallbackObject#construct(9a9a00b054b701a4).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSObjectcxx . . $ QTJSC/JSObject#* constructor, const ArgListcxx . . $ QTJSC/ArgList#& args) |
| 311 | { |
| 312 | JSContextRefcxx . . $ JSContextRef# execRef = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec); |
| 313 | JSObjectRefcxx . . $ JSObjectRef# constructorRef = toRefcxx . . $ toRef(d2164949e0d73831).(constructor); |
| 314 | |
| 315 | for (JSClassRefcxx . . $ JSClassRef# jsClass = static_cast<JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>*>(constructor)->classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) { |
| 316 | if (JSObjectCallAsConstructorCallback callAsConstructor = jsClass->callAsConstructorcxx . . $ OpaqueJSClass#callAsConstructor.) { |
| 317 | int argumentCount = static_cast<int>(args.sizecxx . . $ QTJSC/ArgList#size(fe4d2d262d4164a8).()); |
| 318 | Vectorcxx . . $ Vector#<JSValueRefcxx . . $ JSValueRef#, 16> arguments(argumentCount); |
| 319 | for (int i = 0; i < argumentCount; i++) |
| 320 | arguments[i] = toRefcxx . . $ toRef(df99c259cd5b7643).(exec, args.atcxx . . $ QTJSC/ArgList#at(e9dec2041b7a6b55).(i)); |
| 321 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 322 | JSObjectcxx . . $ QTJSC/JSObject#* result; |
| 323 | { |
| 324 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 325 | result = toJScxx . . $ toJS(f59d9eed7d59fe2c).(callAsConstructor(execRef, constructorRef, argumentCount, arguments.data(), &exception)); |
| 326 | } |
| 327 | if (exception) |
| 328 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 329 | return result; |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | ASSERT_NOT_REACHEDcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:185:9`!(); // getConstructData should prevent us from reaching here |
| 334 | return 0; |
| 335 | } |
| 336 | |
| 337 | template <class Base> |
| 338 | bool JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::hasInstancecxx . . $ QTJSC/JSCallbackObject#hasInstance(658e1865c47113e6).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# value, JSValuecxx . . $ QTJSC/JSValue#) |
| 339 | { |
| 340 | JSContextRefcxx . . $ JSContextRef# execRef = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec); |
| 341 | JSObjectRefcxx . . $ JSObjectRef# thisRef = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(this); |
| 342 | |
| 343 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) { |
| 344 | if (JSObjectHasInstanceCallback hasInstance = jsClass->hasInstancecxx . . $ OpaqueJSClass#hasInstance.) { |
| 345 | JSValueRefcxx . . $ JSValueRef# valueRef = toRefcxx . . $ toRef(df99c259cd5b7643).(exec, value); |
| 346 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 347 | bool result; |
| 348 | { |
| 349 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 350 | result = hasInstance(execRef, thisRef, valueRef, &exception); |
| 351 | } |
| 352 | if (exception) |
| 353 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 354 | return result; |
| 355 | } |
| 356 | } |
| 357 | return false; |
| 358 | } |
| 359 | |
| 360 | template <class Base> |
| 361 | CallTypecxx . . $ QTJSC/CallType# JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::getCallDatacxx . . $ QTJSC/JSCallbackObject#getCallData(9482040cf952d29d).(CallDatacxx . . $ QTJSC/CallData#& callData) |
| 362 | { |
| 363 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) { |
| 364 | if (jsClass->callAsFunctioncxx . . $ OpaqueJSClass#callAsFunction.) { |
| 365 | callData.nativecxx . . $ QTJSC/CallData#native..functioncxx . . $ QTJSC/CallData#$anonymous_type_0#function. =cxx . . $ QTJSC/NativeFuncWrapper#`operator=`(d9f3a0596fbce81c). callcxx . . $ QTJSC/JSCallbackObject#call(cac2aec6ecb9506b).; |
| 366 | return CallTypeHostcxx . . $ QTJSC/CallTypeHost.; |
| 367 | } |
| 368 | } |
| 369 | return CallTypeNonecxx . . $ QTJSC/CallTypeNone.; |
| 370 | } |
| 371 | |
| 372 | template <class Base> |
| 373 | JSValuecxx . . $ QTJSC/JSValue# JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::callcxx . . $ QTJSC/JSCallbackObject#call(cac2aec6ecb9506b).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSObjectcxx . . $ QTJSC/JSObject#* functionObject, JSValuecxx . . $ QTJSC/JSValue# thisValue, const ArgListcxx . . $ QTJSC/ArgList#& args) |
| 374 | { |
| 375 | JSContextRefcxx . . $ JSContextRef# execRef = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec); |
| 376 | JSObjectRefcxx . . $ JSObjectRef# functionRef = toRefcxx . . $ toRef(d2164949e0d73831).(functionObject); |
| 377 | JSObjectRefcxx . . $ JSObjectRef# thisObjRef = toRefcxx . . $ toRef(d2164949e0d73831).(thisValue.toThisObjectcxx . . $ QTJSC/JSValue#toThisObject(8709ed4849a165ab).(exec)); |
| 378 | |
| 379 | for (JSClassRefcxx . . $ JSClassRef# jsClass = static_cast<JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>*>(functionObject)->classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) { |
| 380 | if (JSObjectCallAsFunctionCallback callAsFunction = jsClass->callAsFunctioncxx . . $ OpaqueJSClass#callAsFunction.) { |
| 381 | int argumentCount = static_cast<int>(args.sizecxx . . $ QTJSC/ArgList#size(fe4d2d262d4164a8).()); |
| 382 | Vectorcxx . . $ Vector#<JSValueRefcxx . . $ JSValueRef#, 16> arguments(argumentCount); |
| 383 | for (int i = 0; i < argumentCount; i++) |
| 384 | arguments[i] = toRefcxx . . $ toRef(df99c259cd5b7643).(exec, args.atcxx . . $ QTJSC/ArgList#at(e9dec2041b7a6b55).(i)); |
| 385 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 386 | JSValuecxx . . $ QTJSC/JSValue# resultcxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).; |
| 387 | { |
| 388 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 389 | result = toJScxx . . $ toJS(9aa0b3d2bc733a67).(exec, callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception)); |
| 390 | } |
| 391 | if (exception) |
| 392 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 393 | return result; |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | ASSERT_NOT_REACHEDcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:185:9`!(); // getCallData should prevent us from reaching here |
| 398 | return JSValuecxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).(); |
| 399 | } |
| 400 | |
| 401 | template <class Base> |
| 402 | void JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::getOwnPropertyNamescxx . . $ QTJSC/JSCallbackObject#getOwnPropertyNames(2f9e3f18de200b4e).(ExecStatecxx . . $ QTJSC/ExecState#* exec, PropertyNameArraycxx . . $ QTJSC/PropertyNameArray#& propertyNames, EnumerationModecxx . . $ QTJSC/EnumerationMode# mode) |
| 403 | { |
| 404 | JSContextRefcxx . . $ JSContextRef# execRef = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec); |
| 405 | JSObjectRefcxx . . $ JSObjectRef# thisRef = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(this); |
| 406 | |
| 407 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) { |
| 408 | if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNamescxx . . $ OpaqueJSClass#getPropertyNames.) { |
| 409 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 410 | getPropertyNames(execRef, thisRef, toRefcxx . . $ toRef(a3a0aaa39c54fbf3).(&propertyNames)); |
| 411 | } |
| 412 | |
| 413 | if (OpaqueJSClassStaticValuesTablecxx . . $ OpaqueJSClassStaticValuesTable#* staticValues = jsClass->staticValuescxx . . $ OpaqueJSClass#staticValues(7d16391faedb28a0).(exec)) { |
| 414 | typedef OpaqueJSClassStaticValuesTable::const_iterator iteratorcxx . . $ QTJSC/JSCallbackObject#getOwnPropertyNames(2f9e3f18de200b4e).iterator#; |
| 415 | iteratorcxx . . $ QTJSC/JSCallbackObject#getOwnPropertyNames(2f9e3f18de200b4e).iterator# end = staticValues->end(); |
| 416 | for (iteratorcxx . . $ QTJSC/JSCallbackObject#getOwnPropertyNames(2f9e3f18de200b4e).iterator# it = staticValues->begin(); it != end; ++it) { |
| 417 | UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* name = it->first.get(); |
| 418 | StaticValueEntrycxx . . $ StaticValueEntry#* entry = it->second; |
| 419 | if (entry->getPropertycxx . . $ StaticValueEntry#getProperty. && (!(entry->attributescxx . . $ StaticValueEntry#attributes. & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumPropertiescxx . . $ QTJSC/IncludeDontEnumProperties.))) |
| 420 | propertyNames.addcxx . . $ QTJSC/PropertyNameArray#add(d7ed36c5537ed570).(Identifiercxx . . $ QTJSC/Identifier#Identifier(a8e0b2d7f9c69786).(exec, name)); |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | if (OpaqueJSClassStaticFunctionsTablecxx . . $ OpaqueJSClassStaticFunctionsTable#* staticFunctions = jsClass->staticFunctionscxx . . $ OpaqueJSClass#staticFunctions(7d16391faedb28a0).(exec)) { |
| 425 | typedef OpaqueJSClassStaticFunctionsTable::const_iterator iteratorcxx . . $ QTJSC/JSCallbackObject#getOwnPropertyNames(2f9e3f18de200b4e).iterator#; |
| 426 | iteratorcxx . . $ QTJSC/JSCallbackObject#getOwnPropertyNames(2f9e3f18de200b4e).iterator# end = staticFunctions->end(); |
| 427 | for (iteratorcxx . . $ QTJSC/JSCallbackObject#getOwnPropertyNames(2f9e3f18de200b4e).iterator# it = staticFunctions->begin(); it != end; ++it) { |
| 428 | UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* name = it->first.get(); |
| 429 | StaticFunctionEntrycxx . . $ StaticFunctionEntry#* entry = it->second; |
| 430 | if (!(entry->attributescxx . . $ StaticFunctionEntry#attributes. & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumPropertiescxx . . $ QTJSC/IncludeDontEnumProperties.)) |
| 431 | propertyNames.addcxx . . $ QTJSC/PropertyNameArray#add(d7ed36c5537ed570).(Identifiercxx . . $ QTJSC/Identifier#Identifier(a8e0b2d7f9c69786).(exec, name)); |
| 432 | } |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | Base::getOwnPropertyNames(exec, propertyNames, mode); |
| 437 | } |
| 438 | |
| 439 | template <class Base> |
| 440 | double JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::toNumbercxx . . $ QTJSC/JSCallbackObject#toNumber(1fd034e372fd1279).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const |
| 441 | { |
| 442 | // We need this check to guard against the case where this object is rhs of |
| 443 | // a binary expression where lhs threw an exception in its conversion to |
| 444 | // primitive |
| 445 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 446 | return NaNcxx . . $ QTJSC/NaN.; |
| 447 | JSContextRefcxx . . $ JSContextRef# ctx = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec); |
| 448 | JSObjectRefcxx . . $ JSObjectRef# thisRef = toRefcxx . . $ toRef(df99c259cd5b7643).(this); |
| 449 | |
| 450 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) |
| 451 | if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToTypecxx . . $ OpaqueJSClass#convertToType.) { |
| 452 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 453 | JSValueRefcxx . . $ JSValueRef# value; |
| 454 | { |
| 455 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 456 | value = convertToType(ctx, thisRef, kJSTypeNumbercxx . . $ kJSTypeNumber., &exception); |
| 457 | } |
| 458 | if (exception) { |
| 459 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 460 | return 0; |
| 461 | } |
| 462 | |
| 463 | double dValue; |
| 464 | if (value) |
| 465 | return toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value).getNumbercxx . . $ QTJSC/JSValue#getNumber(c49d02341edf1b7e).(dValue) ? dValue : NaNcxx . . $ QTJSC/NaN.; |
| 466 | } |
| 467 | |
| 468 | return Base::toNumber(exec); |
| 469 | } |
| 470 | |
| 471 | template <class Base> |
| 472 | UStringcxx . . $ QTJSC/UString# JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::toStringcxx . . $ QTJSC/JSCallbackObject#toString(9c94f5abb1995042).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const |
| 473 | { |
| 474 | JSContextRefcxx . . $ JSContextRef# ctx = toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec); |
| 475 | JSObjectRefcxx . . $ JSObjectRef# thisRef = toRefcxx . . $ toRef(c44cefdcd7666f07).(this); |
| 476 | |
| 477 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) |
| 478 | if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToTypecxx . . $ OpaqueJSClass#convertToType.) { |
| 479 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 480 | JSValueRefcxx . . $ JSValueRef# value; |
| 481 | { |
| 482 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 483 | value = convertToType(ctx, thisRef, kJSTypeStringcxx . . $ kJSTypeString., &exception); |
| 484 | } |
| 485 | if (exception) { |
| 486 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 487 | returncxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d). ""cxx . . $ QTJSC/UString#UString(85c52e162fed56f9).; |
| 488 | } |
| 489 | if (value) |
| 490 | return toJScxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d).(exec, value).getStringcxx . . $ QTJSC/JSValue#getString(9c94f5abb1995042).(exec); |
| 491 | } |
| 492 | |
| 493 | return Base::toString(exec); |
| 494 | } |
| 495 | |
| 496 | template <class Base> |
| 497 | void JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::setPrivatecxx . . $ QTJSC/JSCallbackObject#setPrivate(5d22bdacc48458e8).(void* data) |
| 498 | { |
| 499 | m_callbackObjectDatacxx . . $ QTJSC/JSCallbackObject#m_callbackObjectData.->privateData = data; |
| 500 | } |
| 501 | |
| 502 | template <class Base> |
| 503 | void* JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::getPrivatecxx . . $ QTJSC/JSCallbackObject#getPrivate(50c7df7de5344ebb).() |
| 504 | { |
| 505 | return m_callbackObjectDatacxx . . $ QTJSC/JSCallbackObject#m_callbackObjectData.->privateData; |
| 506 | } |
| 507 | |
| 508 | template <class Base> |
| 509 | bool JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::inheritscxx . . $ QTJSC/JSCallbackObject#inherits(e8c3c8616db7478f).(JSClassRefcxx . . $ JSClassRef# c) const |
| 510 | { |
| 511 | for (JSClassRefcxx . . $ JSClassRef# jsClass = classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) |
| 512 | if (jsClass == c) |
| 513 | return true; |
| 514 | |
| 515 | return false; |
| 516 | } |
| 517 | |
| 518 | template <class Base> |
| 519 | JSValuecxx . . $ QTJSC/JSValue# JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::staticValueGettercxx . . $ QTJSC/JSCallbackObject#staticValueGetter(2d50ae1b8ebdc06b).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, const PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 520 | { |
| 521 | JSCallbackObject* thisObj = asCallbackObjectcxx . . $ QTJSC/JSCallbackObject#asCallbackObject(90e037006a47f0a).(slot.slotBasecxx . . $ QTJSC/PropertySlot#slotBase(888c053acf364da1).()); |
| 522 | |
| 523 | JSObjectRefcxx . . $ JSObjectRef# thisRef = toRefcxx . . $ toRef(c44cefdcd7666f07).(thisObj); |
| 524 | RefPtrcxx . . $ RefPtr#<OpaqueJSStringcxx . . $ OpaqueJSString#> propertyNameRef; |
| 525 | |
| 526 | for (JSClassRefcxx . . $ JSClassRef# jsClass = thisObj->classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) |
| 527 | if (OpaqueJSClassStaticValuesTablecxx . . $ OpaqueJSClassStaticValuesTable#* staticValues = jsClass->staticValuescxx . . $ OpaqueJSClass#staticValues(7d16391faedb28a0).(exec)) |
| 528 | if (StaticValueEntrycxx . . $ StaticValueEntry#* entry = staticValues->get(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).().repcxx . . $ QTJSC/UString#rep(eff8ac5d0836371c).())) |
| 529 | if (JSObjectGetPropertyCallback getProperty = entry->getPropertycxx . . $ StaticValueEntry#getProperty.) { |
| 530 | if (!propertyNameRef) |
| 531 | propertyNameRef = OpaqueJSStringcxx . . $ OpaqueJSString#::createcxx . . $ OpaqueJSString#create(66b7c7959bf32be2).(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).()); |
| 532 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 533 | JSValueRefcxx . . $ JSValueRef# value; |
| 534 | { |
| 535 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 536 | value = getProperty(toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec), thisRef, propertyNameRef.get(), &exception); |
| 537 | } |
| 538 | if (exception) { |
| 539 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 540 | return jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).(); |
| 541 | } |
| 542 | if (value) |
| 543 | return toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 544 | } |
| 545 | |
| 546 | return throwErrorcxx . . $ QTJSC/throwError(c8108d54e75f502b).(exec, ReferenceErrorcxx . . $ QTJSC/ReferenceError., "Static value property defined with NULL getProperty callback."); |
| 547 | } |
| 548 | |
| 549 | template <class Base> |
| 550 | JSValuecxx . . $ QTJSC/JSValue# JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::staticFunctionGettercxx . . $ QTJSC/JSCallbackObject#staticFunctionGetter(2d50ae1b8ebdc06b).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, const PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 551 | { |
| 552 | JSCallbackObject* thisObj = asCallbackObjectcxx . . $ QTJSC/JSCallbackObject#asCallbackObject(90e037006a47f0a).(slot.slotBasecxx . . $ QTJSC/PropertySlot#slotBase(888c053acf364da1).()); |
| 553 | |
| 554 | // Check for cached or override property. |
| 555 | PropertySlotcxx . . $ QTJSC/PropertySlot# slot2(thisObj); |
| 556 | if (thisObj->Base::getOwnPropertySlotcxx . . $ QTJSC/JSCallbackObject#getOwnPropertySlot(d57d1c8d4b24d235).(exec, propertyName, slot2)) |
| 557 | return slot2.getValuecxx . . $ QTJSC/PropertySlot#getValue(ccadc8db5e9d2977).(exec, propertyName); |
| 558 | |
| 559 | for (JSClassRefcxx . . $ JSClassRef# jsClass = thisObj->classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) { |
| 560 | if (OpaqueJSClassStaticFunctionsTablecxx . . $ OpaqueJSClassStaticFunctionsTable#* staticFunctions = jsClass->staticFunctionscxx . . $ OpaqueJSClass#staticFunctions(7d16391faedb28a0).(exec)) { |
| 561 | if (StaticFunctionEntrycxx . . $ StaticFunctionEntry#* entry = staticFunctions->get(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).().repcxx . . $ QTJSC/UString#rep(eff8ac5d0836371c).())) { |
| 562 | if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunctioncxx . . $ StaticFunctionEntry#callAsFunction.) { |
| 563 | JSObjectcxx . . $ QTJSC/JSObject#* o = new (exec) JSCallbackFunctioncxx . . $ QTJSC/JSCallbackFunction#(exec, callAsFunction, propertyName); |
| 564 | thisObj->putDirect(propertyName, o, entry->attributescxx . . $ StaticFunctionEntry#attributes.); |
| 565 | return o; |
| 566 | } |
| 567 | } |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | return throwErrorcxx . . $ QTJSC/throwError(c8108d54e75f502b).(exec, ReferenceErrorcxx . . $ QTJSC/ReferenceError., "Static function property defined with NULL callAsFunction callback."); |
| 572 | } |
| 573 | |
| 574 | template <class Base> |
| 575 | JSValuecxx . . $ QTJSC/JSValue# JSCallbackObjectcxx . . $ QTJSC/JSCallbackObject#<Base>::callbackGettercxx . . $ QTJSC/JSCallbackObject#callbackGetter(2d50ae1b8ebdc06b).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, const PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 576 | { |
| 577 | JSCallbackObject* thisObj = asCallbackObjectcxx . . $ QTJSC/JSCallbackObject#asCallbackObject(90e037006a47f0a).(slot.slotBasecxx . . $ QTJSC/PropertySlot#slotBase(888c053acf364da1).()); |
| 578 | |
| 579 | JSObjectRefcxx . . $ JSObjectRef# thisRef = toRefcxx . . $ toRef(d2164949e0d73831).(thisObj); |
| 580 | RefPtrcxx . . $ RefPtr#<OpaqueJSStringcxx . . $ OpaqueJSString#> propertyNameRef; |
| 581 | |
| 582 | for (JSClassRefcxx . . $ JSClassRef# jsClass = thisObj->classRefcxx . . $ QTJSC/JSCallbackObject#classRef(cdeb5289882ccb81).(); jsClass; jsClass = jsClass->parentClasscxx . . $ OpaqueJSClass#parentClass.) |
| 583 | if (JSObjectGetPropertyCallback getProperty = jsClass->getPropertycxx . . $ OpaqueJSClass#getProperty.) { |
| 584 | if (!propertyNameRef) |
| 585 | propertyNameRef = OpaqueJSStringcxx . . $ OpaqueJSString#::createcxx . . $ OpaqueJSString#create(66b7c7959bf32be2).(propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).()); |
| 586 | JSValueRefcxx . . $ JSValueRef# exception = 0; |
| 587 | JSValueRefcxx . . $ JSValueRef# value; |
| 588 | { |
| 589 | APICallbackShimcxx . . $ QTJSC/APICallbackShim# callbackShimcxx . . $ QTJSC/APICallbackShim#APICallbackShim(d2cb180e190a9680).(exec); |
| 590 | value = getProperty(toRefcxx . . $ toRef(90ae1fbacdaa4c37).(exec), thisRef, propertyNameRef.get(), &exception); |
| 591 | } |
| 592 | if (exception) { |
| 593 | exec->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, exception)); |
| 594 | return jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).(); |
| 595 | } |
| 596 | if (value) |
| 597 | return toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 598 | } |
| 599 | |
| 600 | return throwErrorcxx . . $ QTJSC/throwError(c8108d54e75f502b).(exec, ReferenceErrorcxx . . $ QTJSC/ReferenceError., "hasProperty callback returned true for a property that doesn't exist."); |
| 601 | } |
| 602 | |
| 603 | } // namespace JSC |