Open abonander opened 5 years ago
@abonander I do not want to make a workarounds on well-known bugs. Let's wait for the bug to be fixed in Node.
Node has announced that it's not their problem: https://github.com/nodejs/node/issues/20978#issuecomment-518953597
Jest has had an issue open since February: https://github.com/facebook/jest/issues/7780
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: https://github.com/nodejs/node/issues/20978#issuecomment-518900173The 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: https://github.com/Stuk/jszip/pull/598