| Summary: | [JSC] Use ErrorInstance for AggregateError | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||
| Component: | New Bugs | Assignee: | Yusuke Suzuki <ysuzuki> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | darin, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Yusuke Suzuki
2021-03-22 23:28:30 PDT
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]. |