You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the latest version (3.0.10) this results in an error:
Number.prototype[Symbol.add]=newFunction('other','return this + other')Symbol.add=Symbol('add')operator+left13=(left,right)=>{return #`(${left})[Symbol.add](${right})`}classPoint{constructor(x,y){this.x=xthis.y=y}[Symbol.add](other){returnnewPoint(this.x+other.x,this.y+other.y)}}constx=newPoint(3,4)+newPoint(5,6)
Using the latest version (3.0.10) this results in an error:
Error message
Error: Unknown object: {"value":{"token":{"typeCode":3,"type":{"klass":{"name":"Numeric"},"name":""},"value":3,"slice":{"text":"3","start":397,"startLocation":{"line":20,"column":21,"filename":"","position":397},"end":398},"octal":false,"noctal":false},"bindings":{"_map":{}},"scopesets":{"all":[{"name":"outsideEdge_1"}],"phase":{"0":[{"name":"insideEdge0_2"}]}}},"type":"RawSyntax","loc":null}I'm not sure what the minimal cause of the bug is, but I did find that if I do:
Then it's happy.
So it's probably some interaction between operator overloading and new.
The text was updated successfully, but these errors were encountered: