| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2015 The Qt Company Ltd. |
| 4 | ** Contact: http://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtScript module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | #include "config.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/config.h`/ |
| 41 | #include "qscriptglobalobject_p.h"cxx . . $ `<file>/src/script/bridge/qscriptglobalobject_p.h`/ |
| 42 | |
| 43 | #include "../api/qscriptengine.h"cxx . . $ `<file>/src/script/api/qscriptengine.h`/ |
| 44 | #include "../api/qscriptengine_p.h"cxx . . $ `<file>/src/script/api/qscriptengine_p.h`/ |
| 45 | |
| 46 | namespace JSCcxx . . $ `<built-in>:463:9`! |
| 47 | { |
| 48 | QT_USE_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:147:10`! |
| 49 | |
| 50 | ASSERT_CLASS_FITS_IN_CELLcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h:42:9`!(QScript::GlobalObject); |
| 51 | ASSERT_CLASS_FITS_IN_CELLcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h:42:9`!(QScript::OriginalGlobalObjectProxy); |
| 52 | |
| 53 | } // namespace JSC |
| 54 | |
| 55 | QT_BEGIN_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:148:10`! |
| 56 | |
| 57 | namespace QScriptcxx . . $ QScript/ |
| 58 | { |
| 59 | |
| 60 | GlobalObjectcxx . . $ QScript/GlobalObject#::GlobalObjectcxx . . $ QScript/GlobalObject#GlobalObject(49f6e7a06ebc5aa8).() |
| 61 | : JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#(), customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.(0) |
| 62 | { |
| 63 | } |
| 64 | |
| 65 | GlobalObjectcxx . . $ QScript/GlobalObject#::~cxx . . $ QScript/GlobalObject#`~GlobalObject`(49f6e7a06ebc5aa8).GlobalObjectcxx . . $ QScript/GlobalObject#() |
| 66 | { |
| 67 | } |
| 68 | |
| 69 | void GlobalObjectcxx . . $ QScript/GlobalObject#::markChildrencxx . . $ QScript/GlobalObject#markChildren(bd9cae851d80a865).(JSCcxx . . $ `<built-in>:463:9`!::MarkStackcxx . . $ QTJSC/MarkStack#& markStack) |
| 70 | { |
| 71 | JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::markChildrencxx . . $ QTJSC/JSGlobalObject#markChildren(bd9cae851d80a865).(markStack); |
| 72 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 73 | markStack.appendcxx . . $ QTJSC/MarkStack#append(c6d88d3bdacccd64).(customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.); |
| 74 | } |
| 75 | |
| 76 | bool GlobalObjectcxx . . $ QScript/GlobalObject#::getOwnPropertySlotcxx . . $ QScript/GlobalObject#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState#* exec, |
| 77 | const JSCcxx . . $ `<built-in>:463:9`!::Identifiercxx . . $ QTJSC/Identifier#& propertyName, |
| 78 | JSCcxx . . $ `<built-in>:463:9`!::PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 79 | { |
| 80 | QScriptEnginePrivatecxx . . $ QScriptEnginePrivate# *engine = scriptEngineFromExeccxx . . $ QScript/scriptEngineFromExec(29635cd1600319d1).(exec); |
| 81 | if (propertyName ==cxx . . $ `operator==`(99d45ab6e563cfed). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().arguments && engine->currentFramecxx . . $ QScriptEnginePrivate#currentFrame.->argumentCountcxx . . $ QTJSC/ExecState#argumentCount(455f465bc33b4cdf).() > 0) { |
| 82 | JSCcxx . . $ `<built-in>:463:9`!::JSValuecxx . . $ QTJSC/JSValue# args = engine->scriptValueToJSCValuecxx . . $ QScriptEnginePrivate#scriptValueToJSCValue(1334d8176404fb05).(engine->contextForFramecxx . . $ QScriptEnginePrivate#contextForFrame(daeb37b53c2d4631).(engine->currentFramecxx . . $ QScriptEnginePrivate#currentFrame.)->argumentsObjectcxx . . $ QScriptContext#argumentsObject(73013aefd0020d47).()); |
| 83 | slot.setValuecxx . . $ QTJSC/PropertySlot#setValue(5c2ac18db087b3e6).(args); |
| 84 | return true; |
| 85 | } |
| 86 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 87 | return customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.->getOwnPropertySlotcxx . . $ QTJSC/JSObject#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(exec, propertyName, slot); |
| 88 | return JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::getOwnPropertySlotcxx . . $ QTJSC/JSGlobalObject#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(exec, propertyName, slot); |
| 89 | } |
| 90 | |
| 91 | bool GlobalObjectcxx . . $ QScript/GlobalObject#::getOwnPropertyDescriptorcxx . . $ QScript/GlobalObject#getOwnPropertyDescriptor(dce4ef7012294c32).(JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState#* exec, |
| 92 | const JSCcxx . . $ `<built-in>:463:9`!::Identifiercxx . . $ QTJSC/Identifier#& propertyName, |
| 93 | JSCcxx . . $ `<built-in>:463:9`!::PropertyDescriptorcxx . . $ QTJSC/PropertyDescriptor#& descriptor) |
| 94 | { |
| 95 | // Must match the logic of getOwnPropertySlot(). |
| 96 | QScriptEnginePrivatecxx . . $ QScriptEnginePrivate# *engine = scriptEngineFromExeccxx . . $ QScript/scriptEngineFromExec(29635cd1600319d1).(exec); |
| 97 | if (propertyName ==cxx . . $ `operator==`(99d45ab6e563cfed). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().arguments && engine->currentFramecxx . . $ QScriptEnginePrivate#currentFrame.->argumentCountcxx . . $ QTJSC/ExecState#argumentCount(455f465bc33b4cdf).() > 0) { |
| 98 | // ### Can we get rid of this special handling of the arguments property? |
| 99 | JSCcxx . . $ `<built-in>:463:9`!::JSValuecxx . . $ QTJSC/JSValue# args = engine->scriptValueToJSCValuecxx . . $ QScriptEnginePrivate#scriptValueToJSCValue(1334d8176404fb05).(engine->contextForFramecxx . . $ QScriptEnginePrivate#contextForFrame(daeb37b53c2d4631).(engine->currentFramecxx . . $ QScriptEnginePrivate#currentFrame.)->argumentsObjectcxx . . $ QScriptContext#argumentsObject(73013aefd0020d47).()); |
| 100 | descriptor.setValuecxx . . $ QTJSC/PropertyDescriptor#setValue(5c2ac18db087b3e6).(args); |
| 101 | return true; |
| 102 | } |
| 103 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 104 | return customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.->getOwnPropertyDescriptorcxx . . $ QTJSC/JSObject#getOwnPropertyDescriptor(dce4ef7012294c32).(exec, propertyName, descriptor); |
| 105 | return JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::getOwnPropertyDescriptorcxx . . $ QTJSC/JSGlobalObject#getOwnPropertyDescriptor(dce4ef7012294c32).(exec, propertyName, descriptor); |
| 106 | } |
| 107 | |
| 108 | void GlobalObjectcxx . . $ QScript/GlobalObject#::putcxx . . $ QScript/GlobalObject#put(dfb3133dafbe9ff4).(JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState#* exec, const JSCcxx . . $ `<built-in>:463:9`!::Identifiercxx . . $ QTJSC/Identifier#& propertyName, |
| 109 | JSCcxx . . $ `<built-in>:463:9`!::JSValuecxx . . $ QTJSC/JSValue# value, JSCcxx . . $ `<built-in>:463:9`!::PutPropertySlotcxx . . $ QTJSC/PutPropertySlot#& slot) |
| 110 | { |
| 111 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 112 | customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.->putcxx . . $ QTJSC/JSObject#put(dfb3133dafbe9ff4).(exec, propertyName, value, slot); |
| 113 | else |
| 114 | JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::putcxx . . $ QTJSC/JSGlobalObject#put(dfb3133dafbe9ff4).(exec, propertyName, value, slot); |
| 115 | } |
| 116 | |
| 117 | void GlobalObjectcxx . . $ QScript/GlobalObject#::putWithAttributescxx . . $ QScript/GlobalObject#putWithAttributes(3dd2e6313723688d).(JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState#* exec, const JSCcxx . . $ `<built-in>:463:9`!::Identifiercxx . . $ QTJSC/Identifier#& propertyName, |
| 118 | JSCcxx . . $ `<built-in>:463:9`!::JSValuecxx . . $ QTJSC/JSValue# value, unsigned attributes) |
| 119 | { |
| 120 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 121 | customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.->putWithAttributescxx . . $ QTJSC/JSObject#putWithAttributes(3dd2e6313723688d).(exec, propertyName, value, attributes); |
| 122 | else |
| 123 | JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::putWithAttributescxx . . $ QTJSC/JSGlobalObject#putWithAttributes(3dd2e6313723688d).(exec, propertyName, value, attributes); |
| 124 | } |
| 125 | |
| 126 | bool GlobalObjectcxx . . $ QScript/GlobalObject#::deletePropertycxx . . $ QScript/GlobalObject#deleteProperty(13154ef9bddc9416).(JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState#* exec, const JSCcxx . . $ `<built-in>:463:9`!::Identifiercxx . . $ QTJSC/Identifier#& propertyName) |
| 127 | { |
| 128 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 129 | return customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.->deletePropertycxx . . $ QTJSC/JSObject#deleteProperty(13154ef9bddc9416).(exec, propertyName); |
| 130 | return JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::deletePropertycxx . . $ QTJSC/JSVariableObject#deleteProperty(13154ef9bddc9416).(exec, propertyName); |
| 131 | } |
| 132 | |
| 133 | void GlobalObjectcxx . . $ QScript/GlobalObject#::getOwnPropertyNamescxx . . $ QScript/GlobalObject#getOwnPropertyNames(2f9e3f18de200b4e).(JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState#* exec, JSCcxx . . $ `<built-in>:463:9`!::PropertyNameArraycxx . . $ QTJSC/PropertyNameArray#& propertyNames, |
| 134 | JSCcxx . . $ `<built-in>:463:9`!::EnumerationModecxx . . $ QTJSC/EnumerationMode# mode) |
| 135 | { |
| 136 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 137 | customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.->getOwnPropertyNamescxx . . $ QTJSC/JSObject#getOwnPropertyNames(2f9e3f18de200b4e).(exec, propertyNames, mode); |
| 138 | else |
| 139 | JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::getOwnPropertyNamescxx . . $ QTJSC/JSVariableObject#getOwnPropertyNames(2f9e3f18de200b4e).(exec, propertyNames, mode); |
| 140 | } |
| 141 | |
| 142 | void GlobalObjectcxx . . $ QScript/GlobalObject#::defineGettercxx . . $ QScript/GlobalObject#defineGetter(413481394bc380b4).(JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState#* exec, const JSCcxx . . $ `<built-in>:463:9`!::Identifiercxx . . $ QTJSC/Identifier#& propertyName, JSCcxx . . $ `<built-in>:463:9`!::JSObjectcxx . . $ QTJSC/JSObject#* getterFunction, unsigned attributes) |
| 143 | { |
| 144 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 145 | customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.->defineGettercxx . . $ QTJSC/JSObject#defineGetter(413481394bc380b4).(exec, propertyName, getterFunction, attributes); |
| 146 | else |
| 147 | JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::defineGettercxx . . $ QTJSC/JSGlobalObject#defineGetter(413481394bc380b4).(exec, propertyName, getterFunction, attributes); |
| 148 | } |
| 149 | |
| 150 | void GlobalObjectcxx . . $ QScript/GlobalObject#::defineSettercxx . . $ QScript/GlobalObject#defineSetter(413481394bc380b4).(JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState#* exec, const JSCcxx . . $ `<built-in>:463:9`!::Identifiercxx . . $ QTJSC/Identifier#& propertyName, JSCcxx . . $ `<built-in>:463:9`!::JSObjectcxx . . $ QTJSC/JSObject#* setterFunction, unsigned attributes) |
| 151 | { |
| 152 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 153 | customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.->defineSettercxx . . $ QTJSC/JSObject#defineSetter(413481394bc380b4).(exec, propertyName, setterFunction, attributes); |
| 154 | else |
| 155 | JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::defineSettercxx . . $ QTJSC/JSGlobalObject#defineSetter(413481394bc380b4).(exec, propertyName, setterFunction, attributes); |
| 156 | } |
| 157 | |
| 158 | JSCcxx . . $ `<built-in>:463:9`!::JSValuecxx . . $ QTJSC/JSValue# GlobalObjectcxx . . $ QScript/GlobalObject#::lookupGettercxx . . $ QScript/GlobalObject#lookupGetter(c9cd87a849817b6).(JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState#* exec, const JSCcxx . . $ `<built-in>:463:9`!::Identifiercxx . . $ QTJSC/Identifier#& propertyName) |
| 159 | { |
| 160 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 161 | return customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.->lookupGettercxx . . $ QTJSC/JSObject#lookupGetter(c9cd87a849817b6).(exec, propertyName); |
| 162 | return JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::lookupGettercxx . . $ QTJSC/JSObject#lookupGetter(c9cd87a849817b6).(exec, propertyName); |
| 163 | } |
| 164 | |
| 165 | JSCcxx . . $ `<built-in>:463:9`!::JSValuecxx . . $ QTJSC/JSValue# GlobalObjectcxx . . $ QScript/GlobalObject#::lookupSettercxx . . $ QScript/GlobalObject#lookupSetter(c9cd87a849817b6).(JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState#* exec, const JSCcxx . . $ `<built-in>:463:9`!::Identifiercxx . . $ QTJSC/Identifier#& propertyName) |
| 166 | { |
| 167 | if (customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.) |
| 168 | return customGlobalObjectcxx . . $ QScript/GlobalObject#customGlobalObject.->lookupSettercxx . . $ QTJSC/JSObject#lookupSetter(c9cd87a849817b6).(exec, propertyName); |
| 169 | return JSCcxx . . $ `<built-in>:463:9`!::JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#::lookupSettercxx . . $ QTJSC/JSObject#lookupSetter(c9cd87a849817b6).(exec, propertyName); |
| 170 | } |
| 171 | |
| 172 | } // namespace QScript |
| 173 | |
| 174 | QT_END_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:149:10`! |