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

Side by Side Diff: lib/src/codegen/js_interop.dart

Issue 1644823002: Remove library tags, they aren't needed (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dev_compiler.src.js_interop;
6
7 import 'package:analyzer/src/generated/ast.dart'; 5 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 6 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/constant.dart'; 7 import 'package:analyzer/src/generated/constant.dart';
10 8
11 bool _isJsLibType(String expectedName, Element e) => 9 bool _isJsLibType(String expectedName, Element e) =>
12 e?.name == expectedName && _isJsLib(e.library); 10 e?.name == expectedName && _isJsLib(e.library);
13 11
14 /// Returns true if [e] represents any library from `package:js` or is the 12 /// Returns true if [e] represents any library from `package:js` or is the
15 /// internal `dart:_js_helper` library. 13 /// internal `dart:_js_helper` library.
16 bool _isJsLib(LibraryElement e) { 14 bool _isJsLib(LibraryElement e) {
(...skipping 24 matching lines...) Expand all
41 /// instead of `@JS` from `package:js`). 39 /// instead of `@JS` from `package:js`).
42 bool isJSExportNameAnnotation(DartObjectImpl value) { 40 bool isJSExportNameAnnotation(DartObjectImpl value) {
43 var e = value?.type?.element; 41 var e = value?.type?.element;
44 if (e?.name != 'JSExportName') return false; 42 if (e?.name != 'JSExportName') return false;
45 var uri = e.source.uri; 43 var uri = e.source.uri;
46 return uri.scheme == 'dart' && uri.path == '_foreign_helper'; 44 return uri.scheme == 'dart' && uri.path == '_foreign_helper';
47 } 45 }
48 46
49 bool isJsPeerInterface(DartObjectImpl value) => 47 bool isJsPeerInterface(DartObjectImpl value) =>
50 value.type.name == 'JsPeerInterface'; 48 value.type.name == 'JsPeerInterface';
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698