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

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -