Changeset 43130 in webkit for trunk/JavaScriptCore/API
- Timestamp:
- May 1, 2009, 5:25:41 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/API
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/APICast.h
r43122 r43130 27 27 #define APICast_h 28 28 29 #include "JSNumberCell.h" 29 30 #include "JSValue.h" 31 #include <wtf/Platform.h> 30 32 31 33 namespace JSC { … … 56 58 } 57 59 58 inline JSC::JSValue toJS(JS ValueRef v)60 inline JSC::JSValue toJS(JSC::ExecState* exec, JSValueRef v) 59 61 { 60 return JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v))); 62 JSC::JSValue jsValue = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v))); 63 #if !USE(ALTERNATE_JSIMMEDIATE) 64 if (jsValue && jsValue.isNumber()) { 65 ASSERT(jsValue.isAPIMangledNumber()); 66 return JSC::jsNumber(exec, jsValue.uncheckedGetNumber()); 67 } 68 #endif 69 return jsValue; 61 70 } 62 71 … … 76 85 } 77 86 78 inline JSValueRef toRef(JSC:: JSValue v)87 inline JSValueRef toRef(JSC::ExecState* exec, JSC::JSValue v) 79 88 { 89 #if !USE(ALTERNATE_JSIMMEDIATE) 90 if (v && v.isNumber()) { 91 ASSERT(!v.isAPIMangledNumber()); 92 return reinterpret_cast<JSValueRef>(JSC::JSValue::encode(JSC::jsAPIMangledNumber(exec, v.uncheckedGetNumber()))); 93 } 94 #endif 80 95 return reinterpret_cast<JSValueRef>(JSC::JSValue::encode(v)); 81 }82 83 inline JSValueRef* toRef(JSC::JSValue* v)84 {85 return reinterpret_cast<JSValueRef*>(v);86 96 } 87 97 -
trunk/JavaScriptCore/API/JSBase.cpp
r41594 r43130 56 56 if (completion.complType() == Throw) { 57 57 if (exception) 58 *exception = toRef( completion.value());58 *exception = toRef(exec, completion.value()); 59 59 return 0; 60 60 } 61 61 62 62 if (completion.value()) 63 return toRef( completion.value());63 return toRef(exec, completion.value()); 64 64 65 65 // happens, for example, when the only statement is an empty (';') statement 66 return toRef( jsUndefined());66 return toRef(exec, jsUndefined()); 67 67 } 68 68 … … 77 77 if (completion.complType() == Throw) { 78 78 if (exception) 79 *exception = toRef( completion.value());79 *exception = toRef(exec, completion.value()); 80 80 return false; 81 81 } -
trunk/JavaScriptCore/API/JSCallbackConstructor.cpp
r42989 r43130 62 62 Vector<JSValueRef, 16> arguments(argumentCount); 63 63 for (int i = 0; i < argumentCount; i++) 64 arguments[i] = toRef(args.at(i)); 65 66 JSLock::DropAllLocks dropAllLocks(exec); 67 return toJS(callback(ctx, constructorRef, argumentCount, arguments.data(), toRef(exec->exceptionSlot()))); 64 arguments[i] = toRef(exec, args.at(i)); 65 66 JSValueRef exception = 0; 67 JSObjectRef result; 68 { 69 JSLock::DropAllLocks dropAllLocks(exec); 70 result = callback(ctx, constructorRef, argumentCount, arguments.data(), &exception); 71 } 72 if (exception) 73 exec->setException(toJS(exec, exception)); 74 return toJS(result); 68 75 } 69 76 -
trunk/JavaScriptCore/API/JSCallbackFunction.cpp
r43122 r43130 56 56 Vector<JSValueRef, 16> arguments(argumentCount); 57 57 for (int i = 0; i < argumentCount; i++) 58 arguments[i] = toRef( args.at(i));58 arguments[i] = toRef(exec, args.at(i)); 59 59 60 JSLock::DropAllLocks dropAllLocks(exec); 61 return toJS(static_cast<JSCallbackFunction*>(functionObject)->m_callback(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), toRef(exec->exceptionSlot()))); 60 JSValueRef exception = 0; 61 JSValueRef result; 62 { 63 JSLock::DropAllLocks dropAllLocks(exec); 64 result = static_cast<JSCallbackFunction*>(functionObject)->m_callback(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception); 65 } 66 if (exception) 67 exec->setException(toJS(exec, exception)); 68 69 return toJS(exec, result); 62 70 } 63 71 -
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r43122 r43130 129 129 JSValueRef exception = 0; 130 130 JSValueRef value = getProperty(ctx, thisRef, propertyNameRef.get(), &exception); 131 exec->setException(toJS(ex ception));131 exec->setException(toJS(exec, exception)); 132 132 if (value) { 133 slot.setValue(toJS( value));133 slot.setValue(toJS(exec, value)); 134 134 return true; 135 135 } … … 170 170 JSObjectRef thisRef = toRef(this); 171 171 RefPtr<OpaqueJSString> propertyNameRef; 172 JSValueRef valueRef = toRef( value);172 JSValueRef valueRef = toRef(exec, value); 173 173 174 174 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { … … 179 179 JSValueRef exception = 0; 180 180 bool result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); 181 exec->setException(toJS(ex ception));181 exec->setException(toJS(exec, exception)); 182 182 if (result || exception) 183 183 return; … … 194 194 JSValueRef exception = 0; 195 195 bool result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); 196 exec->setException(toJS(ex ception));196 exec->setException(toJS(exec, exception)); 197 197 if (result || exception) 198 198 return; … … 229 229 JSValueRef exception = 0; 230 230 bool result = deleteProperty(ctx, thisRef, propertyNameRef.get(), &exception); 231 exec->setException(toJS(ex ception));231 exec->setException(toJS(exec, exception)); 232 232 if (result || exception) 233 233 return true; … … 283 283 Vector<JSValueRef, 16> arguments(argumentCount); 284 284 for (int i = 0; i < argumentCount; i++) 285 arguments[i] = toRef( args.at(i));285 arguments[i] = toRef(exec, args.at(i)); 286 286 JSLock::DropAllLocks dropAllLocks(exec); 287 287 JSValueRef exception = 0; 288 288 JSObject* result = toJS(callAsConstructor(execRef, constructorRef, argumentCount, arguments.data(), &exception)); 289 exec->setException(toJS(ex ception));289 exec->setException(toJS(exec, exception)); 290 290 return result; 291 291 } … … 306 306 JSLock::DropAllLocks dropAllLocks(exec); 307 307 JSValueRef exception = 0; 308 bool result = hasInstance(execRef, thisRef, toRef( value), &exception);309 exec->setException(toJS(ex ception));308 bool result = hasInstance(execRef, thisRef, toRef(exec, value), &exception); 309 exec->setException(toJS(exec, exception)); 310 310 return result; 311 311 } … … 338 338 Vector<JSValueRef, 16> arguments(argumentCount); 339 339 for (int i = 0; i < argumentCount; i++) 340 arguments[i] = toRef( args.at(i));341 JSLock::DropAllLocks dropAllLocks(exec); 342 JSValueRef exception = 0; 343 JSValue result = toJS( callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception));344 exec->setException(toJS(ex ception));340 arguments[i] = toRef(exec, args.at(i)); 341 JSLock::DropAllLocks dropAllLocks(exec); 342 JSValueRef exception = 0; 343 JSValue result = toJS(exec, callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception)); 344 exec->setException(toJS(exec, exception)); 345 345 return result; 346 346 } … … 406 406 JSValueRef exception = 0; 407 407 JSValueRef value = convertToType(ctx, thisRef, kJSTypeNumber, &exception); 408 exec->setException(toJS(ex ception));408 exec->setException(toJS(exec, exception)); 409 409 if (value) { 410 410 double dValue; 411 return toJS( value).getNumber(dValue) ? dValue : NaN;411 return toJS(exec, value).getNumber(dValue) ? dValue : NaN; 412 412 } 413 413 } … … 429 429 JSLock::DropAllLocks dropAllLocks(exec); 430 430 value = convertToType(ctx, thisRef, kJSTypeString, &exception); 431 exec->setException(toJS(ex ception));431 exec->setException(toJS(exec, exception)); 432 432 } 433 433 if (value) 434 return toJS( value).getString();434 return toJS(exec, value).getString(); 435 435 if (exception) 436 436 return ""; … … 476 476 if (!propertyNameRef) 477 477 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 478 JSLock::DropAllLocks dropAllLocks(exec);479 478 JSValueRef exception = 0; 480 JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception); 481 exec->setException(toJS(exception)); 479 JSValueRef value; 480 { 481 JSLock::DropAllLocks dropAllLocks(exec); 482 value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception); 483 } 484 exec->setException(toJS(exec, exception)); 482 485 if (value) 483 return toJS( value);486 return toJS(exec, value); 484 487 if (exception) 485 488 return jsUndefined(); … … 530 533 JSValueRef exception = 0; 531 534 JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception); 532 exec->setException(toJS(ex ception));535 exec->setException(toJS(exec, exception)); 533 536 if (value) 534 return toJS( value);537 return toJS(exec, value); 535 538 if (exception) 536 539 return jsUndefined(); -
trunk/JavaScriptCore/API/JSObjectRef.cpp
r43122 r43130 131 131 if (exec->hadException()) { 132 132 if (exception) 133 *exception = toRef(exec ->exception());133 *exception = toRef(exec, exec->exception()); 134 134 exec->clearException(); 135 135 result = 0; … … 148 148 MarkedArgumentBuffer argList; 149 149 for (size_t i = 0; i < argumentCount; ++i) 150 argList.append(toJS( arguments[i]));150 argList.append(toJS(exec, arguments[i])); 151 151 152 152 result = constructArray(exec, argList); … … 156 156 if (exec->hadException()) { 157 157 if (exception) 158 *exception = toRef(exec ->exception());158 *exception = toRef(exec, exec->exception()); 159 159 exec->clearException(); 160 160 result = 0; … … 172 172 MarkedArgumentBuffer argList; 173 173 for (size_t i = 0; i < argumentCount; ++i) 174 argList.append(toJS( arguments[i]));174 argList.append(toJS(exec, arguments[i])); 175 175 176 176 JSObject* result = constructDate(exec, argList); 177 177 if (exec->hadException()) { 178 178 if (exception) 179 *exception = toRef(exec ->exception());179 *exception = toRef(exec, exec->exception()); 180 180 exec->clearException(); 181 181 result = 0; … … 193 193 MarkedArgumentBuffer argList; 194 194 for (size_t i = 0; i < argumentCount; ++i) 195 argList.append(toJS( arguments[i]));195 argList.append(toJS(exec, arguments[i])); 196 196 197 197 JSObject* result = constructError(exec, argList); 198 198 if (exec->hadException()) { 199 199 if (exception) 200 *exception = toRef(exec ->exception());200 *exception = toRef(exec, exec->exception()); 201 201 exec->clearException(); 202 202 result = 0; … … 214 214 MarkedArgumentBuffer argList; 215 215 for (size_t i = 0; i < argumentCount; ++i) 216 argList.append(toJS( arguments[i]));216 argList.append(toJS(exec, arguments[i])); 217 217 218 218 JSObject* result = constructRegExp(exec, argList); 219 219 if (exec->hadException()) { 220 220 if (exception) 221 *exception = toRef(exec ->exception());221 *exception = toRef(exec, exec->exception()); 222 222 exec->clearException(); 223 223 result = 0; … … 227 227 } 228 228 229 JSValueRef JSObjectGetPrototype(JSContextRef, JSObjectRef object) 230 { 231 JSObject* jsObject = toJS(object); 232 return toRef(jsObject->prototype()); 233 } 234 235 void JSObjectSetPrototype(JSContextRef, JSObjectRef object, JSValueRef value) 236 { 237 JSObject* jsObject = toJS(object); 238 JSValue jsValue = toJS(value); 229 JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object) 230 { 231 ExecState* exec = toJS(ctx); 232 exec->globalData().heap.registerThread(); 233 JSLock lock(exec); 234 235 JSObject* jsObject = toJS(object); 236 return toRef(exec, jsObject->prototype()); 237 } 238 239 void JSObjectSetPrototype(JSContextRef ctx, JSObjectRef object, JSValueRef value) 240 { 241 ExecState* exec = toJS(ctx); 242 exec->globalData().heap.registerThread(); 243 JSLock lock(exec); 244 245 JSObject* jsObject = toJS(object); 246 JSValue jsValue = toJS(exec, value); 239 247 240 248 jsObject->setPrototype(jsValue.isObject() ? jsValue : jsNull()); … … 263 271 if (exec->hadException()) { 264 272 if (exception) 265 *exception = toRef(exec ->exception());266 exec->clearException(); 267 } 268 return toRef( jsValue);273 *exception = toRef(exec, exec->exception()); 274 exec->clearException(); 275 } 276 return toRef(exec, jsValue); 269 277 } 270 278 … … 277 285 JSObject* jsObject = toJS(object); 278 286 Identifier name(propertyName->identifier(&exec->globalData())); 279 JSValue jsValue = toJS( value);287 JSValue jsValue = toJS(exec, value); 280 288 281 289 if (attributes && !jsObject->hasProperty(exec, name)) … … 288 296 if (exec->hadException()) { 289 297 if (exception) 290 *exception = toRef(exec ->exception());298 *exception = toRef(exec, exec->exception()); 291 299 exec->clearException(); 292 300 } … … 304 312 if (exec->hadException()) { 305 313 if (exception) 306 *exception = toRef(exec ->exception());307 exec->clearException(); 308 } 309 return toRef( jsValue);314 *exception = toRef(exec, exec->exception()); 315 exec->clearException(); 316 } 317 return toRef(exec, jsValue); 310 318 } 311 319 … … 318 326 319 327 JSObject* jsObject = toJS(object); 320 JSValue jsValue = toJS( value);328 JSValue jsValue = toJS(exec, value); 321 329 322 330 jsObject->put(exec, propertyIndex, jsValue); 323 331 if (exec->hadException()) { 324 332 if (exception) 325 *exception = toRef(exec ->exception());333 *exception = toRef(exec, exec->exception()); 326 334 exec->clearException(); 327 335 } … … 339 347 if (exec->hadException()) { 340 348 if (exception) 341 *exception = toRef(exec ->exception());349 *exception = toRef(exec, exec->exception()); 342 350 exec->clearException(); 343 351 } … … 392 400 MarkedArgumentBuffer argList; 393 401 for (size_t i = 0; i < argumentCount; i++) 394 argList.append(toJS( arguments[i]));402 argList.append(toJS(exec, arguments[i])); 395 403 396 404 CallData callData; … … 399 407 return 0; 400 408 401 JSValueRef result = toRef( call(exec, jsObject, callType, callData, jsThisObject, argList));402 if (exec->hadException()) { 403 if (exception) 404 *exception = toRef(exec ->exception());409 JSValueRef result = toRef(exec, call(exec, jsObject, callType, callData, jsThisObject, argList)); 410 if (exec->hadException()) { 411 if (exception) 412 *exception = toRef(exec, exec->exception()); 405 413 exec->clearException(); 406 414 result = 0; … … 431 439 MarkedArgumentBuffer argList; 432 440 for (size_t i = 0; i < argumentCount; i++) 433 argList.append(toJS( arguments[i]));441 argList.append(toJS(exec, arguments[i])); 434 442 JSObjectRef result = toRef(construct(exec, jsObject, constructType, constructData, argList)); 435 443 if (exec->hadException()) { 436 444 if (exception) 437 *exception = toRef(exec ->exception());445 *exception = toRef(exec, exec->exception()); 438 446 exec->clearException(); 439 447 result = 0; -
trunk/JavaScriptCore/API/JSValueRef.cpp
r43122 r43130 42 42 #include <algorithm> // for std::min 43 43 44 JSType JSValueGetType(JSContextRef, JSValueRef value) 45 { 46 JSC::JSValue jsValue = toJS(value); 44 JSType JSValueGetType(JSContextRef ctx, JSValueRef value) 45 { 46 JSC::ExecState* exec = toJS(ctx); 47 exec->globalData().heap.registerThread(); 48 JSC::JSLock lock(exec); 49 50 JSC::JSValue jsValue = toJS(exec, value); 51 47 52 if (jsValue.isUndefined()) 48 53 return kJSTypeUndefined; … … 61 66 using namespace JSC; // placed here to avoid conflict between JSC::JSType and JSType, above. 62 67 63 bool JSValueIsUndefined(JSContextRef, JSValueRef value) 64 { 65 JSValue jsValue = toJS(value); 68 bool JSValueIsUndefined(JSContextRef ctx, JSValueRef value) 69 { 70 ExecState* exec = toJS(ctx); 71 exec->globalData().heap.registerThread(); 72 JSLock lock(exec); 73 74 JSValue jsValue = toJS(exec, value); 66 75 return jsValue.isUndefined(); 67 76 } 68 77 69 bool JSValueIsNull(JSContextRef, JSValueRef value) 70 { 71 JSValue jsValue = toJS(value); 78 bool JSValueIsNull(JSContextRef ctx, JSValueRef value) 79 { 80 ExecState* exec = toJS(ctx); 81 exec->globalData().heap.registerThread(); 82 JSLock lock(exec); 83 84 JSValue jsValue = toJS(exec, value); 72 85 return jsValue.isNull(); 73 86 } 74 87 75 bool JSValueIsBoolean(JSContextRef, JSValueRef value) 76 { 77 JSValue jsValue = toJS(value); 88 bool JSValueIsBoolean(JSContextRef ctx, JSValueRef value) 89 { 90 ExecState* exec = toJS(ctx); 91 exec->globalData().heap.registerThread(); 92 JSLock lock(exec); 93 94 JSValue jsValue = toJS(exec, value); 78 95 return jsValue.isBoolean(); 79 96 } 80 97 81 bool JSValueIsNumber(JSContextRef, JSValueRef value) 82 { 83 JSValue jsValue = toJS(value); 98 bool JSValueIsNumber(JSContextRef ctx, JSValueRef value) 99 { 100 ExecState* exec = toJS(ctx); 101 exec->globalData().heap.registerThread(); 102 JSLock lock(exec); 103 104 JSValue jsValue = toJS(exec, value); 84 105 return jsValue.isNumber(); 85 106 } 86 107 87 bool JSValueIsString(JSContextRef, JSValueRef value) 88 { 89 JSValue jsValue = toJS(value); 108 bool JSValueIsString(JSContextRef ctx, JSValueRef value) 109 { 110 ExecState* exec = toJS(ctx); 111 exec->globalData().heap.registerThread(); 112 JSLock lock(exec); 113 114 JSValue jsValue = toJS(exec, value); 90 115 return jsValue.isString(); 91 116 } 92 117 93 bool JSValueIsObject(JSContextRef, JSValueRef value) 94 { 95 JSValue jsValue = toJS(value); 118 bool JSValueIsObject(JSContextRef ctx, JSValueRef value) 119 { 120 ExecState* exec = toJS(ctx); 121 exec->globalData().heap.registerThread(); 122 JSLock lock(exec); 123 124 JSValue jsValue = toJS(exec, value); 96 125 return jsValue.isObject(); 97 126 } 98 127 99 bool JSValueIsObjectOfClass(JSContextRef, JSValueRef value, JSClassRef jsClass) 100 { 101 JSValue jsValue = toJS(value); 128 bool JSValueIsObjectOfClass(JSContextRef ctx, JSValueRef value, JSClassRef jsClass) 129 { 130 ExecState* exec = toJS(ctx); 131 exec->globalData().heap.registerThread(); 132 JSLock lock(exec); 133 134 JSValue jsValue = toJS(exec, value); 102 135 103 136 if (JSObject* o = jsValue.getObject()) { … … 116 149 JSLock lock(exec); 117 150 118 JSValue jsA = toJS( a);119 JSValue jsB = toJS( b);151 JSValue jsA = toJS(exec, a); 152 JSValue jsB = toJS(exec, b); 120 153 121 154 bool result = JSValue::equal(exec, jsA, jsB); // false if an exception is thrown 122 155 if (exec->hadException()) { 123 156 if (exception) 124 *exception = toRef(exec ->exception());157 *exception = toRef(exec, exec->exception()); 125 158 exec->clearException(); 126 159 } … … 128 161 } 129 162 130 bool JSValueIsStrictEqual(JSContextRef, JSValueRef a, JSValueRef b) 131 { 132 JSValue jsA = toJS(a); 133 JSValue jsB = toJS(b); 134 135 bool result = JSValue::strictEqual(jsA, jsB); 136 return result; 163 bool JSValueIsStrictEqual(JSContextRef ctx, JSValueRef a, JSValueRef b) 164 { 165 ExecState* exec = toJS(ctx); 166 exec->globalData().heap.registerThread(); 167 JSLock lock(exec); 168 169 JSValue jsA = toJS(exec, a); 170 JSValue jsB = toJS(exec, b); 171 172 return JSValue::strictEqual(jsA, jsB); 137 173 } 138 174 … … 143 179 JSLock lock(exec); 144 180 145 JSValue jsValue = toJS(value); 181 JSValue jsValue = toJS(exec, value); 182 146 183 JSObject* jsConstructor = toJS(constructor); 147 184 if (!jsConstructor->structure()->typeInfo().implementsHasInstance()) … … 150 187 if (exec->hadException()) { 151 188 if (exception) 152 *exception = toRef(exec ->exception());189 *exception = toRef(exec, exec->exception()); 153 190 exec->clearException(); 154 191 } … … 156 193 } 157 194 158 JSValueRef JSValueMakeUndefined(JSContextRef) 159 { 160 return toRef(jsUndefined()); 161 } 162 163 JSValueRef JSValueMakeNull(JSContextRef) 164 { 165 return toRef(jsNull()); 166 } 167 168 JSValueRef JSValueMakeBoolean(JSContextRef, bool value) 169 { 170 return toRef(jsBoolean(value)); 195 JSValueRef JSValueMakeUndefined(JSContextRef ctx) 196 { 197 ExecState* exec = toJS(ctx); 198 exec->globalData().heap.registerThread(); 199 JSLock lock(exec); 200 201 return toRef(exec, jsUndefined()); 202 } 203 204 JSValueRef JSValueMakeNull(JSContextRef ctx) 205 { 206 ExecState* exec = toJS(ctx); 207 exec->globalData().heap.registerThread(); 208 JSLock lock(exec); 209 210 return toRef(exec, jsNull()); 211 } 212 213 JSValueRef JSValueMakeBoolean(JSContextRef ctx, bool value) 214 { 215 ExecState* exec = toJS(ctx); 216 exec->globalData().heap.registerThread(); 217 JSLock lock(exec); 218 219 return toRef(exec, jsBoolean(value)); 171 220 } 172 221 … … 177 226 JSLock lock(exec); 178 227 179 return toRef( jsNumber(exec, value));228 return toRef(exec, jsNumber(exec, value)); 180 229 } 181 230 … … 186 235 JSLock lock(exec); 187 236 188 return toRef( jsString(exec, string->ustring()));237 return toRef(exec, jsString(exec, string->ustring())); 189 238 } 190 239 … … 192 241 { 193 242 ExecState* exec = toJS(ctx); 194 JSValue jsValue = toJS(value); 243 exec->globalData().heap.registerThread(); 244 JSLock lock(exec); 245 246 JSValue jsValue = toJS(exec, value); 195 247 return jsValue.toBoolean(exec); 196 248 } … … 202 254 JSLock lock(exec); 203 255 204 JSValue jsValue = toJS( value);256 JSValue jsValue = toJS(exec, value); 205 257 206 258 double number = jsValue.toNumber(exec); 207 259 if (exec->hadException()) { 208 260 if (exception) 209 *exception = toRef(exec ->exception());261 *exception = toRef(exec, exec->exception()); 210 262 exec->clearException(); 211 263 number = NaN; … … 220 272 JSLock lock(exec); 221 273 222 JSValue jsValue = toJS( value);274 JSValue jsValue = toJS(exec, value); 223 275 224 276 RefPtr<OpaqueJSString> stringRef(OpaqueJSString::create(jsValue.toString(exec))); 225 277 if (exec->hadException()) { 226 278 if (exception) 227 *exception = toRef(exec ->exception());279 *exception = toRef(exec, exec->exception()); 228 280 exec->clearException(); 229 281 stringRef.clear(); … … 238 290 JSLock lock(exec); 239 291 240 JSValue jsValue = toJS( value);292 JSValue jsValue = toJS(exec, value); 241 293 242 294 JSObjectRef objectRef = toRef(jsValue.toObject(exec)); 243 295 if (exec->hadException()) { 244 296 if (exception) 245 *exception = toRef(exec ->exception());297 *exception = toRef(exec, exec->exception()); 246 298 exec->clearException(); 247 299 objectRef = 0; … … 256 308 JSLock lock(exec); 257 309 258 JSValue jsValue = toJS( value);310 JSValue jsValue = toJS(exec, value); 259 311 gcProtect(jsValue); 260 312 } … … 266 318 JSLock lock(exec); 267 319 268 JSValue jsValue = toJS( value);320 JSValue jsValue = toJS(exec, value); 269 321 gcUnprotect(jsValue); 270 322 }
Note:
See TracChangeset
for help on using the changeset viewer.