Changeset 43157 in webkit for trunk/JavaScriptCore/API/JSObjectRef.cpp
- Timestamp:
- May 3, 2009, 12:27:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSObjectRef.cpp
r43138 r43157 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;
Note:
See TracChangeset
for help on using the changeset viewer.