| 1 | /* |
| 2 | * Copyright (C) 1999-2001 Harri Porten ([email protected]) |
| 3 | * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Lesser General Public |
| 16 | * License along with this library; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #include "config.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/config.h`/ |
| 22 | #include "StringObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/StringObject.h`/ |
| 23 | |
| 24 | #include "PropertyNameArray.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertyNameArray.h`/ |
| 25 | |
| 26 | namespace JSCcxx . . $ `<built-in>:463:9`! { |
| 27 | |
| 28 | ASSERT_CLASS_FITS_IN_CELLcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h:42:9`!(StringObject); |
| 29 | |
| 30 | const ClassInfocxx . . $ QTJSC/ClassInfo# StringObjectcxx . . $ QTJSC/StringObject#::infocxx . . $ QTJSC/StringObject#info. = { "String", 0, 0, 0 }; |
| 31 | |
| 32 | StringObjectcxx . . $ QTJSC/StringObject#::StringObjectcxx . . $ QTJSC/StringObject#StringObject(aad11863945fc14a).(ExecStatecxx . . $ QTJSC/ExecState#* exec, NonNullPassRefPtrcxx . . $ NonNullPassRefPtr#<Structurecxx . . $ QTJSC/Structure#> structure) |
| 33 | : JSWrapperObjectcxx . . $ QTJSC/JSWrapperObject#(structure) |
| 34 | { |
| 35 | setInternalValuecxx . . $ QTJSC/JSWrapperObject#setInternalValue(5c2ac18db087b3e6).(jsEmptyStringcxx . . $ QTJSC/jsEmptyString(193b2cc77222fd6b).(exec)); |
| 36 | } |
| 37 | |
| 38 | StringObjectcxx . . $ QTJSC/StringObject#::StringObjectcxx . . $ QTJSC/StringObject#StringObject(3c1ce0979548739f).(NonNullPassRefPtrcxx . . $ NonNullPassRefPtr#<Structurecxx . . $ QTJSC/Structure#> structure, JSStringcxx . . $ QTJSC/JSString#* string) |
| 39 | : JSWrapperObjectcxx . . $ QTJSC/JSWrapperObject#(structure) |
| 40 | { |
| 41 | setInternalValuecxx . . $ QTJSC/JSWrapperObject#setInternalValue(5c2ac18db087b3e6).(string); |
| 42 | } |
| 43 | |
| 44 | StringObjectcxx . . $ QTJSC/StringObject#::StringObjectcxx . . $ QTJSC/StringObject#StringObject(17a6c4376bec5d82).(ExecStatecxx . . $ QTJSC/ExecState#* exec, NonNullPassRefPtrcxx . . $ NonNullPassRefPtr#<Structurecxx . . $ QTJSC/Structure#> structure, const UStringcxx . . $ QTJSC/UString#& string) |
| 45 | : JSWrapperObjectcxx . . $ QTJSC/JSWrapperObject#(structure) |
| 46 | { |
| 47 | setInternalValuecxx . . $ QTJSC/JSWrapperObject#setInternalValue(5c2ac18db087b3e6).(jsStringcxx . . $ QTJSC/jsString(edccc873576bddf5).(exec, string)); |
| 48 | } |
| 49 | |
| 50 | bool StringObjectcxx . . $ QTJSC/StringObject#::getOwnPropertySlotcxx . . $ QTJSC/StringObject#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 51 | { |
| 52 | if (internalValuecxx . . $ QTJSC/StringObject#internalValue(c5ea7f10c3c88951).()->getStringPropertySlotcxx . . $ QTJSC/JSString#getStringPropertySlot(6f4ef3dbfe7d5ab9).(exec, propertyName, slot)) |
| 53 | return true; |
| 54 | return JSObjectcxx . . $ QTJSC/JSObject#::getOwnPropertySlotcxx . . $ QTJSC/StringObject#getOwnPropertySlot(d57d1c8d4b24d235).(exec, propertyName, slot); |
| 55 | } |
| 56 | |
| 57 | bool StringObjectcxx . . $ QTJSC/StringObject#::getOwnPropertySlotcxx . . $ QTJSC/StringObject#getOwnPropertySlot(d57d1c8d4b24d235).(ExecStatecxx . . $ QTJSC/ExecState#* exec, unsigned propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 58 | { |
| 59 | if (internalValuecxx . . $ QTJSC/StringObject#internalValue(c5ea7f10c3c88951).()->getStringPropertySlotcxx . . $ QTJSC/JSString#getStringPropertySlot(d57d1c8d4b24d235).(exec, propertyName, slot)) |
| 60 | return true; |
| 61 | return JSObjectcxx . . $ QTJSC/JSObject#::getOwnPropertySlotcxx . . $ QTJSC/StringObject#getOwnPropertySlot(d57d1c8d4b24d235).(exec, Identifiercxx . . $ QTJSC/Identifier#::fromcxx . . $ QTJSC/Identifier#from(d1afedae20629715).(exec, propertyName), slot); |
| 62 | } |
| 63 | |
| 64 | bool StringObjectcxx . . $ QTJSC/StringObject#::getOwnPropertyDescriptorcxx . . $ QTJSC/StringObject#getOwnPropertyDescriptor(dce4ef7012294c32).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertyDescriptorcxx . . $ QTJSC/PropertyDescriptor#& descriptor) |
| 65 | { |
| 66 | if (internalValuecxx . . $ QTJSC/StringObject#internalValue(c5ea7f10c3c88951).()->getStringPropertyDescriptorcxx . . $ QTJSC/JSString#getStringPropertyDescriptor(dce4ef7012294c32).(exec, propertyName, descriptor)) |
| 67 | return true; |
| 68 | return JSObjectcxx . . $ QTJSC/JSObject#::getOwnPropertyDescriptorcxx . . $ QTJSC/JSObject#getOwnPropertyDescriptor(dce4ef7012294c32).(exec, propertyName, descriptor); |
| 69 | } |
| 70 | |
| 71 | void StringObjectcxx . . $ QTJSC/StringObject#::putcxx . . $ QTJSC/StringObject#put(dfb3133dafbe9ff4).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, JSValuecxx . . $ QTJSC/JSValue# value, PutPropertySlotcxx . . $ QTJSC/PutPropertySlot#& slot) |
| 72 | { |
| 73 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().length) |
| 74 | return; |
| 75 | JSObjectcxx . . $ QTJSC/JSObject#::putcxx . . $ QTJSC/StringObject#put(dfb3133dafbe9ff4).(exec, propertyName, value, slot); |
| 76 | } |
| 77 | |
| 78 | bool StringObjectcxx . . $ QTJSC/StringObject#::deletePropertycxx . . $ QTJSC/StringObject#deleteProperty(13154ef9bddc9416).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName) |
| 79 | { |
| 80 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().length) |
| 81 | return false; |
| 82 | bool isStrictUInt32; |
| 83 | unsigned i = propertyName.toStrictUInt32cxx . . $ QTJSC/Identifier#toStrictUInt32(870b63f89c7fb98).(&isStrictUInt32); |
| 84 | if (isStrictUInt32 && internalValuecxx . . $ QTJSC/StringObject#internalValue(c5ea7f10c3c88951).()->canGetIndexcxx . . $ QTJSC/JSString#canGetIndex(dfa6e707f7696010).(i)) |
| 85 | return false; |
| 86 | return JSObjectcxx . . $ QTJSC/JSObject#::deletePropertycxx . . $ QTJSC/StringObject#deleteProperty(13154ef9bddc9416).(exec, propertyName); |
| 87 | } |
| 88 | |
| 89 | void StringObjectcxx . . $ QTJSC/StringObject#::getOwnPropertyNamescxx . . $ QTJSC/StringObject#getOwnPropertyNames(2f9e3f18de200b4e).(ExecStatecxx . . $ QTJSC/ExecState#* exec, PropertyNameArraycxx . . $ QTJSC/PropertyNameArray#& propertyNames, EnumerationModecxx . . $ QTJSC/EnumerationMode# mode) |
| 90 | { |
| 91 | int size = internalValuecxx . . $ QTJSC/StringObject#internalValue(c5ea7f10c3c88951).()->lengthcxx . . $ QTJSC/JSString#length(db52760e79bf9054).(); |
| 92 | for (int i = 0; i < size; ++i) |
| 93 | propertyNames.addcxx . . $ QTJSC/PropertyNameArray#add(d7ed36c5537ed570).(Identifiercxx . . $ QTJSC/Identifier#Identifier(7710b6c66c0f9b39).(exec, UStringcxx . . $ QTJSC/UString#::fromcxx . . $ QTJSC/UString#from(1ed97944dfe079ad).(i))); |
| 94 | if (mode == IncludeDontEnumPropertiescxx . . $ QTJSC/IncludeDontEnumProperties.) |
| 95 | propertyNames.addcxx . . $ QTJSC/PropertyNameArray#add(d7ed36c5537ed570).(exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().length); |
| 96 | return JSObjectcxx . . $ QTJSC/JSObject#::getOwnPropertyNamescxx . . $ QTJSC/JSObject#getOwnPropertyNames(2f9e3f18de200b4e).(exec, propertyNames, mode); |
| 97 | } |
| 98 | |
| 99 | } // namespace JSC |