Changeset 208923 in webkit
- Timestamp:
- Nov 19, 2016 12:03:48 AM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r208913 r208923 1 2016-11-19 Mark Lam <mark.lam@apple.com> 2 3 Fix missing exception checks in JSC inspector files. 4 https://bugs.webkit.org/show_bug.cgi?id=164959 5 6 Reviewed by Saam Barati. 7 8 * inspector/JSInjectedScriptHost.cpp: 9 (Inspector::JSInjectedScriptHost::getInternalProperties): 10 (Inspector::JSInjectedScriptHost::weakMapEntries): 11 (Inspector::JSInjectedScriptHost::weakSetEntries): 12 (Inspector::JSInjectedScriptHost::iteratorEntries): 13 * inspector/JSJavaScriptCallFrame.cpp: 14 (Inspector::JSJavaScriptCallFrame::scopeDescriptions): 15 1 16 2016-11-18 Mark Lam <mark.lam@apple.com> 2 17 -
trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp
r207229 r208923 270 270 switch (promise->status(exec->vm())) { 271 271 case JSPromise::Status::Pending: 272 scope.release(); 272 273 array->putDirectIndex(exec, index++, constructInternalProperty(exec, ASCIILiteral("status"), jsNontrivialString(exec, ASCIILiteral("pending")))); 273 break;274 return array; 274 275 case JSPromise::Status::Fulfilled: 275 276 array->putDirectIndex(exec, index++, constructInternalProperty(exec, ASCIILiteral("status"), jsNontrivialString(exec, ASCIILiteral("resolved")))); 277 RETURN_IF_EXCEPTION(scope, JSValue()); 278 scope.release(); 276 279 array->putDirectIndex(exec, index++, constructInternalProperty(exec, ASCIILiteral("result"), promise->result(exec->vm()))); 277 break;280 return array; 278 281 case JSPromise::Status::Rejected: 279 282 array->putDirectIndex(exec, index++, constructInternalProperty(exec, ASCIILiteral("status"), jsNontrivialString(exec, ASCIILiteral("rejected")))); 283 RETURN_IF_EXCEPTION(scope, JSValue()); 284 scope.release(); 280 285 array->putDirectIndex(exec, index++, constructInternalProperty(exec, ASCIILiteral("result"), promise->result(exec->vm()))); 281 break;286 return array; 282 287 } 283 288 // FIXME: <https://webkit.org/b/141664> Web Inspector: ES6: Improved Support for Promises - Promise Reactions 289 RELEASE_ASSERT_NOT_REACHED(); 290 } 291 292 if (JSBoundFunction* boundFunction = jsDynamicCast<JSBoundFunction*>(value)) { 293 unsigned index = 0; 294 JSArray* array = constructEmptyArray(exec, nullptr); 295 RETURN_IF_EXCEPTION(scope, JSValue()); 296 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "targetFunction", boundFunction->targetFunction())); 297 RETURN_IF_EXCEPTION(scope, JSValue()); 298 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "boundThis", boundFunction->boundThis())); 299 RETURN_IF_EXCEPTION(scope, JSValue()); 300 if (boundFunction->boundArgs()) { 301 scope.release(); 302 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "boundArgs", boundFunction->boundArgs())); 303 return array; 304 } 284 305 return array; 285 306 } 286 307 287 if (JSBoundFunction* boundFunction = jsDynamicCast<JSBoundFunction*>(value)) {288 unsigned index = 0;289 JSArray* array = constructEmptyArray(exec, nullptr);290 RETURN_IF_EXCEPTION(scope, JSValue());291 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "targetFunction", boundFunction->targetFunction()));292 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "boundThis", boundFunction->boundThis()));293 if (boundFunction->boundArgs())294 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "boundArgs", boundFunction->boundArgs()));295 return array;296 }297 298 308 if (ProxyObject* proxy = jsDynamicCast<ProxyObject*>(value)) { 299 309 unsigned index = 0; … … 301 311 RETURN_IF_EXCEPTION(scope, JSValue()); 302 312 array->putDirectIndex(exec, index++, constructInternalProperty(exec, ASCIILiteral("target"), proxy->target())); 313 RETURN_IF_EXCEPTION(scope, JSValue()); 314 scope.release(); 303 315 array->putDirectIndex(exec, index++, constructInternalProperty(exec, ASCIILiteral("handler"), proxy->handler())); 304 316 return array; … … 314 326 RETURN_IF_EXCEPTION(scope, JSValue()); 315 327 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "array", iteratedValue)); 328 RETURN_IF_EXCEPTION(scope, JSValue()); 329 scope.release(); 316 330 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "kind", kind)); 317 331 return array; … … 336 350 RETURN_IF_EXCEPTION(scope, JSValue()); 337 351 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "map", mapIterator->iteratedValue())); 352 RETURN_IF_EXCEPTION(scope, JSValue()); 353 scope.release(); 338 354 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "kind", jsNontrivialString(exec, kind))); 339 355 return array; … … 357 373 RETURN_IF_EXCEPTION(scope, JSValue()); 358 374 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "set", setIterator->iteratedValue())); 375 RETURN_IF_EXCEPTION(scope, JSValue()); 376 scope.release(); 359 377 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "kind", jsNontrivialString(exec, kind))); 360 378 return array; … … 365 383 JSArray* array = constructEmptyArray(exec, nullptr, 1); 366 384 RETURN_IF_EXCEPTION(scope, JSValue()); 385 scope.release(); 367 386 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "string", stringIterator->iteratedValue(exec))); 368 387 return array; … … 373 392 JSArray* array = constructEmptyArray(exec, nullptr, 1); 374 393 RETURN_IF_EXCEPTION(scope, JSValue()); 394 scope.release(); 375 395 array->putDirectIndex(exec, index++, constructInternalProperty(exec, "object", propertyNameIterator->iteratedValue())); 376 396 return array; … … 437 457 entry->putDirect(exec->vm(), Identifier::fromString(exec, "value"), it->value.get()); 438 458 array->putDirectIndex(exec, fetched++, entry); 459 RETURN_IF_EXCEPTION(scope, JSValue()); 439 460 if (numberToFetch && fetched >= numberToFetch) 440 461 break; … … 483 504 entry->putDirect(exec->vm(), Identifier::fromString(exec, "value"), it->key); 484 505 array->putDirectIndex(exec, fetched++, entry); 506 RETURN_IF_EXCEPTION(scope, JSValue()); 485 507 if (numberToFetch && fetched >= numberToFetch) 486 508 break; … … 553 575 entry->putDirect(exec->vm(), Identifier::fromString(exec, "value"), nextValue); 554 576 array->putDirectIndex(exec, i, entry); 577 if (UNLIKELY(scope.exception())) 578 break; 555 579 } 556 580 -
trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp
r206386 r208923 129 129 JSValue JSJavaScriptCallFrame::scopeDescriptions(ExecState* exec) 130 130 { 131 VM& vm = exec->vm(); 132 auto throwScope = DECLARE_THROW_SCOPE(vm); 133 131 134 DebuggerScope* scopeChain = impl().scopeChain(); 132 135 if (!scopeChain) … … 144 147 description->putDirect(exec->vm(), Identifier::fromString(exec, "location"), valueForScopeLocation(exec, scope->location())); 145 148 array->putDirectIndex(exec, index++, description); 149 RETURN_IF_EXCEPTION(throwScope, JSValue()); 146 150 } 147 151
Note: See TracChangeset
for help on using the changeset viewer.