首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Rhino预编译工具栏失败,出现1.0.0 - _triageMustache缺失

Rhino预编译工具栏失败,出现1.0.0 - _triageMustache缺失
EN

Stack Overflow用户
提问于 2013-06-25 14:35:49
回答 1查看 462关注 0票数 1

我们正在构建一个Ember/Java应用程序,并且在maven构建过程中使用Rhino预编译我们的工具栏模板。直到今天,我们还在使用车把RC3和Ember RC3,生活是美好的。今天,我们尝试更新到Ember RC6和Handlebar 1.0.0,现在我们的Rhino预编译器给出了如下内容:

代码语言:javascript
复制
js: "src/main/js/third-party/handlebars-1.0.0.js", line 2024: uncaught JavaScript runtime     
 exception: TypeError: Cannot call method "replace" of undefined
at src/main/js/third-party/handlebars-1.0.0.js:2024
at src/main/js/third-party/handlebars-1.0.0.js:2038
at src/main/js/third-party/handlebars-1.0.0.js:1747
at src/main/js/third-party/handlebars-1.0.0.js:1368
at src/main/js/third-party/handlebars-1.0.0.js:1860
at src/main/js/third-party/handlebars-1.0.0.js:1356
at src/main/js/third-party/handlebars-1.0.0.js:1860
at src/main/js/third-party/handlebars-1.0.0.js:1356
at src/main/js/rhino-handlebars-precompiler.js:75 (precompile)
at src/main/js/rhino-handlebars-precompiler.js:89 (init)
at src/main/js/rhino-handlebars-precompiler.js:93
at src/main/js/rhino-handlebars-precompiler.js:15

我们已经尝试了我们自己的Rhino编译器和这里找到的一种:https://github.com/locnguyen/ember-rhino-precompiler

更新

在深入研究一下车把之后,似乎车把-1.0.0产生了与车把RC3略有不同的操作码,特别是缺少了对_triageMustache助手的调用。对于这个车把碎片:

代码语言:javascript
复制
{{#if enableLinks}}<a href="/foo?userId={{unbound loginAsAdminId}}&userAsId={{unbound legacyUserId}}" id="logoutAsLink">Return to {{loginAsAdminName}}</a>{{/if}}

通过RC3,我们可以得到以下内容:

代码语言:javascript
复制
in compile appendContent "<a href="/userportal/returnToAdmin?userId="
getContext 0
pushStringParam "loginAsAdminId" "ID"
pushProgram
pushProgram
emptyHash
invokeKnownHelper 1 "unbound"
appendEscaped
appendContent "&userAsId="
getContext 0
pushStringParam "legacyUserId" "ID"
pushProgram
pushProgram
emptyHash
invokeKnownHelper 1 "unbound"
appendEscaped
appendContent "" id="logoutAsLink">Return to "
getContext 0
pushStringParam "loginAsAdminName" "ID"
pushProgram
pushProgram
emptyHash
invokeKnownHelper 1 "_triageMustache"
appendEscaped
appendContent "</a>"

在1.0.0中,我们得到如下信息:

代码语言:javascript
复制
in compile appendContent "<a href="/userportal/returnToAdmin?userId="
getContext 0
pushStringParam "loginAsAdminId" "ID"
pushProgram
pushProgram
emptyHash
invokeKnownHelper 1 "unbound"
appendEscaped
appendContent "&userAsId="
getContext 0
pushStringParam "legacyUserId" "ID"
pushProgram
pushProgram
emptyHash
invokeKnownHelper 1 "unbound"
appendEscaped
appendContent "" id="logoutAsLink">Return to "
getContext 0
pushStringParam "loginAsAdminName" "ID"
pushProgram
pushProgram
emptyHash
invokeHelper 1
appendEscaped
appendContent "</a>"

注意,对invokeHelper的最后一次调用缺少了助手名。事情就在那里开始恶化。我还不太清楚车把为什么会漏掉这个。

谢谢你,斯科特

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-06-26 13:01:06

在这里回答我自己的问题:很明显,Ember RC6与工具栏1.0.0不兼容。查看这个线程(我知道它引用了RC5,但问题仍然存在于RC6中):http://discuss.emberjs.com/t/ember-rc-5-is-not-working-properly-with-handlebars-1-0-0/1391

我通过选择这个提交来解决这个问题:https://github.com/emberjs/ember.js/commit/4023186ea157a8687ac611181e2ca49e5fc891d5

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17300241

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档