Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(916)

Unified Diff: tests/html/js_test.dart

Issue 2110273003: Make is checks work on JavaScriptFunction objects. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/html/js_test.dart
diff --git a/tests/html/js_test.dart b/tests/html/js_test.dart
index ae9d9b3b9f1fd572254904ef702aebba7629cae0..c55408160edbfa98e06e68a0a7752aaec1b680b0 100644
--- a/tests/html/js_test.dart
+++ b/tests/html/js_test.dart
@@ -194,6 +194,8 @@ someObject.role = "object";
document.body.append(script);
}
+typedef bool StringToBool(String s);
+
// Some test are either causing other test to fail in IE9, or they are failing
// for unknown reasons
// useHtmlConfiguration+ImageData bug: dartbug.com/14355
@@ -922,6 +924,17 @@ main() {
});
+ group('JavaScriptFunction', () {
+ test('is check', () {
+ var fn = (String s) => true;
+ var jsFn = allowInterop(fn);
+ expect(fn is StringToBool, isTrue);
+ expect(jsFn is StringToBool, isTrue);
+ expect(jsFn is Function, isTrue);
+ expect(jsFn is List, isFalse);
+ });
+ });
+
group('Dart->JS', () {
test('Date', () {

Powered by Google App Engine
This is Rietveld 408576698