Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks it is a compile-time error if a class is annotated with
/// `@staticInterop` but has no `@JS()` annotation.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks it is a compile-time error if an enum is annotated with
/// `@staticInterop`.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks that it is a compile-time error if an extension is
/// annotated with `@staticInterop`.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks that it is a warning if a mixin is annotated with
/// `@staticInterop`.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks that it is a warning if an extension type is annotated
/// with `@staticInterop`.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t06.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks that it is a warning if a declaration that isn't a JS
/// interop class is annotated with `@staticInterop`.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t07.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks that it is a warning if a local declaration is annotated
/// with `@staticInterop`.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t08.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks that it is a warning if a class member is annotated with
/// `@staticInterop`.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t09.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks that it is a warning if a mixin member is annotated with
/// `@staticInterop`.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t10.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks that it is a warning if an enum member is annotated with
/// `@staticInterop`.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t11.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks that it is a warning if an extension type member is
/// annotated with `@staticInterop`.
Expand Down
23 changes: 20 additions & 3 deletions LibTest/js_interop/staticInterop_A01_t12.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
/// @assertion `staticInterop` enables the JS annotated class to be treated as
/// a "static" interop class.
///
/// These classes allow interop with native types, like the ones in `dart:html`.
/// These classes should not contain any instance members, inherited or
/// otherwise, and should instead use static extension members.
/// These classes implicitly all erase to the internal interceptor
/// `JavaScriptObject`, so they can be freely casted to and from other
/// [staticInterop] types, `dart:html` types, and `JSObject` from
/// `dart:js_interop`. Non-[staticInterop] `package:js` types can be casted to
/// [staticInterop] types, but the reverse can fail if the underlying value is a
/// `@Native`-reserved type (like `dart:html` types).
///
/// [staticInterop] classes have the following restrictions:
/// - They must contain a [JS] annotation, either from this library or from
/// `dart:js_interop`.
/// - They should not contain any instance members, inherited or otherwise, and
/// should instead use static extension members, which can be external or
/// non-external.
/// - They can only contain factories and `static` members. They can be
/// combined with [anonymous] to make external factories create new
/// JavaScript object literals instead.
/// - They should not implement, extend, or mixin non-[staticInterop] classes
/// and vice-versa.
/// - The annotation should only be applied to non-mixin classes and no other
/// declarations.
///
/// @description Checks that it is a warning if an extension member is annotated
/// with `@staticInterop`.
Expand Down
Loading