ExportModuleNameCompilerPass implements CompilerPass { @Override public void process(Node externs, Node root) { processChildren(root); } ExportModuleNameCompilerPass(JSSource source); @Override void process(Node externs, Node root); void processChildren(Node node);  }
@Test public void testProcess() { pass = new ExportModuleNameCompilerPass(null); String code, output; code = "define(['a', 'b'], function(a, b) {});"; output = runPass("test", code); System.out.println(output); Assert.assertTrue(output.contains("define(\"test\",[")); code = "(function(){define(['a', 'b'], function(a, b) {})})();"; output = runPass("test", code); System.out.println(output); Assert.assertTrue(output.contains("define(\"test\",[")); code = "(function(){define(['a', 'b'])})();"; output = runPass("test", code); System.out.println(output); Assert.assertTrue(output.contains("define(\"test\",[")); code = "define({color:'black', size:'unisize'});"; output = runPass("test", code); System.out.println(output); Assert.assertTrue(output.contains("define(\"test\",{")); code = "define(function(){return {color:'black', size:'unisize'}});"; output = runPass("test", code); System.out.println(output); Assert.assertTrue(output.contains("define(\"test\",function")); code = "define('named', ['a', 'b'], function(a, b) {});"; output = runPass("test", code); System.out.println(output); Assert.assertFalse(output.contains("test")); }