Open
Description
Hi,
when using rollup to bundle, it converts modules to something like this:
var bufferEs6 = /*#__PURE__*/Object.freeze({
__proto__: null,
Buffer: Buffer,
INSPECT_MAX_BYTES: INSPECT_MAX_BYTES,
SlowBuffer: SlowBuffer,
isBuffer: isBuffer,
kMaxLength: _kMaxLength
});
Because the Object is explicitly set to have no prototype, this check in safer-buffer will fail (no prototype -- no hasOwnProperty()):
if (!buffer.hasOwnProperty(key)) continue
If you use the following instead, it'll work fine:
if (!Object.hasOwnProperty.call(buffer, key)) continue
Do you think this solution would be safe enough to rewrite?
Metadata
Metadata
Assignees
Labels
No labels