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

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

Issue 1998473002: Support @JS with path expressions. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/code_generator.dart
diff --git a/lib/src/compiler/code_generator.dart b/lib/src/compiler/code_generator.dart
index 8a97a278c6114a34e3a048de9a9dd36cedc82799..26c469c0812b271301e5de27c170de820fcd5f41 100644
--- a/lib/src/compiler/code_generator.dart
+++ b/lib/src/compiler/code_generator.dart
@@ -2345,8 +2345,12 @@ class CodeGenerator extends GeneralizingAstVisitor
e.getter != null &&
findAnnotation(e.getter, isPublicJSAnnotation) != null) {
var annotationName = getAnnotationName(e.getter, isPublicJSAnnotation);
- var name = js.string(annotationName ?? e.name);
- return new JS.PropertyAccess(_self, name);
+ var name = annotationName ?? e.name;
+ JS.PropertyAccess result = null;
+ for (var segment in name.split('.')) {
+ result = new JS.PropertyAccess(result ?? _self, js.string(segment));
+ }
+ return result;
}
String name = getJSExportName(e) + suffix;
return new JS.PropertyAccess(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698