"类型错误:非法调用"试图从V1.2升级的时候 [英] "TypeError: Illegal invocation" when trying to upgrade from v1.2

查看:462
本文介绍了"类型错误:非法调用"试图从V1.2升级的时候的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:看来,这可能是与Chrome相关的V43,我降级为V42,一切工作正常。

It seems that this could be related to Chrome v43, I downgraded to v42 and everything works fine.

编辑:我已经提交了问题对角的Github上回购。

I've submitted an issue on the Angular's Github repo.

看来这个错误被抛出由
返回logFn.apply(控制台,参数); 12221 在angular.js源

It seems that the error gets thrown by return logFn.apply(console, args); line 12221 in angular.js source.

什么任何提示现在怎么办?

Any tips on what to do now?

我想我的应用程序从AngularJS V1.2迁移到V1.3或者V1.4或但我得到类型错误:非法调用在Chrome(试图取胜,OSX和Ubuntu)。

I'm trying to migrate my app from AngularJS v1.2 to either v1.3 or v1.4 but I'm getting TypeError: Illegal invocation on Chrome (tried win, osx and ubuntu).

堆栈跟踪是不是真的帮助:

The stack trace isn't really helping:

TypeError: Illegal invocation
    at equals (angular.js:1034)
    at equals (angular.js:1034)
    at equals (angular.js:1034)
    at equals (angular.js:1034)
    at equals (angular.js:1034)
    at Scope.$get.Scope.$digest (angular.js:15550)
    at Scope.$get.Scope.$apply (angular.js:15824)
    at done (angular.js:10263)
    at completeRequest (angular.js:10435)
    at XMLHttpRequest.requestLoaded (angular.js:10376)

所以,这似乎是与AJAX请求,但我也越来越:

So this seems something to do with AJAX requests, but I'm also getting:

TypeError: Illegal invocation
    at equals (angular.js:1034)
    at equals (angular.js:1034)
    at equals (angular.js:1034)
    at equals (angular.js:1034)
    at equals (angular.js:1034)
    at Scope.$get.Scope.$digest (angular.js:15550)
    at Scope.$get.Scope.$apply (angular.js:15824)
    at tick (angular.js:10983)

我用 $间隔更新模型类(这是一个工厂,并通过设置反映的意见 $ scope.client 这一类):

I'm using $interval to update a model class (which is a factory and reflected in the views through setting the $scope.client to this class):

var runTimer = function () {
    self.timeOnline = time(self.timeSoFar);
    self.timeSoFar = Date.now() / 1000 - self.alarmTriggeredTime;
};

$interval(runTimer, 1000);

我觉得有与 $问题消化/ $适用。我花了几个小时的调试这一点,但仍然没有得到对所发生的事情的线索。

I think there's an issue with $digest/$apply. I've spent hours debugging this, but still haven't got a clue on what's happening.

任何指针为进一步调试是非常AP preciated。

Any pointers into further debugging is much appreciated.

推荐答案

angular-问题中,<一个href=\"https://$c$c.google.com/p/chromium/issues/detail?id=167911&q=illegal%20invocation&colspec=ID%20Pri%20M%20Week%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified\"相对=nofollow>铬错误的 WebKit的错误和(我不知道这是什么)东西,Webkit内核-issue 会的显示的好像每个人(当​​然,主要是每个人)是投掷他们的手在空中。也许我是评判/平原说,错了。

Between the angular-issue, the chromium-bug, the webkit-bug and the (I dont even know what this is) something-Webkit-issue it would appear as if everyone (well, mostly everyone) is throwing their hands in the air. Perhaps I'm being judgemental/plain wrong in saying that.

反正我是没能获得 window.history.back 情况下登录而不引起非法调用但我能做到 console.log.call(窗口,'X')通过以下片段:

Anyway, I wasn't able to get the window.history.back case to log without causing an Illegal Invocation but I was able to do console.log.call(window, 'x') with the following 'snippet:'

(function() { console.log = console.log.bind(console); }());

(取直客的最后一个环节出现,感谢布赖恩!的)

就掴了这一点在你的HTML文档/无论你想(我猜)的顶部​​。

Just slap that out in the top of your HTML document/wherever you want (I guess).

我的超级好奇,会发生什么,如果你要运行@Ignas。的我似乎无法复制你是presenting的问题一个工厂结合 $范围和你的运行 $间隔

I'm super curious as to what would happen if you were to run that @Ignas. I cannot seem to replicate the issue you are presenting with a Factory binding to $scope and running that $interval of yours.

很想看看它是否持有任何影响(虽然不是功能之一,但越是这样一个的装饰的之一,我想)。

Would love to see if it holds any effect (albeit, not a functional one but more so a decorative one, I suppose).

旁注;的我是我是新手,我只是用我的同行获悉,console.log.call(窗口)应确实引发非法调用错误,所以这是一个非问题afaic。还是好奇的是,这是否会举行内部角上的 logFn 的效果。

Sidenote; Me being the newbie I am, I was just informed by my peers that console.log.call(window) shall indeed throw an Illegal Invocation error, so that is a non-issue afaic. Still curious as to if this would hold effect on the logFn inside Angular.

这篇关于&QUOT;类型错误:非法调用&QUOT;试图从V1.2升级的时候的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆