| 1 | /* |
| 2 | * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * |
| 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 | * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of |
| 14 | * its contributors may be used to endorse or promote products derived |
| 15 | * from this software without specific prior written permission. |
| 16 | * |
| 17 | * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
| 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 | * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
| 28 | |
| 29 | #ifndef JSNotAnObject_h |
| 30 | #define JSNotAnObject_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSNotAnObject.h:30:9`! |
| 31 | |
| 32 | #include "JSObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h`/ |
| 33 | |
| 34 | namespace JSCcxx . . $ QTJSC/ { |
| 35 | |
| 36 | class JSNotAnObjectErrorStubcxx . . $ QTJSC/JSNotAnObjectErrorStub# : public JSObjectcxx . . $ QTJSC/JSObject# { |
| 37 | public: |
| 38 | JSNotAnObjectErrorStubcxx . . $ QTJSC/JSNotAnObjectErrorStub#JSNotAnObjectErrorStub(8ab7e31759e06129).(ExecStatecxx . . $ QTJSC/ExecState#* exec, bool isNull) |
| 39 | : JSObjectcxx . . $ QTJSC/JSObject#(exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().notAnObjectErrorStubStructure) |
| 40 | , m_isNullcxx . . $ QTJSC/JSNotAnObjectErrorStub#m_isNull.(isNull) |
| 41 | { |
| 42 | } |
| 43 | |
| 44 | bool isNullcxx . . $ QTJSC/JSNotAnObjectErrorStub#isNull(50ce9a9e25b4a850).() const { return m_isNullcxx . . $ QTJSC/JSNotAnObjectErrorStub#m_isNull.; } |
| 45 | |
| 46 | private: |
| 47 | virtual bool isNotAnObjectErrorStubcxx . . $ QTJSC/JSNotAnObjectErrorStub#isNotAnObjectErrorStub(50ce9a9e25b4a850).() const { return true; } |
| 48 | |
| 49 | bool m_isNullcxx . . $ QTJSC/JSNotAnObjectErrorStub#m_isNull.; |
| 50 | }; |
| 51 | |
| 52 | // This unholy class is used to allow us to avoid multiple exception checks |
| 53 | // in certain SquirrelFish bytecodes -- effectively it just silently consumes |
| 54 | // any operations performed on the result of a failed toObject call. |
| 55 | class JSNotAnObjectcxx . . $ QTJSC/JSNotAnObject# : public JSObjectcxx . . $ QTJSC/JSObject# { |
| 56 | public: |
| 57 | JSNotAnObjectcxx . . $ QTJSC/JSNotAnObject#JSNotAnObject(ae681a3545dd9081).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSNotAnObjectErrorStubcxx . . $ QTJSC/JSNotAnObjectErrorStub#* exception) |
| 58 | : JSObjectcxx . . $ QTJSC/JSObject#(exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().notAnObjectStructure) |
| 59 | , m_exceptioncxx . . $ QTJSC/JSNotAnObject#m_exception.(exception) |
| 60 | { |
| 61 | } |
| 62 | |
| 63 | static PassRefPtrcxx . . $ PassRefPtr#<Structurecxx . . $ QTJSC/Structure#> createStructurecxx . . $ QTJSC/JSNotAnObject#createStructure(da75fbe5e97e240f).(JSValuecxx . . $ QTJSC/JSValue# prototype) |
| 64 | { |
| 65 | return Structure::create(prototype, TypeInfocxx . . $ QTJSC/TypeInfo#TypeInfo(85e540a0e5560fef).(ObjectTypecxx . . $ QTJSC/ObjectType., StructureFlagscxx . . $ QTJSC/JSNotAnObject#StructureFlags.)); |
| 66 | } |
| 67 | |
| 68 | private: |
| 69 | |
| 70 | static const unsigned StructureFlagscxx . . $ QTJSC/JSNotAnObject#StructureFlags. = OverridesGetOwnPropertySlotcxx . . $ QTJSC/OverridesGetOwnPropertySlot. | OverridesMarkChildrencxx . . $ QTJSC/OverridesMarkChildren. | OverridesGetPropertyNamescxx . . $ QTJSC/OverridesGetPropertyNames. | JSObjectcxx . . $ QTJSC/JSObject#::StructureFlagscxx . . $ QTJSC/JSObject#StructureFlags.; |
| 71 | |
| 72 | // JSValue methods |
| 73 | virtual JSValuecxx . . $ QTJSC/JSValue# toPrimitivecxx . . $ QTJSC/JSNotAnObject#toPrimitive(9c1c7f5535dadf1e).(ExecStatecxx . . $ QTJSC/ExecState#*, PreferredPrimitiveTypecxx . . $ QTJSC/PreferredPrimitiveType#) const; |
| 74 | virtual bool getPrimitiveNumbercxx . . $ QTJSC/JSNotAnObject#getPrimitiveNumber(5ae801b0dd2b44e9).(ExecStatecxx . . $ QTJSC/ExecState#*, double& number, JSValuecxx . . $ QTJSC/JSValue#&); |
| 75 | virtual bool toBooleancxx . . $ QTJSC/JSNotAnObject#toBoolean(9608304f86fd7dc).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 76 | virtual double toNumbercxx . . $ QTJSC/JSNotAnObject#toNumber(1fd034e372fd1279).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 77 | virtual UStringcxx . . $ QTJSC/UString# toStringcxx . . $ QTJSC/JSNotAnObject#toString(9c94f5abb1995042).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 78 | virtual JSObjectcxx . . $ QTJSC/JSObject#* toObjectcxx . . $ QTJSC/JSNotAnObject#toObject(8709ed4849a165ab).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 79 | |
| 80 | // Marking |
| 81 | virtual void markChildrencxx . . $ QTJSC/JSNotAnObject#markChildren(bd9cae851d80a865).(MarkStackcxx . . $ QTJSC/MarkStack#&); |
| 82 | |
| 83 | // JSObject methods |
| 84 | virtual bool getOwnPropertySlotcxx . . $ QTJSC/JSNotAnObject#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 85 | virtual bool getOwnPropertySlotcxx . . $ QTJSC/JSNotAnObject#getOwnPropertySlot(d57d1c8d4b24d235).(ExecStatecxx . . $ QTJSC/ExecState#*, unsigned propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 86 | virtual bool getOwnPropertyDescriptorcxx . . $ QTJSC/JSNotAnObject#getOwnPropertyDescriptor(dce4ef7012294c32).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#&, PropertyDescriptorcxx . . $ QTJSC/PropertyDescriptor#&); |
| 87 | |
| 88 | virtual void putcxx . . $ QTJSC/JSNotAnObject#put(dfb3133dafbe9ff4).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, JSValuecxx . . $ QTJSC/JSValue#, PutPropertySlotcxx . . $ QTJSC/PutPropertySlot#&); |
| 89 | virtual void putcxx . . $ QTJSC/JSNotAnObject#put(b1b60585cf3bb95).(ExecStatecxx . . $ QTJSC/ExecState#*, unsigned propertyName, JSValuecxx . . $ QTJSC/JSValue#); |
| 90 | |
| 91 | virtual bool deletePropertycxx . . $ QTJSC/JSNotAnObject#deleteProperty(13154ef9bddc9416).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#& propertyName); |
| 92 | virtual bool deletePropertycxx . . $ QTJSC/JSNotAnObject#deleteProperty(2f8cbeb04562a47b).(ExecStatecxx . . $ QTJSC/ExecState#*, unsigned propertyName); |
| 93 | |
| 94 | virtual void getOwnPropertyNamescxx . . $ QTJSC/JSNotAnObject#getOwnPropertyNames(2f9e3f18de200b4e).(ExecStatecxx . . $ QTJSC/ExecState#*, PropertyNameArraycxx . . $ QTJSC/PropertyNameArray#&, EnumerationModecxx . . $ QTJSC/EnumerationMode# mode = ExcludeDontEnumPropertiescxx . . $ QTJSC/ExcludeDontEnumProperties.); |
| 95 | |
| 96 | JSNotAnObjectErrorStubcxx . . $ QTJSC/JSNotAnObjectErrorStub#* m_exceptioncxx . . $ QTJSC/JSNotAnObject#m_exception.; |
| 97 | }; |
| 98 | |
| 99 | } // namespace JSC |
| 100 | |
| 101 | #endif // JSNotAnObject_h |