|
24 | 24 | import static com.google.javascript.jscomp.VarCheck.VAR_MULTIPLY_DECLARED_ERROR; |
25 | 25 | import static com.google.javascript.jscomp.testing.ScopeSubject.assertScope; |
26 | 26 |
|
27 | | -import com.google.common.collect.ImmutableList; |
28 | 27 | import com.google.javascript.jscomp.CompilerOptions.LanguageMode; |
29 | 28 | import com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback; |
30 | 29 | import com.google.javascript.jscomp.testing.JSChunkGraphBuilder; |
31 | 30 | import com.google.javascript.jscomp.testing.TestExternsBuilder; |
32 | 31 | import com.google.javascript.rhino.Node; |
33 | 32 | import com.google.javascript.rhino.StaticSourceFile.SourceKind; |
34 | | -import java.util.List; |
35 | 33 | import org.junit.Before; |
36 | 34 | import org.junit.Test; |
37 | 35 | import org.junit.runner.RunWith; |
@@ -876,31 +874,6 @@ public void testNoUndeclaredVarWhenUsingClosurePass() { |
876 | 874 | "goog.require('namespace.Class1');\n", ClosurePrimitiveErrors.MISSING_MODULE_OR_PROVIDE); |
877 | 875 | } |
878 | 876 |
|
879 | | - // ES6 Module Tests |
880 | | - @Test |
881 | | - public void testImportedNames() throws Exception { |
882 | | - List<SourceFile> inputs = |
883 | | - ImmutableList.of( |
884 | | - SourceFile.fromCode("/index[0].js", "import foo from './foo.js'; foo('hello');"), |
885 | | - SourceFile.fromCode("/foo.js", "export default (foo) => { alert(foo); }")); |
886 | | - |
887 | | - List<ModuleIdentifier> entryPoints = ImmutableList.of(ModuleIdentifier.forFile("/index[0].js")); |
888 | | - |
889 | | - CompilerOptions options = new CompilerOptions(); |
890 | | - CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(options); |
891 | | - options.setLanguage(CompilerOptions.LanguageMode.ECMASCRIPT_2017); |
892 | | - options.setDependencyOptions(DependencyOptions.pruneLegacyForEntryPoints(entryPoints)); |
893 | | - |
894 | | - List<SourceFile> externs = |
895 | | - AbstractCommandLineRunner.getBuiltinExterns(options.getEnvironment()); |
896 | | - |
897 | | - Compiler compiler = new Compiler(); |
898 | | - compiler.compile(externs, inputs, options); |
899 | | - |
900 | | - Result result = compiler.getResult(); |
901 | | - assertThat(result.errors).isEmpty(); |
902 | | - } |
903 | | - |
904 | 877 | @Test |
905 | 878 | public void testImportedNameCollision() { |
906 | 879 | // TODO(tbreisacher): This should throw a duplicate declaration error. |
|
0 commit comments