| 1 | /* |
| 2 | * Copyright (C) 2006, 2007 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 COMPUTER, 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 COMPUTER, 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 "JSValueRef.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/JSValueRef.h`/ |
| 28 | |
| 29 | #include <wtf/Platform.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h`/ |
| 30 | #include "APICast.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/APICast.h`/ |
| 31 | #include "APIShims.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/APIShims.h`/ |
| 32 | #include "JSCallbackObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObject.h`/ |
| 33 | |
| 34 | #include <runtime/JSGlobalObject.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h`/ |
| 35 | #include <runtime/JSString.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSString.h`/ |
| 36 | #include <runtime/Operations.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Operations.h`/ |
| 37 | #include <runtime/Protect.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Protect.h`/ |
| 38 | #include <runtime/UString.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/UString.h`/ |
| 39 | #include <runtime/JSValue.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h`/ |
| 40 | |
| 41 | #include <wtf/Assertions.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h`/ |
| 42 | |
| 43 | #include <algorithm> // for std::min |
| 44 | |
| 45 | using namespace JSCcxx . . $ `<built-in>:463:9`!; |
| 46 | |
| 47 | ::JSTypecxx . . $ JSType# JSValueGetTypecxx . . $ JSValueGetType(3ef1105038617856).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value) |
| 48 | { |
| 49 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 50 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 51 | |
| 52 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 53 | |
| 54 | if (jsValue.isUndefinedcxx . . $ QTJSC/JSValue#isUndefined(50ce9a9e25b4a850).()) |
| 55 | return kJSTypeUndefinedcxx . . $ kJSTypeUndefined.; |
| 56 | if (jsValue.isNullcxx . . $ QTJSC/JSValue#isNull(50ce9a9e25b4a850).()) |
| 57 | return kJSTypeNullcxx . . $ kJSTypeNull.; |
| 58 | if (jsValue.isBooleancxx . . $ QTJSC/JSValue#isBoolean(50ce9a9e25b4a850).()) |
| 59 | return kJSTypeBooleancxx . . $ kJSTypeBoolean.; |
| 60 | if (jsValue.isNumbercxx . . $ QTJSC/JSValue#isNumber(50ce9a9e25b4a850).()) |
| 61 | return kJSTypeNumbercxx . . $ kJSTypeNumber.; |
| 62 | if (jsValue.isStringcxx . . $ QTJSC/JSValue#isString(50ce9a9e25b4a850).()) |
| 63 | return kJSTypeStringcxx . . $ kJSTypeString.; |
| 64 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(jsValue.isObject()); |
| 65 | return kJSTypeObjectcxx . . $ kJSTypeObject.; |
| 66 | } |
| 67 | |
| 68 | bool JSValueIsUndefinedcxx . . $ JSValueIsUndefined(d7be7ed693651faa).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value) |
| 69 | { |
| 70 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 71 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 72 | |
| 73 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 74 | return jsValue.isUndefinedcxx . . $ QTJSC/JSValue#isUndefined(50ce9a9e25b4a850).(); |
| 75 | } |
| 76 | |
| 77 | bool JSValueIsNullcxx . . $ JSValueIsNull(d7be7ed693651faa).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value) |
| 78 | { |
| 79 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 80 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 81 | |
| 82 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 83 | return jsValue.isNullcxx . . $ QTJSC/JSValue#isNull(50ce9a9e25b4a850).(); |
| 84 | } |
| 85 | |
| 86 | bool JSValueIsBooleancxx . . $ JSValueIsBoolean(d7be7ed693651faa).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value) |
| 87 | { |
| 88 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 89 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 90 | |
| 91 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 92 | return jsValue.isBooleancxx . . $ QTJSC/JSValue#isBoolean(50ce9a9e25b4a850).(); |
| 93 | } |
| 94 | |
| 95 | bool JSValueIsNumbercxx . . $ JSValueIsNumber(d7be7ed693651faa).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value) |
| 96 | { |
| 97 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 98 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 99 | |
| 100 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 101 | return jsValue.isNumbercxx . . $ QTJSC/JSValue#isNumber(50ce9a9e25b4a850).(); |
| 102 | } |
| 103 | |
| 104 | bool JSValueIsStringcxx . . $ JSValueIsString(d7be7ed693651faa).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value) |
| 105 | { |
| 106 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 107 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 108 | |
| 109 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 110 | return jsValue.isStringcxx . . $ QTJSC/JSValue#isString(50ce9a9e25b4a850).(); |
| 111 | } |
| 112 | |
| 113 | bool JSValueIsObjectcxx . . $ JSValueIsObject(d7be7ed693651faa).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value) |
| 114 | { |
| 115 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 116 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 117 | |
| 118 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 119 | return jsValue.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).(); |
| 120 | } |
| 121 | |
| 122 | bool JSValueIsObjectOfClasscxx . . $ JSValueIsObjectOfClass(dc22aa00003423f9).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value, JSClassRefcxx . . $ JSClassRef# jsClass) |
| 123 | { |
| 124 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 125 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 126 | |
| 127 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 128 | |
| 129 | if (JSObjectcxx . . $ QTJSC/JSObject#* o = jsValue.getObjectcxx . . $ QTJSC/JSValue#getObject(8ac23ea934d7a115).()) { |
| 130 | if (o->inherits(&JSCallbackObject<JSGlobalObject>::info)) |
| 131 | return static_cast<JSCallbackObject<JSGlobalObject>*>(o)->inherits(jsClass); |
| 132 | else if (o->inherits(&JSCallbackObject<JSObject>::info)) |
| 133 | return static_cast<JSCallbackObject<JSObject>*>(o)->inherits(jsClass); |
| 134 | } |
| 135 | return false; |
| 136 | } |
| 137 | |
| 138 | bool JSValueIsEqualcxx . . $ JSValueIsEqual(25aaf7584b8248a).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# a, JSValueRefcxx . . $ JSValueRef# b, JSValueRefcxx . . $ JSValueRef#* exception) |
| 139 | { |
| 140 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 141 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 142 | |
| 143 | JSValuecxx . . $ QTJSC/JSValue# jsA = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, a); |
| 144 | JSValuecxx . . $ QTJSC/JSValue# jsB = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, b); |
| 145 | |
| 146 | bool result = JSValuecxx . . $ QTJSC/JSValue#::equalcxx . . $ QTJSC/JSValue#equal(658e1865c47113e6).(exec, jsA, jsB); // false if an exception is thrown |
| 147 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) { |
| 148 | if (exception) |
| 149 | *exception = toRefcxx . . $ toRef(df99c259cd5b7643).(exec, exec->exceptioncxx . . $ QTJSC/ExecState#exception(888c053acf364da1).()); |
| 150 | exec->clearExceptioncxx . . $ QTJSC/ExecState#clearException(49f6e7a06ebc5aa8).(); |
| 151 | } |
| 152 | return result; |
| 153 | } |
| 154 | |
| 155 | bool JSValueIsStrictEqualcxx . . $ JSValueIsStrictEqual(b2048c14e6f692fe).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# a, JSValueRefcxx . . $ JSValueRef# b) |
| 156 | { |
| 157 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 158 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 159 | |
| 160 | JSValuecxx . . $ QTJSC/JSValue# jsA = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, a); |
| 161 | JSValuecxx . . $ QTJSC/JSValue# jsB = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, b); |
| 162 | |
| 163 | return JSValuecxx . . $ QTJSC/JSValue#::strictEqualcxx . . $ QTJSC/JSValue#strictEqual(658e1865c47113e6).(exec, jsA, jsB); |
| 164 | } |
| 165 | |
| 166 | bool JSValueIsInstanceOfConstructorcxx . . $ JSValueIsInstanceOfConstructor(b7fb2b75497fe27).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value, JSObjectRefcxx . . $ JSObjectRef# constructor, JSValueRefcxx . . $ JSValueRef#* exception) |
| 167 | { |
| 168 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 169 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 170 | |
| 171 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 172 | |
| 173 | JSObjectcxx . . $ QTJSC/JSObject#* jsConstructor = toJScxx . . $ toJS(a8374ff494b0ca9c).(constructor); |
| 174 | if (!jsConstructor->structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).()->typeInfo().implementsHasInstance()) |
| 175 | return false; |
| 176 | bool result = jsConstructor->hasInstancecxx . . $ QTJSC/JSObject#hasInstance(658e1865c47113e6).(exec, jsValue, jsConstructor->getcxx . . $ QTJSC/JSObject#get(2d9c2221088d2593).(exec, exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().prototype)); // false if an exception is thrown |
| 177 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) { |
| 178 | if (exception) |
| 179 | *exception = toRefcxx . . $ toRef(df99c259cd5b7643).(exec, exec->exceptioncxx . . $ QTJSC/ExecState#exception(888c053acf364da1).()); |
| 180 | exec->clearExceptioncxx . . $ QTJSC/ExecState#clearException(49f6e7a06ebc5aa8).(); |
| 181 | } |
| 182 | return result; |
| 183 | } |
| 184 | |
| 185 | JSValueRefcxx . . $ JSValueRef# JSValueMakeUndefinedcxx . . $ JSValueMakeUndefined(bcb586ed26d4a507).(JSContextRefcxx . . $ JSContextRef# ctx) |
| 186 | { |
| 187 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 188 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 189 | |
| 190 | return toRefcxx . . $ toRef(df99c259cd5b7643).(exec, jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).()); |
| 191 | } |
| 192 | |
| 193 | JSValueRefcxx . . $ JSValueRef# JSValueMakeNullcxx . . $ JSValueMakeNull(bcb586ed26d4a507).(JSContextRefcxx . . $ JSContextRef# ctx) |
| 194 | { |
| 195 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 196 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 197 | |
| 198 | return toRefcxx . . $ toRef(df99c259cd5b7643).(exec, jsNullcxx . . $ QTJSC/jsNull(ad9afe69d7bf6378).()); |
| 199 | } |
| 200 | |
| 201 | JSValueRefcxx . . $ JSValueRef# JSValueMakeBooleancxx . . $ JSValueMakeBoolean(7e00cccac8e8dca0).(JSContextRefcxx . . $ JSContextRef# ctx, bool value) |
| 202 | { |
| 203 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 204 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 205 | |
| 206 | return toRefcxx . . $ toRef(df99c259cd5b7643).(exec, jsBooleancxx . . $ QTJSC/jsBoolean(b805946c4147dfe1).(value)); |
| 207 | } |
| 208 | |
| 209 | JSValueRefcxx . . $ JSValueRef# JSValueMakeNumbercxx . . $ JSValueMakeNumber(d906eead6fc16093).(JSContextRefcxx . . $ JSContextRef# ctx, double value) |
| 210 | { |
| 211 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 212 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 213 | |
| 214 | return toRefcxx . . $ toRef(df99c259cd5b7643).(exec, jsNumbercxx . . $ QTJSC/jsNumber(88e66938454912cb).(exec, value)); |
| 215 | } |
| 216 | |
| 217 | JSValueRefcxx . . $ JSValueRef# JSValueMakeStringcxx . . $ JSValueMakeString(73a38d59dd2bfaa7).(JSContextRefcxx . . $ JSContextRef# ctx, JSStringRefcxx . . $ JSStringRef# string) |
| 218 | { |
| 219 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 220 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 221 | |
| 222 | return toRefcxx . . $ toRef(c44cefdcd7666f07).(exec, jsStringcxx . . $ QTJSC/jsString(edccc873576bddf5).(exec, string->ustringcxx . . $ OpaqueJSString#ustring(ba9ec689f7dd9231).())); |
| 223 | } |
| 224 | |
| 225 | bool JSValueToBooleancxx . . $ JSValueToBoolean(d7be7ed693651faa).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value) |
| 226 | { |
| 227 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 228 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 229 | |
| 230 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 231 | return jsValue.toBooleancxx . . $ QTJSC/JSValue#toBoolean(9608304f86fd7dc).(exec); |
| 232 | } |
| 233 | |
| 234 | double JSValueToNumbercxx . . $ JSValueToNumber(6daa6a5e1dd4d83d).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value, JSValueRefcxx . . $ JSValueRef#* exception) |
| 235 | { |
| 236 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 237 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 238 | |
| 239 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 240 | |
| 241 | double number = jsValue.toNumbercxx . . $ QTJSC/JSValue#toNumber(1fd034e372fd1279).(exec); |
| 242 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) { |
| 243 | if (exception) |
| 244 | *exception = toRefcxx . . $ toRef(df99c259cd5b7643).(exec, exec->exceptioncxx . . $ QTJSC/ExecState#exception(888c053acf364da1).()); |
| 245 | exec->clearExceptioncxx . . $ QTJSC/ExecState#clearException(49f6e7a06ebc5aa8).(); |
| 246 | number = NaNcxx . . $ QTJSC/NaN.; |
| 247 | } |
| 248 | return number; |
| 249 | } |
| 250 | |
| 251 | JSStringRefcxx . . $ JSStringRef# JSValueToStringCopycxx . . $ JSValueToStringCopy(e868c568b3378ce5).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value, JSValueRefcxx . . $ JSValueRef#* exception) |
| 252 | { |
| 253 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 254 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 255 | |
| 256 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 257 | |
| 258 | RefPtrcxx . . $ RefPtr#<OpaqueJSStringcxx . . $ OpaqueJSString#> stringRef(OpaqueJSString::create(jsValue.toString(exec))); |
| 259 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) { |
| 260 | if (exception) |
| 261 | *exception = toRefcxx . . $ toRef(df99c259cd5b7643).(exec, exec->exceptioncxx . . $ QTJSC/ExecState#exception(888c053acf364da1).()); |
| 262 | exec->clearExceptioncxx . . $ QTJSC/ExecState#clearException(49f6e7a06ebc5aa8).(); |
| 263 | stringRef.clear(); |
| 264 | } |
| 265 | return stringRef.release().releaseRef(); |
| 266 | } |
| 267 | |
| 268 | JSObjectRefcxx . . $ JSObjectRef# JSValueToObjectcxx . . $ JSValueToObject(a95c8786d05330f0).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value, JSValueRefcxx . . $ JSValueRef#* exception) |
| 269 | { |
| 270 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 271 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 272 | |
| 273 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJScxx . . $ toJS(c1f9d3957c3f3cd7).(exec, value); |
| 274 | |
| 275 | JSObjectRefcxx . . $ JSObjectRef# objectRef = toRefcxx . . $ toRef(d2164949e0d73831).(jsValue.toObjectcxx . . $ QTJSC/JSValue#toObject(8709ed4849a165ab).(exec)); |
| 276 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) { |
| 277 | if (exception) |
| 278 | *exception = toRefcxx . . $ toRef(df99c259cd5b7643).(exec, exec->exceptioncxx . . $ QTJSC/ExecState#exception(888c053acf364da1).()); |
| 279 | exec->clearExceptioncxx . . $ QTJSC/ExecState#clearException(49f6e7a06ebc5aa8).(); |
| 280 | objectRef = 0; |
| 281 | } |
| 282 | return objectRef; |
| 283 | } |
| 284 | |
| 285 | void JSValueProtectcxx . . $ JSValueProtect(1ddc3de1bdfacb74).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value) |
| 286 | { |
| 287 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 288 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 289 | |
| 290 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJSForGCcxx . . $ toJSForGC(c1f9d3957c3f3cd7).(exec, value); |
| 291 | gcProtectcxx . . $ QTJSC/gcProtect(5c2ac18db087b3e6).(jsValue); |
| 292 | } |
| 293 | |
| 294 | void JSValueUnprotectcxx . . $ JSValueUnprotect(1ddc3de1bdfacb74).(JSContextRefcxx . . $ JSContextRef# ctx, JSValueRefcxx . . $ JSValueRef# value) |
| 295 | { |
| 296 | ExecStatecxx . . $ QTJSC/ExecState#* exec = toJScxx . . $ toJS(f59d9eed7d59fe2c).(ctx); |
| 297 | APIEntryShimcxx . . $ QTJSC/APIEntryShim# entryShimcxx . . $ QTJSC/APIEntryShim#APIEntryShim(8ab7e31759e06129).(exec); |
| 298 | |
| 299 | JSValuecxx . . $ QTJSC/JSValue# jsValue = toJSForGCcxx . . $ toJSForGC(c1f9d3957c3f3cd7).(exec, value); |
| 300 | gcUnprotectcxx . . $ QTJSC/gcUnprotect(5c2ac18db087b3e6).(jsValue); |
| 301 | } |