-
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] Skip interop extension type object literal constructors dur…
…ing serialization Fixes #57008 dart2js was mistakenly assuming the generated procedures for these constructors are top-level external interop members and accidentally generating invalid code. We should skip serializing these procedures. This should be safe since any invocation of these procedures are transformed in visitStaticInvocation. Change-Id: If11c718bea8447b60de00b73f328a3cdd5544bda Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393001 Auto-Submit: Srujan Gaddam <srujzs@google.com> Commit-Queue: Srujan Gaddam <srujzs@google.com> Reviewed-by: Nate Biggs <natebiggs@google.com>
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 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
9 changes: 9 additions & 0 deletions
9
tests/modular/js_interop_object_literal_constructor_with_extension_types/def.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,9 @@ | ||
// 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. | ||
|
||
import 'dart:js_interop'; | ||
|
||
extension type ObjectLiteral._(JSObject _) implements JSObject { | ||
external factory ObjectLiteral({int foo}); | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/modular/js_interop_object_literal_constructor_with_extension_types/main.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,9 @@ | ||
// 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. | ||
|
||
import 'def.dart'; | ||
|
||
void main() { | ||
ObjectLiteral(foo: 0); | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/modular/js_interop_object_literal_constructor_with_extension_types/modules.yaml
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,9 @@ | ||
# 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. | ||
# | ||
# Regression test for https://github.com/dart-lang/sdk/issues/57008: Test that | ||
# we skip generated procedures for object literal constructors when we serialize | ||
# the codegen. All invocations of such procedures are transformed. | ||
dependencies: | ||
main: def |