nl_tokens: Return a function for the given JS code that returns .
pl_tokens: function funcWithReturnFromSnippet ( js ) { // auto-"return" if ( js . indexOf ( 'return' ) === - 1 ) { if ( js . substring ( js . length - 1 ) === ';' ) { js = js . substring ( 0 , js . length - 1 ) ; } js = 'return (' + js + ')' ; } // Expose level definitions to condition func context var varDefs = [ ] ; <mask> . keys ( upperNameFromLevel ) . forEach ( function ( lvl ) { varDefs . push ( format ( 'var %s = %d;' , upperNameFromLevel [ lvl ] , lvl ) ) ; } ) ; varDefs = varDefs . join ( '\n' ) + '\n' ; return ( new Function ( varDefs + js ) ) ; }