| 1 | /* |
| 2 | * Copyright (C) 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 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
| 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #include "config.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/config.h`/ |
| 27 | #include "JSONObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSONObject.h`/ |
| 28 | |
| 29 | #include "BooleanObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/BooleanObject.h`/ |
| 30 | #include "Error.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Error.h`/ |
| 31 | #include "ExceptionHelpers.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ExceptionHelpers.h`/ |
| 32 | #include "JSArray.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.h`/ |
| 33 | #include "LiteralParser.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/LiteralParser.h`/ |
| 34 | #include "PropertyNameArray.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertyNameArray.h`/ |
| 35 | #include "StringBuilder.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/StringBuilder.h`/ |
| 36 | #include <wtf/MathExtras.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/MathExtras.h`/ |
| 37 | |
| 38 | namespace JSCcxx . . $ `<built-in>:463:9`! { |
| 39 | |
| 40 | ASSERT_CLASS_FITS_IN_CELLcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h:42:9`!(JSONObject); |
| 41 | |
| 42 | static JSValuecxx . . $ QTJSC/JSValue# JSC_HOST_CALLcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:1060:9`! JSONProtoFuncParsecxx . . $ QTJSC/JSONProtoFuncParse(cac2aec6ecb9506b).(ExecStatecxx . . $ QTJSC/ExecState#*, JSObjectcxx . . $ QTJSC/JSObject#*, JSValuecxx . . $ QTJSC/JSValue#, const ArgListcxx . . $ QTJSC/ArgList#&); |
| 43 | static JSValuecxx . . $ QTJSC/JSValue# JSC_HOST_CALLcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:1060:9`! JSONProtoFuncStringifycxx . . $ QTJSC/JSONProtoFuncStringify(cac2aec6ecb9506b).(ExecStatecxx . . $ QTJSC/ExecState#*, JSObjectcxx . . $ QTJSC/JSObject#*, JSValuecxx . . $ QTJSC/JSValue#, const ArgListcxx . . $ QTJSC/ArgList#&); |
| 44 | |
| 45 | } |
| 46 | |
| 47 | #include "JSONObject.lut.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/generated/JSONObject.lut.h`/ |
| 48 | |
| 49 | namespace JSCcxx . . $ `<built-in>:463:9`! { |
| 50 | |
| 51 | // PropertyNameForFunctionCall objects must be on the stack, since the JSValue that they create is not marked. |
| 52 | class PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall# { |
| 53 | public: |
| 54 | PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#PropertyNameForFunctionCall(d7ed36c5537ed570).(const Identifiercxx . . $ QTJSC/Identifier#&); |
| 55 | PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#PropertyNameForFunctionCall(cb2f890c2fdad230).(unsigned); |
| 56 | |
| 57 | JSValuecxx . . $ QTJSC/JSValue# valuecxx . . $ QTJSC/PropertyNameForFunctionCall#value(3edd4bd77d4e7240).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 58 | |
| 59 | private: |
| 60 | const Identifiercxx . . $ QTJSC/Identifier#* m_identifiercxx . . $ QTJSC/PropertyNameForFunctionCall#m_identifier.; |
| 61 | unsigned m_numbercxx . . $ QTJSC/PropertyNameForFunctionCall#m_number.; |
| 62 | mutable JSValuecxx . . $ QTJSC/JSValue# m_valuecxx . . $ QTJSC/PropertyNameForFunctionCall#m_value.; |
| 63 | }; |
| 64 | |
| 65 | class Stringifiercxx . . $ QTJSC/Stringifier# : public Noncopyablecxx . . $ Noncopyable# { |
| 66 | public: |
| 67 | Stringifiercxx . . $ QTJSC/Stringifier#Stringifier(1417be83fbbea4dc).(ExecStatecxx . . $ QTJSC/ExecState#*, JSValuecxx . . $ QTJSC/JSValue# replacer, JSValuecxx . . $ QTJSC/JSValue# space); |
| 68 | ~cxx . . $ QTJSC/Stringifier#`~Stringifier`(49f6e7a06ebc5aa8).Stringifiercxx . . $ QTJSC/Stringifier#(); |
| 69 | JSValuecxx . . $ QTJSC/JSValue# stringifycxx . . $ QTJSC/Stringifier#stringify(19277d6b13852c07).(JSValuecxx . . $ QTJSC/JSValue#); |
| 70 | |
| 71 | void markAggregatecxx . . $ QTJSC/Stringifier#markAggregate(bd9cae851d80a865).(MarkStackcxx . . $ QTJSC/MarkStack#&); |
| 72 | |
| 73 | private: |
| 74 | class Holdercxx . . $ QTJSC/Stringifier#Holder# { |
| 75 | public: |
| 76 | Holdercxx . . $ QTJSC/Stringifier#Holder#Holder(aa1c69ebc68b9201).(JSObjectcxx . . $ QTJSC/JSObject#*); |
| 77 | |
| 78 | JSObjectcxx . . $ QTJSC/JSObject#* objectcxx . . $ QTJSC/Stringifier#Holder#object(8ac23ea934d7a115).() const { return m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.; } |
| 79 | |
| 80 | bool appendNextPropertycxx . . $ QTJSC/Stringifier#Holder#appendNextProperty(c2d6d425dd2d8d18).(Stringifiercxx . . $ QTJSC/Stringifier#&, StringBuildercxx . . $ QTJSC/StringBuilder#&); |
| 81 | |
| 82 | private: |
| 83 | JSObjectcxx . . $ QTJSC/JSObject#* const m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.; |
| 84 | const bool m_isArraycxx . . $ QTJSC/Stringifier#Holder#m_isArray.; |
| 85 | bool m_isJSArraycxx . . $ QTJSC/Stringifier#Holder#m_isJSArray.; |
| 86 | unsigned m_indexcxx . . $ QTJSC/Stringifier#Holder#m_index.; |
| 87 | unsigned m_sizecxx . . $ QTJSC/Stringifier#Holder#m_size.; |
| 88 | RefPtrcxx . . $ RefPtr#<PropertyNameArrayDatacxx . . $ QTJSC/PropertyNameArrayData#> m_propertyNamescxx . . $ QTJSC/Stringifier#Holder#m_propertyNames.; |
| 89 | }; |
| 90 | |
| 91 | friend class Holder; |
| 92 | |
| 93 | static void appendQuotedStringcxx . . $ QTJSC/Stringifier#appendQuotedString(ecdb6e808080047).(StringBuildercxx . . $ QTJSC/StringBuilder#&, const UStringcxx . . $ QTJSC/UString#&); |
| 94 | |
| 95 | JSValuecxx . . $ QTJSC/JSValue# toJSONcxx . . $ QTJSC/Stringifier#toJSON(f67c13413456183f).(JSValuecxx . . $ QTJSC/JSValue#, const PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#&); |
| 96 | |
| 97 | enum StringifyResultcxx . . $ QTJSC/Stringifier#StringifyResult# { StringifyFailedcxx . . $ QTJSC/Stringifier#StringifyFailed., StringifySucceededcxx . . $ QTJSC/Stringifier#StringifySucceeded., StringifyFailedDueToUndefinedValuecxx . . $ QTJSC/Stringifier#StringifyFailedDueToUndefinedValue. }; |
| 98 | StringifyResultcxx . . $ QTJSC/Stringifier#StringifyResult# appendStringifiedValuecxx . . $ QTJSC/Stringifier#appendStringifiedValue(9b5b34eb4c02141b).(StringBuildercxx . . $ QTJSC/StringBuilder#&, JSValuecxx . . $ QTJSC/JSValue#, JSObjectcxx . . $ QTJSC/JSObject#* holder, const PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#&); |
| 99 | |
| 100 | bool willIndentcxx . . $ QTJSC/Stringifier#willIndent(50ce9a9e25b4a850).() const; |
| 101 | void indentcxx . . $ QTJSC/Stringifier#indent(49f6e7a06ebc5aa8).(); |
| 102 | void unindentcxx . . $ QTJSC/Stringifier#unindent(49f6e7a06ebc5aa8).(); |
| 103 | void startNewLinecxx . . $ QTJSC/Stringifier#startNewLine(d00e6f86d28eaa60).(StringBuildercxx . . $ QTJSC/StringBuilder#&) const; |
| 104 | |
| 105 | Stringifiercxx . . $ QTJSC/Stringifier#* const m_nextStringifierToMarkcxx . . $ QTJSC/Stringifier#m_nextStringifierToMark.; |
| 106 | ExecStatecxx . . $ QTJSC/ExecState#* const m_execcxx . . $ QTJSC/Stringifier#m_exec.; |
| 107 | const JSValuecxx . . $ QTJSC/JSValue# m_replacercxx . . $ QTJSC/Stringifier#m_replacer.; |
| 108 | bool m_usingArrayReplacercxx . . $ QTJSC/Stringifier#m_usingArrayReplacer.; |
| 109 | PropertyNameArraycxx . . $ QTJSC/PropertyNameArray# m_arrayReplacerPropertyNamescxx . . $ QTJSC/Stringifier#m_arrayReplacerPropertyNames.; |
| 110 | CallTypecxx . . $ QTJSC/CallType# m_replacerCallTypecxx . . $ QTJSC/Stringifier#m_replacerCallType.; |
| 111 | CallDatacxx . . $ QTJSC/CallData# m_replacerCallDatacxx . . $ QTJSC/Stringifier#m_replacerCallData.; |
| 112 | const UStringcxx . . $ QTJSC/UString# m_gapcxx . . $ QTJSC/Stringifier#m_gap.; |
| 113 | |
| 114 | HashSet<JSObject*> m_holderCycleDetectorcxx . . $ QTJSC/Stringifier#m_holderCycleDetector.; |
| 115 | Vectorcxx . . $ Vector#<Holdercxx . . $ QTJSC/Stringifier#Holder#, 16> m_holderStackcxx . . $ QTJSC/Stringifier#m_holderStack.; |
| 116 | UStringcxx . . $ QTJSC/UString# m_repeatedGapcxx . . $ QTJSC/Stringifier#m_repeatedGap.; |
| 117 | UStringcxx . . $ QTJSC/UString# m_indentcxx . . $ QTJSC/Stringifier#m_indent.; |
| 118 | }; |
| 119 | |
| 120 | // ------------------------------ helper functions -------------------------------- |
| 121 | |
| 122 | static inline JSValuecxx . . $ QTJSC/JSValue# unwrapBoxedPrimitivecxx . . $ QTJSC/unwrapBoxedPrimitive(3f1194ef29991aa4).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# value) |
| 123 | { |
| 124 | if (!value.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) |
| 125 | return value; |
| 126 | JSObjectcxx . . $ QTJSC/JSObject#* object = asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(value); |
| 127 | if (object->inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(&NumberObjectcxx . . $ QTJSC/NumberObject#::infocxx . . $ QTJSC/NumberObject#info.)) |
| 128 | return jsNumbercxx . . $ QTJSC/jsNumber(88e66938454912cb).(exec, object->toNumbercxx . . $ QTJSC/JSObject#toNumber(1fd034e372fd1279).(exec)); |
| 129 | if (object->inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(&StringObjectcxx . . $ QTJSC/StringObject#::infocxx . . $ QTJSC/StringObject#info.)) |
| 130 | return jsStringcxx . . $ QTJSC/jsString(edccc873576bddf5).(exec, object->toStringcxx . . $ QTJSC/JSObject#toString(9c94f5abb1995042).(exec)); |
| 131 | if (object->inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(&BooleanObjectcxx . . $ QTJSC/BooleanObject#::infocxx . . $ QTJSC/BooleanObject#info.)) |
| 132 | return object->toPrimitivecxx . . $ QTJSC/JSObject#toPrimitive(9c1c7f5535dadf1e).(exec); |
| 133 | return value; |
| 134 | } |
| 135 | |
| 136 | static inline UStringcxx . . $ QTJSC/UString# gapcxx . . $ QTJSC/gap(b4322dc1cea8dfa7).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# space) |
| 137 | { |
| 138 | const int maxGapLength = 10; |
| 139 | space =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). unwrapBoxedPrimitivecxx . . $ QTJSC/unwrapBoxedPrimitive(3f1194ef29991aa4).(exec, space); |
| 140 | |
| 141 | // If the space value is a number, create a gap string with that number of spaces. |
| 142 | double spaceCount; |
| 143 | if (space.getNumbercxx . . $ QTJSC/JSValue#getNumber(c49d02341edf1b7e).(spaceCount)) { |
| 144 | int count; |
| 145 | if (spaceCount > maxGapLength) |
| 146 | count = maxGapLength; |
| 147 | else if (!(spaceCount > 0)) |
| 148 | count = 0; |
| 149 | else |
| 150 | count = static_cast<int>(spaceCount); |
| 151 | UCharcxx . . $ UChar# spaces[maxGapLength]; |
| 152 | for (int i = 0; i < count; ++i) |
| 153 | spaces[i] = ' '; |
| 154 | return UStringcxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d).(spaces, count); |
| 155 | } |
| 156 | |
| 157 | // If the space value is a string, use it as the gap string, otherwise use no gap string. |
| 158 | UStringcxx . . $ QTJSC/UString# spaces = spacecxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d)..getStringcxx . . $ QTJSC/JSValue#getString(9c94f5abb1995042).(exec); |
| 159 | if (spaces.sizecxx . . $ QTJSC/UString#size(455f465bc33b4cdf).() > maxGapLength) { |
| 160 | spaces = spaces.substrcxx . . $ QTJSC/UString#substr(2aae7669e5263855).(0, maxGapLength); |
| 161 | } |
| 162 | return spacescxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d).; |
| 163 | } |
| 164 | |
| 165 | // ------------------------------ PropertyNameForFunctionCall -------------------------------- |
| 166 | |
| 167 | inline PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#::PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#PropertyNameForFunctionCall(d7ed36c5537ed570).(const Identifiercxx . . $ QTJSC/Identifier#& identifier) |
| 168 | : m_identifiercxx . . $ QTJSC/PropertyNameForFunctionCall#m_identifier.(&identifier) |
| 169 | { |
| 170 | } |
| 171 | |
| 172 | inline PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#::PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#PropertyNameForFunctionCall(cb2f890c2fdad230).(unsigned number) |
| 173 | : m_identifiercxx . . $ QTJSC/PropertyNameForFunctionCall#m_identifier.(0) |
| 174 | , m_numbercxx . . $ QTJSC/PropertyNameForFunctionCall#m_number.(number) |
| 175 | { |
| 176 | } |
| 177 | |
| 178 | JSValuecxx . . $ QTJSC/JSValue# PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#::valuecxx . . $ QTJSC/PropertyNameForFunctionCall#value(3edd4bd77d4e7240).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const |
| 179 | { |
| 180 | if (!m_valuecxx . . $ QTJSC/PropertyNameForFunctionCall#m_value.) { |
| 181 | if (m_identifiercxx . . $ QTJSC/PropertyNameForFunctionCall#m_identifier.) |
| 182 | m_valuecxx . . $ QTJSC/PropertyNameForFunctionCall#m_value. = jsStringcxx . . $ QTJSC/jsString(edccc873576bddf5).(exec, m_identifiercxx . . $ QTJSC/PropertyNameForFunctionCall#m_identifier.->ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).()); |
| 183 | else |
| 184 | m_valuecxx . . $ QTJSC/PropertyNameForFunctionCall#m_value. =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). jsNumbercxx . . $ QTJSC/jsNumber(bf7e02f8c8245e31).(exec, m_numbercxx . . $ QTJSC/PropertyNameForFunctionCall#m_number.); |
| 185 | } |
| 186 | return m_valuecxx . . $ QTJSC/PropertyNameForFunctionCall#m_value.; |
| 187 | } |
| 188 | |
| 189 | // ------------------------------ Stringifier -------------------------------- |
| 190 | |
| 191 | Stringifiercxx . . $ QTJSC/Stringifier#::Stringifiercxx . . $ QTJSC/Stringifier#Stringifier(1417be83fbbea4dc).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# replacer, JSValuecxx . . $ QTJSC/JSValue# space) |
| 192 | : m_nextStringifierToMarkcxx . . $ QTJSC/Stringifier#m_nextStringifierToMark.(exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().firstStringifierToMarkcxx . . $ QTJSC/JSGlobalData#firstStringifierToMark.) |
| 193 | , m_execcxx . . $ QTJSC/Stringifier#m_exec.(exec) |
| 194 | , m_replacercxx . . $ QTJSC/Stringifier#m_replacer.(replacer) |
| 195 | , m_usingArrayReplacercxx . . $ QTJSC/Stringifier#m_usingArrayReplacer.(false) |
| 196 | , m_arrayReplacerPropertyNames(exec) |
| 197 | , m_replacerCallTypecxx . . $ QTJSC/Stringifier#m_replacerCallType.(CallTypeNonecxx . . $ QTJSC/CallTypeNone.) |
| 198 | , m_gap(gap(exec, space)) |
| 199 | { |
| 200 | exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().firstStringifierToMarkcxx . . $ QTJSC/JSGlobalData#firstStringifierToMark. = this; |
| 201 | |
| 202 | if (!m_replacercxx . . $ QTJSC/Stringifier#m_replacer..isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) |
| 203 | return; |
| 204 | |
| 205 | if (asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(m_replacercxx . . $ QTJSC/Stringifier#m_replacer.)->inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(&JSArraycxx . . $ QTJSC/JSArray#::infocxx . . $ QTJSC/JSArray#info.)) { |
| 206 | m_usingArrayReplacercxx . . $ QTJSC/Stringifier#m_usingArrayReplacer. = true; |
| 207 | JSObjectcxx . . $ QTJSC/JSObject#* array = asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(m_replacercxx . . $ QTJSC/Stringifier#m_replacer.); |
| 208 | unsigned length = array->getcxx . . $ QTJSC/JSObject#get(2d9c2221088d2593).(exec, exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().propertyNamescxx . . $ QTJSC/JSGlobalData#propertyNames.->length).toUInt32(exec); |
| 209 | for (unsigned i = 0; i < length; ++i) { |
| 210 | JSValuecxx . . $ QTJSC/JSValue# name = array->getcxx . . $ QTJSC/JSObject#get(2d9c2221088d2593).(exec, i); |
| 211 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 212 | break; |
| 213 | |
| 214 | UStringcxx . . $ QTJSC/UString# propertyNamecxx . . $ QTJSC/UString#UString(49f6e7a06ebc5aa8).; |
| 215 | if (name.getStringcxx . . $ QTJSC/JSValue#getString(4ed3c128543e83ef).(exec, propertyName)) { |
| 216 | m_arrayReplacerPropertyNames.add(Identifier(exec, propertyName)); |
| 217 | continue; |
| 218 | } |
| 219 | |
| 220 | double value = 0; |
| 221 | if (name.getNumbercxx . . $ QTJSC/JSValue#getNumber(c49d02341edf1b7e).(value)) { |
| 222 | m_arrayReplacerPropertyNames.add(Identifier::from(exec, value)); |
| 223 | continue; |
| 224 | } |
| 225 | |
| 226 | if (name.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) { |
| 227 | if (!asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(name)->inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(&NumberObjectcxx . . $ QTJSC/NumberObject#::infocxx . . $ QTJSC/NumberObject#info.) && !asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(name)->inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(&StringObjectcxx . . $ QTJSC/StringObject#::infocxx . . $ QTJSC/StringObject#info.)) |
| 228 | continue; |
| 229 | propertyName = name.toStringcxx . . $ QTJSC/JSValue#toString(9c94f5abb1995042).(exec); |
| 230 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 231 | break; |
| 232 | m_arrayReplacerPropertyNames.add(Identifier(exec, propertyName)); |
| 233 | } |
| 234 | } |
| 235 | return; |
| 236 | } |
| 237 | |
| 238 | m_replacerCallTypecxx . . $ QTJSC/Stringifier#m_replacerCallType. = asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(m_replacercxx . . $ QTJSC/Stringifier#m_replacer.)->getCallDatacxx . . $ QTJSC/JSCell#getCallData(9482040cf952d29d).(m_replacerCallDatacxx . . $ QTJSC/Stringifier#m_replacerCallData.); |
| 239 | } |
| 240 | |
| 241 | Stringifiercxx . . $ QTJSC/Stringifier#::~cxx . . $ QTJSC/Stringifier#`~Stringifier`(49f6e7a06ebc5aa8).Stringifiercxx . . $ QTJSC/Stringifier#() |
| 242 | { |
| 243 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_exec->globalData().firstStringifierToMark == this); |
| 244 | m_execcxx . . $ QTJSC/Stringifier#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().firstStringifierToMarkcxx . . $ QTJSC/JSGlobalData#firstStringifierToMark. = m_nextStringifierToMarkcxx . . $ QTJSC/Stringifier#m_nextStringifierToMark.; |
| 245 | } |
| 246 | |
| 247 | void Stringifiercxx . . $ QTJSC/Stringifier#::markAggregatecxx . . $ QTJSC/Stringifier#markAggregate(bd9cae851d80a865).(MarkStackcxx . . $ QTJSC/MarkStack#& markStack) |
| 248 | { |
| 249 | for (Stringifiercxx . . $ QTJSC/Stringifier#* stringifier = this; stringifier; stringifier = stringifier->m_nextStringifierToMarkcxx . . $ QTJSC/Stringifier#m_nextStringifierToMark.) { |
| 250 | size_t size = m_holderStack.size(); |
| 251 | for (size_t i = 0; i < size; ++i) |
| 252 | markStack.appendcxx . . $ QTJSC/MarkStack#append(5c2ac18db087b3e6).(m_holderStack[i].object()); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | JSValuecxx . . $ QTJSC/JSValue# Stringifiercxx . . $ QTJSC/Stringifier#::stringifycxx . . $ QTJSC/Stringifier#stringify(19277d6b13852c07).(JSValuecxx . . $ QTJSC/JSValue# value) |
| 257 | { |
| 258 | JSObjectcxx . . $ QTJSC/JSObject#* object = constructEmptyObjectcxx . . $ QTJSC/constructEmptyObject(dc025d143f56633c).(m_execcxx . . $ QTJSC/Stringifier#m_exec.); |
| 259 | if (m_execcxx . . $ QTJSC/Stringifier#m_exec.->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 260 | return jsNullcxx . . $ QTJSC/jsNull(ad9afe69d7bf6378).(); |
| 261 | |
| 262 | PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall# emptyPropertyName(m_execcxx . . $ QTJSC/Stringifier#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().propertyNamescxx . . $ QTJSC/JSGlobalData#propertyNames.->emptyIdentifier); |
| 263 | object->putDirectcxx . . $ QTJSC/JSObject#putDirect(10adf5710ac333de).(m_execcxx . . $ QTJSC/Stringifier#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().propertyNamescxx . . $ QTJSC/JSGlobalData#propertyNames.->emptyIdentifier, value); |
| 264 | |
| 265 | StringBuildercxx . . $ QTJSC/StringBuilder# result; |
| 266 | if (appendStringifiedValuecxx . . $ QTJSC/Stringifier#appendStringifiedValue(9b5b34eb4c02141b).(result, value, object, emptyPropertyName) != StringifySucceededcxx . . $ QTJSC/Stringifier#StringifySucceeded.) |
| 267 | return jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).(); |
| 268 | if (m_execcxx . . $ QTJSC/Stringifier#m_exec.->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 269 | return jsNullcxx . . $ QTJSC/jsNull(ad9afe69d7bf6378).(); |
| 270 | |
| 271 | return jsStringcxx . . $ QTJSC/jsString(edccc873576bddf5).(m_execcxx . . $ QTJSC/Stringifier#m_exec., result.releasecxx . . $ QTJSC/StringBuilder#release(efe381e3afb22e2c).()); |
| 272 | } |
| 273 | |
| 274 | void Stringifiercxx . . $ QTJSC/Stringifier#::appendQuotedStringcxx . . $ QTJSC/Stringifier#appendQuotedString(ecdb6e808080047).(StringBuildercxx . . $ QTJSC/StringBuilder#& builder, const UStringcxx . . $ QTJSC/UString#& value) |
| 275 | { |
| 276 | int length = value.sizecxx . . $ QTJSC/UString#size(455f465bc33b4cdf).(); |
| 277 | |
| 278 | // String length plus 2 for quote marks plus 8 so we can accomodate a few escaped characters. |
| 279 | builder.reserveCapacitycxx . . $ QTJSC/StringBuilder#reserveCapacity(2c44cd906ae4e829).(builder.sizecxx . . $ QTJSC/StringBuilder#size(fe4d2d262d4164a8).() + length + 2 + 8); |
| 280 | |
| 281 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('"'); |
| 282 | |
| 283 | const UCharcxx . . $ UChar#* data = value.datacxx . . $ QTJSC/UString#data(9865edf6270d80f8).(); |
| 284 | for (int i = 0; i < length; ++i) { |
| 285 | int start = i; |
| 286 | while (i < length && (data[i] > 0x1F && data[i] != '"' && data[i] != '\\')) |
| 287 | ++i; |
| 288 | builder.appendcxx . . $ QTJSC/StringBuilder#append(f45961e8726b3b69).(data + start, i - start); |
| 289 | if (i >= length) |
| 290 | break; |
| 291 | switch (data[i]) { |
| 292 | case '\t': |
| 293 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('\\'); |
| 294 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('t'); |
| 295 | break; |
| 296 | case '\r': |
| 297 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('\\'); |
| 298 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('r'); |
| 299 | break; |
| 300 | case '\n': |
| 301 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('\\'); |
| 302 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('n'); |
| 303 | break; |
| 304 | case '\f': |
| 305 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('\\'); |
| 306 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('f'); |
| 307 | break; |
| 308 | case '\b': |
| 309 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('\\'); |
| 310 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('b'); |
| 311 | break; |
| 312 | case '"': |
| 313 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('\\'); |
| 314 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('"'); |
| 315 | break; |
| 316 | case '\\': |
| 317 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('\\'); |
| 318 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('\\'); |
| 319 | break; |
| 320 | default: |
| 321 | static const char hexDigits[] = "0123456789abcdef"; |
| 322 | UCharcxx . . $ UChar# ch = data[i]; |
| 323 | UCharcxx . . $ UChar# hex[] = { '\\', 'u', |
| 324 | static_cast<UCharcxx . . $ UChar#>(hexDigits[(ch >> 12) & 0xF]), |
| 325 | static_cast<UCharcxx . . $ UChar#>(hexDigits[(ch >> 8) & 0xF]), |
| 326 | static_cast<UCharcxx . . $ UChar#>(hexDigits[(ch >> 4) & 0xF]), |
| 327 | static_cast<UCharcxx . . $ UChar#>(hexDigits[ch & 0xF]) }; |
| 328 | builder.appendcxx . . $ QTJSC/StringBuilder#append(f45961e8726b3b69).(hex, sizeof(hex) / sizeof(UCharcxx . . $ UChar#)); |
| 329 | break; |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('"'); |
| 334 | } |
| 335 | |
| 336 | inline JSValuecxx . . $ QTJSC/JSValue# Stringifiercxx . . $ QTJSC/Stringifier#::toJSONcxx . . $ QTJSC/Stringifier#toJSON(f67c13413456183f).(JSValuecxx . . $ QTJSC/JSValue# value, const PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#& propertyName) |
| 337 | { |
| 338 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!m_exec->hadException()); |
| 339 | if (!value.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).() || !asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(value)->hasPropertycxx . . $ QTJSC/JSObject#hasProperty(7acd47e03afc206f).(m_execcxx . . $ QTJSC/Stringifier#m_exec., m_execcxx . . $ QTJSC/Stringifier#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().propertyNamescxx . . $ QTJSC/JSGlobalData#propertyNames.->toJSON)) |
| 340 | return value; |
| 341 | |
| 342 | JSValuecxx . . $ QTJSC/JSValue# toJSONFunction = asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(value)->getcxx . . $ QTJSC/JSObject#get(2d9c2221088d2593).(m_execcxx . . $ QTJSC/Stringifier#m_exec., m_execcxx . . $ QTJSC/Stringifier#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().propertyNamescxx . . $ QTJSC/JSGlobalData#propertyNames.->toJSON); |
| 343 | if (m_execcxx . . $ QTJSC/Stringifier#m_exec.->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 344 | return jsNullcxx . . $ QTJSC/jsNull(ad9afe69d7bf6378).(); |
| 345 | |
| 346 | if (!toJSONFunction.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) |
| 347 | return value; |
| 348 | |
| 349 | JSObjectcxx . . $ QTJSC/JSObject#* object = asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(toJSONFunction); |
| 350 | CallDatacxx . . $ QTJSC/CallData# callData; |
| 351 | CallTypecxx . . $ QTJSC/CallType# callType = object->getCallDatacxx . . $ QTJSC/JSCell#getCallData(9482040cf952d29d).(callData); |
| 352 | if (callType == CallTypeNonecxx . . $ QTJSC/CallTypeNone.) |
| 353 | return value; |
| 354 | |
| 355 | JSValuecxx . . $ QTJSC/JSValue# list[] = { propertyName.valuecxx . . $ QTJSC/PropertyNameForFunctionCall#value(3edd4bd77d4e7240).(m_execcxx . . $ QTJSC/Stringifier#m_exec.) }; |
| 356 | ArgListcxx . . $ QTJSC/ArgList# argscxx . . $ QTJSC/ArgList#ArgList(2a25fbd84030d9f).(list, sizeof(list) / sizeof(JSValuecxx . . $ QTJSC/JSValue#)); |
| 357 | return callcxx . . $ QTJSC/call(342816bfcb24d530).(m_execcxx . . $ QTJSC/Stringifier#m_exec., object, callType, callData, value, args); |
| 358 | } |
| 359 | |
| 360 | Stringifiercxx . . $ QTJSC/Stringifier#::StringifyResultcxx . . $ QTJSC/Stringifier#StringifyResult# Stringifiercxx . . $ QTJSC/Stringifier#::appendStringifiedValuecxx . . $ QTJSC/Stringifier#appendStringifiedValue(9b5b34eb4c02141b).(StringBuildercxx . . $ QTJSC/StringBuilder#& builder, JSValuecxx . . $ QTJSC/JSValue# value, JSObjectcxx . . $ QTJSC/JSObject#* holder, const PropertyNameForFunctionCallcxx . . $ QTJSC/PropertyNameForFunctionCall#& propertyName) |
| 361 | { |
| 362 | // Call the toJSON function. |
| 363 | value =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). toJSONcxx . . $ QTJSC/Stringifier#toJSON(f67c13413456183f).(value, propertyName); |
| 364 | if (m_execcxx . . $ QTJSC/Stringifier#m_exec.->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 365 | return StringifyFailedcxx . . $ QTJSC/Stringifier#StringifyFailed.; |
| 366 | |
| 367 | // Call the replacer function. |
| 368 | if (m_replacerCallTypecxx . . $ QTJSC/Stringifier#m_replacerCallType. != CallTypeNonecxx . . $ QTJSC/CallTypeNone.) { |
| 369 | JSValuecxx . . $ QTJSC/JSValue# list[] = { propertyName.valuecxx . . $ QTJSC/PropertyNameForFunctionCall#value(3edd4bd77d4e7240).(m_execcxx . . $ QTJSC/Stringifier#m_exec.), value }; |
| 370 | ArgListcxx . . $ QTJSC/ArgList# argscxx . . $ QTJSC/ArgList#ArgList(2a25fbd84030d9f).(list, sizeof(list) / sizeof(JSValuecxx . . $ QTJSC/JSValue#)); |
| 371 | value =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). callcxx . . $ QTJSC/call(342816bfcb24d530).(m_execcxx . . $ QTJSC/Stringifier#m_exec., m_replacercxx . . $ QTJSC/Stringifier#m_replacer., m_replacerCallTypecxx . . $ QTJSC/Stringifier#m_replacerCallType., m_replacerCallDatacxx . . $ QTJSC/Stringifier#m_replacerCallData., holder, args); |
| 372 | if (m_execcxx . . $ QTJSC/Stringifier#m_exec.->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 373 | return StringifyFailedcxx . . $ QTJSC/Stringifier#StringifyFailed.; |
| 374 | } |
| 375 | |
| 376 | if (value.isUndefinedcxx . . $ QTJSC/JSValue#isUndefined(50ce9a9e25b4a850).() && !holder->inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(&JSArraycxx . . $ QTJSC/JSArray#::infocxx . . $ QTJSC/JSArray#info.)) |
| 377 | return StringifyFailedDueToUndefinedValuecxx . . $ QTJSC/Stringifier#StringifyFailedDueToUndefinedValue.; |
| 378 | |
| 379 | if (value.isNullcxx . . $ QTJSC/JSValue#isNull(50ce9a9e25b4a850).()) { |
| 380 | builder.appendcxx . . $ QTJSC/StringBuilder#append(85c52e162fed56f9).("null"); |
| 381 | return StringifySucceededcxx . . $ QTJSC/Stringifier#StringifySucceeded.; |
| 382 | } |
| 383 | |
| 384 | value =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). unwrapBoxedPrimitivecxx . . $ QTJSC/unwrapBoxedPrimitive(3f1194ef29991aa4).(m_execcxx . . $ QTJSC/Stringifier#m_exec., value); |
| 385 | |
| 386 | if (m_execcxx . . $ QTJSC/Stringifier#m_exec.->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 387 | return StringifyFailedcxx . . $ QTJSC/Stringifier#StringifyFailed.; |
| 388 | |
| 389 | if (value.isBooleancxx . . $ QTJSC/JSValue#isBoolean(50ce9a9e25b4a850).()) { |
| 390 | builder.appendcxx . . $ QTJSC/StringBuilder#append(85c52e162fed56f9).(value.getBooleancxx . . $ QTJSC/JSValue#getBoolean(50ce9a9e25b4a850).() ? "true" : "false"); |
| 391 | return StringifySucceededcxx . . $ QTJSC/Stringifier#StringifySucceeded.; |
| 392 | } |
| 393 | |
| 394 | UStringcxx . . $ QTJSC/UString# stringValuecxx . . $ QTJSC/UString#UString(49f6e7a06ebc5aa8).; |
| 395 | if (value.getStringcxx . . $ QTJSC/JSValue#getString(4ed3c128543e83ef).(m_execcxx . . $ QTJSC/Stringifier#m_exec., stringValue)) { |
| 396 | appendQuotedStringcxx . . $ QTJSC/Stringifier#appendQuotedString(ecdb6e808080047).(builder, stringValue); |
| 397 | return StringifySucceededcxx . . $ QTJSC/Stringifier#StringifySucceeded.; |
| 398 | } |
| 399 | |
| 400 | double numericValue; |
| 401 | if (value.getNumbercxx . . $ QTJSC/JSValue#getNumber(c49d02341edf1b7e).(numericValue)) { |
| 402 | if (!stdcxx . . $ std/::isfinite(numericValue)) |
| 403 | builder.appendcxx . . $ QTJSC/StringBuilder#append(85c52e162fed56f9).("null"); |
| 404 | else |
| 405 | builder.appendcxx . . $ QTJSC/StringBuilder#append(e6bad6cb9b63b14d).(UStringcxx . . $ QTJSC/UString#::fromcxx . . $ QTJSC/UString#from(f1fb2f715195f7ba).(numericValue)); |
| 406 | return StringifySucceededcxx . . $ QTJSC/Stringifier#StringifySucceeded.; |
| 407 | } |
| 408 | |
| 409 | if (!value.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) |
| 410 | return StringifyFailedcxx . . $ QTJSC/Stringifier#StringifyFailed.; |
| 411 | |
| 412 | JSObjectcxx . . $ QTJSC/JSObject#* object = asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(value); |
| 413 | |
| 414 | CallDatacxx . . $ QTJSC/CallData# callData; |
| 415 | if (object->getCallDatacxx . . $ QTJSC/JSCell#getCallData(9482040cf952d29d).(callData) !=cxx . . $ QTJSC/`operator!=`(8208a731c2dadbc2). CallTypeNonecxx . . $ QTJSC/CallTypeNone.) { |
| 416 | if (holder->inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(&JSArraycxx . . $ QTJSC/JSArray#::infocxx . . $ QTJSC/JSArray#info.)) { |
| 417 | builder.appendcxx . . $ QTJSC/StringBuilder#append(85c52e162fed56f9).("null"); |
| 418 | return StringifySucceededcxx . . $ QTJSC/Stringifier#StringifySucceeded.; |
| 419 | } |
| 420 | return StringifyFailedDueToUndefinedValuecxx . . $ QTJSC/Stringifier#StringifyFailedDueToUndefinedValue.; |
| 421 | } |
| 422 | |
| 423 | // Handle cycle detection, and put the holder on the stack. |
| 424 | if (!m_holderCycleDetector.add(object).second) { |
| 425 | throwErrorcxx . . $ QTJSC/throwError(c8108d54e75f502b).(m_execcxx . . $ QTJSC/Stringifier#m_exec., TypeErrorcxx . . $ QTJSC/TypeError., "JSON.stringify cannot serialize cyclic structures."); |
| 426 | return StringifyFailedcxx . . $ QTJSC/Stringifier#StringifyFailed.; |
| 427 | } |
| 428 | bool holderStackWasEmpty = m_holderStack.isEmpty(); |
| 429 | m_holderStack.append(object); |
| 430 | if (!holderStackWasEmpty) |
| 431 | return StringifySucceededcxx . . $ QTJSC/Stringifier#StringifySucceeded.; |
| 432 | |
| 433 | // If this is the outermost call, then loop to handle everything on the holder stack. |
| 434 | //TimeoutChecker localTimeoutChecker(*m_exec->globalData().timeoutChecker); |
| 435 | TimeoutCheckercxx . . $ QTJSC/TimeoutChecker# localTimeoutCheckercxx . . $ QTJSC/TimeoutChecker#TimeoutChecker(49f6e7a06ebc5aa8).; |
| 436 | localTimeoutChecker.copyTimeoutValuescxx . . $ QTJSC/TimeoutChecker#copyTimeoutValues(e783c3e081510ca3).(m_execcxx . . $ QTJSC/Stringifier#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().timeoutCheckercxx . . $ QTJSC/JSGlobalData#timeoutChecker.); |
| 437 | localTimeoutChecker.resetcxx . . $ QTJSC/TimeoutChecker#reset(49f6e7a06ebc5aa8).(); |
| 438 | unsigned tickCount = localTimeoutChecker.ticksUntilNextCheckcxx . . $ QTJSC/TimeoutChecker#ticksUntilNextCheck(db52760e79bf9054).(); |
| 439 | do { |
| 440 | while (m_holderStack.last().appendNextProperty(*this, builder)) { |
| 441 | if (m_execcxx . . $ QTJSC/Stringifier#m_exec.->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 442 | return StringifyFailedcxx . . $ QTJSC/Stringifier#StringifyFailed.; |
| 443 | if (!--tickCount) { |
| 444 | if (localTimeoutChecker.didTimeOutcxx . . $ QTJSC/TimeoutChecker#didTimeOut(ba850ce7a5e451d8).(m_execcxx . . $ QTJSC/Stringifier#m_exec.)) { |
| 445 | m_execcxx . . $ QTJSC/Stringifier#m_exec.->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(createInterruptedExecutionExceptioncxx . . $ QTJSC/createInterruptedExecutionException(5f262fe1c647dd02).(&m_execcxx . . $ QTJSC/Stringifier#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).())); |
| 446 | return StringifyFailedcxx . . $ QTJSC/Stringifier#StringifyFailed.; |
| 447 | } |
| 448 | tickCount = localTimeoutChecker.ticksUntilNextCheckcxx . . $ QTJSC/TimeoutChecker#ticksUntilNextCheck(db52760e79bf9054).(); |
| 449 | } |
| 450 | } |
| 451 | m_holderCycleDetector.remove(m_holderStack.last().object()); |
| 452 | m_holderStack.removeLast(); |
| 453 | } while (!m_holderStack.isEmpty()); |
| 454 | return StringifySucceededcxx . . $ QTJSC/Stringifier#StringifySucceeded.; |
| 455 | } |
| 456 | |
| 457 | inline bool Stringifiercxx . . $ QTJSC/Stringifier#::willIndentcxx . . $ QTJSC/Stringifier#willIndent(50ce9a9e25b4a850).() const |
| 458 | { |
| 459 | return !m_gap.isEmpty(); |
| 460 | } |
| 461 | |
| 462 | inline void Stringifiercxx . . $ QTJSC/Stringifier#::indentcxx . . $ QTJSC/Stringifier#indent(49f6e7a06ebc5aa8).() |
| 463 | { |
| 464 | // Use a single shared string, m_repeatedGap, so we don't keep allocating new ones as we indent and unindent. |
| 465 | int newSize = m_indent.size() + m_gap.size(); |
| 466 | if (newSize > m_repeatedGap.size()) |
| 467 | m_repeatedGap = makeString(m_repeatedGap, m_gap); |
| 468 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(newSize <= m_repeatedGap.size()); |
| 469 | m_indent = m_repeatedGap.substr(0, newSize); |
| 470 | } |
| 471 | |
| 472 | inline void Stringifiercxx . . $ QTJSC/Stringifier#::unindentcxx . . $ QTJSC/Stringifier#unindent(49f6e7a06ebc5aa8).() |
| 473 | { |
| 474 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_indent.size() >= m_gap.size()); |
| 475 | m_indent = m_repeatedGap.substr(0, m_indent.size() - m_gap.size()); |
| 476 | } |
| 477 | |
| 478 | inline void Stringifiercxx . . $ QTJSC/Stringifier#::startNewLinecxx . . $ QTJSC/Stringifier#startNewLine(d00e6f86d28eaa60).(StringBuildercxx . . $ QTJSC/StringBuilder#& builder) const |
| 479 | { |
| 480 | if (m_gap.isEmpty()) |
| 481 | return; |
| 482 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('\n'); |
| 483 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).(m_indent); |
| 484 | } |
| 485 | |
| 486 | inline Stringifiercxx . . $ QTJSC/Stringifier#::Holdercxx . . $ QTJSC/Stringifier#Holder#::Holdercxx . . $ QTJSC/Stringifier#Holder#Holder(aa1c69ebc68b9201).(JSObjectcxx . . $ QTJSC/JSObject#* object) |
| 487 | : m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.(object) |
| 488 | , m_isArraycxx . . $ QTJSC/Stringifier#Holder#m_isArray.(object->inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(&JSArraycxx . . $ QTJSC/JSArray#::infocxx . . $ QTJSC/JSArray#info.)) |
| 489 | , m_indexcxx . . $ QTJSC/Stringifier#Holder#m_index.(0) |
| 490 | { |
| 491 | } |
| 492 | |
| 493 | bool Stringifiercxx . . $ QTJSC/Stringifier#::Holdercxx . . $ QTJSC/Stringifier#Holder#::appendNextPropertycxx . . $ QTJSC/Stringifier#Holder#appendNextProperty(c2d6d425dd2d8d18).(Stringifiercxx . . $ QTJSC/Stringifier#& stringifier, StringBuildercxx . . $ QTJSC/StringBuilder#& builder) |
| 494 | { |
| 495 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_index <= m_size); |
| 496 | |
| 497 | ExecStatecxx . . $ QTJSC/ExecState#* exec = stringifier.m_execcxx . . $ QTJSC/Stringifier#m_exec.; |
| 498 | |
| 499 | // First time through, initialize. |
| 500 | if (!m_indexcxx . . $ QTJSC/Stringifier#Holder#m_index.) { |
| 501 | if (m_isArraycxx . . $ QTJSC/Stringifier#Holder#m_isArray.) { |
| 502 | m_isJSArraycxx . . $ QTJSC/Stringifier#Holder#m_isJSArray. = isJSArraycxx . . $ QTJSC/isJSArray(b468e0305807c4ec).(&exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(), m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.); |
| 503 | m_sizecxx . . $ QTJSC/Stringifier#Holder#m_size. = m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.->getcxx . . $ QTJSC/JSObject#get(2d9c2221088d2593).(exec, exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().propertyNamescxx . . $ QTJSC/JSGlobalData#propertyNames.->length).toUInt32(exec); |
| 504 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('['); |
| 505 | } else { |
| 506 | if (stringifier.m_usingArrayReplacercxx . . $ QTJSC/Stringifier#m_usingArrayReplacer.) |
| 507 | m_propertyNames = stringifier.m_arrayReplacerPropertyNames.data(); |
| 508 | else { |
| 509 | PropertyNameArraycxx . . $ QTJSC/PropertyNameArray# objectPropertyNamescxx . . $ QTJSC/PropertyNameArray#PropertyNameArray(d2cb180e190a9680).(exec); |
| 510 | m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.->getOwnPropertyNamescxx . . $ QTJSC/JSObject#getOwnPropertyNames(2f9e3f18de200b4e).(exec, objectPropertyNames); |
| 511 | m_propertyNames = objectPropertyNames.releaseData(); |
| 512 | } |
| 513 | m_size = m_propertyNames->propertyNameVector().size(); |
| 514 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).('{'); |
| 515 | } |
| 516 | stringifier.indentcxx . . $ QTJSC/Stringifier#indent(49f6e7a06ebc5aa8).(); |
| 517 | } |
| 518 | |
| 519 | // Last time through, finish up and return false. |
| 520 | if (m_indexcxx . . $ QTJSC/Stringifier#Holder#m_index. == m_sizecxx . . $ QTJSC/Stringifier#Holder#m_size.) { |
| 521 | stringifier.unindentcxx . . $ QTJSC/Stringifier#unindent(49f6e7a06ebc5aa8).(); |
| 522 | if (m_sizecxx . . $ QTJSC/Stringifier#Holder#m_size. && builder[cxx . . $ QTJSC/StringBuilder#`operator[]`(1c5620de136a898).builder.sizecxx . . $ QTJSC/StringBuilder#size(fe4d2d262d4164a8).() - 1] != '{') |
| 523 | stringifier.startNewLinecxx . . $ QTJSC/Stringifier#startNewLine(d00e6f86d28eaa60).(builder); |
| 524 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).(m_isArraycxx . . $ QTJSC/Stringifier#Holder#m_isArray. ? ']' : '}'); |
| 525 | return false; |
| 526 | } |
| 527 | |
| 528 | // Handle a single element of the array or object. |
| 529 | unsigned index = m_indexcxx . . $ QTJSC/Stringifier#Holder#m_index.++; |
| 530 | unsigned rollBackPoint = 0; |
| 531 | StringifyResultcxx . . $ QTJSC/Stringifier#StringifyResult# stringifyResult; |
| 532 | if (m_isArraycxx . . $ QTJSC/Stringifier#Holder#m_isArray.) { |
| 533 | // Get the value. |
| 534 | JSValuecxx . . $ QTJSC/JSValue# valuecxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).; |
| 535 | if (m_isJSArraycxx . . $ QTJSC/Stringifier#Holder#m_isJSArray. && asArraycxx . . $ QTJSC/asArray(20d153178ba9b269).(m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.)->canGetIndexcxx . . $ QTJSC/JSArray#canGetIndex(dfa6e707f7696010).(index)) |
| 536 | value =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). asArraycxx . . $ QTJSC/asArray(20d153178ba9b269).(m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.)->getIndexcxx . . $ QTJSC/JSArray#getIndex(65de979777e37a3b).(index); |
| 537 | else { |
| 538 | PropertySlotcxx . . $ QTJSC/PropertySlot# slot(m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.); |
| 539 | if (!m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.->getOwnPropertySlotcxx . . $ QTJSC/JSObject#getOwnPropertySlot(d57d1c8d4b24d235).(exec, index, slot)) |
| 540 | slot.setUndefinedcxx . . $ QTJSC/PropertySlot#setUndefined(49f6e7a06ebc5aa8).(); |
| 541 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 542 | return false; |
| 543 | value =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). slot.getValuecxx . . $ QTJSC/PropertySlot#getValue(2d9c2221088d2593).(exec, index); |
| 544 | } |
| 545 | |
| 546 | // Append the separator string. |
| 547 | if (index) |
| 548 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).(','); |
| 549 | stringifier.startNewLinecxx . . $ QTJSC/Stringifier#startNewLine(d00e6f86d28eaa60).(builder); |
| 550 | |
| 551 | // Append the stringified value. |
| 552 | stringifyResult = stringifier.appendStringifiedValuecxx . . $ QTJSC/Stringifier#appendStringifiedValue(9b5b34eb4c02141b).(builder, value, m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object., indexcxx . . $ QTJSC/PropertyNameForFunctionCall#PropertyNameForFunctionCall(cb2f890c2fdad230).); |
| 553 | } else { |
| 554 | // Get the value. |
| 555 | PropertySlotcxx . . $ QTJSC/PropertySlot# slot(m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.); |
| 556 | Identifiercxx . . $ QTJSC/Identifier#& propertyName = m_propertyNames->propertyNameVector()[index]; |
| 557 | if (!m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object.->getOwnPropertySlotcxx . . $ QTJSC/JSObject#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(exec, propertyName, slot)) |
| 558 | return true; |
| 559 | JSValuecxx . . $ QTJSC/JSValue# value = slot.getValuecxx . . $ QTJSC/PropertySlot#getValue(ccadc8db5e9d2977).(exec, propertyName); |
| 560 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 561 | return false; |
| 562 | |
| 563 | rollBackPoint = builder.sizecxx . . $ QTJSC/StringBuilder#size(fe4d2d262d4164a8).(); |
| 564 | |
| 565 | // Append the separator string. |
| 566 | if (builder[cxx . . $ QTJSC/StringBuilder#`operator[]`(1c5620de136a898).rollBackPoint - 1] != '{') |
| 567 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).(','); |
| 568 | stringifier.startNewLinecxx . . $ QTJSC/Stringifier#startNewLine(d00e6f86d28eaa60).(builder); |
| 569 | |
| 570 | // Append the property name. |
| 571 | appendQuotedStringcxx . . $ QTJSC/Stringifier#appendQuotedString(ecdb6e808080047).(builder, propertyName.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).()); |
| 572 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).(':'); |
| 573 | if (stringifier.willIndentcxx . . $ QTJSC/Stringifier#willIndent(50ce9a9e25b4a850).()) |
| 574 | builder.appendcxx . . $ QTJSC/StringBuilder#append(ed53e3bbd3fa2f69).(' '); |
| 575 | |
| 576 | // Append the stringified value. |
| 577 | stringifyResult = stringifier.appendStringifiedValuecxx . . $ QTJSC/Stringifier#appendStringifiedValue(9b5b34eb4c02141b).(builder, value, m_objectcxx . . $ QTJSC/Stringifier#Holder#m_object., propertyName); |
| 578 | } |
| 579 | |
| 580 | // From this point on, no access to the this pointer or to any members, because the |
| 581 | // Holder object may have moved if the call to stringify pushed a new Holder onto |
| 582 | // m_holderStack. |
| 583 | |
| 584 | switch (stringifyResult) { |
| 585 | case StringifyFailedcxx . . $ QTJSC/Stringifier#StringifyFailed.: |
| 586 | builder.appendcxx . . $ QTJSC/StringBuilder#append(85c52e162fed56f9).("null"); |
| 587 | break; |
| 588 | case StringifySucceededcxx . . $ QTJSC/Stringifier#StringifySucceeded.: |
| 589 | break; |
| 590 | case StringifyFailedDueToUndefinedValuecxx . . $ QTJSC/Stringifier#StringifyFailedDueToUndefinedValue.: |
| 591 | // This only occurs when get an undefined value for an object property. |
| 592 | // In this case we don't want the separator and property name that we |
| 593 | // already appended, so roll back. |
| 594 | builder.resizecxx . . $ QTJSC/StringBuilder#resize(2c44cd906ae4e829).(rollBackPoint); |
| 595 | break; |
| 596 | } |
| 597 | |
| 598 | return true; |
| 599 | } |
| 600 | |
| 601 | // ------------------------------ JSONObject -------------------------------- |
| 602 | |
| 603 | const ClassInfocxx . . $ QTJSC/ClassInfo# JSONObjectcxx . . $ QTJSC/JSONObject#::infocxx . . $ QTJSC/JSONObject#info. = { "JSON", 0, 0, ExecStatecxx . . $ QTJSC/ExecState#::jsonTablecxx . . $ QTJSC/ExecState#jsonTable(3f6af30e59383ee). }; |
| 604 | |
| 605 | /* Source for JSONObject.lut.h |
| 606 | @begin jsonTable |
| 607 | parse JSONProtoFuncParse DontEnum|Function 1 |
| 608 | stringify JSONProtoFuncStringify DontEnum|Function 1 |
| 609 | @end |
| 610 | */ |
| 611 | |
| 612 | // ECMA 15.8 |
| 613 | |
| 614 | bool JSONObjectcxx . . $ QTJSC/JSONObject#::getOwnPropertySlotcxx . . $ QTJSC/JSONObject#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 615 | { |
| 616 | return getStaticFunctionSlotcxx . . $ QTJSC/getStaticFunctionSlot(98ddb1a8b0302336).<JSObjectcxx . . $ QTJSC/JSObject#>(exec, ExecStatecxx . . $ QTJSC/ExecState#::jsonTablecxx . . $ QTJSC/ExecState#jsonTable(3f6af30e59383ee).(exec), this, propertyName, slot); |
| 617 | } |
| 618 | |
| 619 | bool JSONObjectcxx . . $ QTJSC/JSONObject#::getOwnPropertyDescriptorcxx . . $ QTJSC/JSONObject#getOwnPropertyDescriptor(dce4ef7012294c32).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertyDescriptorcxx . . $ QTJSC/PropertyDescriptor#& descriptor) |
| 620 | { |
| 621 | return getStaticFunctionDescriptorcxx . . $ QTJSC/getStaticFunctionDescriptor(e0f361285c53e82f).<JSObjectcxx . . $ QTJSC/JSObject#>(exec, ExecStatecxx . . $ QTJSC/ExecState#::jsonTablecxx . . $ QTJSC/ExecState#jsonTable(3f6af30e59383ee).(exec), this, propertyName, descriptor); |
| 622 | } |
| 623 | |
| 624 | void JSONObjectcxx . . $ QTJSC/JSONObject#::markStringifierscxx . . $ QTJSC/JSONObject#markStringifiers(bb0bcf4103e0fa9f).(MarkStackcxx . . $ QTJSC/MarkStack#& markStack, Stringifiercxx . . $ QTJSC/Stringifier#* stringifier) |
| 625 | { |
| 626 | stringifier->markAggregatecxx . . $ QTJSC/Stringifier#markAggregate(bd9cae851d80a865).(markStack); |
| 627 | } |
| 628 | |
| 629 | class Walkercxx . . $ QTJSC/Walker# { |
| 630 | public: |
| 631 | Walkercxx . . $ QTJSC/Walker#Walker(13f98222cf80e8b9).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSObjectcxx . . $ QTJSC/JSObject#* function, CallTypecxx . . $ QTJSC/CallType# callType, CallDatacxx . . $ QTJSC/CallData# callData) |
| 632 | : m_execcxx . . $ QTJSC/Walker#m_exec.(exec) |
| 633 | , m_functioncxx . . $ QTJSC/Walker#m_function.(function) |
| 634 | , m_callTypecxx . . $ QTJSC/Walker#m_callType.(callType) |
| 635 | , m_callDatacxx . . $ QTJSC/Walker#m_callData.(callData) |
| 636 | { |
| 637 | } |
| 638 | JSValuecxx . . $ QTJSC/JSValue# walkcxx . . $ QTJSC/Walker#walk(19277d6b13852c07).(JSValuecxx . . $ QTJSC/JSValue# unfiltered); |
| 639 | private: |
| 640 | JSValuecxx . . $ QTJSC/JSValue# callRevivercxx . . $ QTJSC/Walker#callReviver(24212414b4c9f408).(JSObjectcxx . . $ QTJSC/JSObject#* thisObj, JSValuecxx . . $ QTJSC/JSValue# property, JSValuecxx . . $ QTJSC/JSValue# unfiltered) |
| 641 | { |
| 642 | JSValuecxx . . $ QTJSC/JSValue# args[] = { property, unfiltered }; |
| 643 | ArgListcxx . . $ QTJSC/ArgList# argListcxx . . $ QTJSC/ArgList#ArgList(2a25fbd84030d9f).(args, 2); |
| 644 | return callcxx . . $ QTJSC/call(342816bfcb24d530).(m_execcxx . . $ QTJSC/Walker#m_exec., m_functioncxx . . $ QTJSC/Walker#m_function., m_callTypecxx . . $ QTJSC/Walker#m_callType., m_callDatacxx . . $ QTJSC/Walker#m_callData., thisObj, argList); |
| 645 | } |
| 646 | |
| 647 | friend class Holdercxx . . $ QTJSC/Holder#; |
| 648 | |
| 649 | ExecStatecxx . . $ QTJSC/ExecState#* m_execcxx . . $ QTJSC/Walker#m_exec.; |
| 650 | JSObjectcxx . . $ QTJSC/JSObject#* m_functioncxx . . $ QTJSC/Walker#m_function.; |
| 651 | CallTypecxx . . $ QTJSC/CallType# m_callTypecxx . . $ QTJSC/Walker#m_callType.; |
| 652 | CallDatacxx . . $ QTJSC/CallData# m_callDatacxx . . $ QTJSC/Walker#m_callData.; |
| 653 | }; |
| 654 | |
| 655 | // We clamp recursion well beyond anything reasonable, but we also have a timeout check |
| 656 | // to guard against "infinite" execution by inserting arbitrarily large objects. |
| 657 | static const unsigned maximumFilterRecursioncxx . . $ QTJSC/maximumFilterRecursion. = 40000; |
| 658 | enum WalkerStatecxx . . $ QTJSC/WalkerState# { StateUnknowncxx . . $ QTJSC/StateUnknown., ArrayStartStatecxx . . $ QTJSC/ArrayStartState., ArrayStartVisitMembercxx . . $ QTJSC/ArrayStartVisitMember., ArrayEndVisitMembercxx . . $ QTJSC/ArrayEndVisitMember., |
| 659 | ObjectStartStatecxx . . $ QTJSC/ObjectStartState., ObjectStartVisitMembercxx . . $ QTJSC/ObjectStartVisitMember., ObjectEndVisitMembercxx . . $ QTJSC/ObjectEndVisitMember. }; |
| 660 | NEVER_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:35:9`! JSValuecxx . . $ QTJSC/JSValue# Walkercxx . . $ QTJSC/Walker#::walkcxx . . $ QTJSC/Walker#walk(19277d6b13852c07).(JSValuecxx . . $ QTJSC/JSValue# unfiltered) |
| 661 | { |
| 662 | Vectorcxx . . $ Vector#<PropertyNameArraycxx . . $ QTJSC/PropertyNameArray#, 16> propertyStack; |
| 663 | Vectorcxx . . $ Vector#<uint32_tcxx . . $ uint32_t#, 16> indexStack; |
| 664 | Vectorcxx . . $ Vector#<JSObjectcxx . . $ QTJSC/JSObject#*, 16> objectStack; |
| 665 | Vectorcxx . . $ Vector#<JSArraycxx . . $ QTJSC/JSArray#*, 16> arrayStack; |
| 666 | |
| 667 | Vectorcxx . . $ Vector#<WalkerStatecxx . . $ QTJSC/WalkerState#, 16> stateStack; |
| 668 | WalkerStatecxx . . $ QTJSC/WalkerState# state = StateUnknowncxx . . $ QTJSC/StateUnknown.; |
| 669 | JSValuecxx . . $ QTJSC/JSValue# inValue = unfiltered; |
| 670 | JSValuecxx . . $ QTJSC/JSValue# outValue = jsNullcxx . . $ QTJSC/jsNull(ad9afe69d7bf6378).(); |
| 671 | |
| 672 | TimeoutCheckercxx . . $ QTJSC/TimeoutChecker# localTimeoutCheckercxx . . $ QTJSC/TimeoutChecker#TimeoutChecker(49f6e7a06ebc5aa8).; |
| 673 | localTimeoutChecker.copyTimeoutValuescxx . . $ QTJSC/TimeoutChecker#copyTimeoutValues(e783c3e081510ca3).(m_execcxx . . $ QTJSC/Walker#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().timeoutCheckercxx . . $ QTJSC/JSGlobalData#timeoutChecker.); |
| 674 | localTimeoutChecker.resetcxx . . $ QTJSC/TimeoutChecker#reset(49f6e7a06ebc5aa8).(); |
| 675 | unsigned tickCount = localTimeoutChecker.ticksUntilNextCheckcxx . . $ QTJSC/TimeoutChecker#ticksUntilNextCheck(db52760e79bf9054).(); |
| 676 | while (1) { |
| 677 | switch (state) { |
| 678 | arrayStartState: |
| 679 | case ArrayStartStatecxx . . $ QTJSC/ArrayStartState.: { |
| 680 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(inValue.isObject()); |
| 681 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(isJSArray(&m_exec->globalData(), asObject(inValue)) || asObject(inValue)->inherits(&JSArray::info)); |
| 682 | if (objectStack.size() +cxx . . $ operator+(f3789794639247d3). arrayStack.size() >cxx . . $ QTJSC/`operator>`(11610d830df66bbf). maximumFilterRecursioncxx . . $ QTJSC/maximumFilterRecursion.) { |
| 683 | m_execcxx . . $ QTJSC/Walker#m_exec.->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(createStackOverflowErrorcxx . . $ QTJSC/createStackOverflowError(3fbe51058e39576a).(m_execcxx . . $ QTJSC/Walker#m_exec.)); |
| 684 | return jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).(); |
| 685 | } |
| 686 | |
| 687 | JSArraycxx . . $ QTJSC/JSArray#* array = asArraycxx . . $ QTJSC/asArray(20d153178ba9b269).(inValue); |
| 688 | arrayStack.append(array); |
| 689 | indexStack.append(0); |
| 690 | // fallthrough |
| 691 | } |
| 692 | arrayStartVisitMember: |
| 693 | case ArrayStartVisitMembercxx . . $ QTJSC/ArrayStartVisitMember.: { |
| 694 | if (!--tickCount) { |
| 695 | if (localTimeoutChecker.didTimeOutcxx . . $ QTJSC/TimeoutChecker#didTimeOut(ba850ce7a5e451d8).(m_execcxx . . $ QTJSC/Walker#m_exec.)) { |
| 696 | m_execcxx . . $ QTJSC/Walker#m_exec.->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(createInterruptedExecutionExceptioncxx . . $ QTJSC/createInterruptedExecutionException(5f262fe1c647dd02).(&m_execcxx . . $ QTJSC/Walker#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).())); |
| 697 | return jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).(); |
| 698 | } |
| 699 | tickCount = localTimeoutChecker.ticksUntilNextCheckcxx . . $ QTJSC/TimeoutChecker#ticksUntilNextCheck(db52760e79bf9054).(); |
| 700 | } |
| 701 | |
| 702 | JSArraycxx . . $ QTJSC/JSArray#* array = arrayStack.last(); |
| 703 | uint32_tcxx . . $ uint32_t# index = indexStack.last(); |
| 704 | if (index == array->lengthcxx . . $ QTJSC/JSArray#length(ddd8539a2fcdd4ce).()) { |
| 705 | outValue = array; |
| 706 | arrayStack.removeLast(); |
| 707 | indexStack.removeLast(); |
| 708 | break; |
| 709 | } |
| 710 | if (isJSArraycxx . . $ QTJSC/isJSArray(b468e0305807c4ec).(&m_execcxx . . $ QTJSC/Walker#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(), array) && array->canGetIndexcxx . . $ QTJSC/JSArray#canGetIndex(dfa6e707f7696010).(index)) |
| 711 | inValue =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). array->getIndexcxx . . $ QTJSC/JSArray#getIndex(65de979777e37a3b).(index); |
| 712 | else { |
| 713 | PropertySlotcxx . . $ QTJSC/PropertySlot# slotcxx . . $ QTJSC/PropertySlot#PropertySlot(49f6e7a06ebc5aa8).; |
| 714 | if (array->getOwnPropertySlotcxx . . $ QTJSC/JSArray#getOwnPropertySlot(d57d1c8d4b24d235).(m_execcxx . . $ QTJSC/Walker#m_exec., index, slot)) |
| 715 | inValue =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). slot.getValuecxx . . $ QTJSC/PropertySlot#getValue(2d9c2221088d2593).(m_execcxx . . $ QTJSC/Walker#m_exec., index); |
| 716 | else |
| 717 | inValue =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).(); |
| 718 | } |
| 719 | |
| 720 | if (inValue.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) { |
| 721 | stateStack.append(ArrayEndVisitMembercxx . . $ QTJSC/ArrayEndVisitMember.); |
| 722 | goto stateUnknown; |
| 723 | } else |
| 724 | outValue =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). inValue; |
| 725 | // fallthrough |
| 726 | } |
| 727 | case ArrayEndVisitMembercxx . . $ QTJSC/ArrayEndVisitMember.: { |
| 728 | JSArraycxx . . $ QTJSC/JSArray#* array = arrayStack.last(); |
| 729 | JSValuecxx . . $ QTJSC/JSValue# filteredValue = callRevivercxx . . $ QTJSC/Walker#callReviver(24212414b4c9f408).(array, jsStringcxx . . $ QTJSC/jsString(cd57c96e3da4d8c2).(m_execcxx . . $ QTJSC/Walker#m_exec., UStringcxx . . $ QTJSC/UString#::fromcxx . . $ QTJSC/UString#from(1ed97944dfe079ad).(indexStack.last())), outValue); |
| 730 | if (filteredValue.isUndefinedcxx . . $ QTJSC/JSValue#isUndefined(50ce9a9e25b4a850).()) |
| 731 | array->deletePropertycxx . . $ QTJSC/JSArray#deleteProperty(2f8cbeb04562a47b).(m_execcxx . . $ QTJSC/Walker#m_exec., indexStack.last()); |
| 732 | else { |
| 733 | if (isJSArraycxx . . $ QTJSC/isJSArray(b468e0305807c4ec).(&m_execcxx . . $ QTJSC/Walker#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(), array) && array->canSetIndexcxx . . $ QTJSC/JSArray#canSetIndex(dfa6e707f7696010).(indexStack.last())) |
| 734 | array->setIndexcxx . . $ QTJSC/JSArray#setIndex(862010b52dad24bc).(indexStack.last(), filteredValue); |
| 735 | else |
| 736 | array->putcxx . . $ QTJSC/JSArray#put(dfb3133dafbe9ff4).(m_execcxx . . $ QTJSC/Walker#m_exec., indexStack.last(), filteredValue); |
| 737 | } |
| 738 | if (m_execcxx . . $ QTJSC/Walker#m_exec.->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 739 | return jsNullcxx . . $ QTJSC/jsNull(ad9afe69d7bf6378).(); |
| 740 | indexStack.last()++; |
| 741 | goto arrayStartVisitMember; |
| 742 | } |
| 743 | objectStartState: |
| 744 | case ObjectStartStatecxx . . $ QTJSC/ObjectStartState.: { |
| 745 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(inValue.isObject()); |
| 746 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!isJSArray(&m_exec->globalData(), asObject(inValue)) && !asObject(inValue)->inherits(&JSArray::info)); |
| 747 | if (objectStack.size() +cxx . . $ operator+(f3789794639247d3). arrayStack.size() >cxx . . $ QTJSC/`operator>`(11610d830df66bbf). maximumFilterRecursioncxx . . $ QTJSC/maximumFilterRecursion.) { |
| 748 | m_execcxx . . $ QTJSC/Walker#m_exec.->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(createStackOverflowErrorcxx . . $ QTJSC/createStackOverflowError(3fbe51058e39576a).(m_execcxx . . $ QTJSC/Walker#m_exec.)); |
| 749 | return jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).(); |
| 750 | } |
| 751 | |
| 752 | JSObjectcxx . . $ QTJSC/JSObject#* object = asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(inValue); |
| 753 | objectStack.append(object); |
| 754 | indexStack.append(0); |
| 755 | propertyStack.append(PropertyNameArraycxx . . $ QTJSC/PropertyNameArray#(m_execcxx . . $ QTJSC/Walker#m_exec.)); |
| 756 | object->getOwnPropertyNamescxx . . $ QTJSC/JSObject#getOwnPropertyNames(2f9e3f18de200b4e).(m_execcxx . . $ QTJSC/Walker#m_exec., propertyStack.last()); |
| 757 | // fallthrough |
| 758 | } |
| 759 | objectStartVisitMember: |
| 760 | case ObjectStartVisitMembercxx . . $ QTJSC/ObjectStartVisitMember.: { |
| 761 | if (!--tickCount) { |
| 762 | if (localTimeoutChecker.didTimeOutcxx . . $ QTJSC/TimeoutChecker#didTimeOut(ba850ce7a5e451d8).(m_execcxx . . $ QTJSC/Walker#m_exec.)) { |
| 763 | m_execcxx . . $ QTJSC/Walker#m_exec.->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(createInterruptedExecutionExceptioncxx . . $ QTJSC/createInterruptedExecutionException(5f262fe1c647dd02).(&m_execcxx . . $ QTJSC/Walker#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).())); |
| 764 | return jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).(); |
| 765 | } |
| 766 | tickCount = localTimeoutChecker.ticksUntilNextCheckcxx . . $ QTJSC/TimeoutChecker#ticksUntilNextCheck(db52760e79bf9054).(); |
| 767 | } |
| 768 | |
| 769 | JSObjectcxx . . $ QTJSC/JSObject#* object = objectStack.last(); |
| 770 | uint32_tcxx . . $ uint32_t# index = indexStack.last(); |
| 771 | PropertyNameArraycxx . . $ QTJSC/PropertyNameArray#& properties = propertyStack.last(); |
| 772 | if (index == properties.sizecxx . . $ QTJSC/PropertyNameArray#size(fe4d2d262d4164a8).()) { |
| 773 | outValue = object; |
| 774 | objectStack.removeLast(); |
| 775 | indexStack.removeLast(); |
| 776 | propertyStack.removeLast(); |
| 777 | break; |
| 778 | } |
| 779 | PropertySlotcxx . . $ QTJSC/PropertySlot# slotcxx . . $ QTJSC/PropertySlot#PropertySlot(49f6e7a06ebc5aa8).; |
| 780 | if (object->getOwnPropertySlotcxx . . $ QTJSC/JSObject#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(m_execcxx . . $ QTJSC/Walker#m_exec., properties[cxx . . $ QTJSC/PropertyNameArray#`operator[]`(25c60255f7bdf682).index], slot)) |
| 781 | inValue =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). slot.getValuecxx . . $ QTJSC/PropertySlot#getValue(ccadc8db5e9d2977).(m_execcxx . . $ QTJSC/Walker#m_exec., properties[cxx . . $ QTJSC/PropertyNameArray#`operator[]`(25c60255f7bdf682).index]); |
| 782 | else |
| 783 | inValue =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).(); |
| 784 | |
| 785 | // The holder may be modified by the reviver function so any lookup may throw |
| 786 | if (m_execcxx . . $ QTJSC/Walker#m_exec.->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 787 | return jsNullcxx . . $ QTJSC/jsNull(ad9afe69d7bf6378).(); |
| 788 | |
| 789 | if (inValue.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) { |
| 790 | stateStack.append(ObjectEndVisitMembercxx . . $ QTJSC/ObjectEndVisitMember.); |
| 791 | goto stateUnknown; |
| 792 | } else |
| 793 | outValue =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). inValue; |
| 794 | // fallthrough |
| 795 | } |
| 796 | case ObjectEndVisitMembercxx . . $ QTJSC/ObjectEndVisitMember.: { |
| 797 | JSObjectcxx . . $ QTJSC/JSObject#* object = objectStack.last(); |
| 798 | Identifiercxx . . $ QTJSC/Identifier# prop = propertyStack.last()[indexStack.last()]; |
| 799 | PutPropertySlotcxx . . $ QTJSC/PutPropertySlot# slotcxx . . $ QTJSC/PutPropertySlot#PutPropertySlot(49f6e7a06ebc5aa8).; |
| 800 | JSValuecxx . . $ QTJSC/JSValue# filteredValue = callRevivercxx . . $ QTJSC/Walker#callReviver(24212414b4c9f408).(object, jsStringcxx . . $ QTJSC/jsString(edccc873576bddf5).(m_execcxx . . $ QTJSC/Walker#m_exec., prop.ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).()), outValue); |
| 801 | if (filteredValue.isUndefinedcxx . . $ QTJSC/JSValue#isUndefined(50ce9a9e25b4a850).()) |
| 802 | object->deletePropertycxx . . $ QTJSC/JSObject#deleteProperty(13154ef9bddc9416).(m_execcxx . . $ QTJSC/Walker#m_exec., prop); |
| 803 | else |
| 804 | object->putcxx . . $ QTJSC/JSObject#put(dfb3133dafbe9ff4).(m_execcxx . . $ QTJSC/Walker#m_exec., prop, filteredValue, slot); |
| 805 | if (m_execcxx . . $ QTJSC/Walker#m_exec.->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 806 | return jsNullcxx . . $ QTJSC/jsNull(ad9afe69d7bf6378).(); |
| 807 | indexStack.last()++; |
| 808 | goto objectStartVisitMember; |
| 809 | } |
| 810 | stateUnknown: |
| 811 | case StateUnknowncxx . . $ QTJSC/StateUnknown.: |
| 812 | if (!inValue.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) { |
| 813 | outValue =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). inValue; |
| 814 | break; |
| 815 | } |
| 816 | JSObjectcxx . . $ QTJSC/JSObject#* object = asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(inValue); |
| 817 | if (isJSArraycxx . . $ QTJSC/isJSArray(b468e0305807c4ec).(&m_execcxx . . $ QTJSC/Walker#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(), object) || object->inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(&JSArraycxx . . $ QTJSC/JSArray#::infocxx . . $ QTJSC/JSArray#info.)) |
| 818 | goto arrayStartState; |
| 819 | goto objectStartState; |
| 820 | } |
| 821 | if (stateStack.isEmpty()) |
| 822 | break; |
| 823 | |
| 824 | state = stateStack.last(); |
| 825 | stateStack.removeLast(); |
| 826 | |
| 827 | if (!--tickCount) { |
| 828 | if (localTimeoutChecker.didTimeOutcxx . . $ QTJSC/TimeoutChecker#didTimeOut(ba850ce7a5e451d8).(m_execcxx . . $ QTJSC/Walker#m_exec.)) { |
| 829 | m_execcxx . . $ QTJSC/Walker#m_exec.->setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(createInterruptedExecutionExceptioncxx . . $ QTJSC/createInterruptedExecutionException(5f262fe1c647dd02).(&m_execcxx . . $ QTJSC/Walker#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).())); |
| 830 | return jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).(); |
| 831 | } |
| 832 | tickCount = localTimeoutChecker.ticksUntilNextCheckcxx . . $ QTJSC/TimeoutChecker#ticksUntilNextCheck(db52760e79bf9054).(); |
| 833 | } |
| 834 | } |
| 835 | JSObjectcxx . . $ QTJSC/JSObject#* finalHolder = constructEmptyObjectcxx . . $ QTJSC/constructEmptyObject(dc025d143f56633c).(m_execcxx . . $ QTJSC/Walker#m_exec.); |
| 836 | PutPropertySlotcxx . . $ QTJSC/PutPropertySlot# slotcxx . . $ QTJSC/PutPropertySlot#PutPropertySlot(49f6e7a06ebc5aa8).; |
| 837 | finalHolder->putcxx . . $ QTJSC/JSObject#put(b1b60585cf3bb95).(m_execcxx . . $ QTJSC/Walker#m_exec., m_execcxx . . $ QTJSC/Walker#m_exec.->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().propertyNamescxx . . $ QTJSC/JSGlobalData#propertyNames.->emptyIdentifier, outValue, slot); |
| 838 | return callRevivercxx . . $ QTJSC/Walker#callReviver(24212414b4c9f408).(finalHolder, jsEmptyStringcxx . . $ QTJSC/jsEmptyString(193b2cc77222fd6b).(m_execcxx . . $ QTJSC/Walker#m_exec.), outValue); |
| 839 | } |
| 840 | |
| 841 | // ECMA-262 v5 15.12.2 |
| 842 | JSValuecxx . . $ QTJSC/JSValue# JSC_HOST_CALLcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:1060:9`! JSONProtoFuncParsecxx . . $ QTJSC/JSONProtoFuncParse(cac2aec6ecb9506b).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSObjectcxx . . $ QTJSC/JSObject#*, JSValuecxx . . $ QTJSC/JSValue#, const ArgListcxx . . $ QTJSC/ArgList#& args) |
| 843 | { |
| 844 | if (args.isEmptycxx . . $ QTJSC/ArgList#isEmpty(50ce9a9e25b4a850).()) |
| 845 | return throwErrorcxx . . $ QTJSC/throwError(c8108d54e75f502b).(exec, GeneralErrorcxx . . $ QTJSC/GeneralError., "JSON.parse requires at least one parameter"); |
| 846 | JSValuecxx . . $ QTJSC/JSValue# value = args.atcxx . . $ QTJSC/ArgList#at(e9dec2041b7a6b55).(0); |
| 847 | UStringcxx . . $ QTJSC/UString# source = valuecxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d)..toStringcxx . . $ QTJSC/JSValue#toString(9c94f5abb1995042).(exec); |
| 848 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 849 | return jsNullcxx . . $ QTJSC/jsNull(ad9afe69d7bf6378).(); |
| 850 | |
| 851 | LiteralParsercxx . . $ QTJSC/LiteralParser# jsonParsercxx . . $ QTJSC/LiteralParser#LiteralParser(6152e55db68c6).(exec, source, LiteralParsercxx . . $ QTJSC/LiteralParser#::StrictJSONcxx . . $ QTJSC/LiteralParser#StrictJSON.); |
| 852 | JSValuecxx . . $ QTJSC/JSValue# unfiltered = jsonParser.tryLiteralParsecxx . . $ QTJSC/LiteralParser#tryLiteralParse(ad9afe69d7bf6378).(); |
| 853 | if (!unfiltered) |
| 854 | return throwErrorcxx . . $ QTJSC/throwError(c8108d54e75f502b).(exec, SyntaxErrorcxx . . $ QTJSC/SyntaxError., "Unable to parse JSON string"); |
| 855 | |
| 856 | if (args.sizecxx . . $ QTJSC/ArgList#size(fe4d2d262d4164a8).() < 2) |
| 857 | return unfiltered; |
| 858 | |
| 859 | JSValuecxx . . $ QTJSC/JSValue# function = args.atcxx . . $ QTJSC/ArgList#at(e9dec2041b7a6b55).(1); |
| 860 | CallDatacxx . . $ QTJSC/CallData# callData; |
| 861 | CallTypecxx . . $ QTJSC/CallType# callType = function.getCallDatacxx . . $ QTJSC/JSValue#getCallData(9482040cf952d29d).(callData); |
| 862 | if (callType == CallTypeNonecxx . . $ QTJSC/CallTypeNone.) |
| 863 | return unfiltered; |
| 864 | return Walkercxx . . $ QTJSC/Walker#Walker(13f98222cf80e8b9).(exec, asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(function), callType, callData).walkcxx . . $ QTJSC/Walker#walk(19277d6b13852c07).(unfiltered); |
| 865 | } |
| 866 | |
| 867 | // ECMA-262 v5 15.12.3 |
| 868 | JSValuecxx . . $ QTJSC/JSValue# JSC_HOST_CALLcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:1060:9`! JSONProtoFuncStringifycxx . . $ QTJSC/JSONProtoFuncStringify(cac2aec6ecb9506b).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSObjectcxx . . $ QTJSC/JSObject#*, JSValuecxx . . $ QTJSC/JSValue#, const ArgListcxx . . $ QTJSC/ArgList#& args) |
| 869 | { |
| 870 | if (args.isEmptycxx . . $ QTJSC/ArgList#isEmpty(50ce9a9e25b4a850).()) |
| 871 | return throwErrorcxx . . $ QTJSC/throwError(c8108d54e75f502b).(exec, GeneralErrorcxx . . $ QTJSC/GeneralError., "No input to stringify"); |
| 872 | JSValuecxx . . $ QTJSC/JSValue# value = args.atcxx . . $ QTJSC/ArgList#at(e9dec2041b7a6b55).(0); |
| 873 | JSValuecxx . . $ QTJSC/JSValue# replacer = args.atcxx . . $ QTJSC/ArgList#at(e9dec2041b7a6b55).(1); |
| 874 | JSValuecxx . . $ QTJSC/JSValue# space = args.atcxx . . $ QTJSC/ArgList#at(e9dec2041b7a6b55).(2); |
| 875 | return Stringifiercxx . . $ QTJSC/Stringifier#Stringifier(1417be83fbbea4dc).(exec, replacer, space).stringifycxx . . $ QTJSC/Stringifier#stringify(19277d6b13852c07).(value); |
| 876 | } |
| 877 | |
| 878 | } // namespace JSC |