marcuswestin / store.js

Cross-browser storage for all use cases, used across the web.
MIT License
14.01k stars 1.33k forks source link

Util function declaration compatible with "use strict" #266

Open andreasrs opened 6 years ago

andreasrs commented 6 years ago

Make make_assign in util.js adhere to strict mode.

Newer versions of UglifyJS will fail to process this code, due to their recent commit https://github.com/mishoo/UglifyJS2/pull/2718/files#diff-9f97a9c36fbbfb0d19068d6fae3bb84eR904

Reported like this by Rollup upon uglify: [!] (uglify plugin) Error: Error transforming bundle with 'uglify' plugin: In strict mode code, functions can only be declared at top level or immediately within another function.

Builds successfully when using var which hoists the function like in this PR.