我正在使用直接Web Remoting (DWR) JavaScript库文件,只在Safari(桌面和iPad)中得到一个错误
它说
超过最大调用堆栈大小。
这个错误到底是什么意思,它是否完全停止处理?
Safari浏览器也有任何修复(实际上是在iPad Safari上,它说
JS:执行超时
我认为这是相同的调用堆栈问题)
我正在使用直接Web Remoting (DWR) JavaScript库文件,只在Safari(桌面和iPad)中得到一个错误
它说
超过最大调用堆栈大小。
这个错误到底是什么意思,它是否完全停止处理?
Safari浏览器也有任何修复(实际上是在iPad Safari上,它说
JS:执行超时
我认为这是相同的调用堆栈问题)
当前回答
遇到同样的问题,不知道怎么回事,开始责怪巴别塔;)
在浏览器中不返回任何异常的代码:
if (typeof document.body.onpointerdown !== ('undefined' || null)) {
问题是严重创建||(或)部分Babel创建自己的类型检查:
function _typeof(obj){if(typeof Symbol==="function"&&_typeof(Symbol.iterator)==="symbol")
所以删除
|| null
让巴别塔翻译起作用了。
其他回答
在你的代码中有一个递归循环(例如,一个函数最终会一次又一次地调用自己,直到堆栈满为止)。
其他浏览器要么有更大的堆栈(所以您会得到一个超时),要么因为某种原因(可能是放置错误的try-catch)而忽略错误。
发生错误时,使用调试器检查调用堆栈。
在我的例子中,我使用以下方法将一个大字节数组转换为字符串:
String.fromCharCode.apply(null, new Uint16Array(bytes))
字节包含数百万个条目,这对于堆栈来说太大了。
对于我这个TypeScript初学者来说,这是_var1的getter和setter的问题。
class Point2{
constructor(private _var1?: number, private y?: number){}
set var1(num: number){
this._var1 = num // problem was here, it was this.var1 = num
}
get var1(){
return this._var1 // this was return this.var1
}
}
在我的例子中,在app。module中。ts,我得到这个错误,因为我在imports和entryComponents中声明了组件。
Example:
import { MyComponent } from '....';
@NgModule({
declarations: [
MyComponent
],
imports: [
MyComponent -- > remove this from here!!!!
],
providers: [],
bootstrap: [AppComponent],
entryComponents: [MyComponent]
})
export class AppModule { }
在我的例子中,click事件在子元素上传播。所以,我不得不写以下内容:
e.stopPropagation ()
点击事件:
$(document).on("click", ".remove-discount-button", function (e) {
e.stopPropagation();
//some code
});
$(document).on("click", ".current-code", function () {
$('.remove-discount-button').trigger("click");
});
下面是html代码:
<div class="current-code">
<input type="submit" name="removediscountcouponcode" value="
title="Remove" class="remove-discount-button">
</div>