diff --git a/pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart b/pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart index c8cd9e8ea7c..cad1e2525df 100644 --- a/pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart +++ b/pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart @@ -671,6 +671,7 @@ class JsUtilOptimizer extends Transformer { /// Returns whether the given DartType is guaranteed to be not a function /// and therefore allowed to interop with JS. bool _allowedInteropType(DartType type) { + type = type.extensionTypeErasure; if (type is InterfaceType) { return type.classNode != _coreTypes.functionClass && type.classNode != _coreTypes.objectClass; diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt index 32567bde15e..6c0af482383 100644 --- a/pkg/front_end/test/spell_checking_list_tests.txt +++ b/pkg/front_end/test/spell_checking_list_tests.txt @@ -113,6 +113,7 @@ builddir bulkcompile busy busywait +bx bye c's ca diff --git a/pkg/front_end/testcases/dart2js/extension_types/external.dart.strong.transformed.expect b/pkg/front_end/testcases/dart2js/extension_types/external.dart.strong.transformed.expect index fa5a49dcc1f..6439e61aa93 100644 --- a/pkg/front_end/testcases/dart2js/extension_types/external.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/dart2js/extension_types/external.dart.strong.transformed.expect @@ -84,14 +84,14 @@ static method method(self::A a) → void { a = js_2::getProperty(b1, "field"); js_2::setProperty(b1, "field", a); a = js_2::_callMethodUnchecked0(b1, "method"); - b2 = js_2::callMethod(b2, "genericMethod", [b2]); + b2 = js_2::_callMethodUnchecked1(b2, "genericMethod", b2); b1 = js_2::getProperty(b2, "getter"); js_2::setProperty(b1, "setter", b2); js_2::setProperty(b1, "property", js_2::getProperty(b2, "property")); a = js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticField"); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticField", a); a = js_2::_callMethodUnchecked0(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticMethod"); - b2 = js_2::callMethod(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGenericMethod", [b2]); + b2 = js_2::_callMethodUnchecked1(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGenericMethod", b2); b1 = js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGetter"); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticSetter", b2); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticProperty", js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticProperty")); diff --git a/pkg/front_end/testcases/dart2js/extension_types/external.dart.weak.transformed.expect b/pkg/front_end/testcases/dart2js/extension_types/external.dart.weak.transformed.expect index fa5a49dcc1f..6439e61aa93 100644 --- a/pkg/front_end/testcases/dart2js/extension_types/external.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/dart2js/extension_types/external.dart.weak.transformed.expect @@ -84,14 +84,14 @@ static method method(self::A a) → void { a = js_2::getProperty(b1, "field"); js_2::setProperty(b1, "field", a); a = js_2::_callMethodUnchecked0(b1, "method"); - b2 = js_2::callMethod(b2, "genericMethod", [b2]); + b2 = js_2::_callMethodUnchecked1(b2, "genericMethod", b2); b1 = js_2::getProperty(b2, "getter"); js_2::setProperty(b1, "setter", b2); js_2::setProperty(b1, "property", js_2::getProperty(b2, "property")); a = js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticField"); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticField", a); a = js_2::_callMethodUnchecked0(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticMethod"); - b2 = js_2::callMethod(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGenericMethod", [b2]); + b2 = js_2::_callMethodUnchecked1(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGenericMethod", b2); b1 = js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGetter"); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticSetter", b2); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticProperty", js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticProperty")); diff --git a/pkg/front_end/testcases/dartdevc/extension_types/external.dart.strong.transformed.expect b/pkg/front_end/testcases/dartdevc/extension_types/external.dart.strong.transformed.expect index fa5a49dcc1f..6439e61aa93 100644 --- a/pkg/front_end/testcases/dartdevc/extension_types/external.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/dartdevc/extension_types/external.dart.strong.transformed.expect @@ -84,14 +84,14 @@ static method method(self::A a) → void { a = js_2::getProperty(b1, "field"); js_2::setProperty(b1, "field", a); a = js_2::_callMethodUnchecked0(b1, "method"); - b2 = js_2::callMethod(b2, "genericMethod", [b2]); + b2 = js_2::_callMethodUnchecked1(b2, "genericMethod", b2); b1 = js_2::getProperty(b2, "getter"); js_2::setProperty(b1, "setter", b2); js_2::setProperty(b1, "property", js_2::getProperty(b2, "property")); a = js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticField"); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticField", a); a = js_2::_callMethodUnchecked0(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticMethod"); - b2 = js_2::callMethod(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGenericMethod", [b2]); + b2 = js_2::_callMethodUnchecked1(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGenericMethod", b2); b1 = js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGetter"); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticSetter", b2); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticProperty", js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticProperty")); diff --git a/pkg/front_end/testcases/dartdevc/extension_types/external.dart.weak.transformed.expect b/pkg/front_end/testcases/dartdevc/extension_types/external.dart.weak.transformed.expect index fa5a49dcc1f..6439e61aa93 100644 --- a/pkg/front_end/testcases/dartdevc/extension_types/external.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/dartdevc/extension_types/external.dart.weak.transformed.expect @@ -84,14 +84,14 @@ static method method(self::A a) → void { a = js_2::getProperty(b1, "field"); js_2::setProperty(b1, "field", a); a = js_2::_callMethodUnchecked0(b1, "method"); - b2 = js_2::callMethod(b2, "genericMethod", [b2]); + b2 = js_2::_callMethodUnchecked1(b2, "genericMethod", b2); b1 = js_2::getProperty(b2, "getter"); js_2::setProperty(b1, "setter", b2); js_2::setProperty(b1, "property", js_2::getProperty(b2, "property")); a = js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticField"); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticField", a); a = js_2::_callMethodUnchecked0(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticMethod"); - b2 = js_2::callMethod(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGenericMethod", [b2]); + b2 = js_2::_callMethodUnchecked1(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGenericMethod", b2); b1 = js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticGetter"); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticSetter", b2); js_2::setProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticProperty", js_2::getProperty(js_2::_getPropertyTrustType(_js2::staticInteropGlobalContext, "B"), "staticProperty"));