diff --git a/LibTest/js_interop/staticInterop_A01_t01.dart b/LibTest/js_interop/staticInterop_A01_t01.dart index cbf0bcd10c..616f979d5e 100644 --- a/LibTest/js_interop/staticInterop_A01_t01.dart +++ b/LibTest/js_interop/staticInterop_A01_t01.dart @@ -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. diff --git a/LibTest/js_interop/staticInterop_A01_t02.dart b/LibTest/js_interop/staticInterop_A01_t02.dart index e1a93c5b98..d1edb9113d 100644 --- a/LibTest/js_interop/staticInterop_A01_t02.dart +++ b/LibTest/js_interop/staticInterop_A01_t02.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A01_t03.dart b/LibTest/js_interop/staticInterop_A01_t03.dart index 43f9d2dd1b..3c44107db0 100644 --- a/LibTest/js_interop/staticInterop_A01_t03.dart +++ b/LibTest/js_interop/staticInterop_A01_t03.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A01_t04.dart b/LibTest/js_interop/staticInterop_A01_t04.dart index cc8efeb452..cf8bd4d6a1 100644 --- a/LibTest/js_interop/staticInterop_A01_t04.dart +++ b/LibTest/js_interop/staticInterop_A01_t04.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A01_t05.dart b/LibTest/js_interop/staticInterop_A01_t05.dart index bffdd6e1cb..fbcda45a28 100644 --- a/LibTest/js_interop/staticInterop_A01_t05.dart +++ b/LibTest/js_interop/staticInterop_A01_t05.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A01_t06.dart b/LibTest/js_interop/staticInterop_A01_t06.dart index 403abb0c1d..4a073d3f24 100644 --- a/LibTest/js_interop/staticInterop_A01_t06.dart +++ b/LibTest/js_interop/staticInterop_A01_t06.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A01_t07.dart b/LibTest/js_interop/staticInterop_A01_t07.dart index 949c901d84..a8954cfd0c 100644 --- a/LibTest/js_interop/staticInterop_A01_t07.dart +++ b/LibTest/js_interop/staticInterop_A01_t07.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A01_t08.dart b/LibTest/js_interop/staticInterop_A01_t08.dart index 380e43a247..369d77f9be 100644 --- a/LibTest/js_interop/staticInterop_A01_t08.dart +++ b/LibTest/js_interop/staticInterop_A01_t08.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A01_t09.dart b/LibTest/js_interop/staticInterop_A01_t09.dart index 17de035f15..a2fc183e6f 100644 --- a/LibTest/js_interop/staticInterop_A01_t09.dart +++ b/LibTest/js_interop/staticInterop_A01_t09.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A01_t10.dart b/LibTest/js_interop/staticInterop_A01_t10.dart index 72414ff58b..2ac71b24bb 100644 --- a/LibTest/js_interop/staticInterop_A01_t10.dart +++ b/LibTest/js_interop/staticInterop_A01_t10.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A01_t11.dart b/LibTest/js_interop/staticInterop_A01_t11.dart index ea8a90bada..9be0f2c0b4 100644 --- a/LibTest/js_interop/staticInterop_A01_t11.dart +++ b/LibTest/js_interop/staticInterop_A01_t11.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A01_t12.dart b/LibTest/js_interop/staticInterop_A01_t12.dart index bcdc8d2d8d..2c4d70c319 100644 --- a/LibTest/js_interop/staticInterop_A01_t12.dart +++ b/LibTest/js_interop/staticInterop_A01_t12.dart @@ -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`. diff --git a/LibTest/js_interop/staticInterop_A02_t01.dart b/LibTest/js_interop/staticInterop_A02_t01.dart index d754ffa4ff..c0c61aac83 100644 --- a/LibTest/js_interop/staticInterop_A02_t01.dart +++ b/LibTest/js_interop/staticInterop_A02_t01.dart @@ -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 a class annotated /// with `@staticInterop` declares any instance members. diff --git a/LibTest/js_interop/staticInterop_A02_t02.dart b/LibTest/js_interop/staticInterop_A02_t02.dart index 0a9ac8cd50..6873061901 100644 --- a/LibTest/js_interop/staticInterop_A02_t02.dart +++ b/LibTest/js_interop/staticInterop_A02_t02.dart @@ -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 not an error if a class annotated with /// `@staticInterop` declares static members. diff --git a/LibTest/js_interop/staticInterop_A02_t03.dart b/LibTest/js_interop/staticInterop_A02_t03.dart index 68f5b87bd2..87cbade09b 100644 --- a/LibTest/js_interop/staticInterop_A02_t03.dart +++ b/LibTest/js_interop/staticInterop_A02_t03.dart @@ -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 a class annotated /// with `@staticInterop` declares any generative constructors. diff --git a/LibTest/js_interop/staticInterop_A02_t04.dart b/LibTest/js_interop/staticInterop_A02_t04.dart index 08f09132de..eefec99fff 100644 --- a/LibTest/js_interop/staticInterop_A02_t04.dart +++ b/LibTest/js_interop/staticInterop_A02_t04.dart @@ -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 a class annotated /// with `@staticInterop` declares any external generative constructors. diff --git a/LibTest/js_interop/staticInterop_A03_t01.dart b/LibTest/js_interop/staticInterop_A03_t01.dart index 8991bc2ee1..c55965f1f4 100644 --- a/LibTest/js_interop/staticInterop_A03_t01.dart +++ b/LibTest/js_interop/staticInterop_A03_t01.dart @@ -5,9 +5,27 @@ /// @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 a class annotated with `@staticInterop` can interop /// with JS objects.