Skip to content

Commit

Permalink
Fixes #586 - enums should now work in SDK libs
Browse files Browse the repository at this point in the history
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2045783002 .
  • Loading branch information
John Messerly committed Jun 6, 2016
1 parent aea2fa1 commit 0ec17d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/dev_compiler/lib/src/compiler/code_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)]));

Expand Down

0 comments on commit 0ec17d1

Please sign in to comment.