UglifyJS/lib
Сковорода Никита Андреевич d2c83610f6 Fix deprecated Buffer constructor usage and add safeguards
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
2018-05-28 08:55:14 +03:00
..
ast.js compress undefined property names (#2811) 2018-01-19 00:36:30 +08:00
compress.js workaround pure_getters=true when dropping unused assignments (#2939) 2018-02-20 17:38:40 +08:00
minify.js Fix deprecated Buffer constructor usage and add safeguards 2018-05-28 08:55:14 +03:00
mozilla-ast.js fix & improve coverage of estree (#1935) 2017-05-15 02:37:53 +08:00
output.js compress undefined property names (#2811) 2018-01-19 00:36:30 +08:00
parse.js compress undefined property names (#2811) 2018-01-19 00:36:30 +08:00
propmangle.js fix mangle name collision across files (#2722) 2018-01-05 05:08:09 +08:00
scope.js handle duplicate function declarations correctly (#2837) 2018-01-23 01:28:09 +08:00
sourcemap.js Generate source map data from normalized files 2016-11-29 20:42:56 +01:00
transform.js Transform can be simplified when clone is not done. (#2621) 2017-12-19 17:56:16 +08:00
utils.js fix AST_Scope.clone() (#2803) 2018-01-17 21:33:13 +08:00