【发布时间】:2015-09-23 17:01:18
【问题描述】:
我几天来一直在努力让this page 中的示例正常工作,但甚至无法正确编译一个示例。
// File 1 - icecream.js
goog.provide('ice.cream');
// File 2 - cone.js
goog.provide('waffle.cone');
// File 3 - shop.js
goog.provide('ice.cream.Shop');
goog.require('ice.cream');
goog.require('waffle.cone');
我已将 compiler.jar 添加到同一文件夹并尝试运行命令:
java -jar compiler.jar --js shop.js --js icecream.js --js cone.js
但是,结果还是报错:
C:\Users\username\Desktop\test>java -jar compiler.jar --js shop.js --js icecream.js --js cone.js
shop.js:3: ERROR - required "ice.cream" namespace not provided yet
goog.require('ice.cream');
^
shop.js:4: ERROR - required "waffle.cone" namespace not provided yet
goog.require('waffle.cone');
^
2 error(s), 0 warning(s)
我错过了什么?为什么这个例子不起作用?
这是我的测试项目:https://github.com/roydukkey/moist/tree/stackoverflow-32745379
【问题讨论】: