Closed Bug 1769849 Opened 3 years ago Closed 3 years ago

Consider reporting more information when ShadowRealm execution fails

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: mgaudet, Assigned: mgaudet)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

When a wrapped function, or ShadowRealm.prototype.evauate throws, the ShadowRealm proposal wraps all failures in a new TypeError.

It would be nice to annotate that type error with more information, to help programmers work with ShadowRealms (as is, the developer experience is sort of dreadful, as all failures look identical)

We could inspect and copy out the .message and .name properties, though, only using pure operations to avoid potential side-effects inside the shadow realm (unless https://github.com/tc39/proposal-shadowrealm/issues/353 is resolved in such a way that side effects are allowed)

Severity: -- → S3
Priority: -- → P1

Conditionally attempt to extract .name and .message and use for issuing error.

Assignee: nobody → mgaudet
Status: NEW → ASSIGNED

Conditionally try to extract .name and .message and use in error message.

Depends on D151849

Pushed by mgaudet@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8552d20058cf Improve ShadowRealm.evaluate errors r=evilpie https://hg.mozilla.org/integration/autoland/rev/262ce0dc4a1e Improve errors from wrapped functions throwing r=jandem
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: