-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as duplicate of#55138
Closed as duplicate of#55138
Copy link
Labels
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-js-interopIssues that impact all js interopIssues that impact all js interop
Description
Dart currently supports renaming properties in an extension type by doing the following:
extension type TestObject._(JSObject _) {
@JS('property')
external String prop;
}
However, it is not possible to rename these same properties during construction of the type, especially anonymous types. For example, the following does not work:
extension type TestObject._(JSObject _) {
@JS('property')
external String prop;
external factory TestObject({
@JS('property') required String,
});
The a workaround for this is to either leave the names of parameters in the constructor, or to assign the properties in the body of a factory constructor, but having constructor parameter name renaming would be a much cleaner solution.
simolus3, YukiAttano, ykmnkmi and iapicca
Metadata
Metadata
Assignees
Labels
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-js-interopIssues that impact all js interopIssues that impact all js interop