bin/lmd_builder.js
function breakSandbox(ast, replaceMap) {
        var sandboxName = ast[2][0] || 'sb';

        var newAst = walker.with_walkers({
            // lookup for dot
            // looking for this pattern
            // ["dot", ["name", "sb"], "require"] -> ["name", map["require"]]
            "dot" : function () {
                if (this[1] && this[1][0] === "name" && this[1][1] === sandboxName) {
                    var sourceName = this[2];
                    return ["name", replaceMap[sourceName]];
                }
            }
        }, function () {
            return walker.walk(ast);
        });

        // remove IEFE's `sb` or whatever argument
        newAst[1][2] = [];

        return newAst;
    }
function breakSandbox(ast, replaceMap) {
        var sandboxName = ast[2][0] || 'sb';

        var newAst = walker.with_walkers({
            // lookup for dot
            // looking for this pattern
            // ["dot", ["name", "sb"], "require"] -> ["name", map["require"]]
            "dot" : function () {
                if (this[1] && this[1][0] === "name" && this[1][1] === sandboxName) {
                    var sourceName = this[2];
                    return ["name", replaceMap[sourceName]];
                }
            }
        }, function () {
            return walker.walk(ast);
        });

        // remove IEFE's `sb` or whatever argument
        newAst[1][2] = [];

        return newAst;
    }
function breakSandbox ( ast , replaceMap ) { var sandboxName = ast [ 2 ] [ 0 ] || 'sb' ; var newAst = walker . with_walkers ( { // lookup for dot // looking for this pattern // ["dot", ["name", "sb"], "require"] -> ["name", map["require"]] "dot" : function ( ) { if ( this [ 1 ] && this [ 1 ] [ 0 ] === "name" && this [ 1 ] [ 1 ] === sandboxName ) { var sourceName = this [ 2 ] ; return [ "name" , replaceMap [ sourceName ] ] ; } } } , function ( ) { return walker . walk ( ast ) ; } ) ; // remove IEFE's `sb` or whatever argument newAst [ 1 ] [ 2 ] = [ ] ; return newAst ; }
Brakes sendbox in one module

@param {Object} ast
@param {Object} replaceMap

@return {Object} call AST
Brakes sendbox in one module