GWT:Opera 的 JavaScript 错误
我们有一个大型 GWT 应用程序。自从几天以来,我们在 Opera 中遇到了一个奇怪的错误,所有其他浏览器都很好:
Syntax error at line 3739 while loading:
f+Gcd(ead)+LIf+A9c.b.b+RIf+Icd(ead)+LIf+
--------------------^
input too deeply nested
我在谷歌上搜索“输入嵌套太深”,但找不到与我们的问题相关的任何内容。它很难调试,因为你无法在开发模式下运行应用程序,而只能使用已编译的 JavaScript 运行。
We have a large GWT app. Since some days we've got a strange error in opera, all other browser are fine:
Syntax error at line 3739 while loading:
f+Gcd(ead)+LIf+A9c.b.b+RIf+Icd(ead)+LIf+
--------------------^
input too deeply nested
I've google for "input too deeply nested" but can't find anything related to our problem. Its hard to debug cause there you cant run the app in development mode, but only with compiled JavaScript.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Carakan 的解析器是一个相当简单的递归解析器。因此,为了避免堆栈崩溃,输入令牌有深度限制。嵌套的“+”表达式可能会导致它,尽管有一些针对这种情况的保护措施(虽然我忘记了具体是什么,稍后会检查和编辑)。
Carakan's parser is a fairly simple recursive-decent one. As such, to avoid blowing the stack, there's a depth limit on input tokens. Nested "+" expressions can cause it, though there is some protection against that (though I forget exactly what, will check and edit this later).
回复很晚,但可能对其他用户有帮助?
Opera(或在我们的例子中为 Opera Mini)仍然可能因深度嵌套的表达式而窒息。缩小工具(例如 Google 的 Closure Compiler 或 UglifyJS)将重新编译 Javascript 源代码,并且可以引入比原始源建议的更复杂(和更深)的表达式。
对于 Ruby on Rails 4 中的 Uglifier,关闭 compress.sequences 通常足以修复问题。在config/environments/Production.rb中:
Very late response, but possibly helpful for other users?
Opera (or Opera Mini in our case) can still choke on deeply nested expressions. Minification tools such as Google's Closure Compiler or UglifyJS will recompile Javascript source code and can introduce much more complex (and deeper) expressions than the original source would suggest.
For Uglifier in Ruby on Rails 4, turning off compress.sequences is usually enough to fix the problem. In config/environments/production.rb: