nl_tokens: Takes a plugin sub - class and returns a factory function for generating instances of it .
pl_tokens: function createPluginFactory ( name , PluginSubClass ) { // Add a `name` property to the plugin prototype so that each plugin can // refer to itself by name. PluginSubClass . prototype . name = name ; return function ( ) { triggerSetupEvent ( this , { name : name , plugin : PluginSubClass , instance : null } , <mask> ) ; for ( var _len = arguments . length , args = Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) { args [ _key ] = arguments [ _key ] ; } var instance = new ( Function . prototype . bind . apply ( PluginSubClass , [ null ] . concat ( [ this ] . concat ( args ) ) ) ) ( ) ; // The plugin is replaced by a function that returns the current instance. this [ name ] = function ( ) { return instance ; } ; triggerSetupEvent ( this , instance . getEventHash ( ) ) ; return instance ; } ; }