nl_tokens: Experimental implementation of the invoke () trap on platforms that support __noSuchMethod__ ( e . g . Spidermonkey / FF ) . / * invoke : function ( receiver name args ) { var trap = this . getTrap ( invoke ) ; if ( trap === undefined ) { default forwarding behavior return Reflect . invoke ( this . target name args receiver ) ; }
pl_tokens: function ( receiver , name ) { // experimental support for invoke() trap on platforms that // support __noSuchMethod__ /*
      if (name === '__noSuchMethod__') {
        var handler = this;
        return function(name, args) {
          return handler.invoke(receiver, name, args);
        }
      }
      */ var trap = this . getTrap ( "get" ) ; if ( trap === undefined ) { // default forwarding behavior return Reflect . get ( this . target , name , receiver ) ; } name = String ( name ) ; var res = trap . call ( this . handler , this . target , name , receiver ) ; var fixedDesc = Object . getOwnPropertyDescriptor ( this . target , <mask> ) ; // check consistency of the returned value if ( fixedDesc !== undefined ) { // getting an existing property if ( isDataDescriptor ( fixedDesc ) && fixedDesc . configurable === false && fixedDesc . writable === false ) { // own frozen data property if ( ! sameValue ( res , fixedDesc . value ) ) { throw new TypeError ( "cannot report inconsistent value for " + "non-writable, non-configurable property '" + name + "'" ) ; } } else { // it's an accessor property if ( isAccessorDescriptor ( fixedDesc ) && fixedDesc . configurable === false && fixedDesc . get === undefined ) { if ( res !== undefined ) { throw new TypeError ( "must report undefined for non-configurable " + "accessor property '" + name + "' without getter" ) ; } } } } return res ; }