dignifiedquire / borc

Assimilate your JavaScript objects into cbor
https://dignifiedquire.github.io/borc
MIT License
31 stars 22 forks source link

Remove one more node global #49

Open pnlp-dev opened 4 years ago

pnlp-dev commented 4 years ago

https://github.com/dignifiedquire/borc/blob/f8b6b7630250e2ee5509f7104529490a388c2cc7/src/decoder.js#L58

Looks like you removed node globals somewhat recently, but you missed one. This global reference is breaking in the latest version of Angular.

AGFlash commented 3 years ago

Yup. Me to. As a workaround I dropped global from the call in decoder.js and just pass a zero: 58 this.parser = parser(0, { ... then in decoder.asm.js I switched back to the native functions 8 var heap = new Uint8Array(buffer) //use native Uint8Array instead of stdlib.Uint8Array 50 var pow = Math.pow //use native Math.pow instead of stdlib.Math.pow

Not 100% sure this will continue to work as intended (please advise) but at least it doesn't fall over any more and seems to do something.