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

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

Issue 2440863002: fix #27642, static members should now work (Closed)
Patch Set: Created 4 years, 2 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 | pkg/dev_compiler/test/browser/language_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/code_generator.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
index 221d94ca9bdec9c773ecbd8bd8371ab22c711948..ac93989682e427cdea8084557adef00506dfab15 100644
--- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart
+++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
@@ -4659,7 +4659,10 @@ class CodeGenerator extends GeneralizingAstVisitor
JS.Expression _emitAccessInternal(Expression target, Element member,
String memberName, List<JS.Expression> typeArgs) {
- bool isStatic = member is ClassMemberElement && member.isStatic;
+ // TODO(jmesserly): we don't use member.isStatic because it doesn't seem to
+ // work, see https://github.com/dart-lang/sdk/issues/27642 for context.
+ bool isStatic = target is SimpleIdentifier &&
+ target.staticElement is TypeDefiningElement;
vsm 2016/10/21 02:07:16 Hmm, do we need target is SimpleIdentifier? Might
Jennifer Messerly 2016/10/21 17:48:07 yes, we need something. You can't get a staticElem
var name = _emitMemberName(memberName,
type: getStaticType(target), isStatic: isStatic);
if (isDynamicInvoke(target)) {
« no previous file with comments | « no previous file | pkg/dev_compiler/test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698