lib/es5.js
function defineNativeMethodsOnChainable() {

  var nativeTokens = {
    'Function': 'apply,call',
    'RegExp':   'compile,exec,test',
    'Number':   'toExponential,toFixed,toLocaleString,toPrecision',
    'Object':   'hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString',
    'Array':    'concat,join,pop,push,reverse,shift,slice,sort,splice,toLocaleString,unshift',
    'Date':     'getTime,getTimezoneOffset,setTime,toDateString,toGMTString,toLocaleDateString,toLocaleString,toLocaleTimeString,toTimeString,toUTCString',
    'String':   'anchor,big,blink,bold,charAt,charCodeAt,concat,fixed,fontcolor,fontsize,indexOf,italics,lastIndexOf,link,localeCompare,match,replace,search,slice,small,split,strike,sub,substr,substring,sup,toLocaleLowerCase,toLocaleUpperCase,toLowerCase,toUpperCase'
  };

  var dateTokens = 'FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds'.split(',');

  function addDateTokens(prefix, arr) {
    for (var i = 0; i < dateTokens.length; i++) {
      arr.push(prefix + dateTokens[i]);
    }
  }

  forEachProperty(nativeTokens, function(str, name) {
    var tokens = str.split(',');
    if (name === 'Date') {
      addDateTokens('get', tokens);
      addDateTokens('set', tokens);
      addDateTokens('getUTC', tokens);
      addDateTokens('setUTC', tokens);
    }
    tokens.push('toString');
    mapNativeToChainable(name, tokens);
  });

}
function defineNativeMethodsOnChainable() {

  var nativeTokens = {
    'Function': 'apply,call',
    'RegExp':   'compile,exec,test',
    'Number':   'toExponential,toFixed,toLocaleString,toPrecision',
    'Object':   'hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString',
    'Array':    'concat,join,pop,push,reverse,shift,slice,sort,splice,toLocaleString,unshift',
    'Date':     'getTime,getTimezoneOffset,setTime,toDateString,toGMTString,toLocaleDateString,toLocaleString,toLocaleTimeString,toTimeString,toUTCString',
    'String':   'anchor,big,blink,bold,charAt,charCodeAt,concat,fixed,fontcolor,fontsize,indexOf,italics,lastIndexOf,link,localeCompare,match,replace,search,slice,small,split,strike,sub,substr,substring,sup,toLocaleLowerCase,toLocaleUpperCase,toLowerCase,toUpperCase'
  };

  var dateTokens = 'FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds'.split(',');

  function addDateTokens(prefix, arr) {
    for (var i = 0; i < dateTokens.length; i++) {
      arr.push(prefix + dateTokens[i]);
    }
  }

  forEachProperty(nativeTokens, function(str, name) {
    var tokens = str.split(',');
    if (name === 'Date') {
      addDateTokens('get', tokens);
      addDateTokens('set', tokens);
      addDateTokens('getUTC', tokens);
      addDateTokens('setUTC', tokens);
    }
    tokens.push('toString');
    mapNativeToChainable(name, tokens);
  });

}
function defineNativeMethodsOnChainable ( ) { var nativeTokens = { 'Function' : 'apply,call' , 'RegExp' : 'compile,exec,test' , 'Number' : 'toExponential,toFixed,toLocaleString,toPrecision' , 'Object' : 'hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString' , 'Array' : 'concat,join,pop,push,reverse,shift,slice,sort,splice,toLocaleString,unshift' , 'Date' : 'getTime,getTimezoneOffset,setTime,toDateString,toGMTString,toLocaleDateString,toLocaleString,toLocaleTimeString,toTimeString,toUTCString' , 'String' : 'anchor,big,blink,bold,charAt,charCodeAt,concat,fixed,fontcolor,fontsize,indexOf,italics,lastIndexOf,link,localeCompare,match,replace,search,slice,small,split,strike,sub,substr,substring,sup,toLocaleLowerCase,toLocaleUpperCase,toLowerCase,toUpperCase' } ; var dateTokens = 'FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds' . split ( ',' ) ; function addDateTokens ( prefix , arr ) { for ( var i = 0 ; i < dateTokens . length ; i ++ ) { arr . push ( prefix + dateTokens [ i ] ) ; } } forEachProperty ( nativeTokens , function ( str , name ) { var tokens = str . split ( ',' ) ; if ( name === 'Date' ) { addDateTokens ( 'get' , tokens ) ; addDateTokens ( 'set' , tokens ) ; addDateTokens ( 'getUTC' , tokens ) ; addDateTokens ( 'setUTC' , tokens ) ; } tokens . push ( 'toString' ) ; mapNativeToChainable ( name , tokens ) ; } ) ; }
Polyfilled methods will automatically be added to the chainable prototype. However, Object.getOwnPropertyNames cannot be shimmed for non-enumerable properties, so if it does not exist, then the only way to access native methods previous to ES5 is to provide them as a list of tokens here.
Polyfilled methods will automatically be added to the chainable prototype . However Object . getOwnPropertyNames cannot be shimmed for non - enumerable properties so if it does not exist then the only way to access native methods previous to ES5 is to provide them as a list of tokens here .