mirrors… (function(a,b){ "use strict"; var c; var d=a.Array; var e=a.isNaN; var f=a.JSON.stringify; var g=a.Math.min; var h=b.ImportNow("promise_status_symbol"); var i=b.ImportNow("promise_value_symbol"); var j; var k; var l; b.Import(function(m){ c=m.FunctionSourceString; j=m.SymbolToString; k=m.ToBoolean; l=m.ToString; }); var n={ UNDEFINED_TYPE:'undefined', NULL_TYPE:'null', BOOLEAN_TYPE:'boolean', NUMBER_TYPE:'number', STRING_TYPE:'string', SYMBOL_TYPE:'symbol', OBJECT_TYPE:'object', FUNCTION_TYPE:'function', REGEXP_TYPE:'regexp', ERROR_TYPE:'error', PROPERTY_TYPE:'property', INTERNAL_PROPERTY_TYPE:'internalProperty', FRAME_TYPE:'frame', SCRIPT_TYPE:'script', CONTEXT_TYPE:'context', SCOPE_TYPE:'scope', PROMISE_TYPE:'promise', MAP_TYPE:'map', SET_TYPE:'set', ITERATOR_TYPE:'iterator', GENERATOR_TYPE:'generator', } var o=0; var p=-1; var q=[]; var r=true; function MirrorCacheIsEmpty(){ return o==0&&q.length==0; } function ToggleMirrorCache(s){ r=s; ClearMirrorCache(); } function ClearMirrorCache(s){ o=0; q=[]; } function ObjectIsPromise(s){ return(%_IsSpecObject(s))&& !(%DebugGetProperty(s,h)===(void 0)); } function MakeMirror(s,t){ var u; if(!t&&r){ for(var v in q){ u=q[v]; if(u.value()===s){ return u; } if(u.isNumber()&&e(u.value())&& typeof s=='number'&&e(s)){ return u; } } } if((s===(void 0))){ u=new UndefinedMirror(); }else if((s===null)){ u=new NullMirror(); }else if((typeof(s)==='boolean')){ u=new BooleanMirror(s); }else if((typeof(s)==='number')){ u=new NumberMirror(s); }else if((typeof(s)==='string')){ u=new StringMirror(s); }else if((typeof(s)==='symbol')){ u=new SymbolMirror(s); }else if((%_IsArray(s))){ u=new ArrayMirror(s); }else if((%_IsDate(s))){ u=new DateMirror(s); }else if((%_IsFunction(s))){ u=new FunctionMirror(s); }else if((%_IsRegExp(s))){ u=new RegExpMirror(s); }else if((%_ClassOf(s)==='Error')){ u=new ErrorMirror(s); }else if((%_ClassOf(s)==='Script')){ u=new ScriptMirror(s); }else if((%_ClassOf(s)==='Map')||(%_ClassOf(s)==='WeakMap')){ u=new MapMirror(s); }else if((%_ClassOf(s)==='Set')||(%_ClassOf(s)==='WeakSet')){ u=new SetMirror(s); }else if((%_ClassOf(s)==='Map Iterator')||(%_ClassOf(s)==='Set Iterator')){ u=new IteratorMirror(s); }else if(ObjectIsPromise(s)){ u=new PromiseMirror(s); }else if((%_ClassOf(s)==='Generator')){ u=new GeneratorMirror(s); }else{ u=new ObjectMirror(s,n.OBJECT_TYPE,t); } if(r)q[u.handle()]=u; return u; } function LookupMirror(w){ if(!r){ throw MakeError(2,"Mirror cache is disabled"); } return q[w]; } function GetUndefinedMirror(){ return MakeMirror((void 0)); } function inherits(x,y){ var z=function(){}; z.prototype=y.prototype; x.super_=y.prototype; x.prototype=new z(); x.prototype.constructor=x; } var A=80; var B={}; B.Named=1; B.Indexed=2; var C={}; C.Data=0; C.DataConstant=2; C.AccessorConstant=3; var D={}; D.None=0; D.ReadOnly=1; D.DontEnum=2; D.DontDelete=4; var E={Global:0, Local:1, With:2, Closure:3, Catch:4, Block:5, Script:6}; function Mirror(F){ this.type_=F; } Mirror.prototype.type=function(){ return this.type_; }; Mirror.prototype.isValue=function(){ return this instanceof ValueMirror; }; Mirror.prototype.isUndefined=function(){ return this instanceof UndefinedMirror; }; Mirror.prototype.isNull=function(){ return this instanceof NullMirror; }; Mirror.prototype.isBoolean=function(){ return this instanceof BooleanMirror; }; Mirror.prototype.isNumber=function(){ return this instanceof NumberMirror; }; Mirror.prototype.isString=function(){ return this instanceof StringMirror; }; Mirror.prototype.isSymbol=function(){ return this instanceof SymbolMirror; }; Mirror.prototype.isObject=function(){ return this instanceof ObjectMirror; }; Mirror.prototype.isFunction=function(){ return this instanceof FunctionMirror; }; Mirror.prototype.isUnresolvedFunction=function(){ return this instanceof UnresolvedFunctionMirror; }; Mirror.prototype.isArray=function(){ return this instanceof ArrayMirror; }; Mirror.prototype.isDate=function(){ return this instanceof DateMirror; }; Mirror.prototype.isRegExp=function(){ return this instanceof RegExpMirror; }; Mirror.prototype.isError=function(){ return this instanceof ErrorMirror; }; Mirror.prototype.isPromise=function(){ return this instanceof PromiseMirror; }; Mirror.prototype.isGenerator=function(){ return this instanceof GeneratorMirror; }; Mirror.prototype.isProperty=function(){ return this instanceof PropertyMirror; }; Mirror.prototype.isInternalProperty=function(){ return this instanceof InternalPropertyMirror; }; Mirror.prototype.isFrame=function(){ return this instanceof FrameMirror; }; Mirror.prototype.isScript=function(){ return this instanceof ScriptMirror; }; Mirror.prototype.isContext=function(){ return this instanceof ContextMirror; }; Mirror.prototype.isScope=function(){ return this instanceof ScopeMirror; }; Mirror.prototype.isMap=function(){ return this instanceof MapMirror; }; Mirror.prototype.isSet=function(){ return this instanceof SetMirror; }; Mirror.prototype.isIterator=function(){ return this instanceof IteratorMirror; }; Mirror.prototype.allocateHandle_=function(){ if(r)this.handle_=o++; }; Mirror.prototype.allocateTransientHandle_=function(){ this.handle_=p--; }; Mirror.prototype.toText=function(){ return"#<"+this.constructor.name+">"; }; function ValueMirror(F,s,G){ %_CallFunction(this,F,Mirror); this.value_=s; if(!G){ this.allocateHandle_(); }else{ this.allocateTransientHandle_(); } } inherits(ValueMirror,Mirror); Mirror.prototype.handle=function(){ return this.handle_; }; ValueMirror.prototype.isPrimitive=function(){ var F=this.type(); return F==='undefined'|| F==='null'|| F==='boolean'|| F==='number'|| F==='string'|| F==='symbol'; }; ValueMirror.prototype.value=function(){ return this.value_; }; function UndefinedMirror(){ %_CallFunction(this,n.UNDEFINED_TYPE,(void 0),ValueMirror); } inherits(UndefinedMirror,ValueMirror); UndefinedMirror.prototype.toText=function(){ return'undefined'; }; function NullMirror(){ %_CallFunction(this,n.NULL_TYPE,null,ValueMirror); } inherits(NullMirror,ValueMirror); NullMirror.prototype.toText=function(){ return'null'; }; function BooleanMirror(s){ %_CallFunction(this,n.BOOLEAN_TYPE,s,ValueMirror); } inherits(BooleanMirror,ValueMirror); BooleanMirror.prototype.toText=function(){ return this.value_?'true':'false'; }; function NumberMirror(s){ %_CallFunction(this,n.NUMBER_TYPE,s,ValueMirror); } inherits(NumberMirror,ValueMirror); NumberMirror.prototype.toText=function(){ return %_NumberToString(this.value_); }; function StringMirror(s){ %_CallFunction(this,n.STRING_TYPE,s,ValueMirror); } inherits(StringMirror,ValueMirror); StringMirror.prototype.length=function(){ return this.value_.length; }; StringMirror.prototype.getTruncatedValue=function(H){ if(H!=-1&&this.length()>H){ return this.value_.substring(0,H)+ '... (length: '+this.length()+')'; } return this.value_; }; StringMirror.prototype.toText=function(){ return this.getTruncatedValue(A); }; function SymbolMirror(s){ %_CallFunction(this,n.SYMBOL_TYPE,s,ValueMirror); } inherits(SymbolMirror,ValueMirror); SymbolMirror.prototype.description=function(){ return %SymbolDescription(%_ValueOf(this.value_)); } SymbolMirror.prototype.toText=function(){ return %_CallFunction(this.value_,j); } function ObjectMirror(s,F,G){ F=F||n.OBJECT_TYPE; %_CallFunction(this,F,s,G,ValueMirror); } inherits(ObjectMirror,ValueMirror); ObjectMirror.prototype.className=function(){ return %_ClassOf(this.value_); }; ObjectMirror.prototype.constructorFunction=function(){ return MakeMirror(%DebugGetProperty(this.value_,'constructor')); }; ObjectMirror.prototype.prototypeObject=function(){ return MakeMirror(%DebugGetProperty(this.value_,'prototype')); }; ObjectMirror.prototype.protoObject=function(){ return MakeMirror(%DebugGetPrototype(this.value_)); }; ObjectMirror.prototype.hasNamedInterceptor=function(){ var I=%GetInterceptorInfo(this.value_); return(I&2)!=0; }; ObjectMirror.prototype.hasIndexedInterceptor=function(){ var I=%GetInterceptorInfo(this.value_); return(I&1)!=0; }; function TryGetPropertyNames(J){ try{ return %GetOwnPropertyNames(J,32); }catch(e){ return[]; } } ObjectMirror.prototype.propertyNames=function(K,L){ K=K||B.Named|B.Indexed; var M; var N; var O=0; if(K&B.Named){ M=TryGetPropertyNames(this.value_); O+=M.length; if(this.hasNamedInterceptor()&&(K&B.Named)){ var P= %GetNamedInterceptorPropertyNames(this.value_); if(P){ M=M.concat(P); O+=P.length; } } } if(K&B.Indexed){ N=%GetOwnElementNames(this.value_); O+=N.length; if(this.hasIndexedInterceptor()&&(K&B.Indexed)){ var Q= %GetIndexedInterceptorElementNames(this.value_); if(Q){ N=N.concat(Q); O+=Q.length; } } } L=g(L||O,O); var R=new d(L); var S=0; if(K&B.Named){ for(var T=0;S'; }; ObjectMirror.GetInternalProperties=function(s){ var U=%DebugGetInternalProperties(s); var Z=[]; for(var T=0;Tad)return new d(); var ae=new d(ad-ac+1); for(var T=ac;T<=ad;T++){ var W=%DebugGetPropertyDetails(this.value_,l(T)); var s; if(W){ s=new PropertyMirror(this,T,W); }else{ s=GetUndefinedMirror(); } ae[T-ac]=s; } return ae; }; function DateMirror(s){ %_CallFunction(this,s,ObjectMirror); } inherits(DateMirror,ObjectMirror); DateMirror.prototype.toText=function(){ var af=f(this.value_); return af.substring(1,af.length-1); }; function RegExpMirror(s){ %_CallFunction(this,s,n.REGEXP_TYPE,ObjectMirror); } inherits(RegExpMirror,ObjectMirror); RegExpMirror.prototype.source=function(){ return this.value_.source; }; RegExpMirror.prototype.global=function(){ return this.value_.global; }; RegExpMirror.prototype.ignoreCase=function(){ return this.value_.ignoreCase; }; RegExpMirror.prototype.multiline=function(){ return this.value_.multiline; }; RegExpMirror.prototype.sticky=function(){ return this.value_.sticky; }; RegExpMirror.prototype.unicode=function(){ return this.value_.unicode; }; RegExpMirror.prototype.toText=function(){ return"/"+this.source()+"/"; }; function ErrorMirror(s){ %_CallFunction(this,s,n.ERROR_TYPE,ObjectMirror); } inherits(ErrorMirror,ObjectMirror); ErrorMirror.prototype.message=function(){ return this.value_.message; }; ErrorMirror.prototype.toText=function(){ var ag; try{ ag=%_CallFunction(this.value_,builtins.$errorToString); }catch(e){ ag='#'; } return ag; }; function PromiseMirror(s){ %_CallFunction(this,s,n.PROMISE_TYPE,ObjectMirror); } inherits(PromiseMirror,ObjectMirror); function PromiseGetStatus_(s){ var ah=%DebugGetProperty(s,h); if(ah==0)return"pending"; if(ah==1)return"resolved"; return"rejected"; } function PromiseGetValue_(s){ return %DebugGetProperty(s,i); } PromiseMirror.prototype.status=function(){ return PromiseGetStatus_(this.value_); }; PromiseMirror.prototype.promiseValue=function(){ return MakeMirror(PromiseGetValue_(this.value_)); }; function MapMirror(s){ %_CallFunction(this,s,n.MAP_TYPE,ObjectMirror); } inherits(MapMirror,ObjectMirror); MapMirror.prototype.entries=function(ai){ var Z=[]; if((%_ClassOf(this.value_)==='WeakMap')){ var aj=%GetWeakMapEntries(this.value_,ai||0); for(var T=0;T3){ this.exception_=W[3]; this.getter_=W[4]; this.setter_=W[5]; } } inherits(PropertyMirror,Mirror); PropertyMirror.prototype.isReadOnly=function(){ return(this.attributes()&D.ReadOnly)!=0; }; PropertyMirror.prototype.isEnum=function(){ return(this.attributes()&D.DontEnum)==0; }; PropertyMirror.prototype.canDelete=function(){ return(this.attributes()&D.DontDelete)==0; }; PropertyMirror.prototype.name=function(){ return this.name_; }; PropertyMirror.prototype.isIndexed=function(){ for(var T=0;T0; }; FrameDetails.prototype.inlinedFrameIndex=function(){ %CheckExecutionState(this.break_id_); var aG=aE; return(this.details_[ax]&aG)>>2; }; FrameDetails.prototype.argumentCount=function(){ %CheckExecutionState(this.break_id_); return this.details_[as]; }; FrameDetails.prototype.argumentName=function(S){ %CheckExecutionState(this.break_id_); if(S>=0&&S=0&&S=0&&S=0&&S0){ for(var T=0;T0){ Z+=this.lineOffset(); Z+='-'; Z+=this.lineOffset()+this.lineCount()-1; }else{ Z+=this.lineCount(); } Z+=')'; return Z; }; function ContextMirror(bj){ %_CallFunction(this,n.CONTEXT_TYPE,Mirror); this.data_=bj; this.allocateHandle_(); } inherits(ContextMirror,Mirror); ContextMirror.prototype.data=function(){ return this.data_; }; function MakeMirrorSerializer(W,bk){ return new JSONProtocolSerializer(W,bk); } function JSONProtocolSerializer(W,bk){ this.details_=W; this.options_=bk; this.mirrors_=[]; } JSONProtocolSerializer.prototype.serializeReference=function(u){ return this.serialize_(u,true,true); }; JSONProtocolSerializer.prototype.serializeValue=function(u){ var bl=this.serialize_(u,false,true); return bl; }; JSONProtocolSerializer.prototype.serializeReferencedObjects=function(){ var bm=[]; var bn=this.mirrors_.length; for(var T=0;Tthis.maxStringLength_()){ var bp=u.getTruncatedValue(this.maxStringLength_()); bm.value=bp; bm.fromIndex=0; bm.toIndex=this.maxStringLength_(); }else{ bm.value=u.value(); } bm.length=u.length(); break; case n.SYMBOL_TYPE: bm.description=u.description(); break; case n.OBJECT_TYPE: case n.FUNCTION_TYPE: case n.ERROR_TYPE: case n.REGEXP_TYPE: case n.PROMISE_TYPE: case n.GENERATOR_TYPE: this.serializeObject_(u,bm,W); break; case n.PROPERTY_TYPE: case n.INTERNAL_PROPERTY_TYPE: throw MakeError(2, 'PropertyMirror cannot be serialized independently'); break; case n.FRAME_TYPE: this.serializeFrame_(u,bm); break; case n.SCOPE_TYPE: this.serializeScope_(u,bm); break; case n.SCRIPT_TYPE: if(u.name()){ bm.name=u.name(); } bm.id=u.id(); bm.lineOffset=u.lineOffset(); bm.columnOffset=u.columnOffset(); bm.lineCount=u.lineCount(); if(u.data()){ bm.data=u.data(); } if(this.includeSource_()){ bm.source=u.source(); }else{ var bq=u.source().substring(0,80); bm.sourceStart=bq; } bm.sourceLength=u.source().length; bm.scriptType=u.scriptType(); bm.compilationType=u.compilationType(); if(u.compilationType()==1&& u.evalFromScript()){ bm.evalFromScript= this.serializeReference(u.evalFromScript()); var br=u.evalFromLocation(); if(br){ bm.evalFromLocation={line:br.line, column:br.column}; } if(u.evalFromFunctionName()){ bm.evalFromFunctionName=u.evalFromFunctionName(); } } if(u.context()){ bm.context=this.serializeReference(u.context()); } break; case n.CONTEXT_TYPE: bm.data=u.data(); break; } bm.text=u.toText(); return bm; }; JSONProtocolSerializer.prototype.serializeObject_=function(u,bm, W){ bm.className=u.className(); bm.constructorFunction= this.serializeReference(u.constructorFunction()); bm.protoObject=this.serializeReference(u.protoObject()); bm.prototypeObject=this.serializeReference(u.prototypeObject()); if(u.hasNamedInterceptor()){ bm.namedInterceptor=true; } if(u.hasIndexedInterceptor()){ bm.indexedInterceptor=true; } if(u.isFunction()){ bm.name=u.name(); if(!(u.inferredName()===(void 0))){ bm.inferredName=u.inferredName(); } bm.resolved=u.resolved(); if(u.resolved()){ bm.source=u.source(); } if(u.script()){ bm.script=this.serializeReference(u.script()); bm.scriptId=u.script().id(); serializeLocationFields(u.sourceLocation(),bm); } bm.scopes=[]; for(var T=0;T0){ var bx=[]; for(var T=0;T0){ return'Infinity'; }else{ return'-Infinity'; } } return s; } b.InstallFunctions(a,2,[ "MakeMirror",MakeMirror, "MakeMirrorSerializer",MakeMirrorSerializer, "LookupMirror",LookupMirror, "ToggleMirrorCache",ToggleMirrorCache, "MirrorCacheIsEmpty",MirrorCacheIsEmpty, ]); b.InstallConstants(a,[ "ScopeType",E, "PropertyKind",B, "PropertyType",C, "PropertyAttribute",D, "Mirror",Mirror, "ValueMirror",ValueMirror, "UndefinedMirror",UndefinedMirror, "NullMirror",NullMirror, "BooleanMirror",BooleanMirror, "NumberMirror",NumberMirror, "StringMirror",StringMirror, "SymbolMirror",SymbolMirror, "ObjectMirror",ObjectMirror, "FunctionMirror",FunctionMirror, "UnresolvedFunctionMirror",UnresolvedFunctionMirror, "ArrayMirror",ArrayMirror, "DateMirror",DateMirror, "RegExpMirror",RegExpMirror, "ErrorMirror",ErrorMirror, "PromiseMirror",PromiseMirror, "MapMirror",MapMirror, "SetMirror",SetMirror, "IteratorMirror",IteratorMirror, "GeneratorMirror",GeneratorMirror, "PropertyMirror",PropertyMirror, "InternalPropertyMirror",InternalPropertyMirror, "FrameMirror",FrameMirror, "ScriptMirror",ScriptMirror, "ScopeMirror",ScopeMirror, "FrameDetails",FrameDetails, ]); b.InstallFunctions(b,2,[ "ClearMirrorCache",ClearMirrorCache ]); b.Export(function(bF){ bF.MirrorType=n; }); }) debugfˆ (function(a,b){ "use strict"; var c=a.FrameMirror; var d=a.Array; var e=a.RegExp; var f=a.isNaN; var g=a.JSON.parse; var h=a.JSON.stringify; var i=a.LookupMirror; var j=a.MakeMirror; var k=a.MakeMirrorSerializer; var l=a.Math.min; var m=a.Mirror; var n; var o=a.parseInt; var p; var q; var r; var s=a.ValueMirror; b.Import(function(t){ n=t.MirrorType; p=t.ToBoolean; q=t.ToNumber; r=t.ToString; }); var u=10; var v={}; var w=/^(?:\s*(?:\/\*.*?\*\/)*)*/; v.DebugEvent={Break:1, Exception:2, NewFunction:3, BeforeCompile:4, AfterCompile:5, CompileError:6, PromiseEvent:7, AsyncTaskEvent:8}; v.ExceptionBreak={Caught:0, Uncaught:1}; v.StepAction={StepOut:0, StepNext:1, StepIn:2, StepMin:3, StepInMin:4, StepFrame:5}; v.ScriptType={Native:0, Extension:1, Normal:2}; v.ScriptCompilationType={Host:0, Eval:1, JSON:2}; v.ScriptBreakPointType={ScriptId:0, ScriptName:1, ScriptRegExp:2}; v.BreakPositionAlignment={ Statement:0, BreakPosition:1 }; function ScriptTypeFlag(x){ return(1<0){ this.ignoreCount_--; return false; } return true; }; function IsBreakPointTriggered(L,G){ return G.isTriggered(MakeExecutionState(L)); } function ScriptBreakPoint(x,script_id_or_name,opt_line,opt_column, opt_groupId,opt_position_alignment){ this.type_=x; if(x==v.ScriptBreakPointType.ScriptId){ this.script_id_=script_id_or_name; }else if(x==v.ScriptBreakPointType.ScriptName){ this.script_name_=script_id_or_name; }else if(x==v.ScriptBreakPointType.ScriptRegExp){ this.script_regexp_object_=new e(script_id_or_name); }else{ throw MakeError(2,"Unexpected breakpoint type "+x); } this.line_=opt_line||0; this.column_=opt_column; this.groupId_=opt_groupId; this.position_alignment_=(opt_position_alignment===(void 0)) ?v.BreakPositionAlignment.Statement:opt_position_alignment; this.hit_count_=0; this.active_=true; this.condition_=null; this.ignoreCount_=0; this.break_points_=[]; } ScriptBreakPoint.prototype.cloneForOtherScript=function(M){ var N=new ScriptBreakPoint(v.ScriptBreakPointType.ScriptId, M.id,this.line_,this.column_,this.groupId_, this.position_alignment_); N.number_=z++; B.push(N); N.hit_count_=this.hit_count_; N.active_=this.active_; N.condition_=this.condition_; N.ignoreCount_=this.ignoreCount_; return N; }; ScriptBreakPoint.prototype.number=function(){ return this.number_; }; ScriptBreakPoint.prototype.groupId=function(){ return this.groupId_; }; ScriptBreakPoint.prototype.type=function(){ return this.type_; }; ScriptBreakPoint.prototype.script_id=function(){ return this.script_id_; }; ScriptBreakPoint.prototype.script_name=function(){ return this.script_name_; }; ScriptBreakPoint.prototype.script_regexp_object=function(){ return this.script_regexp_object_; }; ScriptBreakPoint.prototype.line=function(){ return this.line_; }; ScriptBreakPoint.prototype.column=function(){ return this.column_; }; ScriptBreakPoint.prototype.actual_locations=function(){ var O=[]; for(var P=0;P=this.frameCount()){ throw MakeTypeError(25); } return new c(this.break_id,aE); }; ExecutionState.prototype.setSelectedFrame=function(aF){ var P=q(aF); if(P<0||P>=this.frameCount()){ throw MakeTypeError(25); } this.selected_frame=P; }; ExecutionState.prototype.selectedFrame=function(){ return this.selected_frame; }; ExecutionState.prototype.debugCommandProcessor=function(aG){ return new DebugCommandProcessor(this,aG); }; function MakeBreakEvent(L,aH){ return new BreakEvent(L,aH); } function BreakEvent(L,aH){ this.frame_=new c(L,0); this.break_points_hit_=aH; } BreakEvent.prototype.eventType=function(){ return v.DebugEvent.Break; }; BreakEvent.prototype.func=function(){ return this.frame_.func(); }; BreakEvent.prototype.sourceLine=function(){ return this.frame_.sourceLine(); }; BreakEvent.prototype.sourceColumn=function(){ return this.frame_.sourceColumn(); }; BreakEvent.prototype.sourceLineText=function(){ return this.frame_.sourceLineText(); }; BreakEvent.prototype.breakPointsHit=function(){ return this.break_points_hit_; }; BreakEvent.prototype.toJSONProtocol=function(){ var aI={seq:y++, type:"event", event:"break", body:{invocationText:this.frame_.invocationText()} }; var S=this.func().script(); if(S){ aI.body.sourceLine=this.sourceLine(), aI.body.sourceColumn=this.sourceColumn(), aI.body.sourceLineText=this.sourceLineText(), aI.body.script=MakeScriptObject_(S,false); } if(this.breakPointsHit()){ aI.body.breakpoints=[]; for(var P=0;P0){ aI.body.sourceLine=this.sourceLine(); aI.body.sourceColumn=this.sourceColumn(); aI.body.sourceLineText=this.sourceLineText(); var S=this.func().script(); if(S){ aI.body.script=MakeScriptObject_(S,false); } }else{ aI.body.sourceLine=-1; } return aI.toJSONProtocol(); }; function MakeCompileEvent(S,x){ return new CompileEvent(S,x); } function CompileEvent(S,x){ this.script_=j(S); this.type_=x; } CompileEvent.prototype.eventType=function(){ return this.type_; }; CompileEvent.prototype.script=function(){ return this.script_; }; CompileEvent.prototype.toJSONProtocol=function(){ var aI=new ProtocolMessage(); aI.running=true; switch(this.type_){ case v.DebugEvent.BeforeCompile: aI.event="beforeCompile"; break; case v.DebugEvent.AfterCompile: aI.event="afterCompile"; break; case v.DebugEvent.CompileError: aI.event="compileError"; break; } aI.body={}; aI.body.script=this.script_; return aI.toJSONProtocol(); }; function MakeScriptObject_(S,aO){ var aI={id:S.id(), name:S.name(), lineOffset:S.lineOffset(), columnOffset:S.columnOffset(), lineCount:S.lineCount(), }; if(!(S.data()===(void 0))){ aI.data=S.data(); } if(aO){ aI.source=S.source(); } return aI; } function MakePromiseEvent(aP){ return new PromiseEvent(aP); } function PromiseEvent(aP){ this.promise_=aP.promise; this.parentPromise_=aP.parentPromise; this.status_=aP.status; this.value_=aP.value; } PromiseEvent.prototype.promise=function(){ return j(this.promise_); } PromiseEvent.prototype.parentPromise=function(){ return j(this.parentPromise_); } PromiseEvent.prototype.status=function(){ return this.status_; } PromiseEvent.prototype.value=function(){ return j(this.value_); } function MakeAsyncTaskEvent(aP){ return new AsyncTaskEvent(aP); } function AsyncTaskEvent(aP){ this.type_=aP.type; this.name_=aP.name; this.id_=aP.id; } AsyncTaskEvent.prototype.type=function(){ return this.type_; } AsyncTaskEvent.prototype.name=function(){ return this.name_; } AsyncTaskEvent.prototype.id=function(){ return this.id_; } function DebugCommandProcessor(J,aG){ this.exec_state_=J; this.running_=aG||false; } DebugCommandProcessor.prototype.processDebugRequest=function(aQ){ return this.processDebugJSONRequest(aQ); }; function ProtocolMessage(aQ){ this.seq=y++; if(aQ){ this.type='response'; this.request_seq=aQ.seq; this.command=aQ.command; }else{ this.type='event'; } this.success=true; this.running=(void 0); } ProtocolMessage.prototype.setOption=function(aR,D){ if(!this.options_){ this.options_={}; } this.options_[aR]=D; }; ProtocolMessage.prototype.failed=function(aS,aT){ this.success=false; this.message=aS; if((typeof(aT)==='object')){ this.error_details=aT; } }; ProtocolMessage.prototype.toJSONProtocol=function(){ var aU={}; aU.seq=this.seq; if(this.request_seq){ aU.request_seq=this.request_seq; } aU.type=this.type; if(this.event){ aU.event=this.event; } if(this.command){ aU.command=this.command; } if(this.success){ aU.success=this.success; }else{ aU.success=false; } if(this.body){ var aV; var aW=k(true,this.options_); if(this.body instanceof m){ aV=aW.serializeValue(this.body); }else if(this.body instanceof d){ aV=[]; for(var P=0;P=this.exec_state_.frameCount()){ return aX.failed('Invalid frame "'+bw+'"'); } aX.body=this.exec_state_.frame(bN).evaluate( bH,p(bI),bK); return; }else{ aX.body=this.exec_state_.frame().evaluate( bH,p(bI),bK); return; } }; DebugCommandProcessor.prototype.lookupRequest_=function(aQ,aX){ if(!aQ.arguments){ return aX.failed('Missing arguments'); } var bO=aQ.arguments.handles; if((bO===(void 0))){ return aX.failed('Argument "handles" missing'); } if(!(aQ.arguments.includeSource===(void 0))){ var bP=p(aQ.arguments.includeSource); aX.setOption('includeSource',bP); } var bQ={}; for(var P=0;P=this.exec_state_.frameCount()){ return aX.failed('Invalid frame "'+bw+'"'); } bw=this.exec_state_.frame(bN); } } var S=bw.func().script(); if(!S){ return aX.failed('No source'); } var bT=S.sourceSlice(bR,bS); if(!bT){ return aX.failed('Invalid line interval'); } aX.body={}; aX.body.source=bT.sourceText(); aX.body.fromLine=bT.from_line; aX.body.toLine=bT.to_line; aX.body.fromPosition=bT.from_position; aX.body.toPosition=bT.to_position; aX.body.totalLines=S.lineCount(); }; DebugCommandProcessor.prototype.scriptsRequest_=function(aQ,aX){ var bU=ScriptTypeFlag(v.ScriptType.Normal); var bP=false; var bV=null; if(aQ.arguments){ if(!(aQ.arguments.types===(void 0))){ bU=q(aQ.arguments.types); if(f(bU)||bU<0){ return aX.failed('Invalid types "'+ aQ.arguments.types+'"'); } } if(!(aQ.arguments.includeSource===(void 0))){ bP=p(aQ.arguments.includeSource); aX.setOption('includeSource',bP); } if((%_IsArray(aQ.arguments.ids))){ bV={}; var bW=aQ.arguments.ids; for(var P=0;P=0){ ca=true; } } if(!ca)continue; } if(bU&ScriptTypeFlag(af[P].type)){ aX.body.push(j(af[P])); } } }; DebugCommandProcessor.prototype.threadsRequest_=function(aQ,aX){ var cb=this.exec_state_.threadCount(); var cc=[]; for(var P=0;P=this.exec_state_.frameCount()){ return aX.failed('Invalid frame "'+bw+'"'); } cl=this.exec_state_.frame(bN); }else{ cl=this.exec_state_.frame(); } var ck=v.LiveEdit.RestartFrame(cl); aX.body={result:ck}; }; DebugCommandProcessor.prototype.debuggerFlagsRequest_=function(aQ, aX){ if(!aQ.arguments){ aX.failed('Missing arguments'); return; } var cm=aQ.arguments.flags; aX.body={flags:[]}; if(!(cm===(void 0))){ for(var P=0;PN[C].start_position){ P=C; } } if(P!=x){ var Q=N[P]; var R=O[P]; N[P]=N[x]; O[P]=O[x]; N[x]=Q; O[x]=R; } } var S=0; function ResetIndexes(T,U){ var V=-1; while(S=aJ.pos1+aJ.len1){ return aD+aJ.pos2+aJ.len2-aJ.pos1-aJ.len1; } if(!aE){ aE=PosTranslator.DefaultInsideChunkHandler; } return aE(aD,aJ); }; PosTranslator.DefaultInsideChunkHandler=function(aD,aK){ Assert(false,"Cannot translate position in changed area"); }; PosTranslator.ShiftWithTopInsideChunkHandler= function(aD,aK){ return aD-aK.pos1+aK.pos2; }; var i={ UNCHANGED:"unchanged", SOURCE_CHANGED:"source changed", CHANGED:"changed", DAMAGED:"damaged" }; function CodeInfoTreeNode(aL,aM,aN){ this.info=aL; this.children=aM; this.array_index=aN; this.parent=(void 0); this.status=i.UNCHANGED; this.status_explanation=(void 0); this.new_start_pos=(void 0); this.new_end_pos=(void 0); this.corresponding_node=(void 0); this.unmatched_new_nodes=(void 0); this.textual_corresponding_node=(void 0); this.textually_unmatched_new_nodes=(void 0); this.live_shared_function_infos=(void 0); } function BuildCodeInfoTree(aO){ var aP=0; function BuildNode(){ var aQ=aP; aP++; var aR=new e(); while(aP=ax.length;}; this.TranslatePos=function(aD){return aD+aW;}; }; function ProcessInternals(aX){ aX.new_start_pos=aU.TranslatePos( aX.info.start_position); var aY=0; var aZ=false; var ba=false; while(!aU.done()&& aU.current().pos1= aU.current().pos1+aU.current().len1){ aZ=true; aU.next(); continue; }else if(bb.info.start_position<=aU.current().pos1&& bb.info.end_position>=aU.current().pos1+ aU.current().len1){ ProcessInternals(bb); ba=ba|| (bb.status!=i.UNCHANGED); aZ=aZ|| (bb.status==i.DAMAGED); aY++; continue; }else{ aZ=true; bb.status=i.DAMAGED; bb.status_explanation= "Text diff overlaps with function boundary"; aY++; continue; } }else{ if(aU.current().pos1+aU.current().len1<= aX.info.end_position){ aX.status=i.CHANGED; aU.next(); continue; }else{ aX.status=i.DAMAGED; aX.status_explanation= "Text diff overlaps with function boundary"; return; } } Assert("Unreachable",false); } while(aY0){ return bo; } } function TraverseTree(w){ w.live_shared_function_infos=FindFunctionInfos(w.info); for(var x=0;x ["+bw+"]"; } return; } var bx; function CheckStackActivations(by,X){ var bz=new e(); for(var x=0;x0){ X.push({dropped_from_stack:bC}); } if(bB.length>0){ X.push({functions_on_stack:bB}); throw new Failure("Blocked by functions on stack"); } return bC.length; } var bx={ AVAILABLE_FOR_PATCH:1, BLOCKED_ON_ACTIVE_STACK:2, BLOCKED_ON_OTHER_STACK:3, BLOCKED_UNDER_NATIVE_CODE:4, REPLACED_ON_ACTIVE_STACK:5, BLOCKED_UNDER_GENERATOR:6, BLOCKED_ACTIVE_GENERATOR:7 }; bx.SymbolName=function(bF){ var bG=bx; for(var bH in bG){ if(bG[bH]==bF){ return bH; } } }; function Failure(ar){ this.message=ar; } Failure.prototype.toString=function(){ return"LiveEdit Failure: "+this.message; }; function CopyErrorPositionToDetails(bI,p){ function createPositionStruct(L,bJ){ if(bJ==-1)return; var bK=L.locationFromPosition(bJ,true); if(bK==null)return; return{ line:bK.line+1, column:bK.column+1, position:bJ }; } if(!("scriptObject"in bI)||!("startPosition"in bI)){ return; } var L=bI.scriptObject; var bL={ start:createPositionStruct(L,bI.startPosition), end:createPositionStruct(L,bI.endPosition) }; p.position=bL; } function GetPcFromSourcePos(bM,bN){ return %GetFunctionCodePositionFromSource(bM,bN); } function SetScriptSource(L,bO,bP,X){ var j=L.source; var bQ=CompareStrings(j,bO); return ApplyPatchMultiChunk(L,bQ,bO,bP, X); } function CompareStrings(bR,bS){ return %LiveEditCompareStrings(bR,bS); } function ApplySingleChunkPatch(L,change_pos,change_len,new_str, X){ var j=L.source; var bO=j.substring(0,change_pos)+ new_str+j.substring(change_pos+change_len); return ApplyPatchMultiChunk(L, [change_pos,change_pos+change_len,change_pos+new_str.length], bO,false,X); } function DescribeChangeTree(bc){ function ProcessOldNode(w){ var bT=[]; for(var x=0;x>1); var l=2|4|1; for(var m=0;m>1); for(var m=0;m>1)+(fields?fields.length:0); if(t>=4){ %OptimizeObjectForAddingMultipleProperties(s,t); } if(fields){ for(var m=0;m=0&&h<0x800000){ return h; } } h=(g==null)?0:(g.length>>>0); if(h>0x800000)throw %make_range_error(151); if(g!=null&&!(%_IsSpecObject(g))){ throw %make_type_error(122,"Function.prototype.apply"); } return h; } function REFLECT_APPLY_PREPARE(g){ var h; if(!(typeof(this)==='function')){ throw %make_type_error(9,(%_ToString(this)),typeof this); } if((%_IsArray(g))){ h=g.length; if(%_IsSmi(h)&&h>=0&&h<0x800000){ return h; } } if(!(%_IsSpecObject(g))){ throw %make_type_error(122,"Reflect.apply"); } h=(%ToLength(g.length)); if(h>0x800000)throw %make_range_error(151); return h; } function REFLECT_CONSTRUCT_PREPARE( g,newTarget){ var h; var i=(typeof(this)==='function')&&%IsConstructor(this); var j=(typeof(newTarget)==='function')&&%IsConstructor(newTarget); if((%_IsArray(g))){ h=g.length; if(%_IsSmi(h)&&h>=0&&h<0x800000&& i&&j){ return h; } } if(!i){ if(!(typeof(this)==='function')){ throw %make_type_error(13,(%_ToString(this))); }else{ throw %make_type_error(55,(%_ToString(this))); } } if(!j){ if(!(typeof(newTarget)==='function')){ throw %make_type_error(13,(%_ToString(newTarget))); }else{ throw %make_type_error(55,(%_ToString(newTarget))); } } if(!(%_IsSpecObject(g))){ throw %make_type_error(122,"Reflect.construct"); } h=(%ToLength(g.length)); if(h>0x800000)throw %make_range_error(151); return h; } function CONCAT_ITERABLE_TO_ARRAY(k){ return %concat_iterable_to_array(this,k); }; function ToBoolean(l){ if((typeof(l)==='boolean'))return l; if((typeof(l)==='string'))return l.length!=0; if(l==null)return false; if((typeof(l)==='number'))return!((l==0)||(!%_IsSmi(%IS_VAR(l))&&!(l==l))); return true; } function ToNumber(l){ if((typeof(l)==='number'))return l; if((typeof(l)==='string')){ return %_HasCachedArrayIndex(l)?%_GetCachedArrayIndex(l) :%StringToNumber(l); } if((typeof(l)==='boolean'))return l?1:0; if((l===(void 0)))return $NaN; return((l===null))?0:ToNumber(DefaultNumber(l)); } function NonNumberToNumber(l){ if((typeof(l)==='string')){ return %_HasCachedArrayIndex(l)?%_GetCachedArrayIndex(l) :%StringToNumber(l); } if((typeof(l)==='boolean'))return l?1:0; if((l===(void 0)))return $NaN; return((l===null))?0:ToNumber(DefaultNumber(l)); } function ToString(l){ if((typeof(l)==='string'))return l; if((typeof(l)==='number'))return %_NumberToString(l); if((typeof(l)==='boolean'))return l?'true':'false'; if((l===(void 0)))return'undefined'; return((l===null))?'null':ToString(DefaultString(l)); } function SameValue(l,m){ if(typeof l!=typeof m)return false; if((typeof(l)==='number')){ if((!%_IsSmi(%IS_VAR(l))&&!(l==l))&&(!%_IsSmi(%IS_VAR(m))&&!(m==m)))return true; if(l===0&&m===0&&%_IsMinusZero(l)!=%_IsMinusZero(m)){ return false; } } if((%_IsSimdValue(l)))return %SimdSameValue(l,m); return l===m; } function SameValueZero(l,m){ if(typeof l!=typeof m)return false; if((typeof(l)==='number')){ if((!%_IsSmi(%IS_VAR(l))&&!(l==l))&&(!%_IsSmi(%IS_VAR(m))&&!(m==m)))return true; } if((%_IsSimdValue(l)))return %SimdSameValueZero(l,m); return l===m; } function ConcatIterableToArray(n,k){ var o=n.length; for(var p of k){ %AddElement(n,o++,p); } return n; } function IsPrimitive(l){ return!(%_IsSpecObject(l)); } function IsConcatSpreadable(q){ if(!(%_IsSpecObject(q)))return false; var r=q[f]; if((r===(void 0)))return(%_IsArray(q)); return ToBoolean(r); } function DefaultNumber(l){ var s=l.valueOf; if((typeof(s)==='function')){ var t=%_Call(s,l); if((typeof(t)==='symbol'))throw MakeTypeError(115); if((%_IsSimdValue(l)))throw MakeTypeError(117); if(IsPrimitive(t))return t; } var u=l.toString; if((typeof(u)==='function')){ var v=%_Call(u,l); if(IsPrimitive(v))return v; } throw MakeTypeError(16); } function DefaultString(l){ if(!(%_ClassOf(l)==='Symbol')){ if((typeof(l)==='symbol'))throw MakeTypeError(116); var u=l.toString; if((typeof(u)==='function')){ var v=%_Call(u,l); if(IsPrimitive(v))return v; } var s=l.valueOf; if((typeof(s)==='function')){ var t=%_Call(s,l); if(IsPrimitive(t))return t; } } throw MakeTypeError(16); } function ToPositiveInteger(l,w){ var x=(%_IsSmi(%IS_VAR(l))?l:%NumberToIntegerMapMinusZero(ToNumber(l))); if(x<0)throw MakeRangeError(w); return x; } %FunctionSetPrototype(c,new c(0)); $NaN=%GetRootNaN(); $nonNumberToNumber=NonNumberToNumber; $sameValue=SameValue; $sameValueZero=SameValueZero; $toNumber=ToNumber; $toPositiveInteger=ToPositiveInteger; %InstallToContext([ "apply_prepare_builtin",APPLY_PREPARE, "concat_iterable_to_array_builtin",CONCAT_ITERABLE_TO_ARRAY, "reflect_apply_prepare_builtin",REFLECT_APPLY_PREPARE, "reflect_construct_prepare_builtin",REFLECT_CONSTRUCT_PREPARE, ]); %InstallToContext([ "concat_iterable_to_array",ConcatIterableToArray, "non_number_to_number",NonNumberToNumber, "to_number_fun",ToNumber, ]); b.Export(function(y){ y.ToBoolean=ToBoolean; y.ToNumber=ToNumber; y.ToString=ToString; }); }) $v8natives†Ë (function(a,b){ %CheckIsBootstrapping(); var c; var d=a.Array; var e=a.Boolean; var f=a.Function; var g=a.Number; var h=a.Object; var i=b.InternalArray; var j=b.ImportNow("iterator_symbol"); var k; var l; var m; var n; var o; var p=b.ImportNow("ToBoolean"); var q=b.ImportNow("ToNumber"); var r=b.ImportNow("to_string_tag_symbol"); b.Import(function(s){ k=s.MathAbs; o=s.StringIndexOf; }); b.ImportFromExperimental(function(s){ c=s.FLAG_harmony_tostring; l=s.ProxyDelegateCallAndConstruct; m=s.ProxyDerivedHasOwnTrap; n=s.ProxyDerivedKeysTrap; }); function GlobalIsNaN(t){ t=((typeof(%IS_VAR(t))==='number')?t:$nonNumberToNumber(t)); return(!%_IsSmi(%IS_VAR(t))&&!(t==t)); } function GlobalIsFinite(t){ t=((typeof(%IS_VAR(t))==='number')?t:$nonNumberToNumber(t)); return(%_IsSmi(%IS_VAR(t))||((t==t)&&(t!=1/0)&&(t!=-1/0))); } function GlobalParseInt(u,v){ if((v===(void 0))||v===10||v===0){ if(%_IsSmi(u))return u; if((typeof(u)==='number')&& ((0.01>>0); var am=false; if((%_ToString(al))==Y&&al!=4294967295){ var an=M.length; if(al>=an&&%IsObserved(M)){ am=true; $observeBeginPerformSplice(M); } var ao=GetOwnPropertyJS(M,"length"); if((al>=an&&!ao.isWritable())|| !DefineObjectProperty(M,Y,J,true)){ if(am) $observeEndPerformSplice(M); if(ab){ throw MakeTypeError(27,Y); }else{ return false; } } if(al>=an){ M.length=al+1; } if(am){ $observeEndPerformSplice(M); $observeEnqueueSpliceRecord(M,an,[],al+1-an); } return true; } } return DefineObjectProperty(M,Y,J,ab); } function DefineOwnProperty(M,Y,J,ab){ if(%_IsJSProxy(M)){ if((typeof(Y)==='symbol'))return false; var z=FromGenericPropertyDescriptor(J); return DefineProxyProperty(M,Y,z,ab); }else if((%_IsArray(M))){ return DefineArrayProperty(M,Y,J,ab); }else{ return DefineObjectProperty(M,Y,J,ab); } } function DefineOwnPropertyFromAPI(M,Y,D,J){ return DefineOwnProperty(M,Y,ToPropertyDescriptor({ value:D, writable:J[0], enumerable:J[1], configurable:J[2] }), false); } function ObjectGetPrototypeOf(M){ return %_GetPrototype((%_ToObject(M))); } function ObjectSetPrototypeOf(M,ap){ if((%IS_VAR(M)===null)||(M===(void 0)))throw MakeTypeError(15,"Object.setPrototypeOf"); if(ap!==null&&!(%_IsSpecObject(ap))){ throw MakeTypeError(83,ap); } if((%_IsSpecObject(M))){ %SetPrototype(M,ap); } return M; } function ObjectGetOwnPropertyDescriptor(M,Y){ var J=GetOwnPropertyJS((%_ToObject(M)),Y); return FromPropertyDescriptor(J); } function ToNameArray(M,V,aq){ if(!(%_IsSpecObject(M))){ throw MakeTypeError(90,V,M); } var ar=(M.length>>>0); var as=new d(ar); var at=0; var N={__proto__:null}; for(var al=0;al36)throw MakeRangeError(153); return %NumberToRadixString(t,v); } function NumberToLocaleString(){ return %_CallFunction(this,NumberToStringJS); } function NumberValueOf(){ if(!(typeof(this)==='number')&&!(%_ClassOf(this)==='Number')){ throw MakeTypeError(58,'Number.prototype.valueOf'); } return %_ValueOf(this); } function NumberToFixedJS(bc){ var w=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw MakeTypeError(36, "Number.prototype.toFixed",this); } w=%_ValueOf(this); } var y=(%_ToInteger(bc)); if(y<0||y>20){ throw MakeRangeError(149,"toFixed() digits"); } if((!%_IsSmi(%IS_VAR(w))&&!(w==w)))return"NaN"; if(w==(1/0))return"Infinity"; if(w==-(1/0))return"-Infinity"; return %NumberToFixed(w,y); } function NumberToExponentialJS(bc){ var w=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw MakeTypeError(36, "Number.prototype.toExponential",this); } w=%_ValueOf(this); } var y=(bc===(void 0))?(void 0):(%_ToInteger(bc)); if((!%_IsSmi(%IS_VAR(w))&&!(w==w)))return"NaN"; if(w==(1/0))return"Infinity"; if(w==-(1/0))return"-Infinity"; if((y===(void 0))){ y=-1; }else if(y<0||y>20){ throw MakeRangeError(149,"toExponential()"); } return %NumberToExponential(w,y); } function NumberToPrecisionJS(bd){ var w=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw MakeTypeError(36, "Number.prototype.toPrecision",this); } w=%_ValueOf(this); } if((bd===(void 0)))return(%_ToString(w)); var Y=(%_ToInteger(bd)); if((!%_IsSmi(%IS_VAR(w))&&!(w==w)))return"NaN"; if(w==(1/0))return"Infinity"; if(w==-(1/0))return"-Infinity"; if(Y<1||Y>21){ throw MakeRangeError(152); } return %NumberToPrecision(w,Y); } function NumberIsFinite(t){ return(typeof(t)==='number')&&(%_IsSmi(%IS_VAR(t))||((t==t)&&(t!=1/0)&&(t!=-1/0))); } function NumberIsInteger(t){ return NumberIsFinite(t)&&(%_ToInteger(t))==t; } function NumberIsNaN(t){ return(typeof(t)==='number')&&(!%_IsSmi(%IS_VAR(t))&&!(t==t)); } function NumberIsSafeInteger(t){ if(NumberIsFinite(t)){ var be=(%_ToInteger(t)); if(be==t){ return k(be)<=9007199254740991; } } return false; } %SetCode(g,NumberConstructor); %FunctionSetPrototype(g,new g(0)); %OptimizeObjectForAddingMultipleProperties(g.prototype,8); %AddNamedProperty(g.prototype,"constructor",g, 2); b.InstallConstants(g,[ "MAX_VALUE",1.7976931348623157e+308, "MIN_VALUE",5e-324, "NaN",$NaN, "NEGATIVE_INFINITY",-(1/0), "POSITIVE_INFINITY",(1/0), "MAX_SAFE_INTEGER",%_MathPow(2,53)-1, "MIN_SAFE_INTEGER",-%_MathPow(2,53)+1, "EPSILON",%_MathPow(2,-52) ]); b.InstallFunctions(g.prototype,2,[ "toString",NumberToStringJS, "toLocaleString",NumberToLocaleString, "valueOf",NumberValueOf, "toFixed",NumberToFixedJS, "toExponential",NumberToExponentialJS, "toPrecision",NumberToPrecisionJS ]); b.InstallFunctions(g,2,[ "isFinite",NumberIsFinite, "isInteger",NumberIsInteger, "isNaN",NumberIsNaN, "isSafeInteger",NumberIsSafeInteger, "parseInt",GlobalParseInt, "parseFloat",GlobalParseFloat ]); %SetForceInlineFlag(NumberIsNaN); function NativeCodeFunctionSourceString(ac){ var E=%FunctionGetName(ac); if(E){ return'function '+E+'() { [native code] }'; } return'function () { [native code] }'; } function FunctionSourceString(ac){ while(%IsJSFunctionProxy(ac)){ ac=%GetCallTrap(ac); } if(!(%_IsFunction(ac))){ throw MakeTypeError(58,'Function.prototype.toString'); } if(%FunctionHidesSource(ac)){ return NativeCodeFunctionSourceString(ac); } var bf=%ClassGetSourceCode(ac); if((typeof(bf)==='string')){ return bf; } var bg=%FunctionGetSourceCode(ac); if(!(typeof(bg)==='string')){ return NativeCodeFunctionSourceString(ac); } if(%FunctionIsArrow(ac)){ return bg; } var E=%FunctionNameShouldPrintAsAnonymous(ac) ?'anonymous' :%FunctionGetName(ac); var bh=%FunctionIsGenerator(ac); var bi=%FunctionIsConciseMethod(ac) ?(bh?'*':'') :(bh?'function* ':'function '); return bi+E+bg; } function FunctionToString(){ return FunctionSourceString(this); } function FunctionBind(bj){ if(!(typeof(this)==='function'))throw MakeTypeError(33); var bk=function(){ "use strict"; if(%_IsConstructCall()){ return %NewObjectFromBound(bk); } var bl=%BoundFunctionGetBindings(bk); var bm=%_ArgumentsLength(); if(bm==0){ return %Apply(bl[0],bl[1],bl,2,bl.length-2); } if(bl.length===2){ return %Apply(bl[0],bl[1],arguments,0,bm); } var bn=bl.length-2; var bo=new i(bn+bm); for(var az=0;az>>0)===bq)){ var bm=%_ArgumentsLength(); if(bm>0)bm--; bp=bq-bm; if(bp<0)bp=0; } var ad=%FunctionBindArguments(bk,this, bj,bp); var E=this.name; var br=(typeof(E)==='string')?E:""; %DefineDataPropertyUnchecked(ad,"name","bound "+br, 2|1); return ad; } function NewFunctionString(bs,bt){ var ar=bs.length; var Y=''; if(ar>1){ Y=(%_ToString(bs[0])); for(var az=1;az0)?(%_ToString(bs[ar-1])):''; return'('+bt+'('+Y+') {\n'+bu+'\n})'; } function FunctionConstructor(bv){ var bg=NewFunctionString(arguments,'function'); var x=%GlobalProxy(FunctionConstructor); var y=%_CallFunction(x,%CompileString(bg,true)); %FunctionMarkNameShouldPrintAsAnonymous(y); return y; } %SetCode(f,FunctionConstructor); %AddNamedProperty(f.prototype,"constructor",f, 2); b.InstallFunctions(f.prototype,2,[ "bind",FunctionBind, "toString",FunctionToString ]); function GetIterator(M,bw){ if((bw===(void 0))){ bw=M[j]; } if(!(typeof(bw)==='function')){ throw MakeTypeError(59,M); } var bx=%_CallFunction(M,bw); if(!(%_IsSpecObject(bx))){ throw MakeTypeError(53,bx); } return bx; } b.Export(function(aV){ aV.Delete=Delete; aV.FunctionSourceString=FunctionSourceString; aV.GetIterator=GetIterator; aV.GetMethod=GetMethod; aV.IsFinite=GlobalIsFinite; aV.IsNaN=GlobalIsNaN; aV.NewFunctionString=NewFunctionString; aV.NumberIsNaN=NumberIsNaN; aV.ObjectDefineProperties=ObjectDefineProperties; aV.ObjectDefineProperty=ObjectDefineProperty; aV.ObjectFreeze=ObjectFreezeJS; aV.ObjectGetOwnPropertyKeys=ObjectGetOwnPropertyKeys; aV.ObjectHasOwnProperty=ObjectHasOwnProperty; aV.ObjectIsFrozen=ObjectIsFrozen; aV.ObjectIsSealed=ObjectIsSealed; aV.ObjectToString=ObjectToString; aV.ToNameArray=ToNameArray; }); %InstallToContext([ "global_eval_fun",GlobalEval, "object_value_of",ObjectValueOf, "object_to_string",ObjectToString, "object_define_own_property",DefineOwnPropertyFromAPI, "object_get_own_property_descriptor",ObjectGetOwnPropertyDescriptor, "to_complete_property_descriptor",ToCompletePropertyDescriptor, ]); }) symboly (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Object; var d=a.Symbol; var e=b.ImportNow("has_instance_symbol"); var f= b.ImportNow("is_concat_spreadable_symbol"); var g=b.ImportNow("is_regexp_symbol"); var h=b.ImportNow("iterator_symbol"); var i; var j=b.ImportNow("to_primitive_symbol"); var k=b.ImportNow("to_string_tag_symbol"); var l=b.ImportNow("unscopables_symbol"); b.Import(function(m){ i=m.ObjectGetOwnPropertyKeys; }); function SymbolToPrimitive(n){ if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ throw MakeTypeError(36, "Symbol.prototype [ @@toPrimitive ]",this); } return %_ValueOf(this); } function SymbolToString(){ if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ throw MakeTypeError(36, "Symbol.prototype.toString",this); } return %SymbolDescriptiveString(%_ValueOf(this)); } function SymbolValueOf(){ if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ throw MakeTypeError(36, "Symbol.prototype.valueOf",this); } return %_ValueOf(this); } function SymbolFor(o){ o=(%_ToString(o)); var p=%SymbolRegistry(); if((p.for[o]===(void 0))){ var q=%CreateSymbol(o); p.for[o]=q; p.keyFor[q]=o; } return p.for[o]; } function SymbolKeyFor(q){ if(!(typeof(q)==='symbol'))throw MakeTypeError(114,q); return %SymbolRegistry().keyFor[q]; } function ObjectGetOwnPropertySymbols(r){ r=(%_ToObject(r)); return i(r,8); } %FunctionSetPrototype(d,new c()); b.InstallConstants(d,[ "iterator",h, "toPrimitive",j, "unscopables",l, ]); b.InstallFunctions(d,2,[ "for",SymbolFor, "keyFor",SymbolKeyFor ]); %AddNamedProperty( d.prototype,"constructor",d,2); %AddNamedProperty( d.prototype,k,"Symbol",2|1); b.InstallFunctions(d.prototype,2|1,[ j,SymbolToPrimitive ]); b.InstallFunctions(d.prototype,2,[ "toString",SymbolToString, "valueOf",SymbolValueOf ]); b.InstallFunctions(c,2,[ "getOwnPropertySymbols",ObjectGetOwnPropertySymbols ]); b.Export(function(s){ s.SymbolToString=SymbolToString; }) }) array’~ (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c; var d=a.Array; var e=b.InternalArray; var f=b.InternalPackedArray; var g; var h; var i; var j; var k; var l; var m; var n=b.ImportNow("unscopables_symbol"); b.Import(function(o){ c=o.Delete; g=o.MathMin; h=o.ObjectHasOwnProperty; i=o.ObjectIsFrozen; j=o.ObjectIsSealed; k=o.ObjectToString; l=o.ToNumber; m=o.ToString; }); var p=new e(); function GetSortedArrayKeys(q,r){ var s=new e(); if((typeof(r)==='number')){ var t=r; for(var u=0;u>2; var N=%EstimateNumberOfElements(q); return(NN*4); } function Join(q,w,D,C){ if(w==0)return''; var K=(%_IsArray(q)); if(K){ if(!%PushIfAbsent(p,q))return''; } try{ if(UseSparseVariant(q,w,K,w)){ %NormalizeElements(q); if(D.length==0){ return SparseJoin(q,w,C); }else{ return SparseJoinWithSeparatorJS(q,w,C,D); } } if(w==1){ var v=q[0]; if((typeof(v)==='string'))return v; return C(v); } var F=new e(w); if(D.length==0){ var J=0; for(var u=0;u=R){ var U=q[y]; if(!(U===(void 0))||y in q){ %AddElement(T,y-R,U); } } } } } } function SparseMove(q,R,S,B,V){ if(V===S)return; var W=new e( g(B-S+V,0xffffffff)); var X; var r=%GetArrayKeys(q,B); if((typeof(r)==='number')){ var t=r; for(var u=0;u=R+S){ var U=q[y]; if(!(U===(void 0))||y in q){ var Y=y-S+V; W[Y]=U; if(Y>0xfffffffe){ X=X||new e(); X.push(Y); } } } } } } %MoveArrayContents(W,q); if(!(X===(void 0))){ var w=X.length; for(var u=0;uS){ for(var u=B-S;u>R;u--){ var aa=u+S-1; var ab=u+V-1; if(((K&&%_HasFastPackedElements(%IS_VAR(q)))?(aaB-S+V;u--){ delete q[u-1]; } } } } function ArrayToString(){ var q; var ac; if((%_IsArray(this))){ ac=this.join; if(ac===ArrayJoin){ return Join(this,this.length,',',ConvertToString); } q=this; }else{ q=(%_ToObject(this)); ac=q.join; } if(!(typeof(ac)==='function')){ return %_CallFunction(q,k); } return %_Call(ac,q); } function InnerArrayToLocaleString(q,w){ var B=(harmony_tolength?(%ToLength(w)):(w>>>0)); if(B===0)return""; return Join(q,B,',',ConvertToLocaleString); } function ArrayToLocaleString(){ var q=(%_ToObject(this)); var ad=q.length; return InnerArrayToLocaleString(q,ad); } function InnerArrayJoin(D,q,w){ if((D===(void 0))){ D=','; }else{ D=(%_ToString(D)); } var O=%_FastOneByteArrayJoin(q,D); if(!(O===(void 0)))return O; if(w===1){ var v=q[0]; if((v==null))return''; return(%_ToString(v)); } return Join(q,w,D,ConvertToString); } function ArrayJoin(D){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"Array.prototype.join"); var q=(%_ToObject(this)); var w=(harmony_tolength?(%ToLength(q.length)):(q.length>>>0)); return InnerArrayJoin(D,q,w); } function ObservedArrayPop(ae){ ae--; var af=this[ae]; try{ $observeBeginPerformSplice(this); delete this[ae]; this.length=ae; }finally{ $observeEndPerformSplice(this); $observeEnqueueSpliceRecord(this,ae,[af],0); } return af; } function ArrayPop(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"Array.prototype.pop"); var q=(%_ToObject(this)); var ae=(harmony_tolength?(%ToLength(q.length)):(q.length>>>0)); if(ae==0){ q.length=ae; return; } if(%IsObserved(q)) return ObservedArrayPop.call(q,ae); ae--; var af=q[ae]; c(q,ae,true); q.length=ae; return af; } function ObservedArrayPush(){ var ae=(harmony_tolength?(%ToLength(this.length)):(this.length>>>0)); var ag=%_ArgumentsLength(); try{ $observeBeginPerformSplice(this); for(var u=0;u>>0)); var ag=%_ArgumentsLength(); for(var u=0;u=u){ am=u; while(s[++aj]==u){} an=B-u-1; } var ao=q[am]; if(!(ao===(void 0))||am in q){ var ap=q[an]; if(!(ap===(void 0))||an in q){ q[am]=ap; q[an]=ao; }else{ q[an]=ao; delete q[am]; } }else{ var ap=q[an]; if(!(ap===(void 0))||an in q){ q[am]=ap; delete q[an]; } } } } function PackedArrayReverse(q,B){ var ak=B-1; for(var u=0;u>>0)); var aq=(%_IsArray(q)); if(UseSparseVariant(q,B,aq,B)){ %NormalizeElements(q); SparseReverse(q,B); return q; }else if(aq&&%_HasFastPackedElements(q)){ return PackedArrayReverse(q,B); }else{ return GenericArrayReverse(q,B); } } function ObservedArrayShift(B){ var ar=this[0]; try{ $observeBeginPerformSplice(this); SimpleMove(this,0,1,B,0); this.length=B-1; }finally{ $observeEndPerformSplice(this); $observeEnqueueSpliceRecord(this,0,[ar],0); } return ar; } function ArrayShift(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"Array.prototype.shift"); var q=(%_ToObject(this)); var B=(harmony_tolength?(%ToLength(q.length)):(q.length>>>0)); if(B===0){ q.length=0; return; } if(j(q))throw MakeTypeError(11); if(%IsObserved(q)) return ObservedArrayShift.call(q,B); var ar=q[0]; if(UseSparseVariant(q,B,(%_IsArray(q)),B)){ SparseMove(q,0,1,B,0); }else{ SimpleMove(q,0,1,B,0); } q.length=B-1; return ar; } function ObservedArrayUnshift(){ var B=(harmony_tolength?(%ToLength(this.length)):(this.length>>>0)); var as=%_ArgumentsLength(); try{ $observeBeginPerformSplice(this); SimpleMove(this,0,0,B,as); for(var u=0;u>>0)); var as=%_ArgumentsLength(); if(B>0&&UseSparseVariant(q,B,(%_IsArray(q)),B)&& !j(q)){ SparseMove(q,0,0,B,as); }else{ SimpleMove(q,0,0,B,as); } for(var u=0;u>>0)); var R=(%_ToInteger(au)); var aw=B; if(!(av===(void 0)))aw=(%_ToInteger(av)); if(R<0){ R+=B; if(R<0)R=0; }else{ if(R>B)R=B; } if(aw<0){ aw+=B; if(aw<0)aw=0; }else{ if(aw>B)aw=B; } var O=[]; if(awB?B:R; } function ComputeSpliceDeleteCount(ax,as,B,R){ var S=0; if(as==1) return B-R; S=(%_ToInteger(ax)); if(S<0) return 0; if(S>B-R) return B-R; return S; } function ObservedArraySplice(au,ax){ var as=%_ArgumentsLength(); var B=(harmony_tolength?(%ToLength(this.length)):(this.length>>>0)); var R=ComputeSpliceStartIndex((%_ToInteger(au)),B); var S=ComputeSpliceDeleteCount(ax,as,B, R); var T=[]; T.length=S; var ay=as>2?as-2:0; try{ $observeBeginPerformSplice(this); SimpleSlice(this,R,S,B,T); SimpleMove(this,R,S,B,ay); var u=R; var az=2; var aA=%_ArgumentsLength(); while(az>>0)); var R=ComputeSpliceStartIndex((%_ToInteger(au)),B); var S=ComputeSpliceDeleteCount(ax,as,B, R); var T=[]; T.length=S; var ay=as>2?as-2:0; if(S!=ay&&j(q)){ throw MakeTypeError(11); }else if(S>0&&i(q)){ throw MakeTypeError(10); } var aB=S; if(ay!=S){ aB+=B-R-S; } if(UseSparseVariant(q,B,(%_IsArray(q)),aB)){ %NormalizeElements(q); %NormalizeElements(T); SparseSlice(q,R,S,B,T); SparseMove(q,R,S,B,ay); }else{ SimpleSlice(q,R,S,B,T); SimpleMove(q,R,S,B,ay); } var u=R; var az=2; var aA=%_ArgumentsLength(); while(az=o;ak--){ var aH=z[ak]; var aI=aC(aH,aG); if(aI>0){ z[ak+1]=aH; }else{ break; } } z[ak+1]=aG; } }; var aJ=function(z,o,aF){ var aK=new e(); var aL=200+((aF-o)&15); var ak=0; o+=1; aF-=1; for(var u=o;u>1][0]; return aM; } var aN=function QuickSort(z,o,aF){ var aM=0; while(true){ if(aF-o<=10){ aE(z,o,aF); return; } if(aF-o>1000){ aM=aJ(z,o,aF); }else{ aM=o+((aF-o)>>1); } var aO=z[o]; var aP=z[aF-1]; var aQ=z[aM]; var aR=aC(aO,aP); if(aR>0){ var aH=aO; aO=aP; aP=aH; } var aS=aC(aO,aQ); if(aS>=0){ var aH=aO; aO=aQ; aQ=aP; aP=aH; }else{ var aT=aC(aP,aQ); if(aT>0){ var aH=aP; aP=aQ; aQ=aH; } } z[o]=aO; z[aF-1]=aQ; var aU=aP; var aV=o+1; var aW=aF-1; z[aM]=z[aV]; z[aV]=aU; partition:for(var u=aV+1;u0){ do{ aW--; if(aW==u)break partition; var aX=z[aW]; aI=aC(aX,aU); }while(aI>0); z[u]=z[aW]; z[aW]=aG; if(aI<0){ aG=z[u]; z[u]=z[aV]; z[aV]=aG; aV++; } } } if(aF-aW=ba){ba=u+1;} } } }else{ for(var u=0;u=ba){ba=Z+1;} } } } } return ba; }; var bd=function(aZ,o,aF){ for(var bb=%_GetPrototype(aZ);bb;bb=%_GetPrototype(bb)){ var r=%GetArrayKeys(bb,aF); if((typeof(r)==='number')){ var bc=r; for(var u=o;u>>0)); return InnerArraySort(q,w,aC); } function InnerArrayFilter(bk,bl,q,w){ if(!(typeof(bk)==='function'))throw MakeTypeError(13,bk); var bm=new e(); var bn=0; var K=(%_IsArray(q)); var bo=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); for(var u=0;u>>0)); return InnerArrayFilter(bk,bl,q,w); } function InnerArrayForEach(bk,bl,q,w){ if(!(typeof(bk)==='function'))throw MakeTypeError(13,bk); var K=(%_IsArray(q)); var bo=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); for(var u=0;u>>0)); InnerArrayForEach(bk,bl,q,w); } function InnerArraySome(bk,bl,q,w){ if(!(typeof(bk)==='function'))throw MakeTypeError(13,bk); var K=(%_IsArray(q)); var bo=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); for(var u=0;u>>0)); return InnerArraySome(bk,bl,q,w); } function InnerArrayEvery(bk,bl,q,w){ if(!(typeof(bk)==='function'))throw MakeTypeError(13,bk); var K=(%_IsArray(q)); var bo=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); for(var u=0;u>>0)); return InnerArrayEvery(bk,bl,q,w); } function InnerArrayMap(bk,bl,q,w){ if(!(typeof(bk)==='function'))throw MakeTypeError(13,bk); var bm=new e(w); var K=(%_IsArray(q)); var bo=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); for(var u=0;u>>0)); return InnerArrayMap(bk,bl,q,w); } function InnerArrayIndexOf(q,aG,Z,w){ if(w==0)return-1; if((Z===(void 0))){ Z=0; }else{ Z=(%_ToInteger(Z)); if(Z<0){ Z=w+Z; if(Z<0)Z=0; } } var bp=Z; var ba=w; if(UseSparseVariant(q,w,(%_IsArray(q)),ba-bp)){ %NormalizeElements(q); var r=%GetArrayKeys(q,w); if((typeof(r)==='number')){ ba=r; }else{ if(r.length==0)return-1; var bq=GetSortedArrayKeys(q,r); var ae=bq.length; var u=0; while(u>>0)); return InnerArrayIndexOf(this,aG,Z,w); } function InnerArrayLastIndexOf(q,aG,Z,w,br){ if(w==0)return-1; if(br<2){ Z=w-1; }else{ Z=(%_ToInteger(Z)); if(Z<0)Z+=w; if(Z<0)return-1; else if(Z>=w)Z=w-1; } var bp=0; var ba=Z; if(UseSparseVariant(q,w,(%_IsArray(q)),Z)){ %NormalizeElements(q); var r=%GetArrayKeys(q,Z+1); if((typeof(r)==='number')){ ba=r; }else{ if(r.length==0)return-1; var bq=GetSortedArrayKeys(q,r); var u=bq.length-1; while(u>=0){ var y=bq[u]; if(!(y===(void 0))&&q[y]===aG)return y; u--; } return-1; } } if(!(aG===(void 0))){ for(var u=ba;u>=bp;u--){ if(q[u]===aG)return u; } return-1; } for(var u=ba;u>=bp;u--){ if((q[u]===(void 0))&&u in q){ return u; } } return-1; } function ArrayLastIndexOf(aG,Z){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"Array.prototype.lastIndexOf"); var w=(harmony_tolength?(%ToLength(this.length)):(this.length>>>0)); return InnerArrayLastIndexOf(this,aG,Z,w, %_ArgumentsLength()); } function InnerArrayReduce(bs,U,q,w,br){ if(!(typeof(bs)==='function')){ throw MakeTypeError(13,bs); } var K=(%_IsArray(q)); var u=0; find_initial:if(br<2){ for(;u>>0)); return InnerArrayReduce(bs,U,q,w, %_ArgumentsLength()); } function InnerArrayReduceRight(bs,U,q,w, br){ if(!(typeof(bs)==='function')){ throw MakeTypeError(13,bs); } var K=(%_IsArray(q)); var u=w-1; find_initial:if(br<2){ for(;u>=0;u--){ if(((K&&%_HasFastPackedElements(%IS_VAR(q)))?(u=0;u--){ if(((K&&%_HasFastPackedElements(%IS_VAR(q)))?(u>>0)); return InnerArrayReduceRight(bs,U,q,w, %_ArgumentsLength()); } function ArrayIsArray(aZ){ return(%_IsArray(aZ)); } %AddNamedProperty(d.prototype,"constructor",d, 2); var bt={ __proto__:null, copyWithin:true, entries:true, fill:true, find:true, findIndex:true, keys:true, }; %AddNamedProperty(d.prototype,n,bt, 2|1); b.InstallFunctions(d,2,[ "isArray",ArrayIsArray ]); var bu=%SpecialArrayFunctions(); var bv=function(bw,bx,B){ var bk=bx; if(bu.hasOwnProperty(bw)){ bk=bu[bw]; } if(!(B===(void 0))){ %FunctionSetLength(bk,B); } return bk; }; b.InstallFunctions(d.prototype,2,[ "toString",bv("toString",ArrayToString), "toLocaleString",bv("toLocaleString",ArrayToLocaleString), "join",bv("join",ArrayJoin), "pop",bv("pop",ArrayPop), "push",bv("push",ArrayPush,1), "reverse",bv("reverse",ArrayReverse), "shift",bv("shift",ArrayShift), "unshift",bv("unshift",ArrayUnshift,1), "slice",bv("slice",ArraySlice,2), "splice",bv("splice",ArraySplice,2), "sort",bv("sort",ArraySort), "filter",bv("filter",ArrayFilter,1), "forEach",bv("forEach",ArrayForEach,1), "some",bv("some",ArraySome,1), "every",bv("every",ArrayEvery,1), "map",bv("map",ArrayMap,1), "indexOf",bv("indexOf",ArrayIndexOf,1), "lastIndexOf",bv("lastIndexOf",ArrayLastIndexOf,1), "reduce",bv("reduce",ArrayReduce,1), "reduceRight",bv("reduceRight",ArrayReduceRight,1) ]); %FinishArrayPrototypeSetup(d.prototype); b.SetUpLockedPrototype(e,d(),[ "indexOf",bv("indexOf",ArrayIndexOf), "join",bv("join",ArrayJoin), "pop",bv("pop",ArrayPop), "push",bv("push",ArrayPush), "shift",bv("shift",ArrayShift), "sort",bv("sort",ArraySort), "splice",bv("splice",ArraySplice) ]); b.SetUpLockedPrototype(f,d(),[ "join",bv("join",ArrayJoin), "pop",bv("pop",ArrayPop), "push",bv("push",ArrayPush), "shift",bv("shift",ArrayShift) ]); b.Export(function(aF){ aF.ArrayIndexOf=ArrayIndexOf; aF.ArrayJoin=ArrayJoin; aF.ArrayPush=ArrayPush; aF.ArrayToString=ArrayToString; aF.InnerArrayEvery=InnerArrayEvery; aF.InnerArrayFilter=InnerArrayFilter; aF.InnerArrayForEach=InnerArrayForEach; aF.InnerArrayIndexOf=InnerArrayIndexOf; aF.InnerArrayJoin=InnerArrayJoin; aF.InnerArrayLastIndexOf=InnerArrayLastIndexOf; aF.InnerArrayMap=InnerArrayMap; aF.InnerArrayReduce=InnerArrayReduce; aF.InnerArrayReduceRight=InnerArrayReduceRight; aF.InnerArraySome=InnerArraySome; aF.InnerArraySort=InnerArraySort; aF.InnerArrayToLocaleString=InnerArrayToLocaleString; aF.PackedArrayReverse=PackedArrayReverse; }); %InstallToContext([ "array_pop",ArrayPop, "array_push",ArrayPush, "array_shift",ArrayShift, "array_splice",ArraySplice, "array_slice",ArraySlice, "array_unshift",ArrayUnshift, ]); }); string¶ (function(a,b){ %CheckIsBootstrapping(); var c; var d; var e=a.RegExp; var f=a.String; var g=b.InternalArray; var h=b.InternalPackedArray; var i; var j; var k; var l; b.Import(function(m){ c=m.ArrayIndexOf; d=m.ArrayJoin; i=m.RegExpExec; j=m.RegExpExecNoTests; k=m.RegExpLastMatchInfo; l=m.ToNumber; }); function StringToString(){ if(!(typeof(this)==='string')&&!(%_ClassOf(this)==='String')){ throw MakeTypeError(58,'String.prototype.toString'); } return %_ValueOf(this); } function StringValueOf(){ if(!(typeof(this)==='string')&&!(%_ClassOf(this)==='String')){ throw MakeTypeError(58,'String.prototype.valueOf'); } return %_ValueOf(this); } function StringCharAtJS(n){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.charAt"); var o=%_StringCharAt(this,n); if(%_IsSmi(o)){ o=%_StringCharAt((%_ToString(this)),(%_ToInteger(n))); } return o; } function StringCharCodeAtJS(n){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.charCodeAt"); var o=%_StringCharCodeAt(this,n); if(!%_IsSmi(o)){ o=%_StringCharCodeAt((%_ToString(this)),(%_ToInteger(n))); } return o; } function StringConcat(p){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.concat"); var q=%_ArgumentsLength(); var r=(%_ToString(this)); if(q===1){ return r+(%_ToString(p)); } var s=new g(q+1); s[0]=r; for(var t=0;t1){ x=%_Arguments(1); x=(%_ToInteger(x)); if(x<0)x=0; if(x>w.length)x=w.length; } return %StringIndexOf(w,v,x); } function StringLastIndexOfJS(y){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.lastIndexOf"); var z=(%_ToString(this)); var A=z.length; var y=(%_ToString(y)); var B=y.length; var x=A-B; if(%_ArgumentsLength()>1){ var C=l(%_Arguments(1)); if(!(!%_IsSmi(%IS_VAR(C))&&!(C==C))){ C=(%_ToInteger(C)); if(C<0){ C=0; } if(C+B0xFF&& (typeof(M)==='string')&& %StringIndexOf(M,'$',0)<0){ return %StringReplaceOneCharWithString(w,L,M); } var Q=%StringIndexOf(w,L,0); if(Q<0)return w; var R=Q+L.length; var o=%_SubString(w,0,Q); if((typeof(M)==='function')){ o+=M(L,Q,w); }else{ K[3]=Q; K[4]=R; o=ExpandReplacement((%_ToString(M)), w, K, o); } return o+%_SubString(w,R,w.length); } function ExpandReplacement(S,w,T,o){ var U=S.length; var V=%StringIndexOf(S,'$',0); if(V<0){ if(U>0)o+=S; return o; } if(V>0)o+=%_SubString(S,0,V); while(true){ var W='$'; var C=V+1; if(C=48&&X<=57){ var Y=(X-48)<<1; var Z=1; var aa=((T)[0]); if(C+1=48&&V<=57){ var ab=Y*10+((V-48)<<1); if(ab=0){ o+= %_SubString(w,Q,T[(3+(Y+1))]); } C+=Z; }else{ o+='$'; } }else{ o+='$'; } }else{ o+='$'; } V=%StringIndexOf(S,'$',C); if(V<0){ if(CC){ o+=%_SubString(S,C,V); } } return o; } function CaptureString(S,ac,x){ var ad=x<<1; var Q=ac[(3+(ad))]; if(Q<0)return; var R=ac[(3+(ad+1))]; return %_SubString(S,Q,R); } var ae=new g(4); function StringReplaceGlobalRegExpWithFunction(w,D,M){ var af=ae; if(af){ ae=null; }else{ af=new g(16); } var ag=%RegExpExecMultiple(D, w, k, af); D.lastIndex=0; if((ag===null)){ ae=af; return w; } var q=ag.length; if(((k)[0])==2){ var ah=0; var ai=new h(null,0,w); for(var t=0;t0){ ah=(aj>>11)+(aj&0x7ff); }else{ ah=ag[++t]-aj; } }else{ ai[0]=aj; ai[1]=ah; $regexpLastMatchInfoOverride=ai; var ak=M(aj,ah,w); ag[t]=(%_ToString(ak)); ah+=aj.length; } } }else{ for(var t=0;t>1; var an; if(am==1){ var F=%_SubString(w,x,al); an=M(F,x,w); }else{ var ao=new g(am+2); for(var ap=0;apar){ return''; } } if(at<0){ at+=ar; if(at<0){ return''; } }else{ if(at>ar){ at=ar; } } if(at<=as){ return''; } return %_SubString(F,as,at); } function StringSplitJS(au,av){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.split"); var w=(%_ToString(this)); av=((av===(void 0)))?0xffffffff:(av>>>0); var U=w.length; if(!(%_IsRegExp(au))){ var aw=(%_ToString(au)); if(av===0)return[]; if((au===(void 0)))return[w]; var ax=aw.length; if(ax===0)return %StringToArray(w,av); var o=%StringSplit(w,aw,av); return o; } if(av===0)return[]; return StringSplitOnRegExp(w,au,av,U); } function StringSplitOnRegExp(w,au,av,U){ if(U===0){ if(i(au,w,0,0)!=null){ return[]; } return[w]; } var ay=0; var az=0; var aA=0; var o=new g(); outer_loop: while(true){ if(az===U){ o[o.length]=%_SubString(w,ay,U); break; } var T=i(au,w,az); if(T==null||U===(aA=T[3])){ o[o.length]=%_SubString(w,ay,U); break; } var aB=T[4]; if(az===aB&&aB===ay){ az++; continue; } o[o.length]=%_SubString(w,ay,aA); if(o.length===av)break; var aC=((T)[0])+3; for(var t=3+2;tar){ as=ar; } var at=ar; if(!(R===(void 0))){ at=(%_ToInteger(R)); if(at>ar){ at=ar; }else{ if(at<0)at=0; if(as>at){ var aE=at; at=as; as=aE; } } } return %_SubString(F,as,at); } function StringSubstr(Q,aF){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.substr"); var F=(%_ToString(this)); var q; if((aF===(void 0))){ q=F.length; }else{ q=(%_ToInteger(aF)); if(q<=0)return''; } if((Q===(void 0))){ Q=0; }else{ Q=(%_ToInteger(Q)); if(Q>=F.length)return''; if(Q<0){ Q+=F.length; if(Q<0)Q=0; } } var R=Q+q; if(R>F.length)R=F.length; return %_SubString(F,Q,R); } function StringToLowerCaseJS(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.toLowerCase"); return %StringToLowerCase((%_ToString(this))); } function StringToLocaleLowerCase(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.toLocaleLowerCase"); return %StringToLowerCase((%_ToString(this))); } function StringToUpperCaseJS(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.toUpperCase"); return %StringToUpperCase((%_ToString(this))); } function StringToLocaleUpperCase(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.toLocaleUpperCase"); return %StringToUpperCase((%_ToString(this))); } function StringTrimJS(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.trim"); return %StringTrim((%_ToString(this)),true,true); } function StringTrimLeft(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.trimLeft"); return %StringTrim((%_ToString(this)),true,false); } function StringTrimRight(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.trimRight"); return %StringTrim((%_ToString(this)),false,true); } function StringFromCharCode(aG){ var aF=%_ArgumentsLength(); if(aF==1){ if(!%_IsSmi(aG))aG=l(aG); return %_StringCharFromCode(aG&0xffff); } var aH=%NewString(aF,true); var t; for(t=0;t0xff)break; %_OneByteSeqStringSetChar(t,aG,aH); } if(t==aF)return aH; aH=%TruncateString(aH,t); var aI=%NewString(aF-t,false); for(var ap=0;t"+(%_ToString(this))+ ""; } function StringBig(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.big"); return""+(%_ToString(this))+""; } function StringBlink(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.blink"); return""+(%_ToString(this))+""; } function StringBold(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.bold"); return""+(%_ToString(this))+""; } function StringFixed(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.fixed"); return""+(%_ToString(this))+""; } function StringFontcolor(aL){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.fontcolor"); return""+(%_ToString(this))+ ""; } function StringFontsize(aM){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.fontsize"); return""+(%_ToString(this))+ ""; } function StringItalics(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.italics"); return""+(%_ToString(this))+""; } function StringLink(F){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.link"); return""+(%_ToString(this))+""; } function StringSmall(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.small"); return""+(%_ToString(this))+""; } function StringStrike(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.strike"); return""+(%_ToString(this))+""; } function StringSub(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.sub"); return""+(%_ToString(this))+""; } function StringSup(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.sup"); return""+(%_ToString(this))+""; } function StringRepeat(aN){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.repeat"); var F=(%_ToString(this)); var aF=(%_ToInteger(aN)); if(aF<0||aF>%_MaxSmi())throw MakeRangeError(133); var aO=""; while(true){ if(aF&1)aO+=F; aF>>=1; if(aF===0)return aO; F+=F; } } function StringStartsWith(aP){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.startsWith"); var F=(%_ToString(this)); if((%_IsRegExp(aP))){ throw MakeTypeError(31,"String.prototype.startsWith"); } var aQ=(%_ToString(aP)); var n=0; if(%_ArgumentsLength()>1){ var aR=%_Arguments(1); if(!(aR===(void 0))){ n=(%_ToInteger(aR)); } } var ar=F.length; if(n<0)n=0; if(n>ar)n=ar; var aS=aQ.length; if(aS+n>ar){ return false; } for(var t=0;t1){ var aR=%_Arguments(1); if(!(aR===(void 0))){ n=(%_ToInteger(aR)); } } if(n<0)n=0; if(n>ar)n=ar; var aS=aQ.length; n=n-aS; if(n<0){ return false; } for(var t=0;t1){ n=%_Arguments(1); n=(%_ToInteger(n)); } var aT=S.length; if(n<0)n=0; if(n>aT)n=aT; var aU=aP.length; if(aU+n>aT){ return false; } return %StringIndexOf(S,aP,n)!==-1; } function StringCodePointAt(n){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"String.prototype.codePointAt"); var S=(%_ToString(this)); var aM=S.length; n=(%_ToInteger(n)); if(n<0||n>=aM){ return(void 0); } var aV=%_StringCharCodeAt(S,n); if(aV<0xD800||aV>0xDBFF||n+1==aM){ return aV; } var aW=%_StringCharCodeAt(S,n+1); if(aW<0xDC00||aW>0xDFFF){ return aV; } return(aV-0xD800)*0x400+aW+0x2400; } function StringFromCodePoint(aX){ var aG; var U=%_ArgumentsLength(); var x; var o=""; for(x=0;x0x10FFFF||aG!==(%_ToInteger(aG))){ throw MakeRangeError(132,aG); } if(aG<=0xFFFF){ o+=%_StringCharFromCode(aG); }else{ aG-=0x10000; o+=%_StringCharFromCode((aG>>>10)&0x3FF|0xD800); o+=%_StringCharFromCode(aG&0x3FF|0xDC00); } } return o; } function StringRaw(aY){ var aZ=%_ArgumentsLength(); var ba=(%_ToObject(aY)); var bb=(%_ToObject(ba.raw)); var bc=(%ToLength(bb.length)); if(bc<=0)return""; var o=(%_ToString(bb[0])); for(var t=1;t=48&&f<=57)return f-48; if(f>=65&&f<=70)return f-55; if(f>=97&&f<=102)return f-87; return-1; } function isAlphaNumeric(g){ if(97<=g&&g<=122)return true; if(65<=g&&g<=90)return true; if(48<=g&&g<=57)return true; return false; } var h=0; function URIAddEncodedOctetToBuffer(i,j,k){ j[k++]=37; j[k++]=h[i>>4]; j[k++]=h[i&0x0F]; return k; } function URIEncodeOctets(l,j,k){ if(h===0){ h=[48,49,50,51,52,53,54,55,56,57, 65,66,67,68,69,70]; } k=URIAddEncodedOctetToBuffer(l[0],j,k); if(l[1])k=URIAddEncodedOctetToBuffer(l[1],j,k); if(l[2])k=URIAddEncodedOctetToBuffer(l[2],j,k); if(l[3])k=URIAddEncodedOctetToBuffer(l[3],j,k); return k; } function URIEncodeSingle(g,j,k){ var m=(g>>12)&0xF; var n=(g>>6)&63; var o=g&63; var l=new d(3); if(g<=0x007F){ l[0]=g; }else if(g<=0x07FF){ l[0]=n+192; l[1]=o+128; }else{ l[0]=m+224; l[1]=n+128; l[2]=o+128; } return URIEncodeOctets(l,j,k); } function URIEncodePair(p,q,j,k){ var r=((p>>6)&0xF)+1; var s=(p>>2)&0xF; var m=p&3; var n=(q>>6)&0xF; var o=q&63; var l=new d(4); l[0]=(r>>2)+240; l[1]=(((r&3)<<4)|s)+128; l[2]=((m<<4)|n)+128; l[3]=o+128; return URIEncodeOctets(l,j,k); } function URIHexCharsToCharCode(t,u){ var v=HexValueOf(t); var w=HexValueOf(u); if(v==-1||w==-1)throw MakeURIError(); return(v<<4)|w; } function URIDecodeOctets(l,j,k){ var x; var y=l[0]; if(y<0x80){ x=y; }else if(y<0xc2){ throw MakeURIError(); }else{ var z=l[1]; if(y<0xe0){ var A=y&0x1f; if((z<0x80)||(z>0xbf))throw MakeURIError(); var B=z&0x3f; x=(A<<6)+B; if(x<0x80||x>0x7ff)throw MakeURIError(); }else{ var C=l[2]; if(y<0xf0){ var A=y&0x0f; if((z<0x80)||(z>0xbf))throw MakeURIError(); var B=z&0x3f; if((C<0x80)||(C>0xbf))throw MakeURIError(); var D=C&0x3f; x=(A<<12)+(B<<6)+D; if((x<0x800)||(x>0xffff))throw MakeURIError(); }else{ var E=l[3]; if(y<0xf8){ var A=(y&0x07); if((z<0x80)||(z>0xbf))throw MakeURIError(); var B=(z&0x3f); if((C<0x80)||(C>0xbf)){ throw MakeURIError(); } var D=(C&0x3f); if((E<0x80)||(E>0xbf))throw MakeURIError(); var F=(E&0x3f); x=(A<<18)+(B<<12)+(D<<6)+F; if((x<0x10000)||(x>0x10ffff))throw MakeURIError(); }else{ throw MakeURIError(); } } } } if(0xD800<=x&&x<=0xDFFF)throw MakeURIError(); if(x<0x10000){ %_TwoByteSeqStringSetChar(k++,x,j); }else{ %_TwoByteSeqStringSetChar(k++,(x>>10)+0xd7c0,j); %_TwoByteSeqStringSetChar(k++,(x&0x3ff)+0xdc00,j); } return k; } function Encode(G,H){ G=(%_ToString(G)); var I=G.length; var J=new e(I); var k=0; for(var K=0;K=0xDC00&&p<=0xDFFF)throw MakeURIError(); if(p<0xD800||p>0xDBFF){ k=URIEncodeSingle(p,J,k); }else{ K++; if(K==I)throw MakeURIError(); var q=%_StringCharCodeAt(G,K); if(q<0xDC00||q>0xDFFF)throw MakeURIError(); k=URIEncodePair(p,q,J,k); } } } var j=%NewString(J.length,true); for(var L=0;L=I)throw MakeURIError(); var g=URIHexCharsToCharCode(%_StringCharCodeAt(G,K+1), %_StringCharCodeAt(G,K+2)); if(g>>7)break; if(M(g)){ %_OneByteSeqStringSetChar(k++,37,N); %_OneByteSeqStringSetChar(k++,%_StringCharCodeAt(G,K+1), N); %_OneByteSeqStringSetChar(k++,%_StringCharCodeAt(G,K+2), N); }else{ %_OneByteSeqStringSetChar(k++,g,N); } K+=2; }else{ if(f>0x7f)break; %_OneByteSeqStringSetChar(k++,f,N); } } N=%TruncateString(N,k); if(K==I)return N; var O=%NewString(I-K,false); k=0; for(;K=I)throw MakeURIError(); var g=URIHexCharsToCharCode(%_StringCharCodeAt(G,++K), %_StringCharCodeAt(G,++K)); if(g>>7){ var P=0; while(((g<<++P)&0x80)!=0){} if(P==1||P>4)throw MakeURIError(); var l=new d(P); l[0]=g; if(K+3*(P-1)>=I)throw MakeURIError(); for(var L=1;L0)?g:0-g; } function MathAcosJS(g){ return %_MathAcos(+g); } function MathAsinJS(g){ return %_MathAsin(+g); } function MathAtanJS(g){ return %_MathAtan(+g); } function MathAtan2JS(h,g){ h=+h; g=+g; return %_MathAtan2(h,g); } function MathCeil(g){ return-%_MathFloor(-g); } function MathExp(g){ return %MathExpRT(((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g))); } function MathFloorJS(g){ return %_MathFloor(+g); } function MathLog(g){ return %_MathLogRT(((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g))); } function MathMax(i,j){ var k=%_ArgumentsLength(); if(k==2){ i=((typeof(%IS_VAR(i))==='number')?i:$nonNumberToNumber(i)); j=((typeof(%IS_VAR(j))==='number')?j:$nonNumberToNumber(j)); if(j>i)return j; if(i>j)return i; if(i==j){ return(i===0&&%_IsMinusZero(i))?j:i; } return $NaN; } var l=-(1/0); for(var m=0;ml||(l===0&&n===0&&%_IsMinusZero(l))){ l=n; } } return l; } function MathMin(i,j){ var k=%_ArgumentsLength(); if(k==2){ i=((typeof(%IS_VAR(i))==='number')?i:$nonNumberToNumber(i)); j=((typeof(%IS_VAR(j))==='number')?j:$nonNumberToNumber(j)); if(j>i)return i; if(i>j)return j; if(i==j){ return(i===0&&%_IsMinusZero(i))?i:j; } return $NaN; } var l=(1/0); for(var m=0;m>>16))|0; rngstate[0]=o; var p=(MathImul(36969,rngstate[1]&0xFFFF)+(rngstate[1]>>>16))|0; rngstate[1]=p; var g=((o<<16)+(p&0xFFFF))|0; return(g<0?(g+0x100000000):g)*2.3283064365386962890625e-10; } function MathRandomRaw(){ var o=(MathImul(18030,rngstate[0]&0xFFFF)+(rngstate[0]>>>16))|0; rngstate[0]=o; var p=(MathImul(36969,rngstate[1]&0xFFFF)+(rngstate[1]>>>16))|0; rngstate[1]=p; var g=((o<<16)+(p&0xFFFF))|0; return g&0x3fffffff; } function MathRound(g){ return %RoundNumber(((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g))); } function MathSqrtJS(g){ return %_MathSqrt(+g); } function MathImul(g,h){ return %NumberImul(((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)),((typeof(%IS_VAR(h))==='number')?h:$nonNumberToNumber(h))); } function MathSign(g){ g=+g; if(g>0)return 1; if(g<0)return-1; return g; } function MathTrunc(g){ g=+g; if(g>0)return %_MathFloor(g); if(g<0)return-%_MathFloor(-g); return g; } function MathTanh(g){ g=((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)); if(g===0)return g; if(!(%_IsSmi(%IS_VAR(g))||((g==g)&&(g!=1/0)&&(g!=-1/0))))return MathSign(g); var q=MathExp(g); var r=MathExp(-g); return(q-r)/(q+r); } function MathAsinh(g){ g=((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)); if(g===0||!(%_IsSmi(%IS_VAR(g))||((g==g)&&(g!=1/0)&&(g!=-1/0))))return g; if(g>0)return MathLog(g+%_MathSqrt(g*g+1)); return-MathLog(-g+%_MathSqrt(g*g+1)); } function MathAcosh(g){ g=((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)); if(g<1)return $NaN; if(!(%_IsSmi(%IS_VAR(g))||((g==g)&&(g!=1/0)&&(g!=-1/0))))return g; return MathLog(g+%_MathSqrt(g+1)*%_MathSqrt(g-1)); } function MathAtanh(g){ g=((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)); if(g===0)return g; if(!(%_IsSmi(%IS_VAR(g))||((g==g)&&(g!=1/0)&&(g!=-1/0))))return $NaN; return 0.5*MathLog((1+g)/(1-g)); } function MathHypot(g,h){ var k=%_ArgumentsLength(); var s=new e(k); var t=0; for(var m=0;mt)t=n; s[m]=n; } if(t===0)t=1; var u=0; var v=0; for(var m=0;m>>0); } function MathCbrt(g){ g=((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)); if(g==0||!(%_IsSmi(%IS_VAR(g))||((g==g)&&(g!=1/0)&&(g!=-1/0))))return g; return g>=0?CubeRoot(g):-CubeRoot(-g); } function CubeRoot(g){ var y=MathFloorJS(%_DoubleHi(g)/3)+0x2A9F7893; var z=%_ConstructDouble(y,0); z=(1.0/3.0)*(g/(z*z)+2*z); ; z=(1.0/3.0)*(g/(z*z)+2*z); ; z=(1.0/3.0)*(g/(z*z)+2*z); ; return(1.0/3.0)*(g/(z*z)+2*z); ; } %AddNamedProperty(c,f,"Math",1|2); b.InstallConstants(c,[ "E",2.7182818284590452354, "LN10",2.302585092994046, "LN2",0.6931471805599453, "LOG2E",1.4426950408889634, "LOG10E",0.4342944819032518, "PI",3.1415926535897932, "SQRT1_2",0.7071067811865476, "SQRT2",1.4142135623730951 ]); b.InstallFunctions(c,2,[ "random",MathRandom, "abs",MathAbs, "acos",MathAcosJS, "asin",MathAsinJS, "atan",MathAtanJS, "ceil",MathCeil, "exp",MathExp, "floor",MathFloorJS, "log",MathLog, "round",MathRound, "sqrt",MathSqrtJS, "atan2",MathAtan2JS, "pow",MathPowJS, "max",MathMax, "min",MathMin, "imul",MathImul, "sign",MathSign, "trunc",MathTrunc, "tanh",MathTanh, "asinh",MathAsinh, "acosh",MathAcosh, "atanh",MathAtanh, "hypot",MathHypot, "fround",MathFroundJS, "clz32",MathClz32JS, "cbrt",MathCbrt ]); %SetForceInlineFlag(MathAbs); %SetForceInlineFlag(MathAcosJS); %SetForceInlineFlag(MathAsinJS); %SetForceInlineFlag(MathAtanJS); %SetForceInlineFlag(MathAtan2JS); %SetForceInlineFlag(MathCeil); %SetForceInlineFlag(MathClz32JS); %SetForceInlineFlag(MathFloorJS); %SetForceInlineFlag(MathRandom); %SetForceInlineFlag(MathSign); %SetForceInlineFlag(MathSqrtJS); %SetForceInlineFlag(MathTrunc); b.Export(function(A){ A.MathAbs=MathAbs; A.MathExp=MathExp; A.MathFloor=MathFloorJS; A.IntRandom=MathRandomRaw; A.MathMax=MathMax; A.MathMin=MathMin; }); }) fdlibm-¨ var kMath; var rempio2result; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Math; var d; var e; b.Import(function(f){ d=f.MathAbs; e=f.MathExp; }); function KernelTan(g,h,i){ var j; var k; var l=%_DoubleHi(g); var m=l&0x7fffffff; if(m<0x3e300000){ if(((m|%_DoubleLo(g))|(i+1))==0){ return 1/d(g); }else{ if(i==1){ return g; }else{ var k=g+h; var j=%_ConstructDouble(%_DoubleHi(k),0); var n=h-(j-g); var o=-1/k; var p=%_ConstructDouble(%_DoubleHi(o),0); var q=1+p*j; return p+o*(q+p*n); } } } if(m>=0x3fe59428){ if(g<0){ g=-g; h=-h; } j=kMath[32]-g; k=kMath[33]-h; g=j+k; h=0; } j=g*g; k=j*j; var r=kMath[19+1] +k*(kMath[19+3] +k*(kMath[19+5] + k*(kMath[19+7] +k*(kMath[19+9] +k*kMath[19+11] )))); var n=j*(kMath[19+2] +k*(kMath[19+4] +k*(kMath[19+6] + k*(kMath[19+8] +k*(kMath[19+10] +k*kMath[19+12] ))))); var q=j*g; r=h+j*(q*(r+n)+h); r=r+kMath[19+0] *q; k=g+r; if(m>=0x3fe59428){ return(1-((l>>30)&2))* (i-2.0*(g-(k*k/(k+i)-r))); } if(i==1){ return k; }else{ j=%_ConstructDouble(%_DoubleHi(k),0); n=r-(j-g); var o=-1/k; var p=%_ConstructDouble(%_DoubleHi(o),0); q=1+p*j; return p+o*(q+p*n); } } function MathSinSlow(g){ var s,t,u; var l=%_DoubleHi(g); var m=l&0x7fffffff; if(m<0x4002d97c){ if(l>0){ var j=g-kMath[1]; if(m!=0x3ff921fb){ t=j-kMath[2]; u=(j-t)-kMath[2]; }else{ j-=kMath[3]; t=j-kMath[4]; u=(j-t)-kMath[4]; } s=1; }else{ var j=g+kMath[1]; if(m!=0x3ff921fb){ t=j+kMath[2]; u=(j-t)+kMath[2]; }else{ j+=kMath[3]; t=j+kMath[4]; u=(j-t)+kMath[4]; } s=-1; } }else if(m<=0x413921fb){ var p=d(g); s=(p*kMath[0]+0.5)|0; var r=p-s*kMath[1]; var k=s*kMath[2]; t=r-k; if(m-(%_DoubleHi(t)&0x7ff00000)>0x1000000){ p=r; k=s*kMath[3]; r=p-k; k=s*kMath[4]-((p-r)-k); t=r-k; if(m-(%_DoubleHi(t)&0x7ff00000)>0x3100000){ p=r; k=s*kMath[5]; r=p-k; k=s*kMath[6]-((p-r)-k); t=r-k; } } u=(r-t)-k; if(l<0){ s=-s; t=-t; u=-u; } }else{ s=%RemPiO2(g,rempio2result); t=rempio2result[0]; u=rempio2result[1]; } ; var v=1-(s&2); if(s&1){ var m=%_DoubleHi(t)&0x7fffffff; var j=t*t; var r=j*(4.16666666666666019037e-02+j*(-1.38888888888741095749e-03+j*(2.48015872894767294178e-05+j*(-2.75573143513906633035e-07+j*(2.08757232129817482790e-09+j*-1.13596475577881948265e-11))))); if(m<0x3fd33333){ return(1-(0.5*j-(j*r-t*u)))*v; }else{ var w; if(m>0x3fe90000){ w=0.28125; }else{ w=%_ConstructDouble(%_DoubleHi(0.25*t),0); } var x=0.5*j-w; return(1-w-(x-(j*r-t*u)))*v; } ; }else{ var j=t*t; var n=j*t; var r=8.33333333332248946124e-03+j*(-1.98412698298579493134e-04+j*(2.75573137070700676789e-06+j*(-2.50507602534068634195e-08+j*1.58969099521155010221e-10))); return(t-((j*(0.5*u-n*r)-u)-n*-1.66666666666666324348e-01))*v; ; } } function MathCosSlow(g){ var s,t,u; var l=%_DoubleHi(g); var m=l&0x7fffffff; if(m<0x4002d97c){ if(l>0){ var j=g-kMath[1]; if(m!=0x3ff921fb){ t=j-kMath[2]; u=(j-t)-kMath[2]; }else{ j-=kMath[3]; t=j-kMath[4]; u=(j-t)-kMath[4]; } s=1; }else{ var j=g+kMath[1]; if(m!=0x3ff921fb){ t=j+kMath[2]; u=(j-t)+kMath[2]; }else{ j+=kMath[3]; t=j+kMath[4]; u=(j-t)+kMath[4]; } s=-1; } }else if(m<=0x413921fb){ var p=d(g); s=(p*kMath[0]+0.5)|0; var r=p-s*kMath[1]; var k=s*kMath[2]; t=r-k; if(m-(%_DoubleHi(t)&0x7ff00000)>0x1000000){ p=r; k=s*kMath[3]; r=p-k; k=s*kMath[4]-((p-r)-k); t=r-k; if(m-(%_DoubleHi(t)&0x7ff00000)>0x3100000){ p=r; k=s*kMath[5]; r=p-k; k=s*kMath[6]-((p-r)-k); t=r-k; } } u=(r-t)-k; if(l<0){ s=-s; t=-t; u=-u; } }else{ s=%RemPiO2(g,rempio2result); t=rempio2result[0]; u=rempio2result[1]; } ; if(s&1){ var v=(s&2)-1; var j=t*t; var n=j*t; var r=8.33333333332248946124e-03+j*(-1.98412698298579493134e-04+j*(2.75573137070700676789e-06+j*(-2.50507602534068634195e-08+j*1.58969099521155010221e-10))); return(t-((j*(0.5*u-n*r)-u)-n*-1.66666666666666324348e-01))*v; ; }else{ var v=1-(s&2); var m=%_DoubleHi(t)&0x7fffffff; var j=t*t; var r=j*(4.16666666666666019037e-02+j*(-1.38888888888741095749e-03+j*(2.48015872894767294178e-05+j*(-2.75573143513906633035e-07+j*(2.08757232129817482790e-09+j*-1.13596475577881948265e-11))))); if(m<0x3fd33333){ return(1-(0.5*j-(j*r-t*u)))*v; }else{ var w; if(m>0x3fe90000){ w=0.28125; }else{ w=%_ConstructDouble(%_DoubleHi(0.25*t),0); } var x=0.5*j-w; return(1-w-(x-(j*r-t*u)))*v; } ; } } function MathSin(g){ g=+g; if((%_DoubleHi(g)&0x7fffffff)<=0x3fe921fb){ var j=g*g; var n=j*g; var r=8.33333333332248946124e-03+j*(-1.98412698298579493134e-04+j*(2.75573137070700676789e-06+j*(-2.50507602534068634195e-08+j*1.58969099521155010221e-10))); return(g-((j*(0.5*0-n*r)-0)-n*-1.66666666666666324348e-01)); ; } return+MathSinSlow(g); } function MathCos(g){ g=+g; if((%_DoubleHi(g)&0x7fffffff)<=0x3fe921fb){ var m=%_DoubleHi(g)&0x7fffffff; var j=g*g; var r=j*(4.16666666666666019037e-02+j*(-1.38888888888741095749e-03+j*(2.48015872894767294178e-05+j*(-2.75573143513906633035e-07+j*(2.08757232129817482790e-09+j*-1.13596475577881948265e-11))))); if(m<0x3fd33333){ return(1-(0.5*j-(j*r-g*0))); }else{ var w; if(m>0x3fe90000){ w=0.28125; }else{ w=%_ConstructDouble(%_DoubleHi(0.25*g),0); } var x=0.5*j-w; return(1-w-(x-(j*r-g*0))); } ; } return+MathCosSlow(g); } function MathTan(g){ g=g*1; if((%_DoubleHi(g)&0x7fffffff)<=0x3fe921fb){ return KernelTan(g,0,1); } var s,t,u; var l=%_DoubleHi(g); var m=l&0x7fffffff; if(m<0x4002d97c){ if(l>0){ var j=g-kMath[1]; if(m!=0x3ff921fb){ t=j-kMath[2]; u=(j-t)-kMath[2]; }else{ j-=kMath[3]; t=j-kMath[4]; u=(j-t)-kMath[4]; } s=1; }else{ var j=g+kMath[1]; if(m!=0x3ff921fb){ t=j+kMath[2]; u=(j-t)+kMath[2]; }else{ j+=kMath[3]; t=j+kMath[4]; u=(j-t)+kMath[4]; } s=-1; } }else if(m<=0x413921fb){ var p=d(g); s=(p*kMath[0]+0.5)|0; var r=p-s*kMath[1]; var k=s*kMath[2]; t=r-k; if(m-(%_DoubleHi(t)&0x7ff00000)>0x1000000){ p=r; k=s*kMath[3]; r=p-k; k=s*kMath[4]-((p-r)-k); t=r-k; if(m-(%_DoubleHi(t)&0x7ff00000)>0x3100000){ p=r; k=s*kMath[5]; r=p-k; k=s*kMath[6]-((p-r)-k); t=r-k; } } u=(r-t)-k; if(l<0){ s=-s; t=-t; u=-u; } }else{ s=%RemPiO2(g,rempio2result); t=rempio2result[0]; u=rempio2result[1]; } ; return KernelTan(t,u,(s&1)?-1:1); } function MathLog1p(g){ g=g*1; var l=%_DoubleHi(g); var y=l&0x7fffffff; var z=1; var A=g; var B=1; var C=0; var D=g; if(l<0x3fda827a){ if(y>=0x3ff00000){ if(g===-1){ return-(1/0); }else{ return $NaN; } }else if(y<0x3c900000){ return g; }else if(y<0x3e200000){ return g-g*g*0.5; } if((l>0)||(l<=-0x402D413D)){ z=0; } } if(l>=0x7ff00000)return g; if(z!==0){ if(l<0x43400000){ D=1+g; B=%_DoubleHi(D); z=(B>>20)-1023; C=(z>0)?1-(D-g):g-(D-1); C=C/D; }else{ B=%_DoubleHi(D); z=(B>>20)-1023; } B=B&0xfffff; if(B<0x6a09e){ D=%_ConstructDouble(B|0x3ff00000,%_DoubleLo(D)); }else{ ++z; D=%_ConstructDouble(B|0x3fe00000,%_DoubleLo(D)); B=(0x00100000-B)>>2; } A=D-1; } var E=0.5*A*A; if(B===0){ if(A===0){ if(z===0){ return 0.0; }else{ return z*kMath[34]+(C+z*kMath[35]); } } var F=E*(1-kMath[36]*A); if(z===0){ return A-F; }else{ return z*kMath[34]-((F-(z*kMath[35]+C))-A); } } var q=A/(2+A); var j=q*q; var F=j*((kMath[37+0]) +j*((kMath[37+1]) +j* ((kMath[37+2]) +j*((kMath[37+3]) +j* ((kMath[37+4]) +j*((kMath[37+5]) +j*(kMath[37+6]) )))))); if(z===0){ return A-(E-q*(E+F)); }else{ return z*kMath[34]-((E-(q*(E+F)+(z*kMath[35]+C)))-A); } } function MathExpm1(g){ g=g*1; var h; var G; var H; var z; var p; var C; var l=%_DoubleHi(g); var I=l&0x80000000; var h=(I===0)?g:-g; l&=0x7fffffff; if(l>=0x4043687a){ if(l>=0x40862e42){ if(l>=0x7ff00000){ return(g===-(1/0))?-1:g; } if(g>kMath[44])return(1/0); } if(I!=0)return-1; } if(l>0x3fd62e42){ if(l<0x3ff0a2b2){ if(I===0){ G=g-kMath[34]; H=kMath[35]; z=1; }else{ G=g+kMath[34]; H=-kMath[35]; z=-1; } }else{ z=(kMath[45]*g+((I===0)?0.5:-0.5))|0; p=z; G=g-p*kMath[34]; H=p*kMath[35]; } g=G-H; C=(G-g)-H; }else if(l<0x3c900000){ return g; }else{ z=0; } var J=0.5*g; var K=g*J; var L=1+K*((kMath[46+0]) +K*((kMath[46+1]) +K* ((kMath[46+2]) +K*((kMath[46+3]) +K*(kMath[46+4]) )))); p=3-L*J; var M=K*((L-p)/(6-g*p)); if(z===0){ return g-(g*M-K); }else{ M=(g*(M-C)-C); M-=K; if(z===-1)return 0.5*(g-M)-0.5; if(z===1){ if(g<-0.25)return-2*(M-(g+0.5)); return 1+2*(g-M); } if(z<=-2||z>56){ h=1-(M-g); h=%_ConstructDouble(%_DoubleHi(h)+(z<<20),%_DoubleLo(h)); return h-1; } if(z<20){ p=%_ConstructDouble(0x3ff00000-(0x200000>>z),0); h=p-(M-g); h=%_ConstructDouble(%_DoubleHi(h)+(z<<20),%_DoubleLo(h)); }else{ p=%_ConstructDouble((0x3ff-z)<<20,0); h=g-(M+p); h+=1; h=%_ConstructDouble(%_DoubleHi(h)+(z<<20),%_DoubleLo(h)); } } return h; } function MathSinh(g){ g=g*1; var N=(g<0)?-0.5:0.5; var y=d(g); if(y<22){ if(y<3.725290298461914e-9)return g; var p=MathExpm1(y); if(y<1)return N*(2*p-p*p/(p+1)); return N*(p+p/(p+1)); } if(y<709.7822265625)return N*e(y); if(y<=kMath[51]){ var k=e(0.5*y); var p=N*k; return p*k; } return g*(1/0); } function MathCosh(g){ g=g*1; var m=%_DoubleHi(g)&0x7fffffff; if(m<0x3fd62e43){ var p=MathExpm1(d(g)); var k=1+p; if(m<0x3c800000)return k; return 1+(p*p)/(k+k); } if(m<0x40360000){ var p=e(d(g)); return 0.5*p+0.5/p; } if(m<0x40862e42)return 0.5*e(d(g)); if(d(g)<=kMath[51]){ var k=e(0.5*d(g)); var p=0.5*k; return p*k; } if((!%_IsSmi(%IS_VAR(g))&&!(g==g)))return g; return(1/0); } function MathLog10(g){ g=g*1; var l=%_DoubleHi(g); var O=%_DoubleLo(g); var z=0; if(l<0x00100000){ if(((l&0x7fffffff)|O)===0)return-(1/0); if(l<0)return $NaN; z-=54; g*=18014398509481984; l=%_DoubleHi(g); O=%_DoubleLo(g); } if(l>=0x7ff00000)return g; z+=(l>>20)-1023; var P=(z&0x80000000)>>>31; l=(l&0x000fffff)|((0x3ff-P)<<20); var h=z+P; g=%_ConstructDouble(l,O); var j=h*kMath[54]+kMath[52]*%_MathLogRT(g); return j+h*kMath[53]; } function MathLog2(g){ g=g*1; var y=d(g); var l=%_DoubleHi(g); var O=%_DoubleLo(g); var m=l&0x7fffffff; if((m|O)==0)return-(1/0); if(l<0)return $NaN; if(m>=0x7ff00000)return g; var s=0; if(m<0x00100000){ y*=9007199254740992; s-=53; m=%_DoubleHi(y); } s+=(m>>20)-0x3ff; var Q=m&0x000fffff; m=Q|0x3ff00000; var R=1; var S=0; var T=0; if(Q>0x3988e){ if(Q<0xbb67a){ R=1.5; S=kMath[64]; T=kMath[65]; }else{ s+=1; m-=0x00100000; } } y=%_ConstructDouble(m,%_DoubleLo(y)); var D=y-R; var n=1/(y+R); var U=D*n; var V=%_ConstructDouble(%_DoubleHi(U),0); var W=%_ConstructDouble(%_DoubleHi(y+R),0) var X=y-(W-R); var Y=n*((D-V*W)-V*X); var Z=U*U; var r=Z*Z*((kMath[55+0]) +Z*((kMath[55+1]) +Z*((kMath[55+2]) +Z*( (kMath[55+3]) +Z*((kMath[55+4]) +Z*(kMath[55+5]) ))))); r+=Y*(V+U); Z=V*V; W=%_ConstructDouble(%_DoubleHi(3.0+Z+r),0); X=r-((W-3.0)-Z); D=V*W; n=Y*W+X*U; p_h=%_ConstructDouble(%_DoubleHi(D+n),0); p_l=n-(p_h-D); z_h=kMath[62]*p_h; z_l=kMath[63]*p_h+p_l*kMath[61]+T; var p=s; var aa=%_ConstructDouble(%_DoubleHi(((z_h+z_l)+S)+p),0); var ab=z_l-(((aa-p)-S)-z_h); return aa+ab; } b.InstallFunctions(c,2,[ "cos",MathCos, "sin",MathSin, "tan",MathTan, "sinh",MathSinh, "cosh",MathCosh, "log10",MathLog10, "log2",MathLog2, "log1p",MathLog1p, "expm1",MathExpm1 ]); %SetForceInlineFlag(MathSin); %SetForceInlineFlag(MathCos); }) dateéö var $createDate; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Date; var d=a.Object; var e=b.InternalArray; var f; var g; var h; var i; b.Import(function(j){ f=j.IsFinite; g=j.MathAbs; h=j.MathFloor; i=j.ToNumber; }); var k=$NaN; var l; function LocalTimezone(m){ if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return""; CheckDateCacheCurrent(); if(m==k){ return l; } var n=%DateLocalTimezone(m); k=m; l=n; return n; } function UTC(o){ if((!%_IsSmi(%IS_VAR(o))&&!(o==o)))return o; return %DateToUTC(o); } function MakeTime(p,q,r,s){ if(!f(p))return $NaN; if(!f(q))return $NaN; if(!f(r))return $NaN; if(!f(s))return $NaN; return(%_ToInteger(p))*3600000 +(%_ToInteger(q))*60000 +(%_ToInteger(r))*1000 +(%_ToInteger(s)); } function TimeInYear(t){ return DaysInYear(t)*86400000; } function MakeDay(t,u,v){ if(!f(t)||!f(u)||!f(v))return $NaN; t=(%_IsSmi(%IS_VAR(t))?t:%NumberToIntegerMapMinusZero(i(t))); u=(%_IsSmi(%IS_VAR(u))?u:%NumberToIntegerMapMinusZero(i(u))); v=(%_IsSmi(%IS_VAR(v))?v:%NumberToIntegerMapMinusZero(i(v))); if(t<-1000000||t>1000000|| u<-10000000||u>10000000){ return $NaN; } return %DateMakeDay(t|0,u|0)+v-1; } function MakeDate(w,o){ var o=w*86400000+o; if(g(o)>8640002592000000)return $NaN; return o; } function TimeClip(o){ if(!f(o))return $NaN; if(g(o)>8640000000000000)return $NaN; return(%_ToInteger(o)); } var x={ time:0, string:null }; function DateConstructor(t,u,v,y,z,A,s){ if(!%_IsConstructCall()){ return %_CallFunction(new c(),DateToString); } var B=%_ArgumentsLength(); var C; if(B==0){ C=%DateCurrentTime(); (%DateSetValue(this,C,1)); }else if(B==1){ if((typeof(t)==='number')){ C=t; }else if((typeof(t)==='string')){ CheckDateCacheCurrent(); var D=x; if(D.string===t){ C=D.time; }else{ C=DateParse(t); if(!(!%_IsSmi(%IS_VAR(C))&&!(C==C))){ D.time=C; D.string=t; } } }else if((%_IsDate(t))){ C=(%_DateField(t,0)); }else{ var o=(%_ToPrimitive(t)); C=(typeof(o)==='string')?DateParse(o):i(o); } (%DateSetValue(this,C,1)); }else{ t=i(t); u=i(u); v=B>2?i(v):1; y=B>3?i(y):0; z=B>4?i(z):0; A=B>5?i(A):0; s=B>6?i(s):0; t=(!(!%_IsSmi(%IS_VAR(t))&&!(t==t))&& 0<=(%_ToInteger(t))&& (%_ToInteger(t))<=99)?1900+(%_ToInteger(t)):t; var w=MakeDay(t,u,v); var o=MakeTime(y,z,A,s); C=MakeDate(w,o); (%DateSetValue(this,C,0)); } } var E=['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; var F=['Jan','Feb','Mar','Apr','May','Jun', 'Jul','Aug','Sep','Oct','Nov','Dec']; function TwoDigitString(C){ return C<10?"0"+C:""+C; } function DateString(v){ if(!%_IsDate(v))%_ThrowNotDateError(); return E[(%_DateField(v,4))]+' ' +F[(%_DateField(v,2))]+' ' +TwoDigitString((%_DateField(v,3)))+' ' +(%_DateField(v,1)); } var G=['Sunday','Monday','Tuesday','Wednesday', 'Thursday','Friday','Saturday']; var H=['January','February','March','April','May','June', 'July','August','September','October','November','December']; function LongDateString(v){ if(!%_IsDate(v))%_ThrowNotDateError(); return G[(%_DateField(v,4))]+', ' +H[(%_DateField(v,2))]+' ' +TwoDigitString((%_DateField(v,3)))+', ' +(%_DateField(v,1)); } function TimeString(v){ if(!%_IsDate(v))%_ThrowNotDateError(); return TwoDigitString((%_DateField(v,5)))+':' +TwoDigitString((%_DateField(v,6)))+':' +TwoDigitString((%_DateField(v,7))); } function TimeStringUTC(v){ if(!%_IsDate(v))%_ThrowNotDateError(); return TwoDigitString((%_DateField(v,15)))+':' +TwoDigitString((%_DateField(v,16)))+':' +TwoDigitString((%_DateField(v,17))); } function LocalTimezoneString(v){ if(!%_IsDate(v))%_ThrowNotDateError(); var n=LocalTimezone((%_DateField(v,0))); var I=-(%_DateField(v,21)); var J=(I>=0)?1:-1; var y=h((J*I)/60); var q=h((J*I)%60); var K=' GMT'+((J==1)?'+':'-')+ TwoDigitString(y)+TwoDigitString(q); return K+' ('+n+')'; } function DatePrintString(v){ if(!%_IsDate(v))%_ThrowNotDateError(); return DateString(v)+' '+TimeString(v); } var L=new e(8); function DateParse(M){ var N=%DateParseString(M,L); if((N===null))return $NaN; var w=MakeDay(N[0],N[1],N[2]); var o=MakeTime(N[3],N[4],N[5],N[6]); var v=MakeDate(w,o); if((N[7]===null)){ return TimeClip(UTC(v)); }else{ return TimeClip(v-N[7]*1000); } } function DateUTC(t,u,v,y,z,A,s){ t=i(t); u=i(u); var B=%_ArgumentsLength(); v=B>2?i(v):1; y=B>3?i(y):0; z=B>4?i(z):0; A=B>5?i(A):0; s=B>6?i(s):0; t=(!(!%_IsSmi(%IS_VAR(t))&&!(t==t))&& 0<=(%_ToInteger(t))&& (%_ToInteger(t))<=99)?1900+(%_ToInteger(t)):t; var w=MakeDay(t,u,v); var o=MakeTime(y,z,A,s); return TimeClip(MakeDate(w,o)); } function DateNow(){ return %DateCurrentTime(); } function DateToString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)) if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; var O=LocalTimezoneString(this) return DatePrintString(this)+O; } function DateToDateString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; return DateString(this); } function DateToTimeString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; var O=LocalTimezoneString(this); return TimeString(this)+O; } function DateToLocaleString(){ if(!%_IsDate(this))%_ThrowNotDateError(); return %_CallFunction(this,DateToString); } function DateToLocaleDateString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; return LongDateString(this); } function DateToLocaleTimeString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; return TimeString(this); } function DateValueOf(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,0)); } function DateGetTime(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,0)); } function DateGetFullYear(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,1)); } function DateGetUTCFullYear(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,11)); } function DateGetMonth(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,2)); } function DateGetUTCMonth(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,12)); } function DateGetDate(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,3)); } function DateGetUTCDate(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,13)); } function DateGetDay(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,4)); } function DateGetUTCDay(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,14)); } function DateGetHours(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,5)); } function DateGetUTCHours(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,15)); } function DateGetMinutes(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,6)); } function DateGetUTCMinutes(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,16)); } function DateGetSeconds(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,7)); } function DateGetUTCSeconds(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,17)) } function DateGetMilliseconds(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,8)); } function DateGetUTCMilliseconds(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,18)); } function DateGetTimezoneOffset(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,21)); } function DateSetTime(s){ if(!%_IsDate(this))%_ThrowNotDateError(); (%DateSetValue(this,i(s),1)); return(%_DateField(this,0)); } function DateSetMilliseconds(s){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)+%_DateField(this,21)); s=i(s); var o=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),(%_DateField(this,7)),s); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),o),0)); } function DateSetUTCMilliseconds(s){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); s=i(s); var o=MakeTime((%_DateField(this,15)), (%_DateField(this,16)), (%_DateField(this,17)), s); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),o),1)); } function DateSetSeconds(r,s){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)+%_DateField(this,21)); r=i(r); s=%_ArgumentsLength()<2?(%_DateField(this,8)):i(s); var o=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),r,s); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),o),0)); } function DateSetUTCSeconds(r,s){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); r=i(r); s=%_ArgumentsLength()<2?(%_DateField(this,18)):i(s); var o=MakeTime((%_DateField(this,15)),(%_DateField(this,16)),r,s); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),o),1)); } function DateSetMinutes(q,r,s){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)+%_DateField(this,21)); q=i(q); var B=%_ArgumentsLength(); r=B<2?(%_DateField(this,7)):i(r); s=B<3?(%_DateField(this,8)):i(s); var o=MakeTime((%_DateField(this,5)),q,r,s); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),o),0)); } function DateSetUTCMinutes(q,r,s){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); q=i(q); var B=%_ArgumentsLength(); r=B<2?(%_DateField(this,17)):i(r); s=B<3?(%_DateField(this,18)):i(s); var o=MakeTime((%_DateField(this,15)),q,r,s); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),o),1)); } function DateSetHours(p,q,r,s){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)+%_DateField(this,21)); p=i(p); var B=%_ArgumentsLength(); q=B<2?(%_DateField(this,6)):i(q); r=B<3?(%_DateField(this,7)):i(r); s=B<4?(%_DateField(this,8)):i(s); var o=MakeTime(p,q,r,s); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),o),0)); } function DateSetUTCHours(p,q,r,s){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); p=i(p); var B=%_ArgumentsLength(); q=B<2?(%_DateField(this,16)):i(q); r=B<3?(%_DateField(this,17)):i(r); s=B<4?(%_DateField(this,18)):i(s); var o=MakeTime(p,q,r,s); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),o),1)); } function DateSetDate(v){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)+%_DateField(this,21)); v=i(v); var w=MakeDay((%_DateField(this,1)),(%_DateField(this,2)),v); return(%DateSetValue(this,MakeDate(w,(%_DateField(this,10))),0)); } function DateSetUTCDate(v){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); v=i(v); var w=MakeDay((%_DateField(this,11)),(%_DateField(this,12)),v); return(%DateSetValue(this,MakeDate(w,(%_DateField(this,20))),1)); } function DateSetMonth(u,v){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)+%_DateField(this,21)); u=i(u); v=%_ArgumentsLength()<2?(%_DateField(this,3)):i(v); var w=MakeDay((%_DateField(this,1)),u,v); return(%DateSetValue(this,MakeDate(w,(%_DateField(this,10))),0)); } function DateSetUTCMonth(u,v){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); u=i(u); v=%_ArgumentsLength()<2?(%_DateField(this,13)):i(v); var w=MakeDay((%_DateField(this,11)),u,v); return(%DateSetValue(this,MakeDate(w,(%_DateField(this,20))),1)); } function DateSetFullYear(t,u,v){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)+%_DateField(this,21)); t=i(t); var B=%_ArgumentsLength(); var o; if((!%_IsSmi(%IS_VAR(m))&&!(m==m))){ u=B<2?0:i(u); v=B<3?1:i(v); o=0; }else{ u=B<2?(%_DateField(this,2)):i(u); v=B<3?(%_DateField(this,3)):i(v); o=(%_DateField(this,10)); } var w=MakeDay(t,u,v); return(%DateSetValue(this,MakeDate(w,o),0)); } function DateSetUTCFullYear(t,u,v){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); t=i(t); var B=%_ArgumentsLength(); var o; if((!%_IsSmi(%IS_VAR(m))&&!(m==m))){ u=B<2?0:i(u); v=B<3?1:i(v); o=0; }else{ u=B<2?(%_DateField(this,12)):i(u); v=B<3?(%_DateField(this,13)):i(v); o=(%_DateField(this,20)); } var w=MakeDay(t,u,v); return(%DateSetValue(this,MakeDate(w,o),1)); } function DateToUTCString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))return'Invalid Date'; return E[(%_DateField(this,14))]+', ' +TwoDigitString((%_DateField(this,13)))+' ' +F[(%_DateField(this,12))]+' ' +(%_DateField(this,11))+' ' +TimeStringUTC(this)+' GMT'; } function DateGetYear(){ if(!%_IsDate(this))%_ThrowNotDateError(); return(%_DateField(this,1))-1900; } function DateSetYear(t){ if(!%_IsDate(this))%_ThrowNotDateError(); t=i(t); if((!%_IsSmi(%IS_VAR(t))&&!(t==t)))return(%DateSetValue(this,$NaN,1)); t=(0<=(%_ToInteger(t))&&(%_ToInteger(t))<=99) ?1900+(%_ToInteger(t)):t; var m=(%_DateField(this,0)+%_DateField(this,21)); var u,v,o; if((!%_IsSmi(%IS_VAR(m))&&!(m==m))){ u=0; v=1; o=0; }else{ u=(%_DateField(this,2)); v=(%_DateField(this,3)); o=(%_DateField(this,10)); } var w=MakeDay(t,u,v); return(%DateSetValue(this,MakeDate(w,o),0)); } function DateToGMTString(){ return %_CallFunction(this,DateToUTCString); } function PadInt(P,Q){ if(Q==1)return P; return P<%_MathPow(10,Q-1)?'0'+PadInt(P,Q-1):P; } function DateToISOString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var m=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(m))&&!(m==m)))throw MakeRangeError(143); var t=(%_DateField(this,11)); var R; if(t>=0&&t<=9999){ R=PadInt(t,4); }else{ if(t<0){ R="-"+PadInt(-t,6); }else{ R="+"+PadInt(t,6); } } return R+ '-'+PadInt((%_DateField(this,12))+1,2)+ '-'+PadInt((%_DateField(this,13)),2)+ 'T'+PadInt((%_DateField(this,15)),2)+ ':'+PadInt((%_DateField(this,16)),2)+ ':'+PadInt((%_DateField(this,17)),2)+ '.'+PadInt((%_DateField(this,18)),3)+ 'Z'; } function DateToJSON(S){ var T=(%_ToObject(this)); var U=(%_ToPrimitive_Number(T)); if((typeof(U)==='number')&&!(%_IsSmi(%IS_VAR(U))||((U==U)&&(U!=1/0)&&(U!=-1/0)))){ return null; } return T.toISOString(); } var V; var W=$NaN; function CheckDateCacheCurrent(){ if(!V){ V=%DateCacheVersion(); if(!V)return; } if(V[0]==W){ return; } W=V[0]; k=$NaN; l=(void 0); x.time=$NaN; x.string=null; } function CreateDate(o){ var v=new c(); v.setTime(o); return v; } %SetCode(c,DateConstructor); %FunctionSetPrototype(c,new d()); b.InstallFunctions(c,2,[ "UTC",DateUTC, "parse",DateParse, "now",DateNow ]); %AddNamedProperty(c.prototype,"constructor",c,2); b.InstallFunctions(c.prototype,2,[ "toString",DateToString, "toDateString",DateToDateString, "toTimeString",DateToTimeString, "toLocaleString",DateToLocaleString, "toLocaleDateString",DateToLocaleDateString, "toLocaleTimeString",DateToLocaleTimeString, "valueOf",DateValueOf, "getTime",DateGetTime, "getFullYear",DateGetFullYear, "getUTCFullYear",DateGetUTCFullYear, "getMonth",DateGetMonth, "getUTCMonth",DateGetUTCMonth, "getDate",DateGetDate, "getUTCDate",DateGetUTCDate, "getDay",DateGetDay, "getUTCDay",DateGetUTCDay, "getHours",DateGetHours, "getUTCHours",DateGetUTCHours, "getMinutes",DateGetMinutes, "getUTCMinutes",DateGetUTCMinutes, "getSeconds",DateGetSeconds, "getUTCSeconds",DateGetUTCSeconds, "getMilliseconds",DateGetMilliseconds, "getUTCMilliseconds",DateGetUTCMilliseconds, "getTimezoneOffset",DateGetTimezoneOffset, "setTime",DateSetTime, "setMilliseconds",DateSetMilliseconds, "setUTCMilliseconds",DateSetUTCMilliseconds, "setSeconds",DateSetSeconds, "setUTCSeconds",DateSetUTCSeconds, "setMinutes",DateSetMinutes, "setUTCMinutes",DateSetUTCMinutes, "setHours",DateSetHours, "setUTCHours",DateSetUTCHours, "setDate",DateSetDate, "setUTCDate",DateSetUTCDate, "setMonth",DateSetMonth, "setUTCMonth",DateSetUTCMonth, "setFullYear",DateSetFullYear, "setUTCFullYear",DateSetUTCFullYear, "toGMTString",DateToGMTString, "toUTCString",DateToUTCString, "getYear",DateGetYear, "setYear",DateSetYear, "toISOString",DateToISOString, "toJSON",DateToJSON ]); %InstallToContext(["create_date_fun",CreateDate]); }) regexp±c var $regexpLastMatchInfoOverride; (function(a,b){ %CheckIsBootstrapping(); var c; var d; var e=a.RegExp; var f=b.InternalPackedArray; var g; b.Import(function(h){ g=h.ToNumber; }); b.ImportFromExperimental(function(h){ c=h.FLAG_harmony_regexps; d=h.FLAG_harmony_unicode_regexps; }); var i=new f( 2, "", (void 0), 0, 0 ); $regexpLastMatchInfoOverride=null; function DoConstructRegExp(j,k,l){ if((%_IsRegExp(k))){ if(!(l===(void 0)))throw MakeTypeError(98); l=(k.global?'g':'') +(k.ignoreCase?'i':'') +(k.multiline?'m':''); if(d) l+=(k.unicode?'u':''); if(c) l+=(k.sticky?'y':''); k=k.source; } k=(k===(void 0))?'':(%_ToString(k)); l=(l===(void 0))?'':(%_ToString(l)); %RegExpInitializeAndCompile(j,k,l); } function RegExpConstructor(k,l){ if(%_IsConstructCall()){ DoConstructRegExp(this,k,l); }else{ if((%_IsRegExp(k))&&(l===(void 0))){ return k; } return new e(k,l); } } function RegExpCompileJS(k,l){ if(this==e.prototype){ throw MakeTypeError(36, 'RegExp.prototype.compile',this); } if((k===(void 0))&&%_ArgumentsLength()!=0){ DoConstructRegExp(this,'undefined',l); }else{ DoConstructRegExp(this,k,l); } } function DoRegExpExec(m,n,o){ var p=%_RegExpExec(m,n,o,i); if(p!==null)$regexpLastMatchInfoOverride=null; return p; } function RegExpExecNoTests(m,n,q){ var r=%_RegExpExec(m,n,q,i); if(r!==null){ $regexpLastMatchInfoOverride=null; var s=((r)[0])>>1; var q=r[3]; var t=r[4]; var u=%_SubString(n,q,t); var p=%_RegExpConstructResult(s,q,n); p[0]=u; if(s==1)return p; var v=3+2; for(var w=1;wn.length){ this.lastIndex=0; return null; } }else{ w=0; } var z=%_RegExpExec(this,n,w,i); if((z===null)){ this.lastIndex=0; return null; } $regexpLastMatchInfoOverride=null; if(y){ this.lastIndex=i[4]; } var s=((z)[0])>>1; var q=z[3]; var t=z[4]; var u=%_SubString(n,q,t); var p=%_RegExpConstructResult(s,q,n); p[0]=u; if(s==1)return p; var v=3+2; for(var w=1;wn.length){ this.lastIndex=0; return false; } var z=%_RegExpExec(this,n,w,i); if((z===null)){ this.lastIndex=0; return false; } $regexpLastMatchInfoOverride=null; this.lastIndex=i[4]; return true; }else{ var m=this; if(m.source.length>=3&& %_StringCharCodeAt(m.source,0)==46&& %_StringCharCodeAt(m.source,1)==42&& %_StringCharCodeAt(m.source,2)!=63){ m=TrimRegExp(m); } var z=%_RegExpExec(m,n,0,i); if((z===null)){ this.lastIndex=0; return false; } $regexpLastMatchInfoOverride=null; return true; } } function TrimRegExp(m){ if(!%_ObjectEquals(A,m)){ A=m; B= new e(%_SubString(m.source,2,m.source.length), (m.ignoreCase?m.multiline?"im":"i" :m.multiline?"m":"")); } return B; } function RegExpToString(){ if(!(%_IsRegExp(this))){ throw MakeTypeError(36, 'RegExp.prototype.toString',this); } var p='/'+this.source+'/'; if(this.global)p+='g'; if(this.ignoreCase)p+='i'; if(this.multiline)p+='m'; if(d&&this.unicode)p+='u'; if(c&&this.sticky)p+='y'; return p; } function RegExpGetLastMatch(){ if($regexpLastMatchInfoOverride!==null){ return(($regexpLastMatchInfoOverride)[0]); } var C=((i)[1]); return %_SubString(C, i[3], i[4]); } function RegExpGetLastParen(){ if($regexpLastMatchInfoOverride){ var D=$regexpLastMatchInfoOverride; if(D.length<=3)return''; return D[D.length-3]; } var E=((i)[0]); if(E<=2)return''; var C=((i)[1]); var q=i[(3+(E-2))]; var t=i[(3+(E-1))]; if(q!=-1&&t!=-1){ return %_SubString(C,q,t); } return""; } function RegExpGetLeftContext(){ var F; var G; if(!$regexpLastMatchInfoOverride){ F=i[3]; G=((i)[1]); }else{ var D=$regexpLastMatchInfoOverride; F=((D)[(D).length-2]); G=((D)[(D).length-1]); } return %_SubString(G,0,F); } function RegExpGetRightContext(){ var F; var G; if(!$regexpLastMatchInfoOverride){ F=i[4]; G=((i)[1]); }else{ var D=$regexpLastMatchInfoOverride; G=((D)[(D).length-1]); var H=((D)[0]); F=((D)[(D).length-2])+H.length; } return %_SubString(G,F,G.length); } function RegExpMakeCaptureGetter(I){ return function foo(){ if($regexpLastMatchInfoOverride){ if(I<$regexpLastMatchInfoOverride.length-2){ return(($regexpLastMatchInfoOverride)[(I)]); } return''; } var o=I*2; if(o>=((i)[0]))return''; var J=i[(3+(o))]; var K=i[(3+(o+1))]; if(J==-1||K==-1)return''; return %_SubString(((i)[1]),J,K); }; } %FunctionSetInstanceClassName(e,'RegExp'); %AddNamedProperty( e.prototype,'constructor',e,2); %SetCode(e,RegExpConstructor); b.InstallFunctions(e.prototype,2,[ "exec",RegExpExecJS, "test",RegExpTest, "toString",RegExpToString, "compile",RegExpCompileJS ]); %FunctionSetLength(e.prototype.compile,1); var L=function(){ var M=((i)[2]); return(M===(void 0))?"":M; }; var N=function(n){ ((i)[2])=(%_ToString(n)); }; %OptimizeObjectForAddingMultipleProperties(e,22); %DefineAccessorPropertyUnchecked(e,'input',L, N,4); %DefineAccessorPropertyUnchecked(e,'$_',L, N,2|4); var O=false; var P=function(){return O;}; var Q=function(R){O=R?true:false;}; %DefineAccessorPropertyUnchecked(e,'multiline',P, Q,4); %DefineAccessorPropertyUnchecked(e,'$*',P, Q, 2|4); var S=function(T){}; %DefineAccessorPropertyUnchecked(e,'lastMatch',RegExpGetLastMatch, S,4); %DefineAccessorPropertyUnchecked(e,'$&',RegExpGetLastMatch, S,2|4); %DefineAccessorPropertyUnchecked(e,'lastParen',RegExpGetLastParen, S,4); %DefineAccessorPropertyUnchecked(e,'$+',RegExpGetLastParen, S,2|4); %DefineAccessorPropertyUnchecked(e,'leftContext', RegExpGetLeftContext,S, 4); %DefineAccessorPropertyUnchecked(e,'$`',RegExpGetLeftContext, S,2|4); %DefineAccessorPropertyUnchecked(e,'rightContext', RegExpGetRightContext,S, 4); %DefineAccessorPropertyUnchecked(e,"$'",RegExpGetRightContext, S,2|4); for(var w=1;w<10;++w){ %DefineAccessorPropertyUnchecked(e,'$'+w, RegExpMakeCaptureGetter(w),S, 4); } %ToFastProperties(e); b.Export(function(U){ U.RegExpExec=DoRegExpExec; U.RegExpExecNoTests=RegExpExecNoTests; U.RegExpLastMatchInfo=i; U.RegExpTest=RegExpTest; }); }) ,arraybufferý (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.ArrayBuffer; var d=a.Object; var e; var f; var g; var h=b.ImportNow("to_string_tag_symbol"); b.Import(function(i){ e=i.MathMax; f=i.MathMin; g=i.ToNumber; }); function ArrayBufferConstructor(j){ if(%_IsConstructCall()){ var k=$toPositiveInteger(j,130); %ArrayBufferInitialize(this,k,false); }else{ throw MakeTypeError(21,"ArrayBuffer"); } } function ArrayBufferGetByteLen(){ if(!(%_ClassOf(this)==='ArrayBuffer')){ throw MakeTypeError(36, 'ArrayBuffer.prototype.byteLength',this); } return %_ArrayBufferGetByteLength(this); } function ArrayBufferSlice(l,m){ if(!(%_ClassOf(this)==='ArrayBuffer')){ throw MakeTypeError(36, 'ArrayBuffer.prototype.slice',this); } var n=(%_ToInteger(l)); if(!(m===(void 0))){ m=(%_ToInteger(m)); } var o; var p=%_ArrayBufferGetByteLength(this); if(n<0){ o=e(p+n,0); }else{ o=f(n,p); } var q=(m===(void 0))?p:m; var r; if(q<0){ r=e(p+q,0); }else{ r=f(q,p); } if(ry){ throw MakeRangeError(146); } } var A; var B; if((x===(void 0))){ if(y % 1!==0){ throw MakeRangeError(144, "byte length","Uint8Array",1); } A=y-z; B=A/1; }else{ var B=x; A=B*1; } if((z+A>y) ||(B>%_MaxSmi())){ throw MakeRangeError(145); } %_TypedArrayInitialize(u,1,v,z,A,true); } function Uint8ArrayConstructByLength(u,x){ var C=(x===(void 0))? 0:$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var D=C*1; if(D>%_TypedArrayMaxSizeInHeap()){ var v=new d(D); %_TypedArrayInitialize(u,1,v,0,D,true); }else{ %_TypedArrayInitialize(u,1,null,0,D,true); } } function Uint8ArrayConstructByArrayLike(u,E){ var x=E.length; var C=$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var F=false; var D=C*1; if(D<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(u,1,null,0,D,false); }else{ F= %TypedArrayInitializeFromArrayLike(u,1,E,C); } if(!F){ for(var G=0;Gy){ throw MakeRangeError(146); } } var A; var B; if((x===(void 0))){ if(y % 1!==0){ throw MakeRangeError(144, "byte length","Int8Array",1); } A=y-z; B=A/1; }else{ var B=x; A=B*1; } if((z+A>y) ||(B>%_MaxSmi())){ throw MakeRangeError(145); } %_TypedArrayInitialize(u,2,v,z,A,true); } function Int8ArrayConstructByLength(u,x){ var C=(x===(void 0))? 0:$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var D=C*1; if(D>%_TypedArrayMaxSizeInHeap()){ var v=new d(D); %_TypedArrayInitialize(u,2,v,0,D,true); }else{ %_TypedArrayInitialize(u,2,null,0,D,true); } } function Int8ArrayConstructByArrayLike(u,E){ var x=E.length; var C=$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var F=false; var D=C*1; if(D<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(u,2,null,0,D,false); }else{ F= %TypedArrayInitializeFromArrayLike(u,2,E,C); } if(!F){ for(var G=0;Gy){ throw MakeRangeError(146); } } var A; var B; if((x===(void 0))){ if(y % 2!==0){ throw MakeRangeError(144, "byte length","Uint16Array",2); } A=y-z; B=A/2; }else{ var B=x; A=B*2; } if((z+A>y) ||(B>%_MaxSmi())){ throw MakeRangeError(145); } %_TypedArrayInitialize(u,3,v,z,A,true); } function Uint16ArrayConstructByLength(u,x){ var C=(x===(void 0))? 0:$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var D=C*2; if(D>%_TypedArrayMaxSizeInHeap()){ var v=new d(D); %_TypedArrayInitialize(u,3,v,0,D,true); }else{ %_TypedArrayInitialize(u,3,null,0,D,true); } } function Uint16ArrayConstructByArrayLike(u,E){ var x=E.length; var C=$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var F=false; var D=C*2; if(D<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(u,3,null,0,D,false); }else{ F= %TypedArrayInitializeFromArrayLike(u,3,E,C); } if(!F){ for(var G=0;Gy){ throw MakeRangeError(146); } } var A; var B; if((x===(void 0))){ if(y % 2!==0){ throw MakeRangeError(144, "byte length","Int16Array",2); } A=y-z; B=A/2; }else{ var B=x; A=B*2; } if((z+A>y) ||(B>%_MaxSmi())){ throw MakeRangeError(145); } %_TypedArrayInitialize(u,4,v,z,A,true); } function Int16ArrayConstructByLength(u,x){ var C=(x===(void 0))? 0:$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var D=C*2; if(D>%_TypedArrayMaxSizeInHeap()){ var v=new d(D); %_TypedArrayInitialize(u,4,v,0,D,true); }else{ %_TypedArrayInitialize(u,4,null,0,D,true); } } function Int16ArrayConstructByArrayLike(u,E){ var x=E.length; var C=$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var F=false; var D=C*2; if(D<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(u,4,null,0,D,false); }else{ F= %TypedArrayInitializeFromArrayLike(u,4,E,C); } if(!F){ for(var G=0;Gy){ throw MakeRangeError(146); } } var A; var B; if((x===(void 0))){ if(y % 4!==0){ throw MakeRangeError(144, "byte length","Uint32Array",4); } A=y-z; B=A/4; }else{ var B=x; A=B*4; } if((z+A>y) ||(B>%_MaxSmi())){ throw MakeRangeError(145); } %_TypedArrayInitialize(u,5,v,z,A,true); } function Uint32ArrayConstructByLength(u,x){ var C=(x===(void 0))? 0:$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var D=C*4; if(D>%_TypedArrayMaxSizeInHeap()){ var v=new d(D); %_TypedArrayInitialize(u,5,v,0,D,true); }else{ %_TypedArrayInitialize(u,5,null,0,D,true); } } function Uint32ArrayConstructByArrayLike(u,E){ var x=E.length; var C=$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var F=false; var D=C*4; if(D<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(u,5,null,0,D,false); }else{ F= %TypedArrayInitializeFromArrayLike(u,5,E,C); } if(!F){ for(var G=0;Gy){ throw MakeRangeError(146); } } var A; var B; if((x===(void 0))){ if(y % 4!==0){ throw MakeRangeError(144, "byte length","Int32Array",4); } A=y-z; B=A/4; }else{ var B=x; A=B*4; } if((z+A>y) ||(B>%_MaxSmi())){ throw MakeRangeError(145); } %_TypedArrayInitialize(u,6,v,z,A,true); } function Int32ArrayConstructByLength(u,x){ var C=(x===(void 0))? 0:$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var D=C*4; if(D>%_TypedArrayMaxSizeInHeap()){ var v=new d(D); %_TypedArrayInitialize(u,6,v,0,D,true); }else{ %_TypedArrayInitialize(u,6,null,0,D,true); } } function Int32ArrayConstructByArrayLike(u,E){ var x=E.length; var C=$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var F=false; var D=C*4; if(D<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(u,6,null,0,D,false); }else{ F= %TypedArrayInitializeFromArrayLike(u,6,E,C); } if(!F){ for(var G=0;Gy){ throw MakeRangeError(146); } } var A; var B; if((x===(void 0))){ if(y % 4!==0){ throw MakeRangeError(144, "byte length","Float32Array",4); } A=y-z; B=A/4; }else{ var B=x; A=B*4; } if((z+A>y) ||(B>%_MaxSmi())){ throw MakeRangeError(145); } %_TypedArrayInitialize(u,7,v,z,A,true); } function Float32ArrayConstructByLength(u,x){ var C=(x===(void 0))? 0:$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var D=C*4; if(D>%_TypedArrayMaxSizeInHeap()){ var v=new d(D); %_TypedArrayInitialize(u,7,v,0,D,true); }else{ %_TypedArrayInitialize(u,7,null,0,D,true); } } function Float32ArrayConstructByArrayLike(u,E){ var x=E.length; var C=$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var F=false; var D=C*4; if(D<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(u,7,null,0,D,false); }else{ F= %TypedArrayInitializeFromArrayLike(u,7,E,C); } if(!F){ for(var G=0;Gy){ throw MakeRangeError(146); } } var A; var B; if((x===(void 0))){ if(y % 8!==0){ throw MakeRangeError(144, "byte length","Float64Array",8); } A=y-z; B=A/8; }else{ var B=x; A=B*8; } if((z+A>y) ||(B>%_MaxSmi())){ throw MakeRangeError(145); } %_TypedArrayInitialize(u,8,v,z,A,true); } function Float64ArrayConstructByLength(u,x){ var C=(x===(void 0))? 0:$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var D=C*8; if(D>%_TypedArrayMaxSizeInHeap()){ var v=new d(D); %_TypedArrayInitialize(u,8,v,0,D,true); }else{ %_TypedArrayInitialize(u,8,null,0,D,true); } } function Float64ArrayConstructByArrayLike(u,E){ var x=E.length; var C=$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var F=false; var D=C*8; if(D<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(u,8,null,0,D,false); }else{ F= %TypedArrayInitializeFromArrayLike(u,8,E,C); } if(!F){ for(var G=0;Gy){ throw MakeRangeError(146); } } var A; var B; if((x===(void 0))){ if(y % 1!==0){ throw MakeRangeError(144, "byte length","Uint8ClampedArray",1); } A=y-z; B=A/1; }else{ var B=x; A=B*1; } if((z+A>y) ||(B>%_MaxSmi())){ throw MakeRangeError(145); } %_TypedArrayInitialize(u,9,v,z,A,true); } function Uint8ClampedArrayConstructByLength(u,x){ var C=(x===(void 0))? 0:$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var D=C*1; if(D>%_TypedArrayMaxSizeInHeap()){ var v=new d(D); %_TypedArrayInitialize(u,9,v,0,D,true); }else{ %_TypedArrayInitialize(u,9,null,0,D,true); } } function Uint8ClampedArrayConstructByArrayLike(u,E){ var x=E.length; var C=$toPositiveInteger(x,145); if(C>%_MaxSmi()){ throw MakeRangeError(145); } var F=false; var D=C*1; if(D<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(u,9,null,0,D,false); }else{ F= %TypedArrayInitializeFromArrayLike(u,9,E,C); } if(!F){ for(var G=0;G0){ for(var G=0;G=ad&&ab>=ac; ae--){ W[z+ae]=X[ae]; ab-=aa; ac-=Z; } return ae; } var ae=CopyRightPart(); var af=new c(ae+1-ad); for(var G=ad;G<=ae;G++){ af[G-ad]=X[G]; } for(G=ad;G<=ae;G++){ W[z+G]=af[G-ad]; } } function TypedArraySet(u,z){ var ag=(z===(void 0))?0:(%_ToInteger(z)); if(ag<0)throw MakeTypeError(154); if(ag>%_MaxSmi()){ throw MakeRangeError(155); } switch(%TypedArraySetFastCases(this,u,ag)){ case 0: return; case 1: TypedArraySetFromOverlappingTypedArray(this,u,ag); return; case 2: TypedArraySetFromArrayLike(this,u,u.length,ag); return; case 3: var C=u.length; if((C===(void 0))){ if((typeof(u)==='number')){ throw MakeTypeError(39); } return; } C=(%ToLength(C)); if(ag+C>this.length){ throw MakeRangeError(155); } TypedArraySetFromArrayLike(this,u,C,ag); return; } } function TypedArrayGetToStringTag(){ if(!%_IsTypedArray(this))return; var ah=%_ClassOf(this); if((ah===(void 0)))return; return ah; } %SetCode(i,Uint8ArrayConstructor); %FunctionSetPrototype(i,new f()); %AddNamedProperty(i,"BYTES_PER_ELEMENT",1, 1|2|4); %AddNamedProperty(i.prototype, "constructor",a.Uint8Array,2); %AddNamedProperty(i.prototype, "BYTES_PER_ELEMENT",1, 1|2|4); b.InstallGetter(i.prototype,"buffer",Uint8Array_GetBuffer); b.InstallGetter(i.prototype,"byteOffset",Uint8Array_GetByteOffset, 2|4); b.InstallGetter(i.prototype,"byteLength",Uint8Array_GetByteLength, 2|4); b.InstallGetter(i.prototype,"length",Uint8Array_GetLength, 2|4); b.InstallGetter(i.prototype,h, TypedArrayGetToStringTag); b.InstallFunctions(i.prototype,2,[ "subarray",Uint8ArraySubArray, "set",TypedArraySet ]); %SetCode(j,Int8ArrayConstructor); %FunctionSetPrototype(j,new f()); %AddNamedProperty(j,"BYTES_PER_ELEMENT",1, 1|2|4); %AddNamedProperty(j.prototype, "constructor",a.Int8Array,2); %AddNamedProperty(j.prototype, "BYTES_PER_ELEMENT",1, 1|2|4); b.InstallGetter(j.prototype,"buffer",Int8Array_GetBuffer); b.InstallGetter(j.prototype,"byteOffset",Int8Array_GetByteOffset, 2|4); b.InstallGetter(j.prototype,"byteLength",Int8Array_GetByteLength, 2|4); b.InstallGetter(j.prototype,"length",Int8Array_GetLength, 2|4); b.InstallGetter(j.prototype,h, TypedArrayGetToStringTag); b.InstallFunctions(j.prototype,2,[ "subarray",Int8ArraySubArray, "set",TypedArraySet ]); %SetCode(k,Uint16ArrayConstructor); %FunctionSetPrototype(k,new f()); %AddNamedProperty(k,"BYTES_PER_ELEMENT",2, 1|2|4); %AddNamedProperty(k.prototype, "constructor",a.Uint16Array,2); %AddNamedProperty(k.prototype, "BYTES_PER_ELEMENT",2, 1|2|4); b.InstallGetter(k.prototype,"buffer",Uint16Array_GetBuffer); b.InstallGetter(k.prototype,"byteOffset",Uint16Array_GetByteOffset, 2|4); b.InstallGetter(k.prototype,"byteLength",Uint16Array_GetByteLength, 2|4); b.InstallGetter(k.prototype,"length",Uint16Array_GetLength, 2|4); b.InstallGetter(k.prototype,h, TypedArrayGetToStringTag); b.InstallFunctions(k.prototype,2,[ "subarray",Uint16ArraySubArray, "set",TypedArraySet ]); %SetCode(l,Int16ArrayConstructor); %FunctionSetPrototype(l,new f()); %AddNamedProperty(l,"BYTES_PER_ELEMENT",2, 1|2|4); %AddNamedProperty(l.prototype, "constructor",a.Int16Array,2); %AddNamedProperty(l.prototype, "BYTES_PER_ELEMENT",2, 1|2|4); b.InstallGetter(l.prototype,"buffer",Int16Array_GetBuffer); b.InstallGetter(l.prototype,"byteOffset",Int16Array_GetByteOffset, 2|4); b.InstallGetter(l.prototype,"byteLength",Int16Array_GetByteLength, 2|4); b.InstallGetter(l.prototype,"length",Int16Array_GetLength, 2|4); b.InstallGetter(l.prototype,h, TypedArrayGetToStringTag); b.InstallFunctions(l.prototype,2,[ "subarray",Int16ArraySubArray, "set",TypedArraySet ]); %SetCode(m,Uint32ArrayConstructor); %FunctionSetPrototype(m,new f()); %AddNamedProperty(m,"BYTES_PER_ELEMENT",4, 1|2|4); %AddNamedProperty(m.prototype, "constructor",a.Uint32Array,2); %AddNamedProperty(m.prototype, "BYTES_PER_ELEMENT",4, 1|2|4); b.InstallGetter(m.prototype,"buffer",Uint32Array_GetBuffer); b.InstallGetter(m.prototype,"byteOffset",Uint32Array_GetByteOffset, 2|4); b.InstallGetter(m.prototype,"byteLength",Uint32Array_GetByteLength, 2|4); b.InstallGetter(m.prototype,"length",Uint32Array_GetLength, 2|4); b.InstallGetter(m.prototype,h, TypedArrayGetToStringTag); b.InstallFunctions(m.prototype,2,[ "subarray",Uint32ArraySubArray, "set",TypedArraySet ]); %SetCode(n,Int32ArrayConstructor); %FunctionSetPrototype(n,new f()); %AddNamedProperty(n,"BYTES_PER_ELEMENT",4, 1|2|4); %AddNamedProperty(n.prototype, "constructor",a.Int32Array,2); %AddNamedProperty(n.prototype, "BYTES_PER_ELEMENT",4, 1|2|4); b.InstallGetter(n.prototype,"buffer",Int32Array_GetBuffer); b.InstallGetter(n.prototype,"byteOffset",Int32Array_GetByteOffset, 2|4); b.InstallGetter(n.prototype,"byteLength",Int32Array_GetByteLength, 2|4); b.InstallGetter(n.prototype,"length",Int32Array_GetLength, 2|4); b.InstallGetter(n.prototype,h, TypedArrayGetToStringTag); b.InstallFunctions(n.prototype,2,[ "subarray",Int32ArraySubArray, "set",TypedArraySet ]); %SetCode(o,Float32ArrayConstructor); %FunctionSetPrototype(o,new f()); %AddNamedProperty(o,"BYTES_PER_ELEMENT",4, 1|2|4); %AddNamedProperty(o.prototype, "constructor",a.Float32Array,2); %AddNamedProperty(o.prototype, "BYTES_PER_ELEMENT",4, 1|2|4); b.InstallGetter(o.prototype,"buffer",Float32Array_GetBuffer); b.InstallGetter(o.prototype,"byteOffset",Float32Array_GetByteOffset, 2|4); b.InstallGetter(o.prototype,"byteLength",Float32Array_GetByteLength, 2|4); b.InstallGetter(o.prototype,"length",Float32Array_GetLength, 2|4); b.InstallGetter(o.prototype,h, TypedArrayGetToStringTag); b.InstallFunctions(o.prototype,2,[ "subarray",Float32ArraySubArray, "set",TypedArraySet ]); %SetCode(p,Float64ArrayConstructor); %FunctionSetPrototype(p,new f()); %AddNamedProperty(p,"BYTES_PER_ELEMENT",8, 1|2|4); %AddNamedProperty(p.prototype, "constructor",a.Float64Array,2); %AddNamedProperty(p.prototype, "BYTES_PER_ELEMENT",8, 1|2|4); b.InstallGetter(p.prototype,"buffer",Float64Array_GetBuffer); b.InstallGetter(p.prototype,"byteOffset",Float64Array_GetByteOffset, 2|4); b.InstallGetter(p.prototype,"byteLength",Float64Array_GetByteLength, 2|4); b.InstallGetter(p.prototype,"length",Float64Array_GetLength, 2|4); b.InstallGetter(p.prototype,h, TypedArrayGetToStringTag); b.InstallFunctions(p.prototype,2,[ "subarray",Float64ArraySubArray, "set",TypedArraySet ]); %SetCode(q,Uint8ClampedArrayConstructor); %FunctionSetPrototype(q,new f()); %AddNamedProperty(q,"BYTES_PER_ELEMENT",1, 1|2|4); %AddNamedProperty(q.prototype, "constructor",a.Uint8ClampedArray,2); %AddNamedProperty(q.prototype, "BYTES_PER_ELEMENT",1, 1|2|4); b.InstallGetter(q.prototype,"buffer",Uint8ClampedArray_GetBuffer); b.InstallGetter(q.prototype,"byteOffset",Uint8ClampedArray_GetByteOffset, 2|4); b.InstallGetter(q.prototype,"byteLength",Uint8ClampedArray_GetByteLength, 2|4); b.InstallGetter(q.prototype,"length",Uint8ClampedArray_GetLength, 2|4); b.InstallGetter(q.prototype,h, TypedArrayGetToStringTag); b.InstallFunctions(q.prototype,2,[ "subarray",Uint8ClampedArraySubArray, "set",TypedArraySet ]); function DataViewConstructor(v,w,D){ if(%_IsConstructCall()){ if(!(%_ClassOf(v)==='ArrayBuffer'))throw MakeTypeError(23); if(!(w===(void 0))){ w=$toPositiveInteger(w,137); } if(!(D===(void 0))){ D=(%_ToInteger(D)); } var y=%_ArrayBufferGetByteLength(v); var z=(w===(void 0))?0:w; if(z>y)throw MakeRangeError(137); var x=(D===(void 0)) ?y-z :D; if(x<0||z+x>y){ throw new MakeRangeError(136); } %_DataViewInitialize(this,v,z,x); }else{ throw MakeTypeError(21,"DataView"); } } function DataViewGetBufferJS(){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36,'DataView.buffer',this); } return %DataViewGetBuffer(this); } function DataViewGetByteOffset(){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.byteOffset',this); } return %_ArrayBufferViewGetByteOffset(this); } function DataViewGetByteLength(){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.byteLength',this); } return %_ArrayBufferViewGetByteLength(this); } function DataViewGetInt8JS(z,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.getInt8',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(39); z=$toPositiveInteger(z,135); return %DataViewGetInt8(this,z,!!ai); } function DataViewSetInt8JS(z,M,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.setInt8',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(39); z=$toPositiveInteger(z,135); %DataViewSetInt8(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); } function DataViewGetUint8JS(z,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.getUint8',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(39); z=$toPositiveInteger(z,135); return %DataViewGetUint8(this,z,!!ai); } function DataViewSetUint8JS(z,M,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.setUint8',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(39); z=$toPositiveInteger(z,135); %DataViewSetUint8(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); } function DataViewGetInt16JS(z,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.getInt16',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(39); z=$toPositiveInteger(z,135); return %DataViewGetInt16(this,z,!!ai); } function DataViewSetInt16JS(z,M,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.setInt16',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(39); z=$toPositiveInteger(z,135); %DataViewSetInt16(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); } function DataViewGetUint16JS(z,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.getUint16',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(39); z=$toPositiveInteger(z,135); return %DataViewGetUint16(this,z,!!ai); } function DataViewSetUint16JS(z,M,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.setUint16',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(39); z=$toPositiveInteger(z,135); %DataViewSetUint16(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); } function DataViewGetInt32JS(z,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.getInt32',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(39); z=$toPositiveInteger(z,135); return %DataViewGetInt32(this,z,!!ai); } function DataViewSetInt32JS(z,M,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.setInt32',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(39); z=$toPositiveInteger(z,135); %DataViewSetInt32(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); } function DataViewGetUint32JS(z,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.getUint32',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(39); z=$toPositiveInteger(z,135); return %DataViewGetUint32(this,z,!!ai); } function DataViewSetUint32JS(z,M,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.setUint32',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(39); z=$toPositiveInteger(z,135); %DataViewSetUint32(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); } function DataViewGetFloat32JS(z,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.getFloat32',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(39); z=$toPositiveInteger(z,135); return %DataViewGetFloat32(this,z,!!ai); } function DataViewSetFloat32JS(z,M,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.setFloat32',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(39); z=$toPositiveInteger(z,135); %DataViewSetFloat32(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); } function DataViewGetFloat64JS(z,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.getFloat64',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(39); z=$toPositiveInteger(z,135); return %DataViewGetFloat64(this,z,!!ai); } function DataViewSetFloat64JS(z,M,ai){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(36, 'DataView.setFloat64',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(39); z=$toPositiveInteger(z,135); %DataViewSetFloat64(this,z,((typeof(%IS_VAR(M))==='number')?M:$nonNumberToNumber(M)),!!ai); } %SetCode(e,DataViewConstructor); %FunctionSetPrototype(e,new f); %AddNamedProperty(e.prototype,"constructor",e, 2); %AddNamedProperty(e.prototype,h,"DataView", 1|2); b.InstallGetter(e.prototype,"buffer",DataViewGetBufferJS); b.InstallGetter(e.prototype,"byteOffset", DataViewGetByteOffset); b.InstallGetter(e.prototype,"byteLength", DataViewGetByteLength); b.InstallFunctions(e.prototype,2,[ "getInt8",DataViewGetInt8JS, "setInt8",DataViewSetInt8JS, "getUint8",DataViewGetUint8JS, "setUint8",DataViewSetUint8JS, "getInt16",DataViewGetInt16JS, "setInt16",DataViewSetInt16JS, "getUint16",DataViewGetUint16JS, "setUint16",DataViewSetUint16JS, "getInt32",DataViewGetInt32JS, "setInt32",DataViewSetInt32JS, "getUint32",DataViewGetUint32JS, "setUint32",DataViewSetUint32JS, "getFloat32",DataViewGetFloat32JS, "setFloat32",DataViewSetFloat32JS, "getFloat64",DataViewGetFloat64JS, "setFloat64",DataViewSetFloat64JS ]); }) Hiterator-prototypeÕ var $iteratorPrototype; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Object; var d=b.ImportNow("iterator_symbol"); function IteratorPrototypeIterator(){ return this; } b.SetFunctionName(IteratorPrototypeIterator,d); %AddNamedProperty($iteratorPrototype,d, IteratorPrototypeIterator,2); }) $generator  (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Function; var d; var e=b.ImportNow("to_string_tag_symbol"); b.Import(function(f){ d=f.NewFunctionString; }); function GeneratorObjectNext(g){ if(!(%_ClassOf(this)==='Generator')){ throw MakeTypeError(36, '[Generator].prototype.next',this); } var h=%GeneratorGetContinuation(this); if(h>0){ if((%_DebugIsActive()!=0))%DebugPrepareStepInIfStepping(this); try{ return %_GeneratorNext(this,g); }catch(e){ %GeneratorClose(this); throw e; } }else if(h==0){ return{value:void 0,done:true}; }else{ throw MakeTypeError(34); } } function GeneratorObjectThrow(i){ if(!(%_ClassOf(this)==='Generator')){ throw MakeTypeError(36, '[Generator].prototype.throw',this); } var h=%GeneratorGetContinuation(this); if(h>0){ try{ return %_GeneratorThrow(this,i); }catch(e){ %GeneratorClose(this); throw e; } }else if(h==0){ throw i; }else{ throw MakeTypeError(34); } } function GeneratorFunctionConstructor(j){ var k=d(arguments,'function*'); var l=%GlobalProxy(GeneratorFunctionConstructor); var m=%_CallFunction(l,%CompileString(k,true)); %FunctionMarkNameShouldPrintAsAnonymous(m); return m; } %NeverOptimizeFunction(GeneratorObjectNext); %NeverOptimizeFunction(GeneratorObjectThrow); var n=GeneratorFunctionPrototype.prototype; b.InstallFunctions(n, 2, ["next",GeneratorObjectNext, "throw",GeneratorObjectThrow]); %AddNamedProperty(n,"constructor", GeneratorFunctionPrototype,2|1); %AddNamedProperty(n, e,"Generator",2|1); %InternalSetPrototype(GeneratorFunctionPrototype,c.prototype); %AddNamedProperty(GeneratorFunctionPrototype, e,"GeneratorFunction",2|1); %AddNamedProperty(GeneratorFunctionPrototype,"constructor", GeneratorFunction,2|1); %InternalSetPrototype(GeneratorFunction,c); %SetCode(GeneratorFunction,GeneratorFunctionConstructor); }) 8object-observe³ var $observeEnqueueSpliceRecord; var $observeBeginPerformSplice; var $observeEndPerformSplice; var $observeObjectMethods; var $observeArrayMethods; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Array; var d=a.Object; var e=b.InternalArray; var f; var g; b.Import(function(h){ f=h.ObjectFreeze; g=h.ObjectIsFrozen; }); var i; var j={}; function GetObservationStateJS(){ if((i===(void 0))){ i=%GetObservationState(); } if((i.callbackInfoMap===(void 0))){ i.callbackInfoMap=%ObservationWeakMapCreate(); i.objectInfoMap=%ObservationWeakMapCreate(); i.notifierObjectInfoMap=%ObservationWeakMapCreate(); i.pendingObservers=null; i.nextCallbackPriority=0; i.lastMicrotaskId=0; } return i; } function GetPendingObservers(){ return GetObservationStateJS().pendingObservers; } function SetPendingObservers(k){ GetObservationStateJS().pendingObservers=k; } function GetNextCallbackPriority(){ return GetObservationStateJS().nextCallbackPriority++; } function nullProtoObject(){ return{__proto__:null}; } function TypeMapCreate(){ return nullProtoObject(); } function TypeMapAddType(l,m,n){ l[m]=n?1:(l[m]||0)+1; } function TypeMapRemoveType(l,m){ l[m]--; } function TypeMapCreateFromList(o,p){ var l=TypeMapCreate(); for(var q=0;q0?y.performing:null; } function ConvertAcceptListToTypeMap(E){ if((E===(void 0))) return E; if(!(%_IsSpecObject(E)))throw MakeTypeError(72); var F=(%_ToInteger(E.length)); if(F<0)F=0; return TypeMapCreateFromList(E,F); } function CallbackInfoGet(v){ return %WeakCollectionGet(GetObservationStateJS().callbackInfoMap,v, $getHash(v)); } function CallbackInfoSet(v,C){ %WeakCollectionSet(GetObservationStateJS().callbackInfoMap, v,C,$getHash(v)); } function CallbackInfoGetOrCreate(v){ var C=CallbackInfoGet(v); if(!(C===(void 0))) return C; var D=GetNextCallbackPriority(); CallbackInfoSet(v,D); return D; } function CallbackInfoGetPriority(C){ if((typeof(C)==='number')) return C; else return C.priority; } function CallbackInfoNormalize(v){ var C=CallbackInfoGet(v); if((typeof(C)==='number')){ var D=C; C=new e; C.priority=D; CallbackInfoSet(v,C); } return C; } function ObjectObserve(z,v,w){ if(!(%_IsSpecObject(z))) throw MakeTypeError(74,"observe","observe"); if(%IsJSGlobalProxy(z)) throw MakeTypeError(70,"observe"); if(%IsAccessCheckNeeded(z)) throw MakeTypeError(71,"observe"); if(!(typeof(v)==='function')) throw MakeTypeError(73,"observe"); if(g(v)) throw MakeTypeError(69); var G=%GetObjectContextObjectObserve(z); return G(z,v,w); } function NativeObjectObserve(z,v,w){ var y=ObjectInfoGetOrCreate(z); var o=ConvertAcceptListToTypeMap(w); ObjectInfoAddObserver(y,v,o); return z; } function ObjectUnobserve(z,v){ if(!(%_IsSpecObject(z))) throw MakeTypeError(74,"unobserve","unobserve"); if(%IsJSGlobalProxy(z)) throw MakeTypeError(70,"unobserve"); if(!(typeof(v)==='function')) throw MakeTypeError(73,"unobserve"); var y=ObjectInfoGet(z); if((y===(void 0))) return z; ObjectInfoRemoveObserver(y,v); return z; } function ArrayObserve(z,v){ return ObjectObserve(z,v,['add', 'update', 'delete', 'splice']); } function ArrayUnobserve(z,v){ return ObjectUnobserve(z,v); } function ObserverEnqueueIfActive(x,y,H){ if(!ObserverIsActive(x,y)|| !TypeMapHasType(ObserverGetAcceptTypes(x),H.type)){ return; } var v=ObserverGetCallback(x); if(!%ObserverObjectAndRecordHaveSameOrigin(v,H.object, H)){ return; } var C=CallbackInfoNormalize(v); if((GetPendingObservers()===null)){ SetPendingObservers(nullProtoObject()); if((%_DebugIsActive()!=0)){ var I=++GetObservationStateJS().lastMicrotaskId; var J="Object.observe"; %EnqueueMicrotask(function(){ %DebugAsyncTaskEvent({type:"willHandle",id:I,name:J}); ObserveMicrotaskRunner(); %DebugAsyncTaskEvent({type:"didHandle",id:I,name:J}); }); %DebugAsyncTaskEvent({type:"enqueue",id:I,name:J}); }else{ %EnqueueMicrotask(ObserveMicrotaskRunner); } } GetPendingObservers()[C.priority]=v; C.push(H); } function ObjectInfoEnqueueExternalChangeRecord(y,H,m){ if(!ObjectInfoHasActiveObservers(y)) return; var K=!(m===(void 0)); var L=K? {object:y.object,type:m}: {object:y.object}; for(var M in H){ if(M==='object'||(K&&M==='type'))continue; %DefineDataPropertyUnchecked( L,M,H[M],1+4); } f(L); ObjectInfoEnqueueInternalChangeRecord(y,L); } function ObjectInfoEnqueueInternalChangeRecord(y,H){ if((typeof(H.name)==='symbol'))return; if(ChangeObserversIsOptimized(y.changeObservers)){ var x=y.changeObservers; ObserverEnqueueIfActive(x,y,H); return; } for(var D in y.changeObservers){ var x=y.changeObservers[D]; if((x===null)) continue; ObserverEnqueueIfActive(x,y,H); } } function BeginPerformSplice(N){ var y=ObjectInfoGet(N); if(!(y===(void 0))) ObjectInfoAddPerformingType(y,'splice'); } function EndPerformSplice(N){ var y=ObjectInfoGet(N); if(!(y===(void 0))) ObjectInfoRemovePerformingType(y,'splice'); } function EnqueueSpliceRecord(N,O,P,Q){ var y=ObjectInfoGet(N); if(!ObjectInfoHasActiveObservers(y)) return; var H={ type:'splice', object:N, index:O, removed:P, addedCount:Q }; f(H); f(H.removed); ObjectInfoEnqueueInternalChangeRecord(y,H); } function NotifyChange(m,z,J,R){ var y=ObjectInfoGet(z); if(!ObjectInfoHasActiveObservers(y)) return; var H; if(arguments.length==2){ H={type:m,object:z}; }else if(arguments.length==3){ H={type:m,object:z,name:J}; }else{ H={ type:m, object:z, name:J, oldValue:R }; } f(H); ObjectInfoEnqueueInternalChangeRecord(y,H); } function ObjectNotifierNotify(H){ if(!(%_IsSpecObject(this))) throw MakeTypeError(14,"notify"); var y=ObjectInfoGetFromNotifier(this); if((y===(void 0))) throw MakeTypeError(75); if(!(typeof(H.type)==='string')) throw MakeTypeError(78); ObjectInfoEnqueueExternalChangeRecord(y,H); } function ObjectNotifierPerformChange(S,T){ if(!(%_IsSpecObject(this))) throw MakeTypeError(14,"performChange"); var y=ObjectInfoGetFromNotifier(this); if((y===(void 0))) throw MakeTypeError(75); if(!(typeof(S)==='string')) throw MakeTypeError(77); if(!(typeof(T)==='function')) throw MakeTypeError(76); var U=%GetObjectContextNotifierPerformChange(y); U(y,S,T); } function NativeObjectNotifierPerformChange(y,S,T){ ObjectInfoAddPerformingType(y,S); var H; try{ H=T(); }finally{ ObjectInfoRemovePerformingType(y,S); } if((%_IsSpecObject(H))) ObjectInfoEnqueueExternalChangeRecord(y,H,S); } function ObjectGetNotifier(z){ if(!(%_IsSpecObject(z))) throw MakeTypeError(74,"getNotifier","getNotifier"); if(%IsJSGlobalProxy(z)) throw MakeTypeError(70,"getNotifier"); if(%IsAccessCheckNeeded(z)) throw MakeTypeError(71,"getNotifier"); if(g(z))return null; if(!%ObjectWasCreatedInCurrentOrigin(z))return null; var V=%GetObjectContextObjectGetNotifier(z); return V(z); } function NativeObjectGetNotifier(z){ var y=ObjectInfoGetOrCreate(z); return ObjectInfoGetNotifier(y); } function CallbackDeliverPending(v){ var C=CallbackInfoGet(v); if((C===(void 0))||(typeof(C)==='number')) return false; var D=C.priority; CallbackInfoSet(v,D); var k=GetPendingObservers(); if(!(k===null)) delete k[D]; var W=[]; %MoveArrayContents(C,W); %DeliverObservationChangeRecords(v,W); return true; } function ObjectDeliverChangeRecords(v){ if(!(typeof(v)==='function')) throw MakeTypeError(73,"deliverChangeRecords"); while(CallbackDeliverPending(v)){} } function ObserveMicrotaskRunner(){ var k=GetPendingObservers(); if(!(k===null)){ SetPendingObservers(null); for(var q in k){ CallbackDeliverPending(k[q]); } } } b.InstallFunctions(j,2,[ "notify",ObjectNotifierNotify, "performChange",ObjectNotifierPerformChange ]); $observeObjectMethods=[ "deliverChangeRecords",ObjectDeliverChangeRecords, "getNotifier",ObjectGetNotifier, "observe",ObjectObserve, "unobserve",ObjectUnobserve ]; $observeArrayMethods=[ "observe",ArrayObserve, "unobserve",ArrayUnobserve ]; var X=function(Y,q){ if(q % 2===1)%FunctionRemovePrototype(Y); }; $observeObjectMethods.forEach(X); $observeArrayMethods.forEach(X); $observeEnqueueSpliceRecord=EnqueueSpliceRecord; $observeBeginPerformSplice=BeginPerformSplice; $observeEndPerformSplice=EndPerformSplice; %InstallToContext([ "native_object_get_notifier",NativeObjectGetNotifier, "native_object_notifier_perform_change",NativeObjectNotifierPerformChange, "native_object_observe",NativeObjectObserve, "observers_begin_perform_splice",BeginPerformSplice, "observers_end_perform_splice",EndPerformSplice, "observers_enqueue_splice",EnqueueSpliceRecord, "observers_notify_change",NotifyChange, ]); }) (collection½ˆ var $getHash; var $getExistingHash; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Map; var d=a.Object; var e=a.Set; var f=b.ImportNow("hash_code_symbol"); var g; var h=b.ImportNow("to_string_tag_symbol"); b.Import(function(i){ g=i.IntRandom; }); var j; b.Import(function(i){ j=i.NumberIsNaN; }); function HashToEntry(k,l,m){ var n=(l&((m)-1)); return((%_FixedArrayGet(k,(3+(n))|0))); } %SetForceInlineFlag(HashToEntry); function SetFindEntry(k,m,o,l){ var p=HashToEntry(k,l,m); if(p===-1)return p; var q=((%_FixedArrayGet(k,((3+(m)+((p)<<1)))|0))); if(o===q)return p; var r=j(o); while(true){ if(r&&j(q)){ return p; } p=((%_FixedArrayGet(k,((3+(m)+((p)<<1))+1)|0))); if(p===-1)return p; q=((%_FixedArrayGet(k,((3+(m)+((p)<<1)))|0))); if(o===q)return p; } return-1; } %SetForceInlineFlag(SetFindEntry); function MapFindEntry(k,m,o,l){ var p=HashToEntry(k,l,m); if(p===-1)return p; var q=((%_FixedArrayGet(k,((3+(m)+((p)*3)))|0))); if(o===q)return p; var r=j(o); while(true){ if(r&&j(q)){ return p; } p=((%_FixedArrayGet(k,((3+(m)+((p)*3))+2)|0))); if(p===-1)return p; q=((%_FixedArrayGet(k,((3+(m)+((p)*3)))|0))); if(o===q)return p; } return-1; } %SetForceInlineFlag(MapFindEntry); function ComputeIntegerHash(o,s){ var l=o; l=l^s; l=~l+(l<<15); l=l^(l>>>12); l=l+(l<<2); l=l^(l>>>4); l=(l*2057)|0; l=l^(l>>>16); return l&0x3fffffff; } %SetForceInlineFlag(ComputeIntegerHash); function GetExistingHash(o){ if(%_IsSmi(o)){ return ComputeIntegerHash(o,0); } if((typeof(o)==='string')){ var t=%_StringGetRawHashField(o); if((t&1)===0){ return t>>>2; } }else if((%_IsSpecObject(o))&&!%_IsJSProxy(o)&&!(%_ClassOf(o)==='global')){ var l=(o[f]); return l; } return %GenericHash(o); } %SetForceInlineFlag(GetExistingHash); function GetHash(o){ var l=GetExistingHash(o); if((l===(void 0))){ l=g()|0; if(l===0)l=1; (o[f]=l); } return l; } %SetForceInlineFlag(GetHash); function SetConstructor(u){ if(!%_IsConstructCall()){ throw MakeTypeError(21,"Set"); } %_SetInitialize(this); if(!(u==null)){ var v=this.add; if(!(typeof(v)==='function')){ throw MakeTypeError(82,'add',this); } for(var w of u){ %_Call(v,this,w); } } } function SetAdd(o){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(36,'Set.prototype.add',this); } if(o===0){ o=0; } var k=%_JSCollectionGetTable(this); var m=((%_FixedArrayGet(k,(0)|0))); var l=GetHash(o); if(SetFindEntry(k,m,o,l)!==-1)return this; var x=((%_FixedArrayGet(k,(1)|0))); var y=((%_FixedArrayGet(k,(2)|0))); var z=m<<1; if((x+y)>=z){ %SetGrow(this); k=%_JSCollectionGetTable(this); m=((%_FixedArrayGet(k,(0)|0))); x=((%_FixedArrayGet(k,(1)|0))); y=((%_FixedArrayGet(k,(2)|0))); } var p=x+y; var A=(3+(m)+((p)<<1)); var n=(l&((m)-1)); var B=((%_FixedArrayGet(k,(3+(n))|0))); ((%_FixedArraySet(k,(3+(n))|0,p))); (((%_FixedArraySet(k,(1)|0,(x+1)|0)))); (%_FixedArraySet(k,(A)|0,o)); ((%_FixedArraySet(k,(A+1)|0,(B)|0))); return this; } function SetHas(o){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(36,'Set.prototype.has',this); } var k=%_JSCollectionGetTable(this); var m=((%_FixedArrayGet(k,(0)|0))); var l=GetExistingHash(o); if((l===(void 0)))return false; return SetFindEntry(k,m,o,l)!==-1; } function SetDelete(o){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(36, 'Set.prototype.delete',this); } var k=%_JSCollectionGetTable(this); var m=((%_FixedArrayGet(k,(0)|0))); var l=GetExistingHash(o); if((l===(void 0)))return false; var p=SetFindEntry(k,m,o,l); if(p===-1)return false; var x=((%_FixedArrayGet(k,(1)|0)))-1; var y=((%_FixedArrayGet(k,(2)|0)))+1; var A=(3+(m)+((p)<<1)); (%_FixedArraySet(k,(A)|0,%_TheHole())); (((%_FixedArraySet(k,(1)|0,(x)|0)))); (((%_FixedArraySet(k,(2)|0,(y)|0)))); if(x<(m>>>1))%SetShrink(this); return true; } function SetGetSize(){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(36, 'Set.prototype.size',this); } var k=%_JSCollectionGetTable(this); return((%_FixedArrayGet(k,(1)|0))); } function SetClearJS(){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(36, 'Set.prototype.clear',this); } %_SetClear(this); } function SetForEach(C,D){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(36, 'Set.prototype.forEach',this); } if(!(typeof(C)==='function'))throw MakeTypeError(13,C); var E=new SetIterator(this,2); var o; var F=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(C); var G=[(void 0)]; while(%SetIteratorNext(E,G)){ if(F)%DebugPrepareStepInIfStepping(C); o=G[0]; %_Call(C,D,o,o,this); } } %SetCode(e,SetConstructor); %FunctionSetLength(e,0); %FunctionSetPrototype(e,new d()); %AddNamedProperty(e.prototype,"constructor",e,2); %AddNamedProperty(e.prototype,h,"Set", 2|1); %FunctionSetLength(SetForEach,1); b.InstallGetter(e.prototype,"size",SetGetSize); b.InstallFunctions(e.prototype,2,[ "add",SetAdd, "has",SetHas, "delete",SetDelete, "clear",SetClearJS, "forEach",SetForEach ]); function MapConstructor(u){ if(!%_IsConstructCall()){ throw MakeTypeError(21,"Map"); } %_MapInitialize(this); if(!(u==null)){ var v=this.set; if(!(typeof(v)==='function')){ throw MakeTypeError(82,'set',this); } for(var H of u){ if(!(%_IsSpecObject(H))){ throw MakeTypeError(42,H); } %_Call(v,this,H[0],H[1]); } } } function MapGet(o){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(36, 'Map.prototype.get',this); } var k=%_JSCollectionGetTable(this); var m=((%_FixedArrayGet(k,(0)|0))); var l=GetExistingHash(o); if((l===(void 0)))return(void 0); var p=MapFindEntry(k,m,o,l); if(p===-1)return(void 0); return((%_FixedArrayGet(k,((3+(m)+((p)*3))+1)|0))); } function MapSet(o,w){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(36, 'Map.prototype.set',this); } if(o===0){ o=0; } var k=%_JSCollectionGetTable(this); var m=((%_FixedArrayGet(k,(0)|0))); var l=GetHash(o); var p=MapFindEntry(k,m,o,l); if(p!==-1){ var I=(3+(m)+((p)*3)); (%_FixedArraySet(k,(I+1)|0,w)); return this; } var x=((%_FixedArrayGet(k,(1)|0))); var y=((%_FixedArrayGet(k,(2)|0))); var z=m<<1; if((x+y)>=z){ %MapGrow(this); k=%_JSCollectionGetTable(this); m=((%_FixedArrayGet(k,(0)|0))); x=((%_FixedArrayGet(k,(1)|0))); y=((%_FixedArrayGet(k,(2)|0))); } p=x+y; var A=(3+(m)+((p)*3)); var n=(l&((m)-1)); var B=((%_FixedArrayGet(k,(3+(n))|0))); ((%_FixedArraySet(k,(3+(n))|0,p))); (((%_FixedArraySet(k,(1)|0,(x+1)|0)))); (%_FixedArraySet(k,(A)|0,o)); (%_FixedArraySet(k,(A+1)|0,w)); (%_FixedArraySet(k,(A+2)|0,B)); return this; } function MapHas(o){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(36, 'Map.prototype.has',this); } var k=%_JSCollectionGetTable(this); var m=((%_FixedArrayGet(k,(0)|0))); var l=GetHash(o); return MapFindEntry(k,m,o,l)!==-1; } function MapDelete(o){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(36, 'Map.prototype.delete',this); } var k=%_JSCollectionGetTable(this); var m=((%_FixedArrayGet(k,(0)|0))); var l=GetHash(o); var p=MapFindEntry(k,m,o,l); if(p===-1)return false; var x=((%_FixedArrayGet(k,(1)|0)))-1; var y=((%_FixedArrayGet(k,(2)|0)))+1; var A=(3+(m)+((p)*3)); (%_FixedArraySet(k,(A)|0,%_TheHole())); (%_FixedArraySet(k,(A+1)|0,%_TheHole())); (((%_FixedArraySet(k,(1)|0,(x)|0)))); (((%_FixedArraySet(k,(2)|0,(y)|0)))); if(x<(m>>>1))%MapShrink(this); return true; } function MapGetSize(){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(36, 'Map.prototype.size',this); } var k=%_JSCollectionGetTable(this); return((%_FixedArrayGet(k,(1)|0))); } function MapClearJS(){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(36, 'Map.prototype.clear',this); } %_MapClear(this); } function MapForEach(C,D){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(36, 'Map.prototype.forEach',this); } if(!(typeof(C)==='function'))throw MakeTypeError(13,C); var E=new MapIterator(this,3); var F=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(C); var G=[(void 0),(void 0)]; while(%MapIteratorNext(E,G)){ if(F)%DebugPrepareStepInIfStepping(C); %_Call(C,D,G[1],G[0],this); } } %SetCode(c,MapConstructor); %FunctionSetLength(c,0); %FunctionSetPrototype(c,new d()); %AddNamedProperty(c.prototype,"constructor",c,2); %AddNamedProperty( c.prototype,h,"Map",2|1); %FunctionSetLength(MapForEach,1); b.InstallGetter(c.prototype,"size",MapGetSize); b.InstallFunctions(c.prototype,2,[ "get",MapGet, "set",MapSet, "has",MapHas, "delete",MapDelete, "clear",MapClearJS, "forEach",MapForEach ]); $getHash=GetHash; $getExistingHash=GetExistingHash; function MapFromArray(J){ var K=new c; var L=J.length; for(var M=0;M0?"Promise.resolve":"Promise.reject"; %DebugAsyncTaskEvent({type:"enqueue",id:C,name:D}); } } function PromiseIdResolveHandler(p){return p} function PromiseIdRejectHandler(q){throw q} function PromiseNopResolver(){} function IsPromise(p){ return(%_IsSpecObject(p))&&(!(p[i]===(void 0))); } function PromiseCreate(){ return new m(PromiseNopResolver) } function PromiseResolve(o,p){ PromiseDone(o,+1,p,g) } function PromiseReject(o,q){ if((o[i])==0){ var G=(%_DebugIsActive()!=0); if(G|| !(!(o[e]===(void 0)))){ %PromiseRejectEvent(o,q,G); } } PromiseDone(o,-1,q,f) } function PromiseDeferred(){ if(this===m){ var o=PromiseInit(new m(h)); return{ promise:o, resolve:function(p){PromiseResolve(o,p)}, reject:function(q){PromiseReject(o,q)} }; }else{ var B={promise:(void 0),reject:(void 0),resolve:(void 0)}; B.promise=new this(function(H,I){ B.resolve=H; B.reject=I; }); return B; } } function PromiseResolved(p){ if(this===m){ return PromiseCreateAndSet(+1,p); }else{ return new this(function(H,I){H(p)}); } } function PromiseRejected(q){ var o; if(this===m){ o=PromiseCreateAndSet(-1,q); %PromiseRejectEvent(o,q,false); }else{ o=new this(function(H,I){I(q)}); } return o; } function PromiseChain(t,u){ t=(t===(void 0))?PromiseIdResolveHandler:t; u=(u===(void 0))?PromiseIdRejectHandler:u; var z=%_CallFunction(this.constructor,PromiseDeferred); switch((this[i])){ case(void 0): throw MakeTypeError(54,this); case 0: (this[g]).push(t,z); (this[f]).push(u,z); break; case+1: PromiseEnqueue((this[j]), [t,z], +1); break; case-1: if(!(!(this[e]===(void 0)))){ %PromiseRevokeReject(this); } PromiseEnqueue((this[j]), [u,z], -1); break; } (this[e]=true); if((%_DebugIsActive()!=0)){ %DebugPromiseEvent({promise:z.promise,parentPromise:this}); } return z.promise; } function PromiseCatch(u){ return this.then((void 0),u); } function PromiseThen(t,u){ t=(typeof(t)==='function')?t:PromiseIdResolveHandler; u=(typeof(u)==='function')?u:PromiseIdRejectHandler; var J=this; var x=this.constructor; return %_CallFunction( this, function(p){ p=PromiseCoerce(x,p); if(p===J){ if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(u)))%DebugPrepareStepInIfStepping(u); return u(MakeTypeError(80,p)); }else if(IsPromise(p)){ return p.then(t,u); }else{ if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(t)))%DebugPrepareStepInIfStepping(t); return t(p); } }, u, PromiseChain ); } function PromiseCast(p){ return IsPromise(p)?p:new this(function(H){H(p)}); } function PromiseAll(K){ var z=%_CallFunction(this,PromiseDeferred); var L=[]; try{ var M=0; var F=0; for(var s of K){ this.resolve(s).then( (function(F){ return function(p){ L[F]=p; if(--M===0)z.resolve(L); } })(F), function(q){z.reject(q);}); ++F; ++M; } if(M===0){ z.resolve(L); } }catch(e){ z.reject(e) } return z.promise; } function PromiseRace(K){ var z=%_CallFunction(this,PromiseDeferred); try{ for(var s of K){ this.resolve(s).then( function(p){z.resolve(p)}, function(q){z.reject(q)}); } }catch(e){ z.reject(e) } return z.promise; } function PromiseHasUserDefinedRejectHandlerRecursive(o){ var N=(o[f]); if((N===(void 0)))return false; for(var F=0;F128){ M=%_SubString(M,0,111)+"......"+ %_SubString(M,M.length-2,M.length); } return M; } if((typeof(L)==='symbol'))return %_CallFunction(L,z); if((%_IsSimdValue(L))){ switch(typeof(L)){ case'float32x4':return %_CallFunction(L,k); case'int32x4':return %_CallFunction(L,p); case'int16x8':return %_CallFunction(L,o); case'int8x16':return %_CallFunction(L,q); case'uint32x4':return %_CallFunction(L,B); case'uint16x8':return %_CallFunction(L,A); case'uint8x16':return %_CallFunction(L,C); case'bool32x4':return %_CallFunction(L,e); case'bool16x8':return %_CallFunction(L,d); case'bool8x16':return %_CallFunction(L,f); } } if((typeof(L)==='object') &&%GetDataProperty(L,"toString")===u){ var N=%GetDataProperty(L,"constructor"); if(typeof N=="function"){ var O=N.name; if((typeof(O)==='string')&&O!==""){ return"#<"+O+">"; } } } if(CanBeSafelyTreatedAsAnErrorObject(L)){ return %_CallFunction(L,ErrorToString); } return %_CallFunction(L,NoSideEffectsObjectToString); } function CanBeSafelyTreatedAsAnErrorObject(L){ switch(%_ClassOf(L)){ case'Error': case'EvalError': case'RangeError': case'ReferenceError': case'SyntaxError': case'TypeError': case'URIError': return true; } var P=%GetDataProperty(L,"toString"); return L instanceof E&&P===ErrorToString; } function ToStringCheckErrorObject(L){ if(CanBeSafelyTreatedAsAnErrorObject(L)){ return %_CallFunction(L,ErrorToString); }else{ return(%_ToString(L)); } } function ToDetailString(L){ if(L!=null&&(typeof(L)==='object')&&L.toString===u){ var N=L.constructor; if(typeof N=="function"){ var O=N.name; if((typeof(O)==='string')&&O!==""){ return"#<"+O+">"; } } } return ToStringCheckErrorObject(L); } function MakeGenericError(N,Q,R,S,T){ var U=new N(FormatMessage(Q,R,S,T)); U[s]=true; return U; } %FunctionSetInstanceClassName(Script,'Script'); %AddNamedProperty(Script.prototype,'constructor',Script, 2|4|1); %SetCode(Script,function(V){ throw MakeError(6); }); function FormatMessage(Q,R,S,T){ var R=NoSideEffectToString(R); var S=NoSideEffectToString(S); var T=NoSideEffectToString(T); try{ return %FormatMessageString(Q,R,S,T); }catch(e){ return""; } } function GetLineNumber(W){ var X=%MessageGetStartPosition(W); if(X==-1)return 0; var Y=%MessageGetScript(W); var Z=Y.locationFromPosition(X,true); if(Z==null)return 0; return Z.line+1; } function GetColumnNumber(W){ var Y=%MessageGetScript(W); var X=%MessageGetStartPosition(W); var Z=Y.locationFromPosition(X,true); if(Z==null)return-1; return Z.column; } function GetSourceLine(W){ var Y=%MessageGetScript(W); var X=%MessageGetStartPosition(W); var Z=Y.locationFromPosition(X,true); if(Z==null)return""; return Z.sourceText(); } function ScriptLineFromPosition(aa){ var ab=0; var ac=this.lineCount()-1; var ad=this.line_ends; if(aa>ad[ac]){ return-1; } if(aa<=ad[0]){ return 0; } while(ac>=1){ var ae=(ab+ac)>>1; if(aa>ad[ae]){ ab=ae+1; }else if(aa<=ad[ae-1]){ ac=ae-1; }else{ return ae; } } return-1; } function ScriptLocationFromPosition(aa, include_resource_offset){ var af=this.lineFromPosition(aa); if(af==-1)return null; var ad=this.line_ends; var ag=af==0?0:ad[af-1]+1; var ah=ad[af]; if(ah>0&&%_CallFunction(this.source,ah-1,w)=='\r'){ ah--; } var ai=aa-ag; if(include_resource_offset){ af+=this.line_offset; if(af==this.line_offset){ ai+=this.column_offset; } } return new SourceLocation(this,aa,af,ai,ag,ah); } function ScriptLocationFromLine(aj,ak,al){ var af=0; if(!(aj===(void 0))){ af=aj-this.line_offset; } var ai=ak||0; if(af==0){ ai-=this.column_offset; } var am=al||0; if(af<0||ai<0||am<0)return null; if(af==0){ return this.locationFromPosition(am+ai,false); }else{ var an=this.lineFromPosition(am); if(an==-1||an+af>=this.lineCount()){ return null; } return this.locationFromPosition( this.line_ends[an+af-1]+1+ai); } } function ScriptSourceSlice(ao,ap){ var aq=(ao===(void 0))?this.line_offset :ao; var ar=(ap===(void 0))?this.line_offset+this.lineCount() :ap; aq-=this.line_offset; ar-=this.line_offset; if(aq<0)aq=0; if(ar>this.lineCount())ar=this.lineCount(); if(aq>=this.lineCount()|| ar<0|| aq>ar){ return null; } var ad=this.line_ends; var as=aq==0?0:ad[aq-1]+1; var at=ar==0?0:ad[ar-1]+1; return new SourceSlice(this, aq+this.line_offset, ar+this.line_offset, as,at); } function ScriptSourceLine(aj){ var af=0; if(!(aj===(void 0))){ af=aj-this.line_offset; } if(af<0||this.lineCount()<=af){ return null; } var ad=this.line_ends; var ag=af==0?0:ad[af-1]+1; var ah=ad[af]; return %_CallFunction(this.source,ag,ah,y); } function ScriptLineCount(){ return this.line_ends.length; } function ScriptLineEnd(au){ return this.line_ends[au]; } function ScriptNameOrSourceURL(){ if(this.source_url)return this.source_url; return this.name; } b.SetUpLockedPrototype(Script,[ "source", "name", "source_url", "source_mapping_url", "line_ends", "line_offset", "column_offset" ],[ "lineFromPosition",ScriptLineFromPosition, "locationFromPosition",ScriptLocationFromPosition, "locationFromLine",ScriptLocationFromLine, "sourceSlice",ScriptSourceSlice, "sourceLine",ScriptSourceLine, "lineCount",ScriptLineCount, "nameOrSourceURL",ScriptNameOrSourceURL, "lineEnd",ScriptLineEnd ] ); function SourceLocation(Y,aa,af,ai,ag,ah){ this.script=Y; this.position=aa; this.line=af; this.column=ai; this.start=ag; this.end=ah; } function SourceLocationSourceText(){ return %_CallFunction(this.script.source, this.start, this.end, y); } b.SetUpLockedPrototype(SourceLocation, ["script","position","line","column","start","end"], ["sourceText",SourceLocationSourceText] ); function SourceSlice(Y,aq,ar,as,at){ this.script=Y; this.from_line=aq; this.to_line=ar; this.from_position=as; this.to_position=at; } function SourceSliceSourceText(){ return %_CallFunction(this.script.source, this.from_position, this.to_position, y); } b.SetUpLockedPrototype(SourceSlice, ["script","from_line","to_line","from_position","to_position"], ["sourceText",SourceSliceSourceText] ); function GetStackTraceLine(av,aw,ax,ay){ return new CallSite(av,aw,ax,false).toString(); } function CallSite(az,aw,ax,aA){ (this[g]=az); (this[h]=aw); (this[i]=ax); (this[j]=aA); } function CallSiteGetThis(){ return(this[j]) ?(void 0):(this[g]); } function CallSiteGetFunction(){ return(this[j]) ?(void 0):(this[h]); } function CallSiteGetPosition(){ return(this[i]); } function CallSiteGetTypeName(){ return GetTypeName((this[g]),false); } function CallSiteIsToplevel(){ return %CallSiteIsToplevelRT(this); } function CallSiteIsEval(){ return %CallSiteIsEvalRT(this); } function CallSiteGetEvalOrigin(){ var Y=%FunctionGetScript((this[h])); return FormatEvalOrigin(Y); } function CallSiteGetScriptNameOrSourceURL(){ return %CallSiteGetScriptNameOrSourceUrlRT(this); } function CallSiteGetFunctionName(){ return %CallSiteGetFunctionNameRT(this); } function CallSiteGetMethodName(){ return %CallSiteGetMethodNameRT(this); } function CallSiteGetFileName(){ return %CallSiteGetFileNameRT(this); } function CallSiteGetLineNumber(){ return %CallSiteGetLineNumberRT(this); } function CallSiteGetColumnNumber(){ return %CallSiteGetColumnNumberRT(this); } function CallSiteIsNative(){ return %CallSiteIsNativeRT(this); } function CallSiteIsConstructor(){ return %CallSiteIsConstructorRT(this); } function CallSiteToString(){ var aB; var aC=""; if(this.isNative()){ aC="native"; }else{ aB=this.getScriptNameOrSourceURL(); if(!aB&&this.isEval()){ aC=this.getEvalOrigin(); aC+=", "; } if(aB){ aC+=aB; }else{ aC+=""; } var aD=this.getLineNumber(); if(aD!=null){ aC+=":"+aD; var aE=this.getColumnNumber(); if(aE){ aC+=":"+aE; } } } var af=""; var aF=this.getFunctionName(); var aG=true; var aH=this.isConstructor(); var aI=!(this.isToplevel()||aH); if(aI){ var aJ=GetTypeName((this[g]),true); var aK=this.getMethodName(); if(aF){ if(aJ&& %_CallFunction(aF,aJ,x)!=0){ af+=aJ+"."; } af+=aF; if(aK&& (%_CallFunction(aF,"."+aK,x)!= aF.length-aK.length-1)){ af+=" [as "+aK+"]"; } }else{ af+=aJ+"."+(aK||""); } }else if(aH){ af+="new "+(aF||""); }else if(aF){ af+=aF; }else{ af+=aC; aG=false; } if(aG){ af+=" ("+aC+")"; } return af; } b.SetUpLockedPrototype(CallSite,["receiver","fun","pos"],[ "getThis",CallSiteGetThis, "getTypeName",CallSiteGetTypeName, "isToplevel",CallSiteIsToplevel, "isEval",CallSiteIsEval, "getEvalOrigin",CallSiteGetEvalOrigin, "getScriptNameOrSourceURL",CallSiteGetScriptNameOrSourceURL, "getFunction",CallSiteGetFunction, "getFunctionName",CallSiteGetFunctionName, "getMethodName",CallSiteGetMethodName, "getFileName",CallSiteGetFileName, "getLineNumber",CallSiteGetLineNumber, "getColumnNumber",CallSiteGetColumnNumber, "isNative",CallSiteIsNative, "getPosition",CallSiteGetPosition, "isConstructor",CallSiteIsConstructor, "toString",CallSiteToString ]); function FormatEvalOrigin(Y){ var aL=Y.nameOrSourceURL(); if(aL){ return aL; } var aM="eval at "; if(Y.eval_from_function_name){ aM+=Y.eval_from_function_name; }else{ aM+=""; } var aN=Y.eval_from_script; if(aN){ if(aN.compilation_type==1){ aM+=" ("+FormatEvalOrigin(aN)+")"; }else{ if(aN.name){ aM+=" ("+aN.name; var Z=aN.locationFromPosition( Y.eval_from_script_position,true); if(Z){ aM+=":"+(Z.line+1); aM+=":"+(Z.column+1); } aM+=")"; }else{ aM+=" (unknown source)"; } } } return aM; } function FormatErrorString(U){ try{ return %_CallFunction(U,ErrorToString); }catch(e){ try{ return""; }catch(ee){ return""; } } } function GetStackFrames(aO){ var aP=new r(); var aQ=aO[0]; for(var ae=1;ae"; }catch(ee){ af=""; } } aW.push(" at "+af); } return %_CallFunction(aW,"\n",c); } function GetTypeName(az,aY){ if((az==null))return null; var N=az.constructor; if(!N){ return aY?null: %_CallFunction(az,NoSideEffectsObjectToString); } var O=N.name; if(!O){ return aY?null: %_CallFunction(az,NoSideEffectsObjectToString); } return O; } var aZ=function(){ var ba=(void 0); var bb=this; while(bb){ var ba= (bb[l]); if((ba===(void 0))){ var aV=(bb[v]); if((aV===(void 0))){ bb=%_GetPrototype(bb); continue; } ba=FormatStackTrace(bb,aV); (bb[v]=(void 0)); (bb[l]=ba); } return ba; } return(void 0); }; var bc=function(bd){ if((%HasOwnProperty(this,v))){ (this[v]=(void 0)); (this[l]=bd); } }; var be=function(){}; function DefineError(a,bf){ var bg=bf.name; %AddNamedProperty(a,bg,bf,2); if(bg=='Error'){ var bh=function(){}; %FunctionSetPrototype(bh,n.prototype); %FunctionSetInstanceClassName(bh,'Error'); %FunctionSetPrototype(bf,new bh()); }else{ %FunctionSetPrototype(bf,new E()); %InternalSetPrototype(bf,E); } %FunctionSetInstanceClassName(bf,'Error'); %AddNamedProperty(bf.prototype,'constructor',bf,2); %AddNamedProperty(bf.prototype,'name',bg,2); %SetCode(bf,function(bi){ if(%_IsConstructCall()){ try{be(this,bf);}catch(e){} if(!(bi===(void 0))){ %AddNamedProperty(this,'message',(%_ToString(bi)),2); } }else{ return new bf(bi); } }); %SetNativeFlag(bf); return bf; }; E=DefineError(a,function Error(){}); K=DefineError(a,function EvalError(){}); G=DefineError(a,function RangeError(){}); J=DefineError(a,function ReferenceError(){}); I=DefineError(a,function SyntaxError(){}); F=DefineError(a,function TypeError(){}); H=DefineError(a,function URIError(){}); %AddNamedProperty(E.prototype,'message','',2); function ErrorToString(){ if(!(%_IsSpecObject(this))){ throw MakeTypeError(14,"Error.prototype.toString"); } return %ErrorToStringRT(this); } b.InstallFunctions(E.prototype,2, ['toString',ErrorToString]); $errorToString=ErrorToString; MakeError=function(Q,R,S,T){ return MakeGenericError(E,Q,R,S,T); } MakeRangeError=function(Q,R,S,T){ return MakeGenericError(G,Q,R,S,T); } MakeSyntaxError=function(Q,R,S,T){ return MakeGenericError(I,Q,R,S,T); } MakeTypeError=function(Q,R,S,T){ return MakeGenericError(F,Q,R,S,T); } MakeURIError=function(){ return MakeGenericError(H,240); } var bj=MakeRangeError(151); %DefineAccessorPropertyUnchecked(bj,'stack', aZ,bc, 2); be=function captureStackTrace(L,bk){ t(L,'stack',{get:aZ, set:bc, configurable:true}); %CollectStackTrace(L,bk?bk:be); }; E.captureStackTrace=be; %InstallToContext([ "error_function",E, "eval_error_function",K, "get_stack_trace_line_fun",GetStackTraceLine, "make_error_function",MakeGenericError, "make_range_error",MakeRangeError, "make_type_error",MakeTypeError, "message_get_column_number",GetColumnNumber, "message_get_line_number",GetLineNumber, "message_get_source_line",GetSourceLine, "no_side_effect_to_string_fun",NoSideEffectToString, "range_error_function",G, "reference_error_function",J, "stack_overflow_boilerplate",bj, "syntax_error_function",I, "to_detail_string_fun",ToDetailString, "type_error_function",F, "uri_error_function",H, ]); }); jsonõ: (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.JSON; var d=b.InternalArray; var e; var f; var g; var h; var i=b.ImportNow("to_string_tag_symbol"); b.Import(function(j){ e=j.MathMax; f=j.MathMin; g=j.ObjectHasOwnProperty; h=j.ToNumber; }); function Revive(k,l,m){ var n=k[l]; if((typeof(n)==='object')){ if((%_IsArray(n))){ var o=n.length; for(var p=0;p0){ var E=",\n"+x; D="[\n"+x+A.join(E)+"\n"+ z+"]"; }else{ D="[]"; } w.pop(); return D; } function SerializeObject(u,v,w,x,y){ if(!%PushIfAbsent(w,u))throw MakeTypeError(18); var z=x; x+=y; var A=new d(); if((%_IsArray(v))){ var o=v.length; for(var p=0;p0){ var E=",\n"+x; D="{\n"+x+A.join(E)+"\n"+ z+"}"; }else{ D="{}"; } w.pop(); return D; } function JSONSerialize(G,k,v,w,x,y){ var u=k[G]; if((%_IsSpecObject(u))){ var H=u.toJSON; if((typeof(H)==='function')){ u=%_Call(H,u,G); } } if((typeof(v)==='function')){ u=%_Call(v,k,G,u); } if((typeof(u)==='string')){ return %QuoteJSONString(u); }else if((typeof(u)==='number')){ return((%_IsSmi(%IS_VAR(u))||u-u==0)?%_NumberToString(u):"null"); }else if((typeof(u)==='boolean')){ return u?"true":"false"; }else if((u===null)){ return"null"; }else if((%_IsSpecObject(u))&&!(typeof(u)==='function')){ if((%_IsArray(u))){ return SerializeArray(u,v,w,x,y); }else if((%_ClassOf(u)==='Number')){ u=h(u); return((%_IsSmi(%IS_VAR(u))||u-u==0)?%_NumberToString(u):"null"); }else if((%_ClassOf(u)==='String')){ return %QuoteJSONString((%_ToString(u))); }else if((%_ClassOf(u)==='Boolean')){ return %_ValueOf(u)?"true":"false"; }else{ return SerializeObject(u,v,w,x,y); } } return(void 0); } function JSONStringify(u,v,I){ if(%_ArgumentsLength()==1){ return %BasicJSONStringify(u); } if((%_IsArray(v))){ var J=new d(); var K={__proto__:null}; var o=v.length; for(var p=0;p10){ y=%_SubString(I,0,10); }else{ y=I; } }else{ y=""; } return JSONSerialize('',{'':u},v,new d(),"",y); } %AddNamedProperty(c,i,"JSON",1|2); b.InstallFunctions(c,2,[ "parse",JSONParse, "stringify",JSONStringify ]); function JsonSerializeAdapter(G,N){ var k={}; k[G]=N; return JSONSerialize(G,k,(void 0),new d(),"",""); } %InstallToContext(["json_serialize_adapter",JsonSerializeAdapter]); }) 8array-iterator = var $arrayValues; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c= b.ImportNow("array_iteration_kind_symbol"); var d= b.ImportNow("array_iterator_next_symbol"); var e= b.ImportNow("array_iterator_object_symbol"); var f=a.Array; var g=b.ImportNow("iterator_symbol"); var h=b.ImportNow("to_string_tag_symbol"); var i=a.Uint8Array; var j=a.Int8Array; var k=a.Uint16Array; var l=a.Int16Array; var m=a.Uint32Array; var n=a.Int32Array; var o=a.Float32Array; var p=a.Float64Array; var q=a.Uint8ClampedArray; function ArrayIterator(){} function CreateArrayIterator(r,s){ var t=(%_ToObject(r)); var u=new ArrayIterator; (u[e]=t); (u[d]=0); (u[c]=s); return u; } function ArrayIteratorIterator(){ return this; } function ArrayIteratorNext(){ var u=this; var v=(void 0); var w=true; if(!(%_IsSpecObject(u))|| !(!(u[d]===(void 0)))){ throw MakeTypeError(36, 'Array Iterator.prototype.next',this); } var r=(u[e]); if(!(r===(void 0))){ var x=(u[d]); var y=(u[c]); var z=(r.length>>>0); if(x>=z){ (u[e]=(void 0)); }else{ (u[d]=x+1); if(y==2){ v=r[x]; }else if(y==3){ v=[x,r[x]]; }else{ v=x; } w=false; } } return %_CreateIterResultObject(v,w); } function ArrayEntries(){ return CreateArrayIterator(this,3); } function ArrayValues(){ return CreateArrayIterator(this,2); } function ArrayKeys(){ return CreateArrayIterator(this,1); } %FunctionSetPrototype(ArrayIterator,{__proto__:$iteratorPrototype}); %FunctionSetInstanceClassName(ArrayIterator,'Array Iterator'); b.InstallFunctions(ArrayIterator.prototype,2,[ 'next',ArrayIteratorNext ]); b.SetFunctionName(ArrayIteratorIterator,g); %AddNamedProperty(ArrayIterator.prototype,g, ArrayIteratorIterator,2); %AddNamedProperty(ArrayIterator.prototype,h, "Array Iterator",1|2); b.InstallFunctions(f.prototype,2,[ 'entries',ArrayEntries, 'keys',ArrayKeys ]); b.SetFunctionName(ArrayValues,'values'); %AddNamedProperty(f.prototype,g,ArrayValues, 2); %AddNamedProperty(i.prototype,'entries',ArrayEntries,2); %AddNamedProperty(i.prototype,'values',ArrayValues,2); %AddNamedProperty(i.prototype,'keys',ArrayKeys,2); %AddNamedProperty(i.prototype,g,ArrayValues, 2); %AddNamedProperty(j.prototype,'entries',ArrayEntries,2); %AddNamedProperty(j.prototype,'values',ArrayValues,2); %AddNamedProperty(j.prototype,'keys',ArrayKeys,2); %AddNamedProperty(j.prototype,g,ArrayValues, 2); %AddNamedProperty(k.prototype,'entries',ArrayEntries,2); %AddNamedProperty(k.prototype,'values',ArrayValues,2); %AddNamedProperty(k.prototype,'keys',ArrayKeys,2); %AddNamedProperty(k.prototype,g,ArrayValues, 2); %AddNamedProperty(l.prototype,'entries',ArrayEntries,2); %AddNamedProperty(l.prototype,'values',ArrayValues,2); %AddNamedProperty(l.prototype,'keys',ArrayKeys,2); %AddNamedProperty(l.prototype,g,ArrayValues, 2); %AddNamedProperty(m.prototype,'entries',ArrayEntries,2); %AddNamedProperty(m.prototype,'values',ArrayValues,2); %AddNamedProperty(m.prototype,'keys',ArrayKeys,2); %AddNamedProperty(m.prototype,g,ArrayValues, 2); %AddNamedProperty(n.prototype,'entries',ArrayEntries,2); %AddNamedProperty(n.prototype,'values',ArrayValues,2); %AddNamedProperty(n.prototype,'keys',ArrayKeys,2); %AddNamedProperty(n.prototype,g,ArrayValues, 2); %AddNamedProperty(o.prototype,'entries',ArrayEntries,2); %AddNamedProperty(o.prototype,'values',ArrayValues,2); %AddNamedProperty(o.prototype,'keys',ArrayKeys,2); %AddNamedProperty(o.prototype,g,ArrayValues, 2); %AddNamedProperty(p.prototype,'entries',ArrayEntries,2); %AddNamedProperty(p.prototype,'values',ArrayValues,2); %AddNamedProperty(p.prototype,'keys',ArrayKeys,2); %AddNamedProperty(p.prototype,g,ArrayValues, 2); %AddNamedProperty(q.prototype,'entries',ArrayEntries,2); %AddNamedProperty(q.prototype,'values',ArrayValues,2); %AddNamedProperty(q.prototype,'keys',ArrayKeys,2); %AddNamedProperty(q.prototype,g,ArrayValues, 2); $arrayValues=ArrayValues; %InstallToContext(["array_values_iterator",ArrayValues]); }) >>0); if(m>=n){ (j[e]=(void 0)); }else{ var o=%_StringCharCodeAt(i,m); k=%_StringCharFromCode(o); l=false; m++; if(o>=0xD800&&o<=0xDBFF&&m=0xDC00&&p<=0xDFFF){ k+=%_StringCharFromCode(p); m++; } } (j[f]=m); } } return %_CreateIterResultObject(k,l); } function StringPrototypeIterator(){ return CreateStringIterator(this); } %FunctionSetPrototype(StringIterator,{__proto__:$iteratorPrototype}); %FunctionSetInstanceClassName(StringIterator,'String Iterator'); b.InstallFunctions(StringIterator.prototype,2,[ 'next',StringIteratorNext ]); %AddNamedProperty(StringIterator.prototype,g, "String Iterator",1|2); b.SetFunctionName(StringPrototypeIterator,d); %AddNamedProperty(c.prototype,d, StringPrototypeIterator,2); }) $templatesi (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Map; var d=b.InternalArray; var e=new c; var f=c.prototype.get; var g=c.prototype.set; function SameCallSiteElements(h,i){ var j=h.length; var i=i.raw; if(j!==i.length)return false; for(var k=0;k0){ if(l in p){ p[r]=p[l]; }else{ delete p[r]; } l=l+u; r=r+u; t--; } return p; } function ArrayCopyWithin(m,n,o){ if((%IS_VAR(this)===null)||(this===(void 0)))throw MakeTypeError(15,"Array.prototype.copyWithin"); var p=(%_ToObject(this)); var q=(%ToLength(p.length)); return InnerArrayCopyWithin(m,n,o,p,q); } function InnerArrayFind(v,w,p,q){ if(!(typeof(v)==='function')){ throw MakeTypeError(13,v); } for(var x=0;xq)x=q; } if(o<0){ o+=q; if(o<0)o=0; }else{ if(o>q)o=q; } if((o-x)>0&&i(p)){ throw MakeTypeError(10); } for(;x>>0)); return InnerArrayFill(z,n,o,p,q); } function AddArrayElement(A,p,x,z){ if(A===e){ %AddElement(p,x,z); }else{ j(p,x,{ value:z,writable:true,configurable:true,enumerable:true }); } } function ArrayFrom(B,C,D){ var E=(%_ToObject(B)); var F=!(C===(void 0)); if(F){ if(!(typeof(C)==='function')){ throw MakeTypeError(13,C); } } var G=d(E,f); var H; var I; var J; var K; if(!(G===(void 0))){ I=%IsConstructor(this)?new this():[]; var L=c(E,G); H=0; while(true){ var M=L.next(); if(!(typeof(M)==='object')){ throw MakeTypeError(41,M); } if(M.done){ I.length=H; return I; } K=M.value; if(F){ J=%_Call(C,D,K,H); }else{ J=K; } AddArrayElement(this,I,H,J); H++; } }else{ var N=(%ToLength(E.length)); I=%IsConstructor(this)?new this(N):new e(N); for(H=0;H0){ return L(O,%_Arguments(0)); }else{ return L(O); } } } %FunctionSetName(P,N); %FunctionRemovePrototype(P); %SetNativeFlag(P); this[N]=P; } return this[N]; } %FunctionSetName(getter,K); %FunctionRemovePrototype(getter); %SetNativeFlag(getter); o(J.prototype,K,{ get:getter, enumerable:false, configurable:true }); } function supportedLocalesOf(S,T,U){ if((%_CallFunction(S,GetServiceRE(),s)===null)){ throw MakeError(7,S); } if((U===(void 0))){ U={}; }else{ U=(%_ToObject(U)); } var V=U.localeMatcher; if(!(V===(void 0))){ V=l(V); if(V!=='lookup'&&V!=='best fit'){ throw MakeRangeError(147,V); } }else{ V='best fit'; } var W=initializeLocaleList(T); if((z[S]===(void 0))){ z[S]=getAvailableLocalesOf(S); } if(V==='best fit'){ return initializeLocaleList(bestFitSupportedLocalesOf( W,z[S])); } return initializeLocaleList(lookupSupportedLocalesOf( W,z[S])); } function lookupSupportedLocalesOf(W,X){ var Y=[]; for(var Z=0;Z=3&&M<=8&&!(ao===(void 0))){ an[ao]=ap; ao=(void 0); }else{ return{}; } } return an; } function setOptions(aq,an,ar,ad,as){ var al=''; var at=function updateExtension(au,ai){ return'-'+au+'-'+l(ai); } var av=function updateProperty(ae,af,ai){ if(af==='boolean'&&(typeof ai==='string')){ ai=(ai==='true')?true:false; } if(!(ae===(void 0))){ defineWEProperty(as,ae,ai); } } for(var au in ar){ if(%HasOwnProperty(ar,au)){ var ai=(void 0); var aw=ar[au]; if(!(aw.property===(void 0))){ ai=ad(aw.property,aw.type,aw.values); } if(!(ai===(void 0))){ av(aw.property,aw.type,ai); al+=at(au,ai); continue; } if(%HasOwnProperty(an,au)){ ai=an[au]; if(!(ai===(void 0))){ av(aw.property,aw.type,ai); al+=at(au,ai); }else if(aw.type==='boolean'){ av(aw.property,aw.type,true); al+=at(au,true); } } } } return al===''?'':'-u'+al; } function freezeArray(ax){ var ay=ax.length; for(var Z=0;Z>>0); for(var aL=0;aLbo){ throw MakeRangeError(150,ae); } return m(ai); } return bp; } function initializeNumberFormat(bq,T,U){ if(%IsInitializedIntlObject(bq)){ throw MakeTypeError(99,"NumberFormat"); } if((U===(void 0))){ U={}; } var ad=getGetOption(U,'numberformat'); var aa=resolveLocale('numberformat',T,U); var be={}; defineWEProperty(be,'style',ad( 'style','string',['decimal','percent','currency'],'decimal')); var bm=ad('currency','string'); if(!(bm===(void 0))&&!isWellFormedCurrencyCode(bm)){ throw MakeRangeError(134,bm); } if(be.style==='currency'&&(bm===(void 0))){ throw MakeTypeError(22); } var br=ad( 'currencyDisplay','string',['code','symbol','name'],'symbol'); if(be.style==='currency'){ defineWEProperty(be,'currency',%StringToUpperCase(bm)); defineWEProperty(be,'currencyDisplay',br); } var bs=getNumberOption(U,'minimumIntegerDigits',1,21,1); defineWEProperty(be,'minimumIntegerDigits',bs); var bt=U['minimumFractionDigits']; var bu=U['maximumFractionDigits']; if(!(bt===(void 0))||be.style!=='currency'){ bt=getNumberOption(U,'minimumFractionDigits',0,20,0); defineWEProperty(be,'minimumFractionDigits',bt); } if(!(bu===(void 0))||be.style!=='currency'){ var bv=be.style==='percent'?0:3; bt=(bt===(void 0))?0:bt; fallback_limit=(bt>bv)?bt:bv; bu=getNumberOption(U,'maximumFractionDigits',bt,20,fallback_limit); defineWEProperty(be,'maximumFractionDigits',bu); } var bw=U['minimumSignificantDigits']; var bx=U['maximumSignificantDigits']; if(!(bw===(void 0))||!(bx===(void 0))){ bw=getNumberOption(U,'minimumSignificantDigits',1,21,0); defineWEProperty(be,'minimumSignificantDigits',bw); bx=getNumberOption(U,'maximumSignificantDigits',bw,21,21); defineWEProperty(be,'maximumSignificantDigits',bx); } defineWEProperty(be,'useGrouping',ad( 'useGrouping','boolean',(void 0),true)); var an=parseExtension(aa.extension); var by={ 'nu':{'property':(void 0),'type':'string'} }; var al=setOptions(U,an,by, ad,be); var bj=aa.locale+al; var aj=n({},{ currency:{writable:true}, currencyDisplay:{writable:true}, locale:{writable:true}, maximumFractionDigits:{writable:true}, minimumFractionDigits:{writable:true}, minimumIntegerDigits:{writable:true}, numberingSystem:{writable:true}, requestedLocale:{value:bj,writable:true}, style:{value:be.style,writable:true}, useGrouping:{writable:true} }); if(%HasOwnProperty(be,'minimumSignificantDigits')){ defineWEProperty(aj,'minimumSignificantDigits',(void 0)); } if(%HasOwnProperty(be,'maximumSignificantDigits')){ defineWEProperty(aj,'maximumSignificantDigits',(void 0)); } var bz=%CreateNumberFormat(bj, be, aj); if(be.style==='currency'){ o(aj,'currencyDisplay',{value:br, writable:true}); } %MarkAsInitializedIntlObjectOfType(bq,'numberformat',bz); o(bq,'resolved',{value:aj}); return bq; } %AddNamedProperty(y,'NumberFormat',function(){ var T=%_Arguments(0); var U=%_Arguments(1); if(!this||this===y){ return new y.NumberFormat(T,U); } return initializeNumberFormat((%_ToObject(this)),T,U); }, 2 ); %AddNamedProperty(y.NumberFormat.prototype,'resolvedOptions',function(){ if(%_IsConstructCall()){ throw MakeTypeError(79); } if(!%IsInitializedIntlObjectOfType(this,'numberformat')){ throw MakeTypeError(100,"NumberFormat"); } var bA=this; var aa=getOptimalLanguageTag(bA.resolved.requestedLocale, bA.resolved.locale); var bB={ locale:aa, numberingSystem:bA.resolved.numberingSystem, style:bA.resolved.style, useGrouping:bA.resolved.useGrouping, minimumIntegerDigits:bA.resolved.minimumIntegerDigits, minimumFractionDigits:bA.resolved.minimumFractionDigits, maximumFractionDigits:bA.resolved.maximumFractionDigits, }; if(bB.style==='currency'){ defineWECProperty(bB,'currency',bA.resolved.currency); defineWECProperty(bB,'currencyDisplay', bA.resolved.currencyDisplay); } if(%HasOwnProperty(bA.resolved,'minimumSignificantDigits')){ defineWECProperty(bB,'minimumSignificantDigits', bA.resolved.minimumSignificantDigits); } if(%HasOwnProperty(bA.resolved,'maximumSignificantDigits')){ defineWECProperty(bB,'maximumSignificantDigits', bA.resolved.maximumSignificantDigits); } return bB; }, 2 ); %FunctionSetName(y.NumberFormat.prototype.resolvedOptions, 'resolvedOptions'); %FunctionRemovePrototype(y.NumberFormat.prototype.resolvedOptions); %SetNativeFlag(y.NumberFormat.prototype.resolvedOptions); %AddNamedProperty(y.NumberFormat,'supportedLocalesOf',function(T){ if(%_IsConstructCall()){ throw MakeTypeError(79); } return supportedLocalesOf('numberformat',T,%_Arguments(1)); }, 2 ); %FunctionSetName(y.NumberFormat.supportedLocalesOf,'supportedLocalesOf'); %FunctionRemovePrototype(y.NumberFormat.supportedLocalesOf); %SetNativeFlag(y.NumberFormat.supportedLocalesOf); function formatNumber(bz,ai){ var bC=ToNumber(ai)+0; return %InternalNumberFormat(%GetImplFromInitializedIntlObject(bz), bC); } function parseNumber(bz,ai){ return %InternalNumberParse(%GetImplFromInitializedIntlObject(bz), l(ai)); } addBoundMethod(y.NumberFormat,'format',formatNumber,1); addBoundMethod(y.NumberFormat,'v8Parse',parseNumber,1); function toLDMLString(U){ var ad=getGetOption(U,'dateformat'); var bD=''; var bE=ad('weekday','string',['narrow','short','long']); bD+=appendToLDMLString( bE,{narrow:'EEEEE',short:'EEE',long:'EEEE'}); bE=ad('era','string',['narrow','short','long']); bD+=appendToLDMLString( bE,{narrow:'GGGGG',short:'GGG',long:'GGGG'}); bE=ad('year','string',['2-digit','numeric']); bD+=appendToLDMLString(bE,{'2-digit':'yy','numeric':'y'}); bE=ad('month','string', ['2-digit','numeric','narrow','short','long']); bD+=appendToLDMLString(bE,{'2-digit':'MM','numeric':'M', 'narrow':'MMMMM','short':'MMM','long':'MMMM'}); bE=ad('day','string',['2-digit','numeric']); bD+=appendToLDMLString( bE,{'2-digit':'dd','numeric':'d'}); var bF=ad('hour12','boolean'); bE=ad('hour','string',['2-digit','numeric']); if((bF===(void 0))){ bD+=appendToLDMLString(bE,{'2-digit':'jj','numeric':'j'}); }else if(bF===true){ bD+=appendToLDMLString(bE,{'2-digit':'hh','numeric':'h'}); }else{ bD+=appendToLDMLString(bE,{'2-digit':'HH','numeric':'H'}); } bE=ad('minute','string',['2-digit','numeric']); bD+=appendToLDMLString(bE,{'2-digit':'mm','numeric':'m'}); bE=ad('second','string',['2-digit','numeric']); bD+=appendToLDMLString(bE,{'2-digit':'ss','numeric':'s'}); bE=ad('timeZoneName','string',['short','long']); bD+=appendToLDMLString(bE,{short:'z',long:'zzzz'}); return bD; } function appendToLDMLString(bE,bG){ if(!(bE===(void 0))){ return bG[bE]; }else{ return''; } } function fromLDMLString(bD){ bD=%_CallFunction(bD,GetQuotedStringRE(),'', t); var U={}; var bH=%_CallFunction(bD,/E{3,5}/g,s); U=appendToDateTimeObject( U,'weekday',bH,{EEEEE:'narrow',EEE:'short',EEEE:'long'}); bH=%_CallFunction(bD,/G{3,5}/g,s); U=appendToDateTimeObject( U,'era',bH,{GGGGG:'narrow',GGG:'short',GGGG:'long'}); bH=%_CallFunction(bD,/y{1,2}/g,s); U=appendToDateTimeObject( U,'year',bH,{y:'numeric',yy:'2-digit'}); bH=%_CallFunction(bD,/M{1,5}/g,s); U=appendToDateTimeObject(U,'month',bH,{MM:'2-digit', M:'numeric',MMMMM:'narrow',MMM:'short',MMMM:'long'}); bH=%_CallFunction(bD,/L{1,5}/g,s); U=appendToDateTimeObject(U,'month',bH,{LL:'2-digit', L:'numeric',LLLLL:'narrow',LLL:'short',LLLL:'long'}); bH=%_CallFunction(bD,/d{1,2}/g,s); U=appendToDateTimeObject( U,'day',bH,{d:'numeric',dd:'2-digit'}); bH=%_CallFunction(bD,/h{1,2}/g,s); if(bH!==null){ U['hour12']=true; } U=appendToDateTimeObject( U,'hour',bH,{h:'numeric',hh:'2-digit'}); bH=%_CallFunction(bD,/H{1,2}/g,s); if(bH!==null){ U['hour12']=false; } U=appendToDateTimeObject( U,'hour',bH,{H:'numeric',HH:'2-digit'}); bH=%_CallFunction(bD,/m{1,2}/g,s); U=appendToDateTimeObject( U,'minute',bH,{m:'numeric',mm:'2-digit'}); bH=%_CallFunction(bD,/s{1,2}/g,s); U=appendToDateTimeObject( U,'second',bH,{s:'numeric',ss:'2-digit'}); bH=%_CallFunction(bD,/z|zzzz/g,s); U=appendToDateTimeObject( U,'timeZoneName',bH,{z:'short',zzzz:'long'}); return U; } function appendToDateTimeObject(U,bE,bH,bG){ if((bH===null)){ if(!%HasOwnProperty(U,bE)){ defineWEProperty(U,bE,(void 0)); } return U; } var ae=bH[0]; defineWEProperty(U,bE,bG[ae]); return U; } function toDateTimeOptions(U,bI,bJ){ if((U===(void 0))){ U={}; }else{ U=(%_ToObject(U)); } var bK=true; if((bI==='date'||bI==='any')&& (!(U.weekday===(void 0))||!(U.year===(void 0))|| !(U.month===(void 0))||!(U.day===(void 0)))){ bK=false; } if((bI==='time'||bI==='any')&& (!(U.hour===(void 0))||!(U.minute===(void 0))|| !(U.second===(void 0)))){ bK=false; } if(bK&&(bJ==='date'||bJ==='all')){ o(U,'year',{value:'numeric', writable:true, enumerable:true, configurable:true}); o(U,'month',{value:'numeric', writable:true, enumerable:true, configurable:true}); o(U,'day',{value:'numeric', writable:true, enumerable:true, configurable:true}); } if(bK&&(bJ==='time'||bJ==='all')){ o(U,'hour',{value:'numeric', writable:true, enumerable:true, configurable:true}); o(U,'minute',{value:'numeric', writable:true, enumerable:true, configurable:true}); o(U,'second',{value:'numeric', writable:true, enumerable:true, configurable:true}); } return U; } function initializeDateTimeFormat(bL,T,U){ if(%IsInitializedIntlObject(bL)){ throw MakeTypeError(99,"DateTimeFormat"); } if((U===(void 0))){ U={}; } var aa=resolveLocale('dateformat',T,U); U=toDateTimeOptions(U,'any','date'); var ad=getGetOption(U,'dateformat'); var V=ad('formatMatcher','string', ['basic','best fit'],'best fit'); var bD=toLDMLString(U); var bM=canonicalizeTimeZoneID(U.timeZone); var be={}; var an=parseExtension(aa.extension); var bN={ 'ca':{'property':(void 0),'type':'string'}, 'nu':{'property':(void 0),'type':'string'} }; var al=setOptions(U,an,bN, ad,be); var bj=aa.locale+al; var aj=n({},{ calendar:{writable:true}, day:{writable:true}, era:{writable:true}, hour12:{writable:true}, hour:{writable:true}, locale:{writable:true}, minute:{writable:true}, month:{writable:true}, numberingSystem:{writable:true}, pattern:{writable:true}, requestedLocale:{value:bj,writable:true}, second:{writable:true}, timeZone:{writable:true}, timeZoneName:{writable:true}, tz:{value:bM,writable:true}, weekday:{writable:true}, year:{writable:true} }); var bz=%CreateDateTimeFormat( bj,{skeleton:bD,timeZone:bM},aj); if(!(bM===(void 0))&&bM!==aj.timeZone){ throw MakeRangeError(156,bM); } %MarkAsInitializedIntlObjectOfType(bL,'dateformat',bz); o(bL,'resolved',{value:aj}); return bL; } %AddNamedProperty(y,'DateTimeFormat',function(){ var T=%_Arguments(0); var U=%_Arguments(1); if(!this||this===y){ return new y.DateTimeFormat(T,U); } return initializeDateTimeFormat((%_ToObject(this)),T,U); }, 2 ); %AddNamedProperty(y.DateTimeFormat.prototype,'resolvedOptions',function(){ if(%_IsConstructCall()){ throw MakeTypeError(79); } if(!%IsInitializedIntlObjectOfType(this,'dateformat')){ throw MakeTypeError(100,"DateTimeFormat"); } var bO={ 'gregorian':'gregory', 'japanese':'japanese', 'buddhist':'buddhist', 'roc':'roc', 'persian':'persian', 'islamic-civil':'islamicc', 'islamic':'islamic', 'hebrew':'hebrew', 'chinese':'chinese', 'indian':'indian', 'coptic':'coptic', 'ethiopic':'ethiopic', 'ethiopic-amete-alem':'ethioaa' }; var bA=this; var bP=fromLDMLString(bA.resolved.pattern); var bQ=bO[bA.resolved.calendar]; if((bQ===(void 0))){ bQ=bA.resolved.calendar; } var aa=getOptimalLanguageTag(bA.resolved.requestedLocale, bA.resolved.locale); var bB={ locale:aa, numberingSystem:bA.resolved.numberingSystem, calendar:bQ, timeZone:bA.resolved.timeZone }; addWECPropertyIfDefined(bB,'timeZoneName',bP.timeZoneName); addWECPropertyIfDefined(bB,'era',bP.era); addWECPropertyIfDefined(bB,'year',bP.year); addWECPropertyIfDefined(bB,'month',bP.month); addWECPropertyIfDefined(bB,'day',bP.day); addWECPropertyIfDefined(bB,'weekday',bP.weekday); addWECPropertyIfDefined(bB,'hour12',bP.hour12); addWECPropertyIfDefined(bB,'hour',bP.hour); addWECPropertyIfDefined(bB,'minute',bP.minute); addWECPropertyIfDefined(bB,'second',bP.second); return bB; }, 2 ); %FunctionSetName(y.DateTimeFormat.prototype.resolvedOptions, 'resolvedOptions'); %FunctionRemovePrototype(y.DateTimeFormat.prototype.resolvedOptions); %SetNativeFlag(y.DateTimeFormat.prototype.resolvedOptions); %AddNamedProperty(y.DateTimeFormat,'supportedLocalesOf',function(T){ if(%_IsConstructCall()){ throw MakeTypeError(79); } return supportedLocalesOf('dateformat',T,%_Arguments(1)); }, 2 ); %FunctionSetName(y.DateTimeFormat.supportedLocalesOf,'supportedLocalesOf'); %FunctionRemovePrototype(y.DateTimeFormat.supportedLocalesOf); %SetNativeFlag(y.DateTimeFormat.supportedLocalesOf); function formatDate(bz,bR){ var bS; if((bR===(void 0))){ bS=%DateCurrentTime(); }else{ bS=ToNumber(bR); } if(!f(bS))throw MakeRangeError(128); return %InternalDateFormat(%GetImplFromInitializedIntlObject(bz), new i(bS)); } function parseDate(bz,ai){ return %InternalDateParse(%GetImplFromInitializedIntlObject(bz), l(ai)); } addBoundMethod(y.DateTimeFormat,'format',formatDate,0); addBoundMethod(y.DateTimeFormat,'v8Parse',parseDate,1); function canonicalizeTimeZoneID(bT){ if((bT===(void 0))){ return bT; } var bU=%StringToUpperCase(bT); if(bU==='UTC'||bU==='GMT'|| bU==='ETC/UTC'||bU==='ETC/GMT'){ return'UTC'; } var bH=%_CallFunction(bT,GetTimezoneNameCheckRE(),s); if((bH===null))throw MakeRangeError(129,bT); var bB=toTitleCaseWord(bH[1])+'/'+toTitleCaseWord(bH[2]); var Z=3; while(!(bH[Z]===(void 0))&&Z0){ if((%_DebugIsActive()!=0))%DebugPrepareStepInIfStepping(this); try{ return %_GeneratorNext(this,g); }catch(e){ %GeneratorClose(this); throw e; } }else if(h==0){ return{value:void 0,done:true}; }else{ throw MakeTypeError(34); } } function GeneratorObjectThrow(i){ if(!(%_ClassOf(this)==='Generator')){ throw MakeTypeError(36, '[Generator].prototype.throw',this); } var h=%GeneratorGetContinuation(this); if(h>0){ try{ return %_GeneratorThrow(this,i); }catch(e){ %GeneratorClose(this); throw e; } }else if(h==0){ throw i; }else{ throw MakeTypeError(34); } } function GeneratorFunctionConstructor(j){ var k=d(arguments,'function*'); var l=%GlobalProxy(GeneratorFunctionConstructor); var m=%_CallFunction(l,%CompileString(k,true)); %FunctionMarkNameShouldPrintAsAnonymous(m); return m; } %NeverOptimizeFunction(GeneratorObjectNext); %NeverOptimizeFunction(GeneratorObjectThrow); var n=GeneratorFunctionPrototype.prototype; b.InstallFunctions(n, 2, ["next",GeneratorObjectNext, "throw",GeneratorObjectThrow]); %AddNamedProperty(n,"constructor", GeneratorFunctionPrototype,2|1); %AddNamedProperty(n, e,"Generator",2|1); %InternalSetPrototype(GeneratorFunctionPrototype,c.prototype); %AddNamedProperty(GeneratorFunctionPrototype, e,"GeneratorFunction",2|1); %AddNamedProperty(GeneratorFunctionPrototype,"constructor", GeneratorFunction,2|1); %InternalSetPrototype(GeneratorFunction,c); %SetCode(GeneratorFunction,GeneratorFunctionConstructor); }) =%_TypedArrayGetLength(i)){ return(void 0); } k=e(k); l=e(l); return %_AtomicsCompareExchange(i,j,k,l); } function AtomicsLoadJS(i,j){ CheckSharedIntegerTypedArray(i); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(i)){ return(void 0); } return %_AtomicsLoad(i,j); } function AtomicsStoreJS(i,j,m){ CheckSharedIntegerTypedArray(i); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(i)){ return(void 0); } m=e(m); return %_AtomicsStore(i,j,m); } function AtomicsAddJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=e(m); return %_AtomicsAdd(h,j,m); } function AtomicsSubJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=e(m); return %_AtomicsSub(h,j,m); } function AtomicsAndJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=e(m); return %_AtomicsAnd(h,j,m); } function AtomicsOrJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=e(m); return %_AtomicsOr(h,j,m); } function AtomicsXorJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=e(m); return %_AtomicsXor(h,j,m); } function AtomicsExchangeJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=e(m); return %_AtomicsExchange(h,j,m); } function AtomicsIsLockFreeJS(n){ return %_AtomicsIsLockFree(n); } function AtomicsFutexWaitJS(h,j,m,o){ CheckSharedInteger32TypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } if((o===(void 0))){ o=(1/0); }else{ o=e(o); if((!%_IsSmi(%IS_VAR(o))&&!(o==o))){ o=(1/0); }else{ o=d(0,o); } } return %AtomicsFutexWait(h,j,m,o); } function AtomicsFutexWakeJS(h,j,p){ CheckSharedInteger32TypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } p=d(0,(%_ToInteger(p))); return %AtomicsFutexWake(h,j,p); } function AtomicsFutexWakeOrRequeueJS(h,q,p,m,r){ CheckSharedInteger32TypedArray(h); q=(%_ToInteger(q)); p=d(0,(%_ToInteger(p))); m=(m|0); r=(%_ToInteger(r)); if(q<0||q>=%_TypedArrayGetLength(h)|| r<0||r>=%_TypedArrayGetLength(h)){ return(void 0); } return %AtomicsFutexWakeOrRequeue(h,q,p,m,r); } function AtomicsConstructor(){} var s=new AtomicsConstructor(); %InternalSetPrototype(s,c.prototype); %AddNamedProperty(a,"Atomics",s,2); %FunctionSetInstanceClassName(AtomicsConstructor,'Atomics'); %AddNamedProperty(s,f,"Atomics",1|2); b.InstallConstants(s,[ "OK",0, "NOTEQUAL",-1, "TIMEDOUT",-2, ]); b.InstallFunctions(s,2,[ "compareExchange",AtomicsCompareExchangeJS, "load",AtomicsLoadJS, "store",AtomicsStoreJS, "add",AtomicsAddJS, "sub",AtomicsSubJS, "and",AtomicsAndJS, "or",AtomicsOrJS, "xor",AtomicsXorJS, "exchange",AtomicsExchangeJS, "isLockFree",AtomicsIsLockFreeJS, "futexWait",AtomicsFutexWaitJS, "futexWake",AtomicsFutexWakeJS, "futexWakeOrRequeue",AtomicsFutexWakeOrRequeueJS, ]); }) Xharmony-array-includesñ (function(a,b){ 'use strict'; %CheckIsBootstrapping(); var c=a.Array; function InnerArrayIncludes(d,e,f,g){ if(g===0){ return false; } var h=(%_ToInteger(e)); var i; if(h>=0){ i=h; }else{ i=g+h; if(i<0){ i=0; } } while(i