Changeset 206476 in webkit
- Timestamp:
- Sep 27, 2016 5:26:15 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r206472 r206476 1 2016-09-27 Mark Lam <mark.lam@apple.com> 2 3 createError() and JSObject::calculatedClassName() should not throw any exceptions. 4 https://bugs.webkit.org/show_bug.cgi?id=162637 5 6 Reviewed by Geoffrey Garen. 7 8 * runtime/ExceptionHelpers.cpp: 9 (JSC::createError): 10 - assert that errorDescriptionForValue() did not throw an exception. 11 12 * runtime/JSObject.cpp: 13 (JSC::JSObject::calculatedClassName): 14 - the code already ensures that we always return a non-null String. Just need to 15 make sure that it catches its own exceptions. 16 1 17 2016-09-27 Filip Pizlo <fpizlo@apple.com> 2 18 -
trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
r206408 r206476 237 237 JSObject* createError(ExecState* exec, JSValue value, const String& message, ErrorInstance::SourceAppender appender) 238 238 { 239 VM& vm = exec->vm(); 240 auto scope = DECLARE_CATCH_SCOPE(vm); 241 239 242 String errorMessage = makeString(errorDescriptionForValue(exec, value)->value(exec), ' ', message); 243 ASSERT_UNUSED(scope, !scope.exception()); 240 244 JSObject* exception = createTypeError(exec, errorMessage, appender, runtimeTypeForValue(value)); 241 245 ASSERT(exception->isErrorInstance()); -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r206386 r206476 231 231 { 232 232 String prototypeFunctionName; 233 ExecState* exec = object->globalObject()->globalExec(); 233 auto globalObject = object->globalObject(); 234 VM& vm = globalObject->vm(); 235 auto scope = DECLARE_CATCH_SCOPE(vm); 236 237 ExecState* exec = globalObject->globalExec(); 234 238 PropertySlot slot(object->getPrototypeDirect(), PropertySlot::InternalMethodType::VMInquiry); 235 239 PropertyName constructor(exec->propertyNames().constructor); … … 240 244 if (JSCell* constructorCell = constructorValue.asCell()) { 241 245 if (JSObject* ctorObject = constructorCell->getObject()) { 242 VM& vm = exec->vm();243 246 if (JSFunction* constructorFunction = jsDynamicCast<JSFunction*>(ctorObject)) 244 247 prototypeFunctionName = constructorFunction->calculatedDisplayName(vm); … … 250 253 } 251 254 } 255 ASSERT(!scope.exception() || prototypeFunctionName.isNull()); 256 if (UNLIKELY(scope.exception())) 257 scope.clearException(); 252 258 253 259 if (prototypeFunctionName.isNull() || prototypeFunctionName == "Object") {
Note: See TracChangeset
for help on using the changeset viewer.