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

Unified Diff: lib/src/compiler/js_interop.dart

Issue 1977893002: implement @JS classes (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: enable more tests Created 4 years, 7 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
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | test/browser/language_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/js_interop.dart
diff --git a/lib/src/compiler/js_interop.dart b/lib/src/compiler/js_interop.dart
index afdd0ed996939920ee497e38b52760c14c14887a..7e9fcc8f74c3bd3a9fa454c36d676fc9ecd4143c 100644
--- a/lib/src/compiler/js_interop.dart
+++ b/lib/src/compiler/js_interop.dart
@@ -40,6 +40,13 @@ bool isJsSpreadInvocation(MethodInvocation i) =>
bool isJSAnnotation(DartObjectImpl value) =>
_isJsLibType('JS', value.type.element) || isJsName(value);
+/// Returns [true] if [e] is the `JS` annotation from `package:js`.
+bool isPublicJSAnnotation(DartObjectImpl value) =>
+ _isJsLibType('JS', value.type.element);
+
+bool isJSAnonymousAnnotation(DartObjectImpl value) =>
+ _isJsLibType('_Anonymous', value.type.element);
+
bool _isBuiltinAnnotation(
DartObjectImpl value, String libraryName, String annotationName) {
var e = value?.type?.element;
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698