Modern Buffer API polyfill without footguns
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?
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by schadenn and has received 3 comments.