Debugging 正在确定Ember.js上弃用警告的位置

Debugging 正在确定Ember.js上弃用警告的位置,debugging,ember.js,Debugging,Ember.js,我升级到了Ember 1.18,我得到了: DEPRECATION: Using currentWhen with {{link-to}} is deprecated in favor of `current-when`. at Ember.LinkView.EmberComponent.extend.init (http://example.com:8000/static/assets/vendor.js:33811:15) at apply (http://e

我升级到了Ember 1.18,我得到了:

DEPRECATION: Using currentWhen with {{link-to}} is deprecated in favor of `current-when`.
        at Ember.LinkView.EmberComponent.extend.init (http://example.com:8000/static/assets/vendor.js:33811:15)
        at apply (http://example.com:8000/static/assets/vendor.js:32885:32)
        at superWrapper [as init] (http://example.com:8000/static/assets/vendor.js:32459:15)
        at apply (http://example.com:8000/static/assets/vendor.js:32885:32)
        at new Class (http://example.com:8000/static/assets/vendor.js:47485:9)
        at Function.Mixin.create.create (http://example.com:8000/static/assets/vendor.js:47943:16)
        at CoreView.extend.createChildView (http://example.com:8000/static/assets/vendor.js:56278:23)
        at Object.merge.appendChild (http://example.com:8000/static/assets/vendor.js:54369:26)
        at CoreView.extend.appendChild (http://example.com:8000/static/assets/vendor.js:56161:34)
所有的回溯都不是我的代码,我主要使用
{link to animated}
(没有
currentWhen


我如何找出哪里可以找到有问题的代码?

弃用通知没有显示对代码的回溯,因为问题不在代码中。:)查看一下,您将看到
currentWhen
在内部使用

有一些肮脏的技巧可以让弃用警告保持沉默,但我建议只向回购协议提交一个请求,让它改变。这应该是一个相当容易的解决办法

编辑:似乎有,但尚未合并。关于那些肮脏的把戏。。。如果您被弃用警告所困扰,您可以随时覆盖
Ember.deprecate
。在运行应用程序代码之前(可能在供应商脚本中)放置以下内容:


谢谢我在代码中提到了这一点,但我的修复不正确。。。有没有一种方法,我可以找出这是因为余烬动画,而不是使用我的头?(一种更有条理的方式——这就是我最初的问题的目的)我所知道的唯一更好的方式是使用余烬检查器的新的弃用特性。但是,这将提供与控制台中相同的堆栈跟踪。如果您的代码中有弃用,那么很容易在堆栈跟踪中发现。不幸的是,如果问题出在库代码中,没有比检查堆栈跟踪位置、搜索文件和批判性思考更好的方法了。谢谢。顺便说一句-一件奇怪的事。。。修正代码后,我仍然收到警告。在chrome调试器中的行上放置断点不会被执行。有什么想法吗?可能是
deprecate
函数的旧版本被缓存在某个闭包中。(Ember CLI的工作原理与我的设置稍有不同。)实际上,禁用警告可能太困难了。也许只需将原始回购协议分叉,更改有问题的代码,然后将您的
bower.json
指向您的回购协议即可。(我过去也这样做过。)
var oldDeprecate = Ember.deprecate;
Ember.deprecate = function(message) {
    if (message.indexOf('currentWhen') >= 0) {
        return;
    }

    return oldDeprecate.apply(this, arguments);
};