Changeset 222617 in webkit for trunk/Source/JavaScriptCore/API/JSValueRef.cpp
- Timestamp:
- Sep 28, 2017, 11:09:09 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSValueRef.cpp
r211247 r222617 224 224 } 225 225 ExecState* exec = toJS(ctx); 226 JSLockHolder locker(exec); 226 VM& vm = exec->vm(); 227 JSLockHolder locker(vm); 228 auto scope = DECLARE_CATCH_SCOPE(vm); 227 229 228 230 JSValue jsA = toJS(exec, a); … … 230 232 231 233 bool result = JSValue::equal(exec, jsA, jsB); // false if an exception is thrown 232 handleExceptionIfNeeded( exec, exception);234 handleExceptionIfNeeded(scope, exec, exception); 233 235 234 236 return result; … … 257 259 } 258 260 ExecState* exec = toJS(ctx); 259 JSLockHolder locker(exec); 261 VM& vm = exec->vm(); 262 JSLockHolder locker(vm); 263 auto scope = DECLARE_CATCH_SCOPE(vm); 260 264 261 265 JSValue jsValue = toJS(exec, value); … … 265 269 return false; 266 270 bool result = jsConstructor->hasInstance(exec, jsValue); // false if an exception is thrown 267 handleExceptionIfNeeded( exec, exception);271 handleExceptionIfNeeded(scope, exec, exception); 268 272 return result; 269 273 } … … 354 358 } 355 359 ExecState* exec = toJS(ctx); 356 JSLockHolder locker(exec); 360 VM& vm = exec->vm(); 361 JSLockHolder locker(vm); 362 auto scope = DECLARE_CATCH_SCOPE(vm); 363 357 364 JSValue value = toJS(exec, apiValue); 358 365 String result = JSONStringify(exec, value, indent); 359 366 if (exception) 360 367 *exception = 0; 361 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)368 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 362 369 return 0; 363 370 return OpaqueJSString::create(result).leakRef(); … … 384 391 } 385 392 ExecState* exec = toJS(ctx); 386 JSLockHolder locker(exec); 393 VM& vm = exec->vm(); 394 JSLockHolder locker(vm); 395 auto scope = DECLARE_CATCH_SCOPE(vm); 387 396 388 397 JSValue jsValue = toJS(exec, value); 389 398 390 399 double number = jsValue.toNumber(exec); 391 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)400 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 392 401 number = PNaN; 393 402 return number; … … 401 410 } 402 411 ExecState* exec = toJS(ctx); 403 JSLockHolder locker(exec); 412 VM& vm = exec->vm(); 413 JSLockHolder locker(vm); 414 auto scope = DECLARE_CATCH_SCOPE(vm); 404 415 405 416 JSValue jsValue = toJS(exec, value); 406 417 407 418 auto stringRef(OpaqueJSString::create(jsValue.toWTFString(exec))); 408 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)419 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 409 420 stringRef = nullptr; 410 421 return stringRef.leakRef(); … … 418 429 } 419 430 ExecState* exec = toJS(ctx); 420 JSLockHolder locker(exec); 431 VM& vm = exec->vm(); 432 JSLockHolder locker(vm); 433 auto scope = DECLARE_CATCH_SCOPE(vm); 421 434 422 435 JSValue jsValue = toJS(exec, value); 423 436 424 437 JSObjectRef objectRef = toRef(jsValue.toObject(exec)); 425 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)438 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 426 439 objectRef = 0; 427 440 return objectRef;
Note:
See TracChangeset
for help on using the changeset viewer.