Changeset 271731 in webkit for trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
- Timestamp:
- Jan 21, 2021, 6:51:26 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r271568 r271731 800 800 801 801 auto catchScope = DECLARE_CATCH_SCOPE(vm); 802 auto reject = [&] (JSValue rejectionReason) { 802 803 auto reject = [&](Exception* exception) { 804 if (UNLIKELY(isTerminatedExecutionException(vm, exception))) 805 return promise; 806 JSValue error = exception->value(); 803 807 catchScope.clearException(); 804 promise->reject(globalObject, rejectionReason); 805 catchScope.clearException(); 806 return JSValue::encode(promise); 808 promise->reject(globalObject, error); 809 return promise; 807 810 }; 808 811 … … 811 814 auto* specifier = callFrame->uncheckedArgument(0).toString(globalObject); 812 815 if (Exception* exception = catchScope.exception()) 813 return reject(exception->value());816 return JSValue::encode(reject(exception)); 814 817 815 818 // We always specify parameters as undefined. Once dynamic import() starts accepting fetching parameters, … … 818 821 auto* internalPromise = globalObject->moduleLoader()->importModule(globalObject, specifier, parameters, sourceOrigin); 819 822 if (Exception* exception = catchScope.exception()) 820 return reject(exception->value()); 823 return JSValue::encode(reject(exception)); 824 821 825 promise->resolve(globalObject, internalPromise); 822 823 catchScope.clearException();824 826 return JSValue::encode(promise); 825 827 }
Note:
See TracChangeset
for help on using the changeset viewer.