Edit in JSFiddle

var self = this;
this.v1 = 1;
(function(global){
    alert(global.v1); //1
    global.v2 = 2;
})(self);
alert(this.v2); //2