nl_tokens: Patches the global Promise built - in to define asCallback and others as instance methods so you can do e . g . Promise . resolve ( true ) . asCallback ( cb ) .
pl_tokens: function patchPromise ( ) { const props = { } ; for ( let method of methods ) { if ( Promise . prototype [ method . name ] && Promise . prototype [ method . name ] !== method ) { throw new Error ( '`Promise` already defines method `' + method . name + '`' ) ; } props [ method . name ] = { configurable : true , enumerable : <mask> , writable : true , value : method } ; } Object . defineProperties ( Promise . prototype , props ) ; }