Avoid mutating the passed-in options for babel-register (#6542)

This commit is contained in:
Logan Smyth 2017-10-23 15:49:10 -07:00 committed by GitHub
parent 70818c3db8
commit 11d8e0555f

View File

@ -97,6 +97,8 @@ register({
});
export default function register(opts?: Object = {}) {
// Clone to avoid mutating the arguments object with the 'delete's below.
opts = Object.assign({}, opts);
if (opts.extensions) hookExtensions(opts.extensions);
if (opts.cache === false) cache = null;