Fix to propagate OOMs correctly.

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@3445 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java b/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java
index 7e89ac8..3929349 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java
@@ -66,6 +66,9 @@
     InternalCompilerException ice;
     if (e instanceof InternalCompilerException) {
       ice = (InternalCompilerException) e;
+    } else if (e instanceof OutOfMemoryError) {
+      // Just rethrow, it's not our problem.
+      throw (OutOfMemoryError) e;
     } else {
       ice = new InternalCompilerException("Unexpected error during visit.", e);
     }
diff --git a/dev/core/src/com/google/gwt/dev/js/ast/JsVisitor.java b/dev/core/src/com/google/gwt/dev/js/ast/JsVisitor.java
index 7a3cbc3..d0ea60b 100644
--- a/dev/core/src/com/google/gwt/dev/js/ast/JsVisitor.java
+++ b/dev/core/src/com/google/gwt/dev/js/ast/JsVisitor.java
@@ -427,9 +427,6 @@
       JsContext<T> ctx) {
     try {
       node.traverse(this, ctx);
-    } catch (OutOfMemoryError e) {
-      // Just rethrow, it's not our problem.
-      throw e;
     } catch (Throwable e) {
       throw translateException(node, e);
     }
@@ -440,6 +437,9 @@
     InternalCompilerException ice;
     if (e instanceof InternalCompilerException) {
       ice = (InternalCompilerException) e;
+    } else if (e instanceof OutOfMemoryError) {
+      // Just rethrow, it's not our problem.
+      throw (OutOfMemoryError) e;
     } else {
       ice = new InternalCompilerException("Unexpected error during visit.", e);
     }