Index: third_party/closure_compiler/runner/test/com/google/javascript/jscomp/ChromePassTest.java |
diff --git a/third_party/closure_compiler/runner/test/com/google/javascript/jscomp/ChromePassTest.java b/third_party/closure_compiler/runner/test/com/google/javascript/jscomp/ChromePassTest.java |
index d6264c1ad06919f8b3c0c6ca0581bcaf7f493e58..830b9ba414499ec45fc260a6ab610876c841c568 100644 |
--- a/third_party/closure_compiler/runner/test/com/google/javascript/jscomp/ChromePassTest.java |
+++ b/third_party/closure_compiler/runner/test/com/google/javascript/jscomp/ChromePassTest.java |
@@ -192,6 +192,36 @@ public class ChromePassTest extends CompilerTestCase { |
"});\n"); |
} |
+ public void testCrDefineDoesNothingWithExportedNotAName() throws Exception { |
+ test( |
+ "cr.define('namespace', function() {\n" + |
+ " return {\n" + |
+ " a: 42\n" + |
+ " };\n" + |
+ "});\n", |
+ "var namespace = namespace || {};\n" + |
+ "cr.define('namespace', function() {\n" + |
+ " return {\n" + |
+ " a: 42\n" + |
+ " };\n" + |
+ "});\n"); |
+ } |
+ |
+ public void testCrDefineDoesNothingWithExportedNotAName() throws Exception { |
+ test( |
+ "cr.define('namespace', function() {\n" + |
+ " return {\n" + |
+ " a: 42\n" + |
+ " };\n" + |
+ "});\n", |
+ "var namespace = namespace || {};\n" + |
+ "cr.define('namespace', function() {\n" + |
+ " return {\n" + |
+ " a: 42\n" + |
+ " };\n" + |
+ "});\n"); |
+ } |
+ |
public void testCrDefineChangesReferenceToExportedFunction() throws Exception { |
test( |
"cr.define('namespace', function() {\n" + |