Index: pkg/compiler/lib/src/js_backend/codegen/codegen.dart |
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart |
index 963f1d7f43ae700436985490c217268f38209910..791677068760e9f52c606fbbc7d3729894f60943 100644 |
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart |
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart |
@@ -639,6 +639,14 @@ class CodeGenerator extends tree_ir.StatementVisitor |
@override |
void visitTry(tree_ir.Try node) { |
+ void register(ClassElement classElement) { |
+ if (classElement == null) return; |
+ registry.registerInstantiatedClass(classElement); |
+ } |
+ // We might catch JavaScript exceptions. |
+ register(glue.jsPlainJavaScriptObjectClass); |
+ register(glue.jsUnknownJavaScriptObjectClass); |
+ |
js.Block tryBlock = buildBodyBlock(node.tryBody); |
tree_ir.Variable exceptionVariable = node.catchParameters.first; |
js.VariableDeclaration exceptionParameter = |