-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dart2js] Handle object literal constructors with no library @js anno…
…tation Fixes #54801 Object literal constructors need to be explicitly handled when determining a member is JS interop or not in dart2js as it does not require any @js annotations. Change-Id: Iee99375439057844485aa3f5cd88f85f5d03ae06 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349840 Reviewed-by: Stephen Adams <[email protected]> Commit-Queue: Srujan Gaddam <[email protected]>
- Loading branch information
Showing
4 changed files
with
63 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
23 changes: 23 additions & 0 deletions
23
..._interop_test/extension_type/object_literal_constructor_with_library_annotation_test.dart
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
// Validate that the library adding an annotation doesn't change the backend's | ||
// lowerings. | ||
|
||
@JS() | ||
library object_literal_constructor_with_library_annotation_test; | ||
|
||
import 'dart:js_interop'; | ||
|
||
import 'object_literal_constructor_test.dart' show testProperties; | ||
|
||
extension type Literal._(JSObject _) implements JSObject { | ||
external Literal({double? a}); | ||
external factory Literal.fact({double? a}); | ||
} | ||
|
||
void main() { | ||
testProperties(Literal()); | ||
testProperties(Literal.fact(a: 0.0), a: 0.0); | ||
} |