script.js icon indicating copy to clipboard operation
script.js copied to clipboard

$script.order() mutate the paths array parameter

Open Yimiprod opened this issue 10 years ago • 0 comments

import scriptjs from 'scriptjs';

const LIBS = ['url/to/main/lib.js', 'url/to/dep/lib.js'];

scriptjs.order(LIBS, () => done());
scriptjs.order(LIBS, () => done());

The second one will throw an error because LIBS will be mutated with the .shift() and will be empty.

Yimiprod avatar Apr 26 '16 14:04 Yimiprod