Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
sample kotlin js output for 1.1-M04 blog post

the code for the CommonJS module system:

    (function (_, Kotlin, $module$jquery) {
        'use strict';
        function main$lambda(it) {
            $module$jquery('.toggle-panel').toggle(300);
        }
        function main(args) {
            $module$jquery('.toggle-button').click(main$lambda);
        }
        _.main_kand9s$ = main;
        main([]);
        return _;
    }(module.exports, require('kotlin'), require('jquery')));

and a plain module system (i.e. no module system at all):

    this['kotlin-1.1-demo'] = function (_, Kotlin) {
        'use strict';
        function main$lambda(it) {
            $('.toggle-panel').toggle(300);
        }
        function main(args) {
            $('.toggle-button').click(main$lambda);
        }
        _.main_kand9s$ = main;
        main([]);
        return _;
    }(typeof this['kotlin-1.1-demo'] === 'undefined' ? {} : this['kotlin-1.1-demo'], kotlin);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment