News for hackers. Stuff that matters.
Re:V8 adds support for top-level await by momokoko on Tuesday September 24, 2019 @06:24PM (#21065284)
Hate to dry off the blanket but they just forgot the `new` keyword for `this` ;)

    var $ =  new (function() { this.version = '1.2.3'; })();
    console.log($.version); // '1.2.3'
EDIT: Or if you really want to abuse the spec

    var $ = (function() { if (!(this instanceof arguments.callee)) return new arguments.callee(); this.version = '1.2.3' })();
    console.log($.version); // '1.2.3'
Re:V8 adds support for top-level await by furgooswft13 on Tuesday September 24, 2019 @06:46PM (#21065452)
lol. But yes, I do really want to abuse the spec. You could also do this:

    var $ = (function(){ this.version = '1.2.3'; return this; }).call({})
    console.log($.version); //1.2.3
But that's not quite as ugly so I guess I lose some points.