nl_tokens: RequireJS & AMD - style define
pl_tokens: function ( name , deps , module ) { switch ( arguments . length ) { <mask> 1 : // define(function () {}) module = name ; deps = name = sb . undefined ; break ; case 2 : // define(['a', 'b'], function () {}) module = deps ; deps = name ; name = sb . undefined ; break ; case 3 : // define('name', ['a', 'b'], function () {}) } if ( typeof module !== "function" ) { amdModules [ currentModule ] = module ; return ; } var output = { 'exports' : { } } ; if ( ! deps ) { deps = [ "require" , "exports" , "module" ] ; } for ( var i = 0 , c = deps . length ; i < c ; i ++ ) { switch ( deps [ i ] ) { case "require" : deps [ i ] = currentRequire ; break ; case "module" : deps [ i ] = output ; break ; case "exports" : deps [ i ] = output . exports ; break ; default : deps [ i ] = currentRequire && currentRequire ( deps [ i ] ) ; } } module = module . apply ( this , deps ) || output . exports ; amdModules [ currentModule ] = module ; }