[JSC] Use ErrorInstance for AggregateError
Created attachment 423990 [details] Patch
Comment on attachment 423990 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423990&action=review > Source/JavaScriptCore/runtime/AggregateError.cpp:54 > + auto* array = constructArray(globalObject, static_cast<ArrayAllocationProfile*>(nullptr), errorsList); Surprised that we need the ArrayAllocationProfile cast. I don’t see so much overloading for constructArray that I would have expected ambiguity. > Source/JavaScriptCore/runtime/AggregateError.cpp:58 > + error->putDirect(vm, vm.propertyNames->errors, array, static_cast<unsigned>(PropertyAttribute::DontEnum)); We should consider moving from unsigned to OptionSet for property attributes. Not sure how people who regularly work on JavaScriptCore feel about that, but I would love it.
Comment on attachment 423990 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423990&action=review >> Source/JavaScriptCore/runtime/AggregateError.cpp:54 >> + auto* array = constructArray(globalObject, static_cast<ArrayAllocationProfile*>(nullptr), errorsList); > > Surprised that we need the ArrayAllocationProfile cast. I don’t see so much overloading for constructArray that I would have expected ambiguity. This static_cast is necessary since there is `JS_EXPORT_PRIVATE JSArray* constructArray(JSGlobalObject*, Structure*, const ArgList& values);`. >> Source/JavaScriptCore/runtime/AggregateError.cpp:58 >> + error->putDirect(vm, vm.propertyNames->errors, array, static_cast<unsigned>(PropertyAttribute::DontEnum)); > > We should consider moving from unsigned to OptionSet for property attributes. Not sure how people who regularly work on JavaScriptCore feel about that, but I would love it. We should consider this option at some point.
Committed r274893: <https://commits.webkit.org/r274893> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423990 [details].
<rdar://problem/75750983>