Skip to content

Commit

Permalink
Version 3.3.0-132.0.dev
Browse files Browse the repository at this point in the history
Merge 77ec617 into dev
  • Loading branch information
Dart CI committed Nov 14, 2023
2 parents f253c9f + 77ec617 commit a91208f
Show file tree
Hide file tree
Showing 87 changed files with 593 additions and 147 deletions.
3 changes: 2 additions & 1 deletion pkg/dart2wasm/lib/js/runtime_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ JSMethods _performJSInteropTransformations(
additionalCoreLibraries: {
'_js_helper',
'_js_types',
'convert',
'js_interop',
'js_interop_unsafe'
'js_interop_unsafe',
});
for (Library library in interopDependentLibraries) {
staticInteropClassEraser.visitLibrary(library);
Expand Down
2 changes: 2 additions & 0 deletions pkg/dart2wasm/lib/target.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ class WasmTarget extends Target {
component, Uri.parse("dart:_js_annotations")),
...?jsInteropHelper.calculateTransitiveImportsOfJsInteropIfUsed(
component, Uri.parse("dart:js_interop")),
...?jsInteropHelper.calculateTransitiveImportsOfJsInteropIfUsed(
component, Uri.parse("dart:convert")),
};
if (transitiveImportingJSInterop.isEmpty) {
logger?.call("Skipped JS interop transformations");
Expand Down
14 changes: 12 additions & 2 deletions pkg/front_end/test/fasta/textual_outline_suite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class TextualOutline extends Step<TestDescription, TestDescription, Context> {
context.suiteFolderOptions.computeFolderOptions(description);
Map<ExperimentalFlag, bool> experimentalFlags = folderOptions
.computeExplicitExperimentalFlags(context.forcedExperimentalFlags);
Map<ExperimentalFlag, bool> experimentalFlagsExplicit =
folderOptions.computeExplicitExperimentalFlags(const {});

List<int> bytes = new File.fromUri(description.uri).readAsBytesSync();
for (bool modelled in [false, true]) {
Expand Down Expand Up @@ -146,7 +148,15 @@ class TextualOutline extends Step<TestDescription, TestDescription, Context> {
if (!containsUnknownChunk) {
// Try to format only if it doesn't contain the unknown chunk marker.
try {
result = new DartFormatter().format(result);
List<String> experimentFlags = [];
for (MapEntry<ExperimentalFlag, bool> entry
in experimentalFlags.entries) {
if (entry.value) {
experimentFlags.add(entry.key.name);
}
}
result = new DartFormatter(experimentFlags: experimentFlags)
.format(result);
} catch (e, st) {
formatterException = e;
formatterExceptionSt = st;
Expand All @@ -171,7 +181,7 @@ class TextualOutline extends Step<TestDescription, TestDescription, Context> {
if (formatterException != null && !info.hasParserErrors) {
bool hasUnreleasedExperiment = false;
for (MapEntry<ExperimentalFlag, bool> entry
in experimentalFlags.entries) {
in experimentalFlagsExplicit.entries) {
if (entry.value) {
if (!entry.key.isEnabledByDefault) {
hasUnreleasedExperiment = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
@JS()
library static_interop;

import 'dart:js_interop';

@JS()
@staticInterop
class A {}

@JS()
extension type B._(A a) {
external B(A a);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
@JS()
library static_interop;

import 'dart:js_interop';

@JS()
@staticInterop
class A {}

@JS()
extension type B._(A a) {
external A field;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
@JS()
library static_interop;

import 'dart:js_interop';

@JS()
@staticInterop
class A {}

@JS()
extension type B._(A a) {
external B(A a);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
@JS()
library static_interop;

import 'dart:js_interop';

@JS()
@staticInterop
class A {}

@JS()
extension type B._(A a) {
external A field;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ class A {
int get getter => field;
void set setter(int value) {}
}

class B extends A {}

extension type E(B it) implements B {}
extension type F(B it) implements E {}
main() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ class A {
int method() => field;
void set setter(int value) {}
}

class B extends A {}

expect(expected, actual) {}
extension type E(B it) implements B {}
extension type F(B it) implements E {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
class A {}

class B extends A {}

extension type C(Object? o) {}
extension type D(Object o) {}
extension type E(B it) implements A {}
extension type F(B it) implements E, B {}
extension type G<T>(T o) {}
test<T1, T2 extends A>( Object o, A a, B b, C c, D d, E e, F f, G<T1> g1, G<T2> g2) {}
test<T1, T2 extends A>(
Object o, A a, B b, C c, D d, E e, F f, G<T1> g1, G<T2> g2) {}
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
class A {}

class B extends A {}

extension type C(Object? o) {}
extension type D(Object o) {}
extension type E(B it) implements A {}
extension type F(B it) implements E, B {}
extension type G<T>(T o) {}
test<T1, T2 extends A>( Object o, A a, B b, C c, D d, E e, F f, G<T1> g1, G<T2> g2) {}
test<T1, T2 extends A>(
Object o, A a, B b, C c, D d, E e, F f, G<T1> g1, G<T2> g2) {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extension type V1(Future<int> id) implements Future<int> {}
extension type V2<T extends Future<Object>>(T id) implements Future<Object>{}
extension type V2<T extends Future<Object>>(T id) implements Future<Object> {}
main() async {}
expect(expected, actual) {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
expect(expected, actual) {}
extension type V1(Future<int> id) implements Future<int> {}
extension type V2<T extends Future<Object>>(T id) implements Future<Object>{}
extension type V2<T extends Future<Object>>(T id) implements Future<Object> {}
main() async {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ abstract class A {
(Object?, dynamic) get getter;
void set setter((int, int) Function(Object?, dynamic) f);
}

abstract class B {
(dynamic, Object?) method();
(dynamic, Object?) get getter;
void set setter((int, int) Function(dynamic, Object?) f);
}

class C implements A, B {
(int, int) method() => (42, 87);
(int, int) get getter => (42, 87);
void set setter((int, int) Function(dynamic, dynamic) f) {}
}

extension type E(C c) implements A, B {}
(Object?, Object?) testMethod0(E e) => e.method();
(int, Object?) testMethod1(E e) => e.method();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,25 @@
(int, Object?) testGetter1(E e) => e.getter;
(int, Object?) testMethod1(E e) => e.method();
E e = E(C());

abstract class A {
(Object?, dynamic) get getter;
(Object?, dynamic) method();
void set setter((int, int) Function(Object?, dynamic) f);
}

abstract class B {
(dynamic, Object?) get getter;
(dynamic, Object?) method();
void set setter((int, int) Function(dynamic, Object?) f);
}

class C implements A, B {
(int, int) get getter => (42, 87);
(int, int) method() => (42, 87);
void set setter((int, int) Function(dynamic, dynamic) f) {}
}

expect(expected, actual) {}
extension type E(C c) implements A, B {}
main() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
class C1 {
void x() {}
}

class C2 implements C1 {
static int get x => 1;
}

extension type I1(int id) {
void x() {}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
class C1 {
void x() {}
}

class C2 implements C1 {
static int get x => 1;
}

extension type ET1(int id) implements I1 {
static int get x => 1;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class Class<T> {
const Class();
}

extension type const ExtensionType<T>(T id) {}
const a1 = Class<int>;
const a2 = ExtensionType<Class<int>>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class Class<T> {
const Class();
}

const a1 = Class<int>;
const a2 = ExtensionType<Class<int>>;
const a3 = Class<bool>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
extension type ExtensionType(int it) {
ExtensionType.constructorAndMethod();
void constructorAndMethod() {}
factory ExtensionType.factoryAndMethod() => new ExtensionType.constructorAndMethod();
factory ExtensionType.factoryAndMethod() =>
new ExtensionType.constructorAndMethod();
void factoryAndMethod() {}
factory ExtensionType.redirectingFactoryAndMethod() = ExtensionType.constructorAndMethod;
factory ExtensionType.redirectingFactoryAndMethod() =
ExtensionType.constructorAndMethod;
void redirectingFactoryAndMethod() {}
ExtensionType.constructorAndGetter();
dynamic get constructorAndGetter => null;
factory ExtensionType.factoryAndGetter() => new ExtensionType.constructorAndGetter();
factory ExtensionType.factoryAndGetter() =>
new ExtensionType.constructorAndGetter();
dynamic get factoryAndGetter => null;
factory ExtensionType.redirectingFactoryAndGetter() = ExtensionType.constructorAndGetter;
factory ExtensionType.redirectingFactoryAndGetter() =
ExtensionType.constructorAndGetter;
dynamic get redirectingFactoryAndGetter => null;
ExtensionType.constructorAndSetter();
void set constructorAndSetter(value) {}
factory ExtensionType.factoryAndSetter() => new ExtensionType.constructorAndSetter();
factory ExtensionType.factoryAndSetter() =>
new ExtensionType.constructorAndSetter();
void set factoryAndSetter(value) {}
factory ExtensionType.redirectingFactoryAndSetter() = ExtensionType.constructorAndSetter;
factory ExtensionType.redirectingFactoryAndSetter() =
ExtensionType.constructorAndSetter;
void set redirectingFactoryAndSetter(value) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ extension type ExtensionType(int it) {
dynamic get constructorAndGetter => null;
dynamic get factoryAndGetter => null;
dynamic get redirectingFactoryAndGetter => null;
factory ExtensionType.factoryAndGetter() => new ExtensionType.constructorAndGetter();
factory ExtensionType.factoryAndMethod() => new ExtensionType.constructorAndMethod();
factory ExtensionType.factoryAndSetter() => new ExtensionType.constructorAndSetter();
factory ExtensionType.redirectingFactoryAndGetter() = ExtensionType.constructorAndGetter;
factory ExtensionType.redirectingFactoryAndMethod() = ExtensionType.constructorAndMethod;
factory ExtensionType.redirectingFactoryAndSetter() = ExtensionType.constructorAndSetter;
factory ExtensionType.factoryAndGetter() =>
new ExtensionType.constructorAndGetter();
factory ExtensionType.factoryAndMethod() =>
new ExtensionType.constructorAndMethod();
factory ExtensionType.factoryAndSetter() =>
new ExtensionType.constructorAndSetter();
factory ExtensionType.redirectingFactoryAndGetter() =
ExtensionType.constructorAndGetter;
factory ExtensionType.redirectingFactoryAndMethod() =
ExtensionType.constructorAndMethod;
factory ExtensionType.redirectingFactoryAndSetter() =
ExtensionType.constructorAndSetter;
void constructorAndMethod() {}
void factoryAndMethod() {}
void redirectingFactoryAndMethod() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
class A {}

class B implements A {
@override
bool operator ==(covariant A other) {}
}

class C {}

extension type ET1(B b) implements A {}
extension type ET2(B b) implements ET1, B {}
void test() {}
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
class A {}

class B implements A {
@override
bool operator ==(covariant A other) {}
}

class C {}

extension type ET1(B b) implements A {}
extension type ET2(B b) implements ET1, B {}
void test() {}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ extension type ExtensionType4(int it) {
int get getter => it;
void set setter(int value) {}
int method() => it;
int operator[](int index) => it;
void operator[]=(int index, int value) {}
int operator [](int index) => it;
void operator []=(int index, int value) {}
static int staticField = 42;
static int get staticGetter => 42;
static void set staticSetter(int value) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ extension type ExtensionType4(int it) {
final int field = 42;
int get getter => it;
int method() => it;
int operator[](int index) => it;
int operator [](int index) => it;
static int get staticGetter => 42;
static int staticField = 42;
static int staticMethod() => 42;
static void set staticSetter(int value) {}
void operator[]=(int index, int value) {}
void operator []=(int index, int value) {}
void set setter(int value) {}
}
extension type ExtensionType5.new(int it) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
abstract class A {}

extension type B._(A a) {
external B(A a);
external B.named(int i);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
abstract class A {}

extension type B._(A a) {
external A field;
external A method();
Expand Down
Loading

0 comments on commit a91208f

Please sign in to comment.