-
Notifications
You must be signed in to change notification settings - Fork 34
[interop] Add Support for Enums #404
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
Merged
Merged
+767
−81
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
srujzs
reviewed
Jul 3, 2025
srujzs
reviewed
Jul 8, 2025
srujzs
approved these changes
Jul 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just two more nits, sorry :)
srujzs
approved these changes
Jul 8, 2025
Thanks Nike! |
copybara-service bot
pushed a commit
to dart-lang/sdk
that referenced
this pull request
Jul 10, 2025
Revisions updated by `dart tools/rev_sdk_deps.dart`. http (https://github.com/dart-lang/http/compare/7d2d87e..4209e84): 4209e84 2025-07-09 Brian Quinlan [cronet_http] Upgrade to kotlin 1.8.10 (dart-lang/http#1789) d2886a0 2025-07-08 dependabot[bot] Bump subosito/flutter-action in the github-actions group (dart-lang/http#1784) 4097219 2025-07-08 Brian Quinlan Prepare to release 1.5.0-beta (dart-lang/http#1787) a4f5a8d 2025-07-08 Luka S feat: support aborting HTTP requests (dart-lang/http#1773) i18n (https://github.com/dart-lang/i18n/compare/42c4932..c45e050): c45e0504 2025-07-09 Googler No public description bdb94c25 2025-07-09 Googler No public description tools (https://github.com/dart-lang/tools/compare/6282b35..fd7cc89): fd7cc89a 2025-07-09 Nate Biggs Fix wasm dry run event and tests (dart-lang/tools#2128) 1500539b 2025-07-09 Liam Appelbe [coverage] Expose `filterIgnored` function (dart-lang/tools#2123) 99634476 2025-07-08 Nate Biggs Add wasm dry run event to unified analytics. (dart-lang/tools#2125) web (https://github.com/dart-lang/web/compare/fb8a149..354e229): 354e229 2025-07-09 Nikechukwu [interop] Add Support for Typealiases (dart-lang/web#407) f0f0914 2025-07-08 Nikechukwu [interop] Add Support for Enums (dart-lang/web#404) Change-Id: Ia691d4ca8d20ccb1d7a96598c369dabaf9124850 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439804 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Auto-Submit: Devon Carew <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #393 and #384
This PR adds support for enumerations in the Dart JS Interop Interface Gen project.
Enums in TS with the
enum
keyword are mapped to (constant) Dart extension types with the values being static properties.Therefore:
Turns into:
This enum pattern is used to represent TS Syntax Kinds in the generator.
Although the vast majority of enums declared with the
enum
keyword are homogenous with defined number or string values:JSAny
This PR also supports homogenous union types as enums (i.e
"north" | "south" | "east" | "west"
), translating them to become enum declarations.