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
varn=bigInt('1000')if(n==null){//this line throws an erroralert('this alert will never show')}
However if I switch the condition to say
varn=bigInt('1000')if(null==n){//this line does not erroralert('this alert will never show')}
The error
BigInteger.js:688 Uncaught TypeError: Cannot read property 'value' of nullSmallInteger.compare
BigInteger.js:688BigInteger.equals
BigInteger.js:700t
paper-full.min.js:38setCanonicalPath
VM1729:306update
VM1729:251(anonymous function)
truncated for convince .......
It seems, PaperScript assumes an object in the first position with an equals function will be able to handle any input given to the equals function.
Ex if(__$__(n, "==" , null)) {
This may be a huge assumption on the PaperScript interpreter as JavaScript can handle this expression correctly.
The text was updated successfully, but these errors were encountered:
The problem is that the bigInt class defines an equals() method that is unable to handle null, and PaperScript currently translates == to such left.equals(right) calls.
We've already moved to special signatures for all math calls (__add()& co.), so we just have to do the same for equals, to mark these special equals methods that are able to behave like == does.
I am using this library for large integers https://github.com/peterolson/BigInteger.js
PaperScript will throw an error when I write
However if I switch the condition to say
The error
BigInteger.js:688 Uncaught TypeError: Cannot read property 'value' of nullSmallInteger.compare
BigInteger.js:688BigInteger.equals
BigInteger.js:700t
paper-full.min.js:38setCanonicalPath
VM1729:306update
VM1729:251(anonymous function)
truncated for convince .......
It seems, PaperScript assumes an object in the first position with an equals function will be able to handle any input given to the equals function.
Ex
if(__$__(n, "==" , null)) {
This may be a huge assumption on the PaperScript interpreter as JavaScript can handle this expression correctly.
The text was updated successfully, but these errors were encountered: