| Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
|
| diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
|
| index e91d790839ffbc3f9cb6bedcf6afedbd65988763..cdc14c1c37a9279066a7ac4831f04da8572ddd81 100644
|
| --- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
|
| +++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
|
| @@ -203,6 +203,21 @@ getType(obj) => JS(
|
| return $obj == null ? $Object : $obj.__proto__.constructor;
|
| })()''');
|
|
|
| +bool isJsInterop(obj) {
|
| + if (JS('bool', 'typeof # === "function"', obj)) {
|
| + // A function is a Dart function if it has runtime type information.
|
| + return _getRuntimeType(obj) == null;
|
| + }
|
| + // Primitive types are not JS interop types.
|
| + if (JS('bool', 'typeof # !== "object"', obj)) return false;
|
| +
|
| + // Extension types are not considered JS interop types.
|
| + // Note that it is still possible to call typed JS interop methods on
|
| + // extension types but the calls must be statically typed.
|
| + if (getExtensionType(obj) != null) return false;
|
| + return JS('bool', '!($obj instanceof $Object)');
|
| +}
|
| +
|
| /// Get the type of a method from a type using the stored signature
|
| getMethodType(type, name) => JS(
|
| '',
|
|
|