Maximum call stack size exceeded error

后端 未结 30 3249
独厮守ぢ
独厮守ぢ 2020-11-21 23:51

I am using a Direct Web Remoting (DWR) JavaScript library file and am getting an error only in Safari (desktop and iPad)

It says

Maximum call

30条回答
  •  生来不讨喜
    2020-11-22 00:18

    For me as a beginner in TypeScript, it was a problem in the getter and the setter of _var1.

    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
        }
    }
    

提交回复
热议问题