Skip to content

dart2js should throw TypeErrorImplementation for both Cast and Type errors #41007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
leafpetersen opened this issue Mar 12, 2020 · 3 comments
Closed
Assignees
Labels
area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop web-dart2js web-dev-compiler

Comments

@leafpetersen
Copy link
Member

leafpetersen commented Mar 12, 2020

Per #40763, I landed the change to make the dart2js implementation classes TypeErrorImplementation and CastErrorImplementation both implement TypeError and CastError here.

CastError will be deprecated in a follow up CL. The web compilers should be changed to throw instances of a single implementation class (TypeErrorImplementation) for all implicit and explicit casts. This change should be non-breaking given the changes in my CL.

cc @sigmundch @rakudrama @fishythefish @nshahan

@leafpetersen leafpetersen added the area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop label Mar 12, 2020
@leafpetersen leafpetersen changed the title dart2js should throw TypeErrorImpl for both Cast and Type errors dart2js should throw TypeErrorImplementation for both Cast and Type errors Mar 12, 2020
@rakudrama
Copy link
Member

js_runtime now has a single _TypeError class that implements both TypeError and CastError interfaces.

js_dev_runtime has two 'Impl' classes, both implementing TypeError and CastError.
@nshahan perhaps these could be merged.

@nshahan
Copy link
Contributor

nshahan commented Oct 20, 2021

I'll take a look. Since this has already been done in dart2js I'll reassign the issue.

@nshahan nshahan self-assigned this Oct 20, 2021
@nshahan
Copy link
Contributor

nshahan commented Nov 16, 2021

All uses of CastErrorImpl were already migrated to TypeErrorImpl in https://dart-review.googlesource.com/c/sdk/+/139490. I'm sending out a change to finally delete CastErrorImpl and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop web-dart2js web-dev-compiler
Projects
None yet
Development

No branches or pull requests

4 participants