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

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

Issue 1879373004: Implement modular compilation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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/js_field_storage.dart ('k') | lib/src/compiler/js_metalet.dart » ('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/codegen/js_interop.dart b/lib/src/compiler/js_interop.dart
similarity index 88%
rename from lib/src/codegen/js_interop.dart
rename to lib/src/compiler/js_interop.dart
index 0c2178a6629a0f6a5d33595138515b1769127b6b..db0b7833bc25dcb31fd7f23350b0a491fb0f2e73 100644
--- a/lib/src/codegen/js_interop.dart
+++ b/lib/src/compiler/js_interop.dart
@@ -5,9 +5,8 @@
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/src/generated/constant.dart';
import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
-import '../utils.dart';
+import 'element_helpers.dart';
bool _isJsLibType(String expectedName, Element e) =>
e?.name == expectedName && _isJsLib(e.library);
@@ -64,10 +63,9 @@ bool isNativeAnnotation(DartObjectImpl value) =>
/// Returns the name value of the `JSExportName` annotation (when compiling
/// the SDK), or `null` if there's none. This is used to control the name
/// under which functions are compiled and exported.
-String getJSExportName(Element e, TypeProvider types) {
- if (!e.source.isInSystemLibrary) {
- return null;
+String getJSExportName(Element e) {
+ if (e.source.isInSystemLibrary) {
+ return getAnnotationName(e, isJSExportNameAnnotation) ?? e.name;
}
- var jsName = findAnnotation(e, isJSExportNameAnnotation);
- return getConstantField(jsName, 'name', types.stringType)?.toStringValue();
+ return e.name;
}
« no previous file with comments | « lib/src/compiler/js_field_storage.dart ('k') | lib/src/compiler/js_metalet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698