javascript - Uglify with anonymous function -


i have .js , i'm compacting it:

'use strict'; !(function () {   var object = typeof exports != 'undefined' ? exports : this; }()); 

when use google closure compiler don't erros , 'this' referencing window object. when use uglify ( mangle true or false ) gets undefined on 'this' ( object undefined , receive error ). knows why?

basically can change window , work concern other codes, libs or else i'm uglyfing in future.

note: i'm using grunt-contrib-uglify plugin options: mangle: true, preservercomments: false, sourcemap: true

it expected behaviour:

with 'use strict'; function's context undefined, not global object.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -