Advertisement
Guest User

big-l.js -- RVKlein -- +2019-01-21T14:20:00

a guest
Jan 21st, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(true===true)
  2. {
  3.     if((void(null))!==(undefined)){undefined=void(null);}
  4.     if(!Function.prototype.prototype){Function.prototype.prototype={};}
  5. }
  6. /*!~~!*/
  7. var L=(function(_,_SCOPE_)
  8. {
  9.     var meta=(
  10.     {   "author_url":"https//rvklein.me/"
  11.     ,   "title":"big-l.js"
  12.     ,   "modified":"+2019-01-21"
  13.     });
  14.  
  15.     var $=(new Object({}));
  16.  
  17.     var inst=(
  18.     {   timing:{spawned:undefined}
  19.     ,   eid:{a:undefined}
  20.     });
  21.  
  22.     inst.timing.spawned=((new Date()).getTime());
  23.     inst.eid.a=(Math.floor(Math.random()*(Math.pow(2,53)-1)));
  24.  
  25.     _=_SCOPE_(_);
  26.  
  27.     function L ()
  28.     {
  29.         this.meta=meta;
  30.         this._=_;
  31.         this.inst=inst;
  32.     }
  33.  
  34.     //L.prototype.is=is;
  35.  
  36.     return(new L());
  37. }
  38. )(this,function(that)
  39. {'use strict';
  40.    
  41.     function isOwnConstructor (x)
  42.     {
  43.         return((('object'===typeof(x))
  44.             &&  (x.constructor.name in x)
  45.             &&  (x instanceof x[x.constructor.name])
  46.             &&  ('function'===typeof(x.constructor.constructor))
  47.             &&  (x.constructor.constructor instanceof Function)
  48.             &&  (Function===x.constructor.constructor)
  49.         )?true:false);
  50.     }
  51.  
  52.     that=((that&&isOwnConstructor(that))?that:undefined);
  53.  
  54.     var $=(
  55.     {   scope:undefined
  56.     ,   scopeName:undefined
  57.     ,   scopeProps:undefined
  58.     ,   console:undefined
  59.     ,   has:{strictMode:undefined}
  60.     });
  61.  
  62.     try
  63.     {   if(isOwnConstructor(this)){$.has.strictMode=false;}else{$.has.strictMode=true;}
  64.     }
  65.     catch(e)
  66.     {}
  67.  
  68.     try
  69.     {   $.has.GeneratorFunction=(true===(
  70.             'GeneratorFunction'===((Object.getPrototypeOf(function*(){})).constructor.name)
  71.         ));
  72.     }
  73.     catch(e)
  74.     {   $.has.GeneratorFunction=false;
  75.     }
  76.  
  77.     try
  78.     {   if
  79.         (   ('concat' in ([]))
  80.         &&  ('function'===typeof(([]).concat))
  81.         &&  (3===(([0,1]).concat([2])).length)
  82.         )
  83.         {   $.has.ArrayMethodConcat=true;
  84.         }else
  85.         {   $.has.ArrayMethodConcat=false;
  86.         }
  87.     }
  88.     catch(e)
  89.     {   $.has.ArrayMethodConcat=false;
  90.     }
  91.  
  92.     var scope={};
  93.  
  94.     try{if(isOwnConstructor(global)){scope.global=global;}}catch(e){}
  95.     try{if(isOwnConstructor(self)){scope.self=self;}}catch(e){}
  96.     try{if(isOwnConstructor(window)){scope.window=window;}}catch(e){}
  97.  
  98.     if
  99.     (   ('global' in scope)
  100.     &&  ((!that)||(that===scope.global))
  101.     &&  ('Object'===scope.global.constructor.name)
  102.     &&  ('[object process]'===({}).toString.call(scope.global.process))
  103.     &&  ('module' in scope.global)
  104.     &&  ('Module'===module.constructor.name)
  105.     )
  106.     {   $.scopeName='global';
  107.     }
  108.  
  109.     if
  110.     (   ('self' in scope)
  111.     &&  ((!that)||(that===scope.self))
  112.     &&  ('importScripts' in scope.self)
  113.     &&  ('function'===typeof(importScripts))
  114.     &&  ('function'===typeof(postMessage))
  115.     &&  ('onmessage' in scope.self)
  116.     &&  ((null===scope.self.onmessage)||('function'===typeof(scope.self.onmessage)))
  117.     )
  118.     {   $.scopeName='self';
  119.     }
  120.  
  121.     if
  122.     (   ('window' in scope)
  123.     &&  ((!that)||(that===scope.window))
  124.     &&  ('Window'===scope.window.constructor.name)
  125.     &&  ('top' in scope.window)
  126.     &&  ('parent' in scope.window)
  127.     &&  (scope.window.top instanceof scope.window.constructor)
  128.     &&  (scope.window.parent instanceof scope.window.constructor)
  129.     &&  ('document' in scope.window)
  130.     &&  (   ('navigator' in scope.window)
  131.         &&  ('function'===typeof(Navigator))
  132.         &&  ('Navigator'===scope.window.navigator.constructor.name)
  133.         )
  134.     &&  (   ('location' in scope.window)
  135.         &&  ('function'===typeof(Location))
  136.         &&  ('Location'===scope.window.location.constructor.name)
  137.         )
  138.     )
  139.     {   $.scopeName='window';
  140.     }
  141.  
  142.     $.scope=scope[$.scopeName];
  143.  
  144.     $.scopeProps=(function(a)
  145.         {
  146.             var z=[];
  147.             for(var i=0,j=a.length;j>i;i++)
  148.             {
  149.                 if('L'!==a[i]){z.push(a[i]);}
  150.             };
  151.             return(z);
  152.         }
  153.     )(Object.keys($.scope));
  154.  
  155.     $.scopePropsLength=($.scopeProps.length);
  156.  
  157.     if
  158.     (   ('console' in $.scope)
  159.     &&  ('object'===typeof($.scope.console))
  160.     )
  161.     {
  162.         if
  163.         (   ('Object'===$.scope.console.constructor.name)
  164.         &&  ('[object Console]'===({}).toString.call($.scope.console))
  165.         )
  166.         {
  167.             //browser//
  168.             $.console=$.scope.console;
  169.         }
  170.         else if
  171.         (   ('Console'===$.scope.console.constructor.name)
  172.         &&  ('[object Object]'===({}).toString.call($.scope.console))
  173.         )
  174.         {
  175.             //node//
  176.             $.console=$.scope.console;
  177.         }
  178.     }
  179.  
  180.     if('global'===$.scopeName)
  181.     {
  182.         if(that&&(Object.keys(that).length)){$._isNodeInteractiveConsole=true;}
  183.     }
  184.     else if('window'===$.scopeName)
  185.     {
  186.         $._isTopWindow=($.scope.window===$.scope.window.top);
  187.         //
  188.         if
  189.         (   ''===$.scope.window.document.domain
  190.         &&  $.scope.window.document.location.hostname
  191.         &&  (   ('http:'===$.scope.window.location.protocol)
  192.             ||  ('https:'===$.scope.window.location.protocol)
  193.             )
  194.         )
  195.         {
  196.             window.document.domain=$.scope.document.location.hostname;
  197.         }
  198.         //
  199.         if
  200.         (   ('HTMLDocument'===$.scope.document.constructor.name)
  201.         &&  ('html'===$.scope.document.doctype.name)
  202.         )
  203.         {
  204.             $._isHTMLDocument=true;
  205.             try{$._documentCurrentScript=$.scope.window.document.currentScript;}catch(e){}
  206.         }
  207.     }
  208.  
  209.     return($);
  210. });
  211. /*!~~!*/
  212. if
  213. (true===true)
  214. {
  215.     if
  216.     (   !(  ('now' in Date)
  217.         &&  ('function'===typeof(Date.now))
  218.         &&  (((new Date()).getTime())===(Date.now()))
  219.         )
  220.     )
  221.     {   Date.now=function(){return((new Date()).getTime());};
  222.     }
  223.     //
  224.     if
  225.     (   !(  ('MAX_SAFE_INTEGER' in Number)
  226.         &&  ('number'===typeof(Number.MAX_SAFE_INTEGER))
  227.         )
  228.     )
  229.     {   Number.MAX_SAFE_INTEGER=(Math.pow(2,53)-1);
  230.     }
  231.     //
  232.     if(!(('NaN' in Number)&&('number'===typeof(Number.NaN))&&(Number.NaN!==Number.NaN)))
  233.     {   Number.NaN=(new Number(void(0)));
  234.     }
  235.     //
  236.     if
  237.     (   !(  ('function'===typeof(Number.isNaN))
  238.         &&  (false===Number.isNaN(0))
  239.         &&  (true===Number.isNaN(new Number(void(0))))
  240.         )
  241.     )
  242.     {   Number.isNaN=function(n)
  243.         {   return((('number'===typeof(n))&&(n!==n))?true:false);
  244.         };
  245.     }
  246.     if
  247.     (   'function'!==typeof(Object.is)
  248.     )
  249.     {   Object.is=function(x,y)
  250.         {   return( (x===y)?((0!==x)||((1/x)===(1/y))):((x!==x)&&(y!==y)) );
  251.         };
  252.     }
  253.     if
  254.     (   false===
  255.         (   ('isArray' in Array)
  256.         &&  ('function'!==typeof(Array.isArray))
  257.         )
  258.     )
  259.     {   Array.isArray=function(arg)
  260.         {   return(('[object Array]'===Object.prototype.toString.call(arg)?true:false));
  261.         };
  262.     }
  263.     //
  264.     if
  265.     (   !Array.prototype.forEach
  266.     )
  267.     {   Array.prototype.forEach=function(f)
  268.         {
  269.             var k=0,o,l,a;
  270.             if(('undefined'===typeof(this))||(null===this))
  271.             {   throw(new TypeError('`this` is null or not defined'));
  272.             };
  273.             o=(Object(this));l=(o.length>>>0);
  274.             if('function'!==typeof(f))
  275.             {   throw(new TypeError(f+' is not a function'));
  276.             };
  277.             if(1<arguments.length)
  278.             {   a=arguments[1];
  279.             };
  280.             while(l>k)
  281.             {   var v;if(k in o){v=o[k];f.call(a,v,k,o);};k++;
  282.             };
  283.             return(void(0));
  284.         };
  285.     }
  286. }
  287. /*!~~!*/
  288. //
  289. //console.log( L );
  290. //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement