Skip to content
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

[pkg:js] Disallow users from using synthetic constructors for @staticInterop #49941

Closed
srujzs opened this issue Sep 9, 2022 · 0 comments · Fixed by flutter/engine#37443 or flutter/flutter#115094
Assignees
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. web-js-interop Issues that impact all js interop

Comments

@srujzs
Copy link
Contributor

srujzs commented Sep 9, 2022

Currently, users can write interop classes and call synthetic constructors and they will hit no checks. In the Wasm case, generative constructors are a pain point, so a synthetic constructor should be disallowed. Synthetic constructors should compile to the same code as factories with and without the @anonymous annotation. We should check for invocations of synthetic constructors and disallow them and advise them to use non-synthetic constructors instead.

Related:

#48730
#49350

cc @sigmundch @joshualitt

@srujzs srujzs added web-js-interop Issues that impact all js interop area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. labels Sep 9, 2022
@srujzs srujzs self-assigned this Sep 9, 2022
srujzs added a commit to srujzs/engine that referenced this issue Nov 8, 2022
…c constructor

Per dart-lang/sdk#49941, synthetic constructors
will be disallowed on @staticInterop classes. Functionally, they are lowered
to the same code.

Also fixes an erroneous call to the DomHTMLStyleConstructor instead of the
relevant factory method.
srujzs added a commit to srujzs/engine that referenced this issue Nov 9, 2022
…c constructor

Per dart-lang/sdk#49941, synthetic constructors
will be disallowed on @staticInterop classes. Functionally, they are lowered
to the same code.

Also fixes an erroneous call to the DomHTMLStyleConstructor instead of the
relevant factory method.
joshualitt pushed a commit to flutter/engine that referenced this issue Nov 10, 2022
…c constructor (#37443)

Per dart-lang/sdk#49941, synthetic constructors
will be disallowed on @staticInterop classes. Functionally, they are lowered
to the same code.

Also fixes an erroneous call to the DomHTMLStyleConstructor instead of the
relevant factory method.
schwa423 pushed a commit to schwa423/engine that referenced this issue Nov 16, 2022
…c constructor (flutter#37443)

Per dart-lang/sdk#49941, synthetic constructors
will be disallowed on @staticInterop classes. Functionally, they are lowered
to the same code.

Also fixes an erroneous call to the DomHTMLStyleConstructor instead of the
relevant factory method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. web-js-interop Issues that impact all js interop
Projects
None yet
1 participant