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

Side by Side Diff: pkg/dev_compiler/lib/src/compiler/js_interop.dart

Issue 2994203002: Optimize DDC private library files. (Closed)
Patch Set: Address comments Created 3 years, 4 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 import 'package:analyzer/dart/ast/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/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 8
9 import 'element_helpers.dart'; 9 import 'element_helpers.dart';
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 bool isJsName(DartObjectImpl value) => 64 bool isJsName(DartObjectImpl value) =>
65 _isBuiltinAnnotation(value, '_js_helper', 'JSName'); 65 _isBuiltinAnnotation(value, '_js_helper', 'JSName');
66 66
67 bool isJsPeerInterface(DartObjectImpl value) => 67 bool isJsPeerInterface(DartObjectImpl value) =>
68 _isBuiltinAnnotation(value, '_js_helper', 'JsPeerInterface'); 68 _isBuiltinAnnotation(value, '_js_helper', 'JsPeerInterface');
69 69
70 bool isNativeAnnotation(DartObjectImpl value) => 70 bool isNativeAnnotation(DartObjectImpl value) =>
71 _isBuiltinAnnotation(value, '_js_helper', 'Native'); 71 _isBuiltinAnnotation(value, '_js_helper', 'Native');
72 72
73 bool isNotNullAnnotation(DartObjectImpl value) =>
74 _isBuiltinAnnotation(value, '_js_helper', 'NotNull');
75
76 bool isNullCheckAnnotation(DartObjectImpl value) =>
77 _isBuiltinAnnotation(value, '_js_helper', 'NullCheck');
78
73 /// Returns the name value of the `JSExportName` annotation (when compiling 79 /// Returns the name value of the `JSExportName` annotation (when compiling
74 /// the SDK), or `null` if there's none. This is used to control the name 80 /// the SDK), or `null` if there's none. This is used to control the name
75 /// under which functions are compiled and exported. 81 /// under which functions are compiled and exported.
76 String getJSExportName(Element e) { 82 String getJSExportName(Element e) {
77 if (!e.source.isInSystemLibrary) return null; 83 if (!e.source.isInSystemLibrary) return null;
78 84
79 e = e is PropertyAccessorElement && e.isSynthetic ? e.variable : e; 85 e = e is PropertyAccessorElement && e.isSynthetic ? e.variable : e;
80 return getAnnotationName(e, isJSExportNameAnnotation); 86 return getAnnotationName(e, isJSExportNameAnnotation);
81 } 87 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698