Chromium Code Reviews| Index: pkg/analyzer/test/generated/hint_code_test.dart |
| diff --git a/pkg/analyzer/test/generated/hint_code_test.dart b/pkg/analyzer/test/generated/hint_code_test.dart |
| index fa3da216fadc4f776d7becfc8124e281c4ad2bae..b79590e25079927fe006ec900d01bd310a98e901 100644 |
| --- a/pkg/analyzer/test/generated/hint_code_test.dart |
| +++ b/pkg/analyzer/test/generated/hint_code_test.dart |
| @@ -132,6 +132,12 @@ class _Required { |
| final String reason; |
| const _Required([this.reason])); |
| } |
| +''', |
| + 'package:js/js.dart': r''' |
| +library js; |
| +class JS { |
| + const JS([String js]) { } |
| +} |
| ''' |
| }); |
| } |
| @@ -1241,6 +1247,35 @@ main() { |
| verify([source]); |
| } |
| + void test_js_lib_OK() { |
| + Source source = addSource(r''' |
| +@JS() |
| +library foo; |
| + |
| +import 'package:js/js.dart'; |
| + |
| +@JS() |
| +class A { } |
| +'''); |
| + computeLibrarySourceErrors(source); |
| + assertNoErrors(source); |
| + verify([source]); |
| + } |
| + |
| + void test_missing_js_lib() { |
|
Brian Wilkerson
2016/04/08 19:15:31
Maybe also test it on a class member (if that's al
pquitslund
2016/04/08 20:29:42
Done.
|
| + Source source = addSource(r''' |
| +library foo; |
| + |
| +import 'package:js/js.dart'; |
| + |
| +@JS() |
| +class A { } |
| +'''); |
| + computeLibrarySourceErrors(source); |
| + assertErrors(source, [HintCode.MISSING_JS_LIB_ANNOTATION]); |
| + verify([source]); |
| + } |
| + |
|
terry
2016/04/08 19:38:57
May want to test top-level function use of @JS
@J
pquitslund
2016/04/08 20:29:42
Done.
|
| void test_missingReturn_async() { |
| Source source = addSource(''' |
| import 'dart:async'; |