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

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

Issue 1797063002: Resolve obvious deprecation warnings on bleeding edge (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Add test Created 4 years, 9 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
« no previous file with comments | « lib/src/codegen/js_field_storage.dart ('k') | lib/src/codegen/js_module_item_order.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import 'package:analyzer/src/generated/ast.dart'; 5 import 'package:analyzer/dart/ast/ast.dart';
6 import 'package:analyzer/src/generated/constant.dart'; 6 import 'package:analyzer/src/generated/constant.dart';
7 import 'package:analyzer/src/generated/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; 8 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
9 9
10 import '../utils.dart'; 10 import '../utils.dart';
11 11
12 bool _isJsLibType(String expectedName, Element e) => 12 bool _isJsLibType(String expectedName, Element e) =>
13 e?.name == expectedName && _isJsLib(e.library); 13 e?.name == expectedName && _isJsLib(e.library);
14 14
15 /// Returns true if [e] represents any library from `package:js` or is the 15 /// Returns true if [e] represents any library from `package:js` or is the
16 /// internal `dart:_js_helper` library. 16 /// internal `dart:_js_helper` library.
17 bool _isJsLib(LibraryElement e) { 17 bool _isJsLib(LibraryElement e) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 /// Returns the name value of the `JSExportName` annotation (when compiling 64 /// Returns the name value of the `JSExportName` annotation (when compiling
65 /// the SDK), or `null` if there's none. This is used to control the name 65 /// the SDK), or `null` if there's none. This is used to control the name
66 /// under which functions are compiled and exported. 66 /// under which functions are compiled and exported.
67 String getJSExportName(Element e, TypeProvider types) { 67 String getJSExportName(Element e, TypeProvider types) {
68 if (!e.source.isInSystemLibrary) { 68 if (!e.source.isInSystemLibrary) {
69 return null; 69 return null;
70 } 70 }
71 var jsName = findAnnotation(e, isJSExportNameAnnotation); 71 var jsName = findAnnotation(e, isJSExportNameAnnotation);
72 return getConstantField(jsName, 'name', types.stringType)?.toStringValue(); 72 return getConstantField(jsName, 'name', types.stringType)?.toStringValue();
73 } 73 }
OLDNEW
« no previous file with comments | « lib/src/codegen/js_field_storage.dart ('k') | lib/src/codegen/js_module_item_order.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698