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
I'm trying to use asn1js but I'm getting an error from checkBufferParams in this lib due to the following problem which was previously fixed but has cropped up again in Node v11.15.0: nodejs/node#20978 (comment)
The problem is that Uint8Array.prototype.buffer instanceof ArrayBuffer always returns false when running code in Jest. It doesn't make any sense (even inspecting the value shows a class of ArrayBuffer) but it seems to be a bug in the current V8 version of Node.
The popular workaround seems to be to check the constructor name strings instead: Stuk/jszip#598
The text was updated successfully, but these errors were encountered:
abonander
changed the title
Don't use instanceof ArrayBuffer, it breaks around sandboxing like in Jest
Don't use instanceof ArrayBuffer, it breaks in Jest
Aug 7, 2019
I'm trying to use
asn1js
but I'm getting an error fromcheckBufferParams
in this lib due to the following problem which was previously fixed but has cropped up again in Node v11.15.0: nodejs/node#20978 (comment)The problem is that
Uint8Array.prototype.buffer instanceof ArrayBuffer
always returns false when running code in Jest. It doesn't make any sense (even inspecting the value shows a class ofArrayBuffer
) but it seems to be a bug in the current V8 version of Node.The popular workaround seems to be to check the constructor name strings instead: Stuk/jszip#598
The text was updated successfully, but these errors were encountered: