Title: [277524] trunk/Source/_javascript_Core
Revision
277524
Author
[email protected]
Date
2021-05-14 17:47:33 -0700 (Fri, 14 May 2021)

Log Message

REGRESSION (r277221): 2 test262 tests failing
https://bugs.webkit.org/show_bug.cgi?id=225819

Reviewed by Alexey Shvayka.

Undo the other part of r277221's code consolidation --
I'd forgotten that this exists to enforce a evaluation order on AggregateError's arguments.

* runtime/AggregateError.cpp:
(JSC::createAggregateError):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (277523 => 277524)


--- trunk/Source/_javascript_Core/ChangeLog	2021-05-15 00:29:19 UTC (rev 277523)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-05-15 00:47:33 UTC (rev 277524)
@@ -1,3 +1,16 @@
+2021-05-14  Ross Kirsling  <[email protected]>
+
+        REGRESSION (r277221): 2 test262 tests failing
+        https://bugs.webkit.org/show_bug.cgi?id=225819
+
+        Reviewed by Alexey Shvayka.
+
+        Undo the other part of r277221's code consolidation --
+        I'd forgotten that this exists to enforce a evaluation order on AggregateError's arguments.
+
+        * runtime/AggregateError.cpp:
+        (JSC::createAggregateError):
+
 2021-05-14  Mark Lam  <[email protected]>
 
         Implement Baseline JIT property access slow paths using JIT thunks.

Modified: trunk/Source/_javascript_Core/runtime/AggregateError.cpp (277523 => 277524)


--- trunk/Source/_javascript_Core/runtime/AggregateError.cpp	2021-05-15 00:29:19 UTC (rev 277523)
+++ trunk/Source/_javascript_Core/runtime/AggregateError.cpp	2021-05-15 00:47:33 UTC (rev 277524)
@@ -37,6 +37,16 @@
 {
     auto scope = DECLARE_THROW_SCOPE(vm);
 
+    String messageString = message.isUndefined() ? String() : message.toWTFString(globalObject);
+    RETURN_IF_EXCEPTION(scope, nullptr);
+
+    JSValue cause;
+    if (options.isObject()) {
+        // Since `throw undefined;` is valid, we need to distinguish the case where `cause` is an explicit undefined.
+        cause = asObject(options)->getIfPropertyExists(globalObject, vm.propertyNames->cause);
+        RETURN_IF_EXCEPTION(scope, nullptr);
+    }
+
     MarkedArgumentBuffer errorsList;
     forEachInIterable(globalObject, errors, [&] (VM&, JSGlobalObject*, JSValue nextValue) {
         errorsList.append(nextValue);
@@ -48,8 +58,7 @@
     auto* array = constructArray(globalObject, static_cast<ArrayAllocationProfile*>(nullptr), errorsList);
     RETURN_IF_EXCEPTION(scope, nullptr);
 
-    auto* error = ErrorInstance::create(globalObject, structure, message, options, appender, type, ErrorType::AggregateError, useCurrentFrame);
-    RETURN_IF_EXCEPTION(scope, nullptr);
+    auto* error = ErrorInstance::create(globalObject, vm, structure, messageString, cause, appender, type, ErrorType::AggregateError, useCurrentFrame);
     error->putDirect(vm, vm.propertyNames->errors, array, static_cast<unsigned>(PropertyAttribute::DontEnum));
     return error;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to