Changeset 222617 in webkit for trunk/Source/JavaScriptCore/API/JSObjectRef.cpp
- Timestamp:
- Sep 28, 2017, 11:09:09 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSObjectRef.cpp
r222473 r222617 143 143 VM& vm = exec->vm(); 144 144 JSLockHolder locker(vm); 145 auto scope = DECLARE_CATCH_SCOPE(vm); 145 146 146 147 startingLineNumber = std::max(1, startingLineNumber); … … 154 155 auto sourceURLString = sourceURL ? sourceURL->string() : String(); 155 156 JSObject* result = constructFunction(exec, exec->lexicalGlobalObject(), args, nameID, SourceOrigin { sourceURLString }, sourceURLString, TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber())); 156 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)157 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 157 158 result = 0; 158 159 return toRef(result); … … 166 167 } 167 168 ExecState* exec = toJS(ctx); 168 JSLockHolder locker(exec); 169 VM& vm = exec->vm(); 170 JSLockHolder locker(vm); 171 auto scope = DECLARE_CATCH_SCOPE(vm); 169 172 170 173 JSObject* result; … … 178 181 result = constructEmptyArray(exec, 0); 179 182 180 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)183 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 181 184 result = 0; 182 185 … … 191 194 } 192 195 ExecState* exec = toJS(ctx); 193 JSLockHolder locker(exec); 196 VM& vm = exec->vm(); 197 JSLockHolder locker(vm); 198 auto scope = DECLARE_CATCH_SCOPE(vm); 194 199 195 200 MarkedArgumentBuffer argList; … … 198 203 199 204 JSObject* result = constructDate(exec, exec->lexicalGlobalObject(), JSValue(), argList); 200 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)205 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 201 206 result = 0; 202 207 … … 211 216 } 212 217 ExecState* exec = toJS(ctx); 213 JSLockHolder locker(exec); 218 VM& vm = exec->vm(); 219 JSLockHolder locker(vm); 220 auto scope = DECLARE_CATCH_SCOPE(vm); 214 221 215 222 JSValue message = argumentCount ? toJS(exec, arguments[0]) : jsUndefined(); … … 217 224 JSObject* result = ErrorInstance::create(exec, errorStructure, message); 218 225 219 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)226 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 220 227 result = 0; 221 228 … … 230 237 } 231 238 ExecState* exec = toJS(ctx); 232 JSLockHolder locker(exec); 239 VM& vm = exec->vm(); 240 JSLockHolder locker(vm); 241 auto scope = DECLARE_CATCH_SCOPE(vm); 233 242 234 243 MarkedArgumentBuffer argList; … … 237 246 238 247 JSObject* result = constructRegExp(exec, exec->lexicalGlobalObject(), argList); 239 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)248 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 240 249 result = 0; 241 250 … … 265 274 VM& vm = exec->vm(); 266 275 JSLockHolder locker(vm); 276 auto scope = DECLARE_CATCH_SCOPE(vm); 267 277 268 278 JSObject* jsObject = toJS(object); 269 279 JSValue jsValue = toJS(exec, value); 270 280 jsObject->setPrototype(vm, exec, jsValue.isObject() ? jsValue : jsNull()); 271 handleExceptionIfNeeded( exec, nullptr);281 handleExceptionIfNeeded(scope, exec, nullptr); 272 282 } 273 283 … … 296 306 VM& vm = exec->vm(); 297 307 JSLockHolder locker(vm); 308 auto scope = DECLARE_CATCH_SCOPE(vm); 298 309 299 310 JSObject* jsObject = toJS(object); 300 311 301 312 JSValue jsValue = jsObject->get(exec, propertyName->identifier(&vm)); 302 handleExceptionIfNeeded( exec, exception);313 handleExceptionIfNeeded(scope, exec, exception); 303 314 return toRef(exec, jsValue); 304 315 } … … 329 340 } 330 341 } 331 handleExceptionIfNeeded( exec, exception);342 handleExceptionIfNeeded(scope, exec, exception); 332 343 } 333 344 … … 339 350 } 340 351 ExecState* exec = toJS(ctx); 341 JSLockHolder locker(exec); 352 VM& vm = exec->vm(); 353 JSLockHolder locker(vm); 354 auto scope = DECLARE_CATCH_SCOPE(vm); 342 355 343 356 JSObject* jsObject = toJS(object); 344 357 345 358 JSValue jsValue = jsObject->get(exec, propertyIndex); 346 handleExceptionIfNeeded( exec, exception);359 handleExceptionIfNeeded(scope, exec, exception); 347 360 return toRef(exec, jsValue); 348 361 } … … 358 371 VM& vm = exec->vm(); 359 372 JSLockHolder locker(vm); 373 auto scope = DECLARE_CATCH_SCOPE(vm); 360 374 361 375 JSObject* jsObject = toJS(object); … … 363 377 364 378 jsObject->methodTable(vm)->putByIndex(jsObject, exec, propertyIndex, jsValue, false); 365 handleExceptionIfNeeded( exec, exception);379 handleExceptionIfNeeded(scope, exec, exception); 366 380 } 367 381 … … 375 389 VM& vm = exec->vm(); 376 390 JSLockHolder locker(vm); 391 auto scope = DECLARE_CATCH_SCOPE(vm); 377 392 378 393 JSObject* jsObject = toJS(object); 379 394 380 395 bool result = jsObject->methodTable(vm)->deleteProperty(jsObject, exec, propertyName->identifier(&vm)); 381 handleExceptionIfNeeded( exec, exception);396 handleExceptionIfNeeded(scope, exec, exception); 382 397 return result; 383 398 } … … 553 568 VM& vm = exec->vm(); 554 569 JSLockHolder locker(vm); 570 auto scope = DECLARE_CATCH_SCOPE(vm); 555 571 556 572 if (!object) … … 573 589 574 590 JSValueRef result = toRef(exec, profiledCall(exec, ProfilingReason::API, jsObject, callType, callData, jsThisObject, argList)); 575 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)591 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 576 592 result = 0; 577 593 return result; … … 592 608 VM& vm = exec->vm(); 593 609 JSLockHolder locker(vm); 610 auto scope = DECLARE_CATCH_SCOPE(vm); 594 611 595 612 if (!object) … … 608 625 609 626 JSObjectRef result = toRef(profiledConstruct(exec, ProfilingReason::API, jsObject, constructType, constructData, argList)); 610 if (handleExceptionIfNeeded( exec, exception) == ExceptionStatus::DidThrow)627 if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow) 611 628 result = 0; 612 629 return result;
Note:
See TracChangeset
for help on using the changeset viewer.