This avoids using deprecated Buffer constructor API on newer Node.js versions. To achieve that, Buffer.from presence is checked, with validating that it's not the same method as Uint8Array.from. Also, additional checks were added for older Node.js versions to ensure that a number is never accidentally passed to the Buffer constructor. Throwing is in line with browser atob/btoa behavior, and in line with what Buffer.from does on numbers in newer Node.js versions. No actual security issues present in that code, the safeguard has been added preemptively to avoid accidential calls to atob/btoa(number) in the future. Refs: https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor |
||
|---|---|---|
| .. | ||
| ast.js | ||
| compress.js | ||
| minify.js | ||
| mozilla-ast.js | ||
| output.js | ||
| parse.js | ||
| propmangle.js | ||
| scope.js | ||
| sourcemap.js | ||
| transform.js | ||
| utils.js | ||