Index: lib/src/codegen/js_codegen.dart |
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart |
index 005808114b65eefe3e35961473b15a75dcb16424..2a8e4b61c52c3f30494d95e721f4f91a102aa44f 100644 |
--- a/lib/src/codegen/js_codegen.dart |
+++ b/lib/src/codegen/js_codegen.dart |
@@ -2399,6 +2399,9 @@ class JSCodegenVisitor extends GeneralizingAstVisitor |
if (isPublic(fieldName)) _addExport(fieldName, exportName); |
var declKeyword = field.isConst || field.isFinal ? 'const' : 'let'; |
+ if (isJSTopLevel && jsInit is JS.ClassExpression) { |
+ return new JS.ClassDeclaration(jsInit); |
+ } |
return js.statement('#;', [ |
annotate( |
new JS.VariableDeclarationList(declKeyword, [ |