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

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

Issue 2045783002: Fixes #586 - enums should now work in SDK libs (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 6 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 b38971079076b5d06ca662c9aa42de913997bfe3..3969091deb2a31d8602eba929acaafc2f8f61844 100644
--- a/lib/src/compiler/code_generator.dart
+++ b/lib/src/compiler/code_generator.dart
@@ -1053,6 +1053,10 @@ class CodeGenerator extends GeneralizingAstVisitor
// Create static values list
var values = new JS.ArrayInitializer(new List<JS.Expression>.from(
fields.map((f) => js.call('#.#', [id, f.name]))));
+
+ // dart.constList helper internally depends on _interceptors.JSArray.
+ _declareBeforeUse(_jsArray);
+
result.add(js.statement(
'#.values = dart.constList(#, #);', [id, values, _emitType(type)]));
« 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