debug:™ "use strict"; var kDefaultBacktraceLength=10; var Debug={}; var sourceLineBeginningSkip=/^(?:\s*(?:\/\*.*?\*\/)*)*/; Debug.DebugEvent={Break:1, Exception:2, NewFunction:3, BeforeCompile:4, AfterCompile:5, CompileError:6, PromiseEvent:7, AsyncTaskEvent:8}; Debug.ExceptionBreak={Caught:0, Uncaught:1}; Debug.StepAction={StepOut:0, StepNext:1, StepIn:2, StepMin:3, StepInMin:4, StepFrame:5}; Debug.ScriptType={Native:0, Extension:1, Normal:2}; Debug.ScriptCompilationType={Host:0, Eval:1, JSON:2}; Debug.ScriptBreakPointType={ScriptId:0, ScriptName:1, ScriptRegExp:2}; Debug.BreakPositionAlignment={ Statement:0, BreakPosition:1 }; function ScriptTypeFlag(a){ return(1<0){ this.ignoreCount_--; return false; } return true; }; function IsBreakPointTriggered(a,b){ return b.isTriggered(MakeExecutionState(a)); } function ScriptBreakPoint(type,script_id_or_name,opt_line,opt_column, opt_groupId,opt_position_alignment){ this.type_=type; if(type==Debug.ScriptBreakPointType.ScriptId){ this.script_id_=script_id_or_name; }else if(type==Debug.ScriptBreakPointType.ScriptName){ this.script_name_=script_id_or_name; }else if(type==Debug.ScriptBreakPointType.ScriptRegExp){ this.script_regexp_object_=new RegExp(script_id_or_name); }else{ throw new Error("Unexpected breakpoint type "+type); } this.line_=opt_line||0; this.column_=opt_column; this.groupId_=opt_groupId; this.position_alignment_=(opt_position_alignment===(void 0)) ?Debug.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(a){ var b=new ScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, a.id,this.line_,this.column_,this.groupId_, this.position_alignment_); b.number_=next_break_point_number++; script_break_points.push(b); b.hit_count_=this.hit_count_; b.active_=this.active_; b.condition_=this.condition_; b.ignoreCount_=this.ignoreCount_; return b; }; 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 a=[]; for(var b=0;b=this.frameCount()){ throw new Error('Illegal frame index.'); } return new FrameMirror(this.break_id,a); }; ExecutionState.prototype.setSelectedFrame=function(a){ var b=builtins.$toNumber(a); if(b<0||b>=this.frameCount())throw new Error('Illegal frame index.'); this.selected_frame=b; }; ExecutionState.prototype.selectedFrame=function(){ return this.selected_frame; }; ExecutionState.prototype.debugCommandProcessor=function(a){ return new DebugCommandProcessor(this,a); }; function MakeBreakEvent(a,b){ return new BreakEvent(a,b); } function BreakEvent(a,b){ this.frame_=new FrameMirror(a,0); this.break_points_hit_=b; } BreakEvent.prototype.eventType=function(){ return Debug.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 a={seq:next_response_seq++, type:"event", event:"break", body:{invocationText:this.frame_.invocationText()} }; var b=this.func().script(); if(b){ a.body.sourceLine=this.sourceLine(), a.body.sourceColumn=this.sourceColumn(), a.body.sourceLineText=this.sourceLineText(), a.body.script=MakeScriptObject_(b,false); } if(this.breakPointsHit()){ a.body.breakpoints=[]; for(var c=0;c0){ a.body.sourceLine=this.sourceLine(); a.body.sourceColumn=this.sourceColumn(); a.body.sourceLineText=this.sourceLineText(); var b=this.func().script(); if(b){ a.body.script=MakeScriptObject_(b,false); } }else{ a.body.sourceLine=-1; } return a.toJSONProtocol(); }; function MakeCompileEvent(a,b){ return new CompileEvent(a,b); } function CompileEvent(a,b){ this.script_=MakeMirror(a); this.type_=b; } CompileEvent.prototype.eventType=function(){ return this.type_; }; CompileEvent.prototype.script=function(){ return this.script_; }; CompileEvent.prototype.toJSONProtocol=function(){ var a=new ProtocolMessage(); a.running=true; switch(this.type_){ case Debug.DebugEvent.BeforeCompile: a.event="beforeCompile"; break; case Debug.DebugEvent.AfterCompile: a.event="afterCompile"; break; case Debug.DebugEvent.CompileError: a.event="compileError"; break; } a.body={}; a.body.script=this.script_; return a.toJSONProtocol(); }; function MakeScriptObject_(a,b){ var c={id:a.id(), name:a.name(), lineOffset:a.lineOffset(), columnOffset:a.columnOffset(), lineCount:a.lineCount(), }; if(!(a.data()===(void 0))){ c.data=a.data(); } if(b){ c.source=a.source(); } return c; } function MakePromiseEvent(a){ return new PromiseEvent(a); } function PromiseEvent(a){ this.promise_=a.promise; this.parentPromise_=a.parentPromise; this.status_=a.status; this.value_=a.value; } PromiseEvent.prototype.promise=function(){ return MakeMirror(this.promise_); } PromiseEvent.prototype.parentPromise=function(){ return MakeMirror(this.parentPromise_); } PromiseEvent.prototype.status=function(){ return this.status_; } PromiseEvent.prototype.value=function(){ return MakeMirror(this.value_); } function MakeAsyncTaskEvent(a){ return new AsyncTaskEvent(a); } function AsyncTaskEvent(a){ this.type_=a.type; this.name_=a.name; this.id_=a.id; } AsyncTaskEvent.prototype.type=function(){ return this.type_; } AsyncTaskEvent.prototype.name=function(){ return this.name_; } AsyncTaskEvent.prototype.id=function(){ return this.id_; } function DebugCommandProcessor(a,b){ this.exec_state_=a; this.running_=b||false; } DebugCommandProcessor.prototype.processDebugRequest=function(a){ return this.processDebugJSONRequest(a); }; function ProtocolMessage(a){ this.seq=next_response_seq++; if(a){ this.type='response'; this.request_seq=a.seq; this.command=a.command; }else{ this.type='event'; } this.success=true; this.running=undefined; } ProtocolMessage.prototype.setOption=function(a,b){ if(!this.options_){ this.options_={}; } this.options_[a]=b; }; ProtocolMessage.prototype.failed=function(a,b){ this.success=false; this.message=a; if((%_IsObject(b))){ this.error_details=b; } }; ProtocolMessage.prototype.toJSONProtocol=function(){ var a={}; a.seq=this.seq; if(this.request_seq){ a.request_seq=this.request_seq; } a.type=this.type; if(this.event){ a.event=this.event; } if(this.command){ a.command=this.command; } if(this.success){ a.success=this.success; }else{ a.success=false; } if(this.body){ var b; var c=MakeMirrorSerializer(true,this.options_); if(this.body instanceof Mirror){ b=c.serializeValue(this.body); }else if(this.body instanceof Array){ b=[]; for(var d=0;d=this.exec_state_.frameCount()){ return b.failed('Invalid frame "'+d+'"'); } b.body=this.exec_state_.frame(m).evaluate( c,Boolean(g),i); return; }else{ b.body=this.exec_state_.frame().evaluate( c,Boolean(g),i); return; } }; DebugCommandProcessor.prototype.lookupRequest_=function(a,b){ if(!a.arguments){ return b.failed('Missing arguments'); } var c=a.arguments.handles; if((c===(void 0))){ return b.failed('Argument "handles" missing'); } if(!(a.arguments.includeSource===(void 0))){ var d=builtins.$toBoolean(a.arguments.includeSource); b.setOption('includeSource',d); } var e={}; for(var g=0;g=this.exec_state_.frameCount()){ return b.failed('Invalid frame "'+e+'"'); } e=this.exec_state_.frame(g); } } var h=e.func().script(); if(!h){ return b.failed('No source'); } var i=h.sourceSlice(c,d); if(!i){ return b.failed('Invalid line interval'); } b.body={}; b.body.source=i.sourceText(); b.body.fromLine=i.from_line; b.body.toLine=i.to_line; b.body.fromPosition=i.from_position; b.body.toPosition=i.to_position; b.body.totalLines=h.lineCount(); }; DebugCommandProcessor.prototype.scriptsRequest_=function(a,b){ var c=ScriptTypeFlag(Debug.ScriptType.Normal); var d=false; var e=null; if(a.arguments){ if(!(a.arguments.types===(void 0))){ c=builtins.$toNumber(a.arguments.types); if(isNaN(c)||c<0){ return b.failed('Invalid types "'+ a.arguments.types+'"'); } } if(!(a.arguments.includeSource===(void 0))){ d=builtins.$toBoolean(a.arguments.includeSource); b.setOption('includeSource',d); } if((%_IsArray(a.arguments.ids))){ e={}; var g=a.arguments.ids; for(var h=0;h=0){ n=true; } } if(!n)continue; } if(c&ScriptTypeFlag(l[h].type)){ b.body.push(MakeMirror(l[h])); } } }; DebugCommandProcessor.prototype.threadsRequest_=function(a,b){ var c=this.exec_state_.threadCount(); var d=[]; for(var e=0;e=this.exec_state_.frameCount()){ return response.failed('Invalid frame "'+a+'"'); } b=this.exec_state_.frame(c); }else{ b=this.exec_state_.frame(); } var d=Debug.LiveEdit.RestartFrame(b); response.body={result:d}; }; DebugCommandProcessor.prototype.debuggerFlagsRequest_=function(request, response){ if(!request.arguments){ response.failed('Missing arguments'); return; } var a=request.arguments.flags; response.body={flags:[]}; if(!(a===(void 0))){ for(var b=0;b"; }; function ValueMirror(a,b,c){ %_CallFunction(this,a,Mirror); this.value_=b; if(!c){ this.allocateHandle_(); }else{ this.allocateTransientHandle_(); } } inherits(ValueMirror,Mirror); Mirror.prototype.handle=function(){ return this.handle_; }; ValueMirror.prototype.isPrimitive=function(){ var a=this.type(); return a==='undefined'|| a==='null'|| a==='boolean'|| a==='number'|| a==='string'|| a==='symbol'; }; ValueMirror.prototype.value=function(){ return this.value_; }; function UndefinedMirror(){ %_CallFunction(this,UNDEFINED_TYPE,(void 0),ValueMirror); } inherits(UndefinedMirror,ValueMirror); UndefinedMirror.prototype.toText=function(){ return'undefined'; }; function NullMirror(){ %_CallFunction(this,NULL_TYPE,null,ValueMirror); } inherits(NullMirror,ValueMirror); NullMirror.prototype.toText=function(){ return'null'; }; function BooleanMirror(a){ %_CallFunction(this,BOOLEAN_TYPE,a,ValueMirror); } inherits(BooleanMirror,ValueMirror); BooleanMirror.prototype.toText=function(){ return this.value_?'true':'false'; }; function NumberMirror(a){ %_CallFunction(this,NUMBER_TYPE,a,ValueMirror); } inherits(NumberMirror,ValueMirror); NumberMirror.prototype.toText=function(){ return %_NumberToString(this.value_); }; function StringMirror(a){ %_CallFunction(this,STRING_TYPE,a,ValueMirror); } inherits(StringMirror,ValueMirror); StringMirror.prototype.length=function(){ return this.value_.length; }; StringMirror.prototype.getTruncatedValue=function(a){ if(a!=-1&&this.length()>a){ return this.value_.substring(0,a)+ '... (length: '+this.length()+')'; } return this.value_; }; StringMirror.prototype.toText=function(){ return this.getTruncatedValue(kMaxProtocolStringLength); }; function SymbolMirror(a){ %_CallFunction(this,SYMBOL_TYPE,a,ValueMirror); } inherits(SymbolMirror,ValueMirror); SymbolMirror.prototype.description=function(){ return %SymbolDescription(%_ValueOf(this.value_)); } SymbolMirror.prototype.toText=function(){ return %_CallFunction(this.value_,builtins.$symbolToString); } function ObjectMirror(a,b,c){ %_CallFunction(this,b||OBJECT_TYPE,a,c,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 a=%GetInterceptorInfo(this.value_); return(a&2)!=0; }; ObjectMirror.prototype.hasIndexedInterceptor=function(){ var a=%GetInterceptorInfo(this.value_); return(a&1)!=0; }; function TryGetPropertyNames(a){ try{ return %GetOwnPropertyNames(a,32); }catch(e){ return[]; } } ObjectMirror.prototype.propertyNames=function(a,b){ a=a||PropertyKind.Named|PropertyKind.Indexed; var c; var d; var e=0; if(a&PropertyKind.Named){ c=TryGetPropertyNames(this.value_); e+=c.length; if(this.hasNamedInterceptor()&&(a&PropertyKind.Named)){ var g= %GetNamedInterceptorPropertyNames(this.value_); if(g){ c=c.concat(g); e+=g.length; } } } if(a&PropertyKind.Indexed){ d=%GetOwnElementNames(this.value_); e+=d.length; if(this.hasIndexedInterceptor()&&(a&PropertyKind.Indexed)){ var h= %GetIndexedInterceptorElementNames(this.value_); if(h){ d=d.concat(h); e+=h.length; } } } b=Math.min(b||e,e); var i=new Array(b); var j=0; if(a&PropertyKind.Named){ for(var k=0;j'; }; ObjectMirror.GetInternalProperties=function(a){ var b=%DebugGetInternalProperties(a); var c=[]; for(var d=0;db)return new Array(); var c=new Array(b-a+1); for(var d=a;d<=b;d++){ var e=%DebugGetPropertyDetails(this.value_,builtins.$toString(d)); var g; if(e){ g=new PropertyMirror(this,d,e); }else{ g=GetUndefinedMirror(); } c[d-a]=g; } return c; }; function DateMirror(a){ %_CallFunction(this,a,ObjectMirror); } inherits(DateMirror,ObjectMirror); DateMirror.prototype.toText=function(){ var a=JSON.stringify(this.value_); return a.substring(1,a.length-1); }; function RegExpMirror(a){ %_CallFunction(this,a,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(a){ %_CallFunction(this,a,ERROR_TYPE,ObjectMirror); } inherits(ErrorMirror,ObjectMirror); ErrorMirror.prototype.message=function(){ return this.value_.message; }; ErrorMirror.prototype.toText=function(){ var a; try{ a=%_CallFunction(this.value_,builtins.$errorToString); }catch(e){ a='#'; } return a; }; function PromiseMirror(a){ %_CallFunction(this,a,PROMISE_TYPE,ObjectMirror); } inherits(PromiseMirror,ObjectMirror); function PromiseGetStatus_(a){ var b=%DebugGetProperty(a,builtins.$promiseStatus); if(b==0)return"pending"; if(b==1)return"resolved"; return"rejected"; } function PromiseGetValue_(a){ return %DebugGetProperty(a,builtins.$promiseValue); } PromiseMirror.prototype.status=function(){ return PromiseGetStatus_(this.value_); }; PromiseMirror.prototype.promiseValue=function(){ return MakeMirror(PromiseGetValue_(this.value_)); }; function MapMirror(a){ %_CallFunction(this,a,MAP_TYPE,ObjectMirror); } inherits(MapMirror,ObjectMirror); MapMirror.prototype.entries=function(a){ var b=[]; if((%_ClassOf(this.value_)==='WeakMap')){ var c=%GetWeakMapEntries(this.value_,a||0); for(var d=0;d3){ this.exception_=c[3]; this.getter_=c[4]; this.setter_=c[5]; } } inherits(PropertyMirror,Mirror); PropertyMirror.prototype.isReadOnly=function(){ return(this.attributes()&PropertyAttribute.ReadOnly)!=0; }; PropertyMirror.prototype.isEnum=function(){ return(this.attributes()&PropertyAttribute.DontEnum)==0; }; PropertyMirror.prototype.canDelete=function(){ return(this.attributes()&PropertyAttribute.DontDelete)==0; }; PropertyMirror.prototype.name=function(){ return this.name_; }; PropertyMirror.prototype.isIndexed=function(){ for(var a=0;a0; }; FrameDetails.prototype.inlinedFrameIndex=function(){ %CheckExecutionState(this.break_id_); var a=kFrameDetailsFlagInlinedFrameIndexMask; return(this.details_[kFrameDetailsFlagsIndex]&a)>>2; }; FrameDetails.prototype.argumentCount=function(){ %CheckExecutionState(this.break_id_); return this.details_[kFrameDetailsArgumentCountIndex]; }; FrameDetails.prototype.argumentName=function(a){ %CheckExecutionState(this.break_id_); if(a>=0&&a=0&&a=0&&a=0&&a0){ for(var c=0;c0){ a+=this.lineOffset(); a+='-'; a+=this.lineOffset()+this.lineCount()-1; }else{ a+=this.lineCount(); } a+=')'; return a; }; function ContextMirror(a){ %_CallFunction(this,CONTEXT_TYPE,Mirror); this.data_=a; this.allocateHandle_(); } inherits(ContextMirror,Mirror); ContextMirror.prototype.data=function(){ return this.data_; }; function MakeMirrorSerializer(a,b){ return new JSONProtocolSerializer(a,b); } function JSONProtocolSerializer(a,b){ this.details_=a; this.options_=b; this.mirrors_=[]; } JSONProtocolSerializer.prototype.serializeReference=function(a){ return this.serialize_(a,true,true); }; JSONProtocolSerializer.prototype.serializeValue=function(a){ var b=this.serialize_(a,false,true); return b; }; JSONProtocolSerializer.prototype.serializeReferencedObjects=function(){ var a=[]; var b=this.mirrors_.length; for(var c=0;cthis.maxStringLength_()){ var b=mirror.getTruncatedValue(this.maxStringLength_()); a.value=b; a.fromIndex=0; a.toIndex=this.maxStringLength_(); }else{ a.value=mirror.value(); } a.length=mirror.length(); break; case SYMBOL_TYPE: a.description=mirror.description(); break; case OBJECT_TYPE: case FUNCTION_TYPE: case ERROR_TYPE: case REGEXP_TYPE: case PROMISE_TYPE: case GENERATOR_TYPE: this.serializeObject_(mirror,a,details); break; case PROPERTY_TYPE: case INTERNAL_PROPERTY_TYPE: throw new Error('PropertyMirror cannot be serialized independently'); break; case FRAME_TYPE: this.serializeFrame_(mirror,a); break; case SCOPE_TYPE: this.serializeScope_(mirror,a); break; case SCRIPT_TYPE: if(mirror.name()){ a.name=mirror.name(); } a.id=mirror.id(); a.lineOffset=mirror.lineOffset(); a.columnOffset=mirror.columnOffset(); a.lineCount=mirror.lineCount(); if(mirror.data()){ a.data=mirror.data(); } if(this.includeSource_()){ a.source=mirror.source(); }else{ var c=mirror.source().substring(0,80); a.sourceStart=c; } a.sourceLength=mirror.source().length; a.scriptType=mirror.scriptType(); a.compilationType=mirror.compilationType(); if(mirror.compilationType()==1&& mirror.evalFromScript()){ a.evalFromScript= this.serializeReference(mirror.evalFromScript()); var d=mirror.evalFromLocation(); if(d){ a.evalFromLocation={line:d.line, column:d.column}; } if(mirror.evalFromFunctionName()){ a.evalFromFunctionName=mirror.evalFromFunctionName(); } } if(mirror.context()){ a.context=this.serializeReference(mirror.context()); } break; case CONTEXT_TYPE: a.data=mirror.data(); break; } a.text=mirror.toText(); return a; }; JSONProtocolSerializer.prototype.serializeObject_=function(mirror,content, details){ content.className=mirror.className(); content.constructorFunction= this.serializeReference(mirror.constructorFunction()); content.protoObject=this.serializeReference(mirror.protoObject()); content.prototypeObject=this.serializeReference(mirror.prototypeObject()); if(mirror.hasNamedInterceptor()){ content.namedInterceptor=true; } if(mirror.hasIndexedInterceptor()){ content.indexedInterceptor=true; } if(mirror.isFunction()){ content.name=mirror.name(); if(!(mirror.inferredName()===(void 0))){ content.inferredName=mirror.inferredName(); } content.resolved=mirror.resolved(); if(mirror.resolved()){ content.source=mirror.source(); } if(mirror.script()){ content.script=this.serializeReference(mirror.script()); content.scriptId=mirror.script().id(); serializeLocationFields(mirror.sourceLocation(),content); } content.scopes=[]; for(var a=0;a0){ var i=[]; for(var a=0;a0){ return'Infinity'; }else{ return'-Infinity'; } } return a; } liveeditÁø "use strict"; Debug.LiveEdit=new function(){ var a; var b="stack_update_needs_step_in"; function ApplyPatchMultiChunk(script,diff_array,new_source,preview_only, change_log){ var c=script.source; var d=GatherCompileInfo(c,script); var e=BuildCodeInfoTree(d); var g=new PosTranslator(diff_array); MarkChangedFunctions(e,g.GetChunks()); FindLiveSharedInfos(e,script); var h; try{ h=GatherCompileInfo(new_source,script); }catch(e){ var i= new Failure("Failed to compile new version of script: "+e); if(e instanceof SyntaxError){ var j={ type:"liveedit_compile_error", syntaxErrorMessage:e.message }; CopyErrorPositionToDetails(e,j); i.details=j; } throw i; } var k=BuildCodeInfoTree(h); FindCorrespondingFunctions(e,k); var l=new Array(); var m=new Array(); var n=new Array(); var o=new Array(); function HarvestTodo(p){ function CollectDamaged(q){ m.push(q); for(var r=0;rI[x].start_position){ K=x; } } if(K!=r){ var L=I[K]; var M=J[K]; I[K]=I[r]; J[K]=J[r]; I[r]=L; J[r]=M; } } var N=0; function ResetIndexes(O,P){ var Q=-1; while(N=aE.pos1+aE.len1){ return ay+aE.pos2+aE.len2-aE.pos1-aE.len1; } if(!az){ az=PosTranslator.DefaultInsideChunkHandler; } return az(ay,aE); }; PosTranslator.DefaultInsideChunkHandler=function(ay,aF){ Assert(false,"Cannot translate position in changed area"); }; PosTranslator.ShiftWithTopInsideChunkHandler= function(ay,aF){ return ay-aF.pos1+aF.pos2; }; var a={ UNCHANGED:"unchanged", SOURCE_CHANGED:"source changed", CHANGED:"changed", DAMAGED:"damaged" }; function CodeInfoTreeNode(aG,aH,aI){ this.info=aG; this.children=aH; this.array_index=aI; this.parent=(void 0); this.status=a.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(aJ){ var aK=0; function BuildNode(){ var aL=aK; aK++; var aM=new Array(); while(aK=as.length;}; this.TranslatePos=function(ay){return ay+aR;}; }; function ProcessInternals(aS){ aS.new_start_pos=aP.TranslatePos( aS.info.start_position); var aT=0; var aU=false; var aV=false; while(!aP.done()&& aP.current().pos1= aP.current().pos1+aP.current().len1){ aU=true; aP.next(); continue; }else if(aW.info.start_position<=aP.current().pos1&& aW.info.end_position>=aP.current().pos1+ aP.current().len1){ ProcessInternals(aW); aV=aV|| (aW.status!=a.UNCHANGED); aU=aU|| (aW.status==a.DAMAGED); aT++; continue; }else{ aU=true; aW.status=a.DAMAGED; aW.status_explanation= "Text diff overlaps with function boundary"; aT++; continue; } }else{ if(aP.current().pos1+aP.current().len1<= aS.info.end_position){ aS.status=a.CHANGED; aP.next(); continue; }else{ aS.status=a.DAMAGED; aS.status_explanation= "Text diff overlaps with function boundary"; return; } } Assert("Unreachable",false); } while(aT0){ return bj; } } function TraverseTree(q){ q.live_shared_function_infos=FindFunctionInfos(q.info); for(var r=0;r ["+br+"]"; } return; } var bs; function CheckStackActivations(bt,S){ var bu=new Array(); for(var r=0;r0){ S.push({dropped_from_stack:bx}); } if(bw.length>0){ S.push({functions_on_stack:bw}); throw new Failure("Blocked by functions on stack"); } return bx.length; } var bs={ 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 }; bs.SymbolName=function(bA){ var bB=bs; for(var bC in bB){ if(bB[bC]==bA){ return bC; } } }; function Failure(am){ this.message=am; } this.Failure=Failure; Failure.prototype.toString=function(){ return"LiveEdit Failure: "+this.message; }; function CopyErrorPositionToDetails(bD,j){ function createPositionStruct(G,bE){ if(bE==-1)return; var bF=G.locationFromPosition(bE,true); if(bF==null)return; return{ line:bF.line+1, column:bF.column+1, position:bE }; } if(!("scriptObject"in bD)||!("startPosition"in bD)){ return; } var G=bD.scriptObject; var bG={ start:createPositionStruct(G,bD.startPosition), end:createPositionStruct(G,bD.endPosition) }; j.position=bG; } function GetPcFromSourcePos(bH,bI){ return %GetFunctionCodePositionFromSource(bH,bI); } this.GetPcFromSourcePos=GetPcFromSourcePos; function SetScriptSource(G,bJ,bK,S){ var c=G.source; var bL=CompareStrings(c,bJ); return ApplyPatchMultiChunk(G,bL,bJ,bK, S); } this.SetScriptSource=SetScriptSource; function CompareStrings(bM,bN){ return %LiveEditCompareStrings(bM,bN); } function ApplySingleChunkPatch(G,change_pos,change_len,new_str, S){ var c=G.source; var bJ=c.substring(0,change_pos)+ new_str+c.substring(change_pos+change_len); return ApplyPatchMultiChunk(G, [change_pos,change_pos+change_len,change_pos+new_str.length], bJ,false,S); } function DescribeChangeTree(aX){ function ProcessOldNode(q){ var bO=[]; for(var r=0;r=0&&D<0x800000&& (%_ClassOf(this)==='Function')){ return D; } } D=(C==null)?0:%$toUint32(C.length); if(D>0x800000)throw %MakeRangeError(144); if(!(%_ClassOf(this)==='Function')){ throw %MakeTypeError(8,%$toString(this),typeof this); } if(C!=null&&!(%_IsSpecObject(C))){ throw %MakeTypeError(116,"Function.prototype.apply"); } return D; } REFLECT_APPLY_PREPARE=function REFLECT_APPLY_PREPARE(C){ var D; if((%_IsArray(C))){ D=C.length; if(%_IsSmi(D)&&D>=0&&D<0x800000&& (%_ClassOf(this)==='Function')){ return D; } } if(!(%_ClassOf(this)==='Function')){ throw %MakeTypeError(12,%$toString(this)); } if(!(%_IsSpecObject(C))){ throw %MakeTypeError(116,"Reflect.apply"); } D=%$toLength(C.length); if(D>0x800000)throw %MakeRangeError(144); return D; } REFLECT_CONSTRUCT_PREPARE=function REFLECT_CONSTRUCT_PREPARE( C,newTarget){ var D; var E=(%_ClassOf(this)==='Function')&&%IsConstructor(this); var F=(%_ClassOf(newTarget)==='Function')&&%IsConstructor(newTarget); if((%_IsArray(C))){ D=C.length; if(%_IsSmi(D)&&D>=0&&D<0x800000&& E&&F){ return D; } } if(!E){ if(!(%_ClassOf(this)==='Function')){ throw %MakeTypeError(12,%$toString(this)); }else{ throw %MakeTypeError(52,%$toString(this)); } } if(!F){ if(!(%_ClassOf(newTarget)==='Function')){ throw %MakeTypeError(12,%$toString(newTarget)); }else{ throw %MakeTypeError(52,%$toString(newTarget)); } } if(!(%_IsSpecObject(C))){ throw %MakeTypeError(116,"Reflect.construct"); } D=%$toLength(C.length); if(D>0x800000)throw %MakeRangeError(144); return D; } CONCAT_ITERABLE_TO_ARRAY=function CONCAT_ITERABLE_TO_ARRAY(G){ return %$concatIterableToArray(this,G); }; STACK_OVERFLOW=function STACK_OVERFLOW(D){ throw %MakeRangeError(144); } TO_OBJECT=function TO_OBJECT(){ return %$toObject(this); } TO_NUMBER=function TO_NUMBER(){ return %$toNumber(this); } TO_STRING=function TO_STRING(){ return %$toString(this); } TO_NAME=function TO_NAME(){ return %$toName(this); } StringLengthTFStub=function StringLengthTFStub(H,I){ var J=function(K,L,M,N){ return %_StringGetLength(%_JSValueGetValue(K)); } return J; } StringAddTFStub=function StringAddTFStub(H,I){ var J=function(k,l){ return %StringAdd(k,l); } return J; } MathFloorStub=function MathFloorStub(H,I){ var J=function(O,M,N){ var P=%_MathFloor(+N); if(%_IsMinusZero(P)){ %_FixedArraySet(%_GetTypeFeedbackVector(O),((M|0)+1)|0,1); return-0; } var Q=P|0; if(Q===P){ return Q; } return P; } return J; } function ToPrimitive(i,R){ if((typeof(i)==='string'))return i; if(!(%_IsSpecObject(i)))return i; if((%_ClassOf(i)==='Symbol'))throw MakeTypeError(109); if(R==0)R=((%_IsDate(i)))?2:1; return(R==1)?DefaultNumber(i):DefaultString(i); } function ToBoolean(i){ if((typeof(i)==='boolean'))return i; if((typeof(i)==='string'))return i.length!=0; if(i==null)return false; if((typeof(i)==='number'))return!((i==0)||(!%_IsSmi(%IS_VAR(i))&&!(i==i))); return true; } function ToNumber(i){ if((typeof(i)==='number'))return i; if((typeof(i)==='string')){ return %_HasCachedArrayIndex(i)?%_GetCachedArrayIndex(i) :%StringToNumber(i); } if((typeof(i)==='boolean'))return i?1:0; if((i===(void 0)))return $NaN; if((typeof(i)==='symbol'))throw MakeTypeError(110); return((i===null))?0:ToNumber(DefaultNumber(i)); } function NonNumberToNumber(i){ if((typeof(i)==='string')){ return %_HasCachedArrayIndex(i)?%_GetCachedArrayIndex(i) :%StringToNumber(i); } if((typeof(i)==='boolean'))return i?1:0; if((i===(void 0)))return $NaN; if((typeof(i)==='symbol'))throw MakeTypeError(110); return((i===null))?0:ToNumber(DefaultNumber(i)); } function ToString(i){ if((typeof(i)==='string'))return i; if((typeof(i)==='number'))return %_NumberToString(i); if((typeof(i)==='boolean'))return i?'true':'false'; if((i===(void 0)))return'undefined'; if((typeof(i)==='symbol'))throw MakeTypeError(111); return((i===null))?'null':ToString(DefaultString(i)); } function NonStringToString(i){ if((typeof(i)==='number'))return %_NumberToString(i); if((typeof(i)==='boolean'))return i?'true':'false'; if((i===(void 0)))return'undefined'; if((typeof(i)==='symbol'))throw MakeTypeError(111); return((i===null))?'null':ToString(DefaultString(i)); } function ToName(i){ return(typeof(i)==='symbol')?i:ToString(i); } function ToObject(i){ if((typeof(i)==='string'))return new e(i); if((typeof(i)==='number'))return new g(i); if((typeof(i)==='boolean'))return new d(i); if((typeof(i)==='symbol'))return %NewSymbolWrapper(i); if((i==null)&&!(%_IsUndetectableObject(i))){ throw MakeTypeError(112); } return i; } function ToInteger(i){ if(%_IsSmi(i))return i; return %NumberToInteger(ToNumber(i)); } function ToLength(S){ S=ToInteger(S); if(S<0)return 0; return S=0)return i; return %NumberToJSUint32(ToNumber(i)); } function ToInt32(i){ if(%_IsSmi(i))return i; return %NumberToJSInt32(ToNumber(i)); } function SameValue(i,h){ if(typeof i!=typeof h)return false; if((typeof(i)==='number')){ if((!%_IsSmi(%IS_VAR(i))&&!(i==i))&&(!%_IsSmi(%IS_VAR(h))&&!(h==h)))return true; if(i===0&&h===0&&%_IsMinusZero(i)!=%_IsMinusZero(h)){ return false; } } return i===h; } function SameValueZero(i,h){ if(typeof i!=typeof h)return false; if((typeof(i)==='number')){ if((!%_IsSmi(%IS_VAR(i))&&!(i==i))&&(!%_IsSmi(%IS_VAR(h))&&!(h==h)))return true; } return i===h; } function ConcatIterableToArray(T,G){ var U=T.length; for(var V of G){ %AddElement(T,U++,V); } return T; } function IsPrimitive(i){ return!(%_IsSpecObject(i)); } function IsConcatSpreadable(w){ if(!(%_IsSpecObject(w)))return false; var W=w[symbolIsConcatSpreadable]; if((W===(void 0)))return(%_IsArray(w)); return ToBoolean(W); } function DefaultNumber(i){ if(!(%_ClassOf(i)==='Symbol')){ var X=i.valueOf; if((%_ClassOf(X)==='Function')){ var N=%_CallFunction(i,X); if(IsPrimitive(N))return N; } var Y=i.toString; if((%_ClassOf(Y)==='Function')){ var Z=%_CallFunction(i,Y); if(IsPrimitive(Z))return Z; } } throw MakeTypeError(15); } function DefaultString(i){ if(!(%_ClassOf(i)==='Symbol')){ var Y=i.toString; if((%_ClassOf(Y)==='Function')){ var Z=%_CallFunction(i,Y); if(IsPrimitive(Z))return Z; } var X=i.valueOf; if((%_ClassOf(X)==='Function')){ var N=%_CallFunction(i,X); if(IsPrimitive(N))return N; } } throw MakeTypeError(15); } function ToPositiveInteger(i,aa){ var M=(%_IsSmi(%IS_VAR(i))?i:%NumberToIntegerMapMinusZero($toNumber(i))); if(M<0)throw MakeRangeError(aa); return M; } %FunctionSetPrototype(c,new c(0)); $concatIterableToArray=ConcatIterableToArray; $defaultNumber=DefaultNumber; $defaultString=DefaultString; $NaN=%GetRootNaN(); $nonNumberToNumber=NonNumberToNumber; $nonStringToString=NonStringToString; $sameValue=SameValue; $sameValueZero=SameValueZero; $toBoolean=ToBoolean; $toInt32=ToInt32; $toInteger=ToInteger; $toLength=ToLength; $toName=ToName; $toNumber=ToNumber; $toObject=ToObject; $toPositiveInteger=ToPositiveInteger; $toPrimitive=ToPrimitive; $toString=ToString; $toUint32=ToUint32; }) prologue½4 (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=(void 0); var d=(void 0); var e=(void 0); function Export(g){ g.next=d; d=g; }; function Import(g){ g.next=c; c=g; }; function ImportFromExperimental(g){ g.next=e; e=g; }; function SetFunctionName(g,h,i){ if((typeof(h)==='symbol')){ h="["+%SymbolDescription(h)+"]"; } if((i===(void 0))){ %FunctionSetName(g,h); }else{ %FunctionSetName(g,i+" "+h); } } function InstallConstants(j,k){ %CheckIsBootstrapping(); %OptimizeObjectForAddingMultipleProperties(j,k.length>>1); var l=2|4|1; for(var m=0;m>1); for(var m=0;m>1)+(fields?fields.length:0); if(u>=4){ %OptimizeObjectForAddingMultipleProperties(t,u); } if(fields){ for(var m=0;m>0)); if(!(t==0||(2<=t&&t<=36))){ return $NaN; } } if(%_HasCachedArrayIndex(r)&& (t==0||t==10)){ return %_GetCachedArrayIndex(r); } return %StringParseInt(r,t); } function GlobalParseFloat(r){ r=((typeof(%IS_VAR(r))==='string')?r:$nonStringToString(r)); if(%_HasCachedArrayIndex(r))return %_GetCachedArrayIndex(r); return %StringParseFloat(r); } function GlobalEval(u){ if(!(typeof(u)==='string'))return u; var v=%GlobalProxy(GlobalEval); var w=%CompileString(u,false); if(!(%_IsFunction(w)))return w; return %_CallFunction(v,w); } var x=2|4|1; b.InstallConstants(a,[ "NaN",$NaN, "Infinity",(1/0), "undefined",(void 0), ]); b.InstallFunctions(a,2,[ "isNaN",GlobalIsNaN, "isFinite",GlobalIsFinite, "parseInt",GlobalParseInt, "parseFloat",GlobalParseFloat, "eval",GlobalEval ]); function ObjectToString(){ if((this===(void 0))&&!(%_IsUndetectableObject(this)))return"[object Undefined]"; if((this===null))return"[object Null]"; var y=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)); var z=%_ClassOf(y); var A; if(harmony_tostring){ A=y[symbolToStringTag]; if(!(typeof(A)==='string')){ A=z; } }else{ A=z; } return`[object ${A}]`; } function ObjectToLocaleString(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Object.prototype.toLocaleString"); return this.toString(); } function ObjectValueOf(){ return((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)); } function ObjectHasOwnProperty(B){ var C=$toName(B); var D=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)); if(%_IsJSProxy(D)){ if((typeof(B)==='symbol'))return false; var E=%GetHandler(D); return CallTrap1(E,"hasOwn",m,C); } return %HasOwnProperty(D,C); } function ObjectIsPrototypeOf(F){ if(!(%_IsSpecObject(F)))return false; if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Object.prototype.isPrototypeOf"); return %IsInPrototypeChain(this,F); } function ObjectPropertyIsEnumerable(F){ var G=$toName(F); if(%_IsJSProxy(this)){ if((typeof(F)==='symbol'))return false; var H=GetOwnPropertyJS(this,G); return(H===(void 0))?false:H.isEnumerable(); } return %IsPropertyEnumerable(((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)),G); } function ObjectDefineGetter(C,I){ var J=this; if(J==null&&!(%_IsUndetectableObject(J))){ J=%GlobalProxy(ObjectDefineGetter); } if(!(%_ClassOf(I)==='Function')){ throw MakeTypeError(60); } var H=new PropertyDescriptor(); H.setGet(I); H.setEnumerable(true); H.setConfigurable(true); DefineOwnProperty(((%_IsSpecObject(%IS_VAR(J)))?J:$toObject(J)),$toName(C),H,false); } function ObjectLookupGetter(C){ var J=this; if(J==null&&!(%_IsUndetectableObject(J))){ J=%GlobalProxy(ObjectLookupGetter); } return %LookupAccessor(((%_IsSpecObject(%IS_VAR(J)))?J:$toObject(J)),$toName(C),0); } function ObjectDefineSetter(C,I){ var J=this; if(J==null&&!(%_IsUndetectableObject(J))){ J=%GlobalProxy(ObjectDefineSetter); } if(!(%_ClassOf(I)==='Function')){ throw MakeTypeError(63); } var H=new PropertyDescriptor(); H.setSet(I); H.setEnumerable(true); H.setConfigurable(true); DefineOwnProperty(((%_IsSpecObject(%IS_VAR(J)))?J:$toObject(J)),$toName(C),H,false); } function ObjectLookupSetter(C){ var J=this; if(J==null&&!(%_IsUndetectableObject(J))){ J=%GlobalProxy(ObjectLookupSetter); } return %LookupAccessor(((%_IsSpecObject(%IS_VAR(J)))?J:$toObject(J)),$toName(C),1); } function ObjectKeys(K){ K=((%_IsSpecObject(%IS_VAR(K)))?K:$toObject(K)); if(%_IsJSProxy(K)){ var E=%GetHandler(K); var L=CallTrap0(E,"keys",n); return ToNameArray(L,"keys",false); } return %OwnKeys(K); } function IsAccessorDescriptor(H){ if((H===(void 0)))return false; return H.hasGetter()||H.hasSetter(); } function IsDataDescriptor(H){ if((H===(void 0)))return false; return H.hasValue()||H.hasWritable(); } function IsGenericDescriptor(H){ if((H===(void 0)))return false; return!(IsAccessorDescriptor(H)||IsDataDescriptor(H)); } function IsInconsistentDescriptor(H){ return IsAccessorDescriptor(H)&&IsDataDescriptor(H); } function FromPropertyDescriptor(H){ if((H===(void 0)))return H; if(IsDataDescriptor(H)){ return{value:H.getValue(), writable:H.isWritable(), enumerable:H.isEnumerable(), configurable:H.isConfigurable()}; } return{get:H.getGet(), set:H.getSet(), enumerable:H.isEnumerable(), configurable:H.isConfigurable()}; } function FromGenericPropertyDescriptor(H){ if((H===(void 0)))return H; var K=new h(); if(H.hasValue()){ %AddNamedProperty(K,"value",H.getValue(),0); } if(H.hasWritable()){ %AddNamedProperty(K,"writable",H.isWritable(),0); } if(H.hasGetter()){ %AddNamedProperty(K,"get",H.getGet(),0); } if(H.hasSetter()){ %AddNamedProperty(K,"set",H.getSet(),0); } if(H.hasEnumerable()){ %AddNamedProperty(K,"enumerable",H.isEnumerable(),0); } if(H.hasConfigurable()){ %AddNamedProperty(K,"configurable",H.isConfigurable(),0); } return K; } function ToPropertyDescriptor(K){ if(!(%_IsSpecObject(K)))throw MakeTypeError(76,K); var H=new PropertyDescriptor(); if("enumerable"in K){ H.setEnumerable($toBoolean(K.enumerable)); } if("configurable"in K){ H.setConfigurable($toBoolean(K.configurable)); } if("value"in K){ H.setValue(K.value); } if("writable"in K){ H.setWritable($toBoolean(K.writable)); } if("get"in K){ var M=K.get; if(!(M===(void 0))&&!(%_ClassOf(M)==='Function')){ throw MakeTypeError(61,M); } H.setGet(M); } if("set"in K){ var N=K.set; if(!(N===(void 0))&&!(%_ClassOf(N)==='Function')){ throw MakeTypeError(64,N); } H.setSet(N); } if(IsInconsistentDescriptor(H)){ throw MakeTypeError(113,K); } return H; } function ToCompletePropertyDescriptor(K){ var H=ToPropertyDescriptor(K); if(IsGenericDescriptor(H)||IsDataDescriptor(H)){ if(!H.hasValue())H.setValue((void 0)); if(!H.hasWritable())H.setWritable(false); }else{ if(!H.hasGetter())H.setGet((void 0)); if(!H.hasSetter())H.setSet((void 0)); } if(!H.hasEnumerable())H.setEnumerable(false); if(!H.hasConfigurable())H.setConfigurable(false); return H; } function PropertyDescriptor(){ this.value_=(void 0); this.hasValue_=false; this.writable_=false; this.hasWritable_=false; this.enumerable_=false; this.hasEnumerable_=false; this.configurable_=false; this.hasConfigurable_=false; this.get_=(void 0); this.hasGetter_=false; this.set_=(void 0); this.hasSetter_=false; } b.SetUpLockedPrototype(PropertyDescriptor,[ "value_", "hasValue_", "writable_", "hasWritable_", "enumerable_", "hasEnumerable_", "configurable_", "hasConfigurable_", "get_", "hasGetter_", "set_", "hasSetter_" ],[ "toString",function PropertyDescriptor_ToString(){ return"[object PropertyDescriptor]"; }, "setValue",function PropertyDescriptor_SetValue(B){ this.value_=B; this.hasValue_=true; }, "getValue",function PropertyDescriptor_GetValue(){ return this.value_; }, "hasValue",function PropertyDescriptor_HasValue(){ return this.hasValue_; }, "setEnumerable",function PropertyDescriptor_SetEnumerable(O){ this.enumerable_=O; this.hasEnumerable_=true; }, "isEnumerable",function PropertyDescriptor_IsEnumerable(){ return this.enumerable_; }, "hasEnumerable",function PropertyDescriptor_HasEnumerable(){ return this.hasEnumerable_; }, "setWritable",function PropertyDescriptor_SetWritable(P){ this.writable_=P; this.hasWritable_=true; }, "isWritable",function PropertyDescriptor_IsWritable(){ return this.writable_; }, "hasWritable",function PropertyDescriptor_HasWritable(){ return this.hasWritable_; }, "setConfigurable", function PropertyDescriptor_SetConfigurable(Q){ this.configurable_=Q; this.hasConfigurable_=true; }, "hasConfigurable",function PropertyDescriptor_HasConfigurable(){ return this.hasConfigurable_; }, "isConfigurable",function PropertyDescriptor_IsConfigurable(){ return this.configurable_; }, "setGet",function PropertyDescriptor_SetGetter(M){ this.get_=M; this.hasGetter_=true; }, "getGet",function PropertyDescriptor_GetGetter(){ return this.get_; }, "hasGetter",function PropertyDescriptor_HasGetter(){ return this.hasGetter_; }, "setSet",function PropertyDescriptor_SetSetter(N){ this.set_=N; this.hasSetter_=true; }, "getSet",function PropertyDescriptor_GetSetter(){ return this.set_; }, "hasSetter",function PropertyDescriptor_HasSetter(){ return this.hasSetter_; } ]); function ConvertDescriptorArrayToDescriptor(R){ if((R===(void 0))){ return(void 0); } var H=new PropertyDescriptor(); if(R[0]){ H.setGet(R[2]); H.setSet(R[3]); }else{ H.setValue(R[1]); H.setWritable(R[4]); } H.setEnumerable(R[5]); H.setConfigurable(R[6]); return H; } function GetTrap(E,C,S){ var T=E[C]; if((T===(void 0))){ if((S===(void 0))){ throw MakeTypeError(83,E,C); } T=S; }else if(!(%_ClassOf(T)==='Function')){ throw MakeTypeError(84,E,C); } return T; } function CallTrap0(E,C,S){ return %_CallFunction(E,GetTrap(E,C,S)); } function CallTrap1(E,C,S,u){ return %_CallFunction(E,u,GetTrap(E,C,S)); } function CallTrap2(E,C,S,u,U){ return %_CallFunction(E,u,U,GetTrap(E,C,S)); } function GetOwnPropertyJS(K,V){ var W=$toName(V); if(%_IsJSProxy(K)){ if((typeof(V)==='symbol'))return(void 0); var E=%GetHandler(K); var X=CallTrap1( E,"getOwnPropertyDescriptor",(void 0),W); if((X===(void 0)))return X; var H=ToCompletePropertyDescriptor(X); if(!H.isConfigurable()){ throw MakeTypeError(87, E,W,"getOwnPropertyDescriptor"); } return H; } var Y=%GetOwnProperty(((%_IsSpecObject(%IS_VAR(K)))?K:$toObject(K)),W); return ConvertDescriptorArrayToDescriptor(Y); } function Delete(K,W,Z){ var H=GetOwnPropertyJS(K,W); if((H===(void 0)))return true; if(H.isConfigurable()){ %DeleteProperty(K,W,0); return true; }else if(Z){ throw MakeTypeError(24,W); }else{ return; } } function GetMethod(K,W){ var aa=K[W]; if((aa==null))return(void 0); if((%_ClassOf(aa)==='Function'))return aa; throw MakeTypeError(12,typeof aa); } function DefineProxyProperty(K,W,x,Z){ if((typeof(W)==='symbol'))return false; var E=%GetHandler(K); var ab=CallTrap2(E,"defineProperty",(void 0),W,x); if(!$toBoolean(ab)){ if(Z){ throw MakeTypeError(82, E,"false","defineProperty"); }else{ return false; } } return true; } function DefineObjectProperty(K,W,H,Z){ var ac=%GetOwnProperty(K,$toName(W)); var ad=ConvertDescriptorArrayToDescriptor(ac); var ae=%IsExtensible(K); if((ad===(void 0))&&!ae){ if(Z){ throw MakeTypeError(24,W); }else{ return false; } } if(!(ad===(void 0))){ if((IsGenericDescriptor(H)|| IsDataDescriptor(H)==IsDataDescriptor(ad))&& (!H.hasEnumerable()|| $sameValue(H.isEnumerable(),ad.isEnumerable()))&& (!H.hasConfigurable()|| $sameValue(H.isConfigurable(),ad.isConfigurable()))&& (!H.hasWritable()|| $sameValue(H.isWritable(),ad.isWritable()))&& (!H.hasValue()|| $sameValue(H.getValue(),ad.getValue()))&& (!H.hasGetter()|| $sameValue(H.getGet(),ad.getGet()))&& (!H.hasSetter()|| $sameValue(H.getSet(),ad.getSet()))){ return true; } if(!ad.isConfigurable()){ if(H.isConfigurable()|| (H.hasEnumerable()&& H.isEnumerable()!=ad.isEnumerable())){ if(Z){ throw MakeTypeError(90,W); }else{ return false; } } if(!IsGenericDescriptor(H)){ if(IsDataDescriptor(ad)!=IsDataDescriptor(H)){ if(Z){ throw MakeTypeError(90,W); }else{ return false; } } if(IsDataDescriptor(ad)&&IsDataDescriptor(H)){ var af=ad.isWritable(); if(af!=H.isWritable()){ if(!af||(%IsStrong(K))){ if(Z){ throw af ?MakeTypeError(106,K,W) :MakeTypeError(90,W); }else{ return false; } } } if(!af&&H.hasValue()&& !$sameValue(H.getValue(),ad.getValue())){ if(Z){ throw MakeTypeError(90,W); }else{ return false; } } } if(IsAccessorDescriptor(H)&&IsAccessorDescriptor(ad)){ if(H.hasSetter()&& !$sameValue(H.getSet(),ad.getSet())){ if(Z){ throw MakeTypeError(90,W); }else{ return false; } } if(H.hasGetter()&&!$sameValue(H.getGet(),ad.getGet())){ if(Z){ throw MakeTypeError(90,W); }else{ return false; } } } } } } var ag=0; if(H.hasEnumerable()){ ag|=H.isEnumerable()?0:2; }else if(!(ad===(void 0))){ ag|=ad.isEnumerable()?0:2; }else{ ag|=2; } if(H.hasConfigurable()){ ag|=H.isConfigurable()?0:4; }else if(!(ad===(void 0))){ ag|=ad.isConfigurable()?0:4; }else ag|=4; if(IsDataDescriptor(H)|| (IsGenericDescriptor(H)&& ((ad===(void 0))||IsDataDescriptor(ad)))){ if(H.hasWritable()){ ag|=H.isWritable()?0:1; }else if(!(ad===(void 0))){ ag|=ad.isWritable()?0:1; }else{ ag|=1; } var B=(void 0); if(H.hasValue()){ B=H.getValue(); }else if(!(ad===(void 0))&&IsDataDescriptor(ad)){ B=ad.getValue(); } %DefineDataPropertyUnchecked(K,W,B,ag); }else{ var ah=null; if(H.hasGetter()){ ah=H.getGet(); }else if(IsAccessorDescriptor(ad)&&ad.hasGetter()){ ah=ad.getGet(); } var ai=null; if(H.hasSetter()){ ai=H.getSet(); }else if(IsAccessorDescriptor(ad)&&ad.hasSetter()){ ai=ad.getSet(); } %DefineAccessorPropertyUnchecked(K,W,ah,ai,ag); } return true; } function DefineArrayProperty(K,W,H,Z){ if(!(typeof(W)==='symbol')){ var aj=$toUint32(W); var ak=false; if($toString(aj)==W&&aj!=4294967295){ var al=K.length; if(aj>=al&&%IsObserved(K)){ ak=true; $observeBeginPerformSplice(K); } var am=GetOwnPropertyJS(K,"length"); if((aj>=al&&!am.isWritable())|| !DefineObjectProperty(K,W,H,true)){ if(ak) $observeEndPerformSplice(K); if(Z){ throw MakeTypeError(24,W); }else{ return false; } } if(aj>=al){ K.length=aj+1; } if(ak){ $observeEndPerformSplice(K); $observeEnqueueSpliceRecord(K,al,[],aj+1-al); } return true; } } return DefineObjectProperty(K,W,H,Z); } function DefineOwnProperty(K,W,H,Z){ if(%_IsJSProxy(K)){ if((typeof(W)==='symbol'))return false; var x=FromGenericPropertyDescriptor(H); return DefineProxyProperty(K,W,x,Z); }else if((%_IsArray(K))){ return DefineArrayProperty(K,W,H,Z); }else{ return DefineObjectProperty(K,W,H,Z); } } function DefineOwnPropertyFromAPI(K,W,B,H){ return DefineOwnProperty(K,W,ToPropertyDescriptor({ value:B, writable:H[0], enumerable:H[1], configurable:H[2] }), false); } function ObjectGetPrototypeOf(K){ return %_GetPrototype(((%_IsSpecObject(%IS_VAR(K)))?K:$toObject(K))); } function ObjectSetPrototypeOf(K,an){ if((K==null)&&!(%_IsUndetectableObject(K)))throw MakeTypeError(14,"Object.setPrototypeOf"); if(an!==null&&!(%_IsSpecObject(an))){ throw MakeTypeError(78,an); } if((%_IsSpecObject(K))){ %SetPrototype(K,an); } return K; } function ObjectGetOwnPropertyDescriptor(K,W){ var H=GetOwnPropertyJS(((%_IsSpecObject(%IS_VAR(K)))?K:$toObject(K)),W); return FromPropertyDescriptor(H); } function ToNameArray(K,T,ao){ if(!(%_IsSpecObject(K))){ throw MakeTypeError(85,T,K); } var ap=$toUint32(K.length); var aq=new c(ap); var ar=0; var L={__proto__:null}; for(var aj=0;aj36)throw MakeRangeError(146); return %NumberToRadixString(q,t); } function NumberToLocaleString(){ return %_CallFunction(this,NumberToStringJS); } function NumberValueOf(){ if(!(typeof(this)==='number')&&!(%_ClassOf(this)==='Number')){ throw MakeTypeError(55,'Number.prototype.valueOf'); } return %_ValueOf(this); } function NumberToFixedJS(aS){ var u=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw MakeTypeError(33, "Number.prototype.toFixed",this); } u=%_ValueOf(this); } var w=(%_IsSmi(%IS_VAR(aS))?aS:%NumberToInteger($toNumber(aS))); if(w<0||w>20){ throw MakeRangeError(142,"toFixed() digits"); } if((!%_IsSmi(%IS_VAR(u))&&!(u==u)))return"NaN"; if(u==(1/0))return"Infinity"; if(u==-(1/0))return"-Infinity"; return %NumberToFixed(u,w); } function NumberToExponentialJS(aS){ var u=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw MakeTypeError(33, "Number.prototype.toExponential",this); } u=%_ValueOf(this); } var w=(aS===(void 0))?(void 0):(%_IsSmi(%IS_VAR(aS))?aS:%NumberToInteger($toNumber(aS))); if((!%_IsSmi(%IS_VAR(u))&&!(u==u)))return"NaN"; if(u==(1/0))return"Infinity"; if(u==-(1/0))return"-Infinity"; if((w===(void 0))){ w=-1; }else if(w<0||w>20){ throw MakeRangeError(142,"toExponential()"); } return %NumberToExponential(u,w); } function NumberToPrecisionJS(aT){ var u=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw MakeTypeError(33, "Number.prototype.toPrecision",this); } u=%_ValueOf(this); } if((aT===(void 0)))return $toString(%_ValueOf(this)); var W=(%_IsSmi(%IS_VAR(aT))?aT:%NumberToInteger($toNumber(aT))); if((!%_IsSmi(%IS_VAR(u))&&!(u==u)))return"NaN"; if(u==(1/0))return"Infinity"; if(u==-(1/0))return"-Infinity"; if(W<1||W>21){ throw MakeRangeError(145); } return %NumberToPrecision(u,W); } function NumberIsFinite(q){ return(typeof(q)==='number')&&(%_IsSmi(%IS_VAR(q))||((q==q)&&(q!=1/0)&&(q!=-1/0))); } function NumberIsInteger(q){ return NumberIsFinite(q)&&(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q)))==q; } function NumberIsNaN(q){ return(typeof(q)==='number')&&(!%_IsSmi(%IS_VAR(q))&&!(q==q)); } function NumberIsSafeInteger(q){ if(NumberIsFinite(q)){ var aU=(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q))); if(aU==q){ return k(aU)<=g.MAX_SAFE_INTEGER; } } 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(aa){ var C=%FunctionGetName(aa); if(C){ return'function '+C+'() { [native code] }'; } return'function () { [native code] }'; } function FunctionSourceString(aa){ while(%IsJSFunctionProxy(aa)){ aa=%GetCallTrap(aa); } if(!(%_IsFunction(aa))){ throw MakeTypeError(55,'Function.prototype.toString'); } if(%FunctionIsBuiltin(aa)){ return NativeCodeFunctionSourceString(aa); } var aV=%ClassGetSourceCode(aa); if((typeof(aV)==='string')){ return aV; } var aW=%FunctionGetSourceCode(aa); if(!(typeof(aW)==='string')){ return NativeCodeFunctionSourceString(aa); } if(%FunctionIsArrow(aa)){ return aW; } var C=%FunctionNameShouldPrintAsAnonymous(aa) ?'anonymous' :%FunctionGetName(aa); var aX=%FunctionIsGenerator(aa); var aY=%FunctionIsConciseMethod(aa) ?(aX?'*':'') :(aX?'function* ':'function '); return aY+C+aW; } function FunctionToString(){ return FunctionSourceString(this); } function FunctionBind(aZ){ if(!(%_ClassOf(this)==='Function'))throw MakeTypeError(30); var ba=function(){ "use strict"; if(%_IsConstructCall()){ return %NewObjectFromBound(ba); } var bb=%BoundFunctionGetBindings(ba); var bc=%_ArgumentsLength(); if(bc==0){ return %Apply(bb[0],bb[1],bb,2,bb.length-2); } if(bb.length===2){ return %Apply(bb[0],bb[1],arguments,0,bc); } var bd=bb.length-2; var be=new i(bd+bc); for(var ax=0;ax>>0)===bg)){ var bc=%_ArgumentsLength(); if(bc>0)bc--; bf=bg-bc; if(bf<0)bf=0; } var ab=%FunctionBindArguments(ba,this, aZ,bf); var C=this.name; var bh=(typeof(C)==='string')?C:""; j(ab,bh,"bound"); return ab; } function NewFunctionString(bi,bj){ var ap=bi.length; var W=''; if(ap>1){ W=$toString(bi[0]); for(var ax=1;ax0)?$toString(bi[ap-1]):''; return'('+bj+'('+W+') {\n'+bk+'\n})'; } function FunctionConstructor(bl){ var aW=NewFunctionString(arguments,'function'); var v=%GlobalProxy(FunctionConstructor); var w=%_CallFunction(v,%CompileString(aW,true)); %FunctionMarkNameShouldPrintAsAnonymous(w); return w; } %SetCode(e,FunctionConstructor); %AddNamedProperty(e.prototype,"constructor",e, 2); b.InstallFunctions(e.prototype,2,[ "bind",FunctionBind, "toString",FunctionToString ]); function GetIterator(K,bm){ if((bm===(void 0))){ bm=K[symbolIterator]; } if(!(%_ClassOf(bm)==='Function')){ throw MakeTypeError(56,K); } var bn=%_CallFunction(K,bm); if(!(%_IsSpecObject(bn))){ throw MakeTypeError(50,bn); } return bn; } $functionSourceString=FunctionSourceString; $globalEval=GlobalEval; $objectDefineOwnProperty=DefineOwnPropertyFromAPI; $objectGetOwnPropertyDescriptor=ObjectGetOwnPropertyDescriptor; $toCompletePropertyDescriptor=ToCompletePropertyDescriptor; b.ObjectDefineProperties=ObjectDefineProperties; b.ObjectDefineProperty=ObjectDefineProperty; b.Export(function(bo){ bo.Delete=Delete; bo.GetIterator=GetIterator; bo.GetMethod=GetMethod; bo.IsFinite=GlobalIsFinite; bo.IsNaN=GlobalIsNaN; bo.NewFunctionString=NewFunctionString; bo.NumberIsNaN=NumberIsNaN; bo.ObjectDefineProperty=ObjectDefineProperty; bo.ObjectFreeze=ObjectFreezeJS; bo.ObjectGetOwnPropertyKeys=ObjectGetOwnPropertyKeys; bo.ObjectHasOwnProperty=ObjectHasOwnProperty; bo.ObjectIsFrozen=ObjectIsFrozen; bo.ObjectIsSealed=ObjectIsSealed; bo.ObjectToString=ObjectToString; bo.OwnPropertyKeys=OwnPropertyKeys; bo.ToNameArray=ToNameArray; }); }) symbol% var $symbolToString; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Object; var d=a.Symbol; var e; b.Import(function(g){ e=g.ObjectGetOwnPropertyKeys; }); function SymbolConstructor(h){ if(%_IsConstructCall())throw MakeTypeError(52,"Symbol"); return %CreateSymbol((h===(void 0))?h:$toString(h)); } function SymbolToString(){ if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ throw MakeTypeError(33, "Symbol.prototype.toString",this); } var i=%SymbolDescription(%_ValueOf(this)); return"Symbol("+((i===(void 0))?"":i)+")"; } function SymbolValueOf(){ if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ throw MakeTypeError(33, "Symbol.prototype.valueOf",this); } return %_ValueOf(this); } function SymbolFor(j){ j=((typeof(%IS_VAR(j))==='string')?j:$nonStringToString(j)); var k=%SymbolRegistry(); if((k.for[j]===(void 0))){ var l=%CreateSymbol(j); k.for[j]=l; k.keyFor[l]=j; } return k.for[j]; } function SymbolKeyFor(l){ if(!(typeof(l)==='symbol'))throw MakeTypeError(108,l); return %SymbolRegistry().keyFor[l]; } function ObjectGetOwnPropertySymbols(m){ m=$toObject(m); return e(m,8); } %SetCode(d,SymbolConstructor); %FunctionSetPrototype(d,new c()); b.InstallConstants(d,[ "iterator",symbolIterator, "unscopables",symbolUnscopables ]); b.InstallFunctions(d,2,[ "for",SymbolFor, "keyFor",SymbolKeyFor ]); %AddNamedProperty( d.prototype,"constructor",d,2); %AddNamedProperty( d.prototype,symbolToStringTag,"Symbol",2|1); b.InstallFunctions(d.prototype,2,[ "toString",SymbolToString, "valueOf",SymbolValueOf ]); b.InstallFunctions(c,2,[ "getOwnPropertySymbols",ObjectGetOwnPropertySymbols ]); $symbolToString=SymbolToString; }) array• var $arrayConcat; var $arrayPush; var $arrayPop; var $arrayShift; var $arraySlice; var $arraySplice; var $arrayUnshift; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Array; var d=b.InternalArray; var e=b.InternalPackedArray; var g; var h; var i; var j; var k; var l; b.Import(function(m){ g=m.Delete; h=m.MathMin; i=m.ObjectHasOwnProperty; j=m.ObjectIsFrozen; k=m.ObjectIsSealed; l=m.ObjectToString; }); var n=new d(); function GetSortedArrayKeys(o,p){ var q=new d(); if((typeof(p)==='number')){ var r=p; for(var t=0;t>2; var M=%EstimateNumberOfElements(o); return(MM*4); } function Join(o,v,C,B){ if(v==0)return''; var J=(%_IsArray(o)); if(J){ if(!%PushIfAbsent(n,o))return''; } try{ if(UseSparseVariant(o,v,J,v)){ %NormalizeElements(o); if(C.length==0){ return SparseJoin(o,v,B); }else{ return SparseJoinWithSeparatorJS(o,v,B,C); } } if(v==1){ var u=o[0]; if((typeof(u)==='string'))return u; return B(u); } var E=new d(v); if(C.length==0){ var I=0; for(var t=0;t=Q){ var T=o[x]; if(!(T===(void 0))||x in o){ %AddElement(S,x-Q,T); } } } } } } function SparseMove(o,Q,R,A,U){ if(U===R)return; var V=new d( h(A-R+U,0xffffffff)); var W; var p=%GetArrayKeys(o,A); if((typeof(p)==='number')){ var r=p; for(var t=0;t=Q+R){ var T=o[x]; if(!(T===(void 0))||x in o){ var X=x-R+U; V[X]=T; if(X>0xfffffffe){ W=W||new d(); W.push(X); } } } } } } %MoveArrayContents(V,o); if(!(W===(void 0))){ var v=W.length; for(var t=0;tR){ for(var t=A-R;t>Q;t--){ var Z=t+R-1; var aa=t+U-1; if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(ZA-R+U;t--){ delete o[t-1]; } } } } function ArrayToString(){ var o; var ab; if((%_IsArray(this))){ ab=this.join; if(ab===ArrayJoin){ return Join(this,this.length,',',ConvertToString); } o=this; }else{ o=$toObject(this); ab=o.join; } if(!(%_ClassOf(ab)==='Function')){ return %_CallFunction(o,l); } return %_CallFunction(o,ab); } function InnerArrayToLocaleString(o,v){ var A=(v>>>0); if(A===0)return""; return Join(o,A,',',ConvertToLocaleString); } function ArrayToLocaleString(){ var o=$toObject(this); var ac=o.length; return InnerArrayToLocaleString(o,ac); } function InnerArrayJoin(C,o,v){ if((C===(void 0))){ C=','; }else if(!(typeof(C)==='string')){ C=$nonStringToString(C); } var N=%_FastOneByteArrayJoin(o,C); if(!(N===(void 0)))return N; if(v===1){ var u=o[0]; if((typeof(u)==='string'))return u; if((u==null))return''; return $nonStringToString(u); } return Join(o,v,C,ConvertToString); } function ArrayJoin(C){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.join"); var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)); var v=(o.length>>>0); return InnerArrayJoin(C,o,v); } function ObservedArrayPop(ad){ ad--; var ae=this[ad]; try{ $observeBeginPerformSplice(this); delete this[ad]; this.length=ad; }finally{ $observeEndPerformSplice(this); $observeEnqueueSpliceRecord(this,ad,[ae],0); } return ae; } function ArrayPop(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.pop"); var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)); var ad=(o.length>>>0); if(ad==0){ o.length=ad; return; } if(%IsObserved(o)) return ObservedArrayPop.call(o,ad); ad--; var ae=o[ad]; g(o,ad,true); o.length=ad; return ae; } function ObservedArrayPush(){ var ad=(this.length>>>0); var af=%_ArgumentsLength(); try{ $observeBeginPerformSplice(this); for(var t=0;t>>0); var af=%_ArgumentsLength(); for(var t=0;t=t){ ao=t; while(q[++al]==t){} ap=A-t-1; } var aq=o[ao]; if(!(aq===(void 0))||ao in o){ var ar=o[ap]; if(!(ar===(void 0))||ap in o){ o[ao]=ar; o[ap]=aq; }else{ o[ap]=aq; delete o[ao]; } }else{ var ar=o[ap]; if(!(ar===(void 0))||ap in o){ o[ao]=ar; delete o[ap]; } } } } function InnerArrayReverse(o,A){ var am=A-1; for(var t=0;t>>0); if(UseSparseVariant(o,A,(%_IsArray(o)),A)){ %NormalizeElements(o); SparseReverse(o,A); return o; } return InnerArrayReverse(o,A); } function ObservedArrayShift(A){ var as=this[0]; try{ $observeBeginPerformSplice(this); SimpleMove(this,0,1,A,0); this.length=A-1; }finally{ $observeEndPerformSplice(this); $observeEnqueueSpliceRecord(this,0,[as],0); } return as; } function ArrayShift(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.shift"); var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)); var A=(o.length>>>0); if(A===0){ o.length=0; return; } if(k(o))throw MakeTypeError(10); if(%IsObserved(o)) return ObservedArrayShift.call(o,A); var as=o[0]; if(UseSparseVariant(o,A,(%_IsArray(o)),A)){ SparseMove(o,0,1,A,0); }else{ SimpleMove(o,0,1,A,0); } o.length=A-1; return as; } function ObservedArrayUnshift(){ var A=(this.length>>>0); var at=%_ArgumentsLength(); try{ $observeBeginPerformSplice(this); SimpleMove(this,0,0,A,at); for(var t=0;t>>0); var at=%_ArgumentsLength(); if(A>0&&UseSparseVariant(o,A,(%_IsArray(o)),A)&& !k(o)){ SparseMove(o,0,0,A,at); }else{ SimpleMove(o,0,0,A,at); } for(var t=0;t>>0); var Q=(%_IsSmi(%IS_VAR(au))?au:%NumberToInteger($toNumber(au))); var aw=A; if(!(av===(void 0)))aw=(%_IsSmi(%IS_VAR(av))?av:%NumberToInteger($toNumber(av))); if(Q<0){ Q+=A; if(Q<0)Q=0; }else{ if(Q>A)Q=A; } if(aw<0){ aw+=A; if(aw<0)aw=0; }else{ if(aw>A)aw=A; } var N=[]; if(awA?A:Q; } function ComputeSpliceDeleteCount(ax,at,A,Q){ var R=0; if(at==1) return A-Q; R=(%_IsSmi(%IS_VAR(ax))?ax:%NumberToInteger($toNumber(ax))); if(R<0) return 0; if(R>A-Q) return A-Q; return R; } function ObservedArraySplice(au,ax){ var at=%_ArgumentsLength(); var A=(this.length>>>0); var Q=ComputeSpliceStartIndex((%_IsSmi(%IS_VAR(au))?au:%NumberToInteger($toNumber(au))),A); var R=ComputeSpliceDeleteCount(ax,at,A, Q); var S=[]; S.length=R; var ay=at>2?at-2:0; try{ $observeBeginPerformSplice(this); SimpleSlice(this,Q,R,A,S); SimpleMove(this,Q,R,A,ay); var t=Q; var az=2; var aA=%_ArgumentsLength(); while(az>>0); var Q=ComputeSpliceStartIndex((%_IsSmi(%IS_VAR(au))?au:%NumberToInteger($toNumber(au))),A); var R=ComputeSpliceDeleteCount(ax,at,A, Q); var S=[]; S.length=R; var ay=at>2?at-2:0; if(R!=ay&&k(o)){ throw MakeTypeError(10); }else if(R>0&&j(o)){ throw MakeTypeError(9); } var aB=R; if(ay!=R){ aB+=A-Q-R; } if(UseSparseVariant(o,A,(%_IsArray(o)),aB)){ %NormalizeElements(o); %NormalizeElements(S); SparseSlice(o,Q,R,A,S); SparseMove(o,Q,R,A,ay); }else{ SimpleSlice(o,Q,R,A,S); SimpleMove(o,Q,R,A,ay); } var t=Q; var az=2; var aA=%_ArgumentsLength(); while(az=m;am--){ var aH=y[am]; var aI=%_CallFunction((void 0),aH,aG,aC); if(aI>0){ y[am+1]=aH; }else{ break; } } y[am+1]=aG; } }; var aJ=function(y,m,aF){ var aK=[]; var aL=200+((aF-m)&15); for(var t=m+1,am=0;t>1][0]; return aM; } var aN=function QuickSort(y,m,aF){ var aM=0; while(true){ if(aF-m<=10){ aE(y,m,aF); return; } if(aF-m>1000){ aM=aJ(y,m,aF); }else{ aM=m+((aF-m)>>1); } var aO=y[m]; var aP=y[aF-1]; var aQ=y[aM]; var aR=%_CallFunction((void 0),aO,aP,aC); if(aR>0){ var aH=aO; aO=aP; aP=aH; } var aS=%_CallFunction((void 0),aO,aQ,aC); if(aS>=0){ var aH=aO; aO=aQ; aQ=aP; aP=aH; }else{ var aT=%_CallFunction((void 0),aP,aQ,aC); if(aT>0){ var aH=aP; aP=aQ; aQ=aH; } } y[m]=aO; y[aF-1]=aQ; var aU=aP; var aV=m+1; var aW=aF-1; y[aM]=y[aV]; y[aV]=aU; partition:for(var t=aV+1;t0){ do{ aW--; if(aW==t)break partition; var aX=y[aW]; aI=%_CallFunction((void 0),aX,aU,aC); }while(aI>0); y[t]=y[aW]; y[aW]=aG; if(aI<0){ aG=y[t]; y[t]=y[aV]; y[aV]=aG; aV++; } } } if(aF-aW=ba){ba=t+1;} } } }else{ for(var t=0;t=ba){ba=Y+1;} } } } } return ba; }; var bd=function(aZ,m,aF){ for(var bb=%_GetPrototype(aZ);bb;bb=%_GetPrototype(bb)){ var p=%GetArrayKeys(bb,aF); if((typeof(p)==='number')){ var bc=p; for(var t=m;t>>0); return %_CallFunction(o,v,aC,InnerArraySort); } function InnerArrayFilter(bk,bl,o,v){ if(!(%_ClassOf(bk)==='Function'))throw MakeTypeError(12,bk); var bm=false; if((bl===null)){ if(%IsSloppyModeFunction(bk))bl=(void 0); }else if(!(bl===(void 0))){ bm=(!(%_IsSpecObject(bl))&&%IsSloppyModeFunction(bk)); } var bn=new d(); var bo=0; var J=(%_IsArray(o)); var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); for(var t=0;t>>0); InnerArrayForEach(bk,bl,o,v); } function InnerArraySome(bk,bl,o,v){ if(!(%_ClassOf(bk)==='Function'))throw MakeTypeError(12,bk); var bm=false; if((bl===null)){ if(%IsSloppyModeFunction(bk))bl=(void 0); }else if(!(bl===(void 0))){ bm=(!(%_IsSpecObject(bl))&&%IsSloppyModeFunction(bk)); } var J=(%_IsArray(o)); var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); for(var t=0;t>>0); return InnerArraySome(bk,bl,o,v); } function InnerArrayEvery(bk,bl,o,v){ if(!(%_ClassOf(bk)==='Function'))throw MakeTypeError(12,bk); var bm=false; if((bl===null)){ if(%IsSloppyModeFunction(bk))bl=(void 0); }else if(!(bl===(void 0))){ bm=(!(%_IsSpecObject(bl))&&%IsSloppyModeFunction(bk)); } var J=(%_IsArray(o)); var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); for(var t=0;t>>0); return InnerArrayEvery(bk,bl,o,v); } function InnerArrayMap(bk,bl,o,v){ if(!(%_ClassOf(bk)==='Function'))throw MakeTypeError(12,bk); var bm=false; if((bl===null)){ if(%IsSloppyModeFunction(bk))bl=(void 0); }else if(!(bl===(void 0))){ bm=(!(%_IsSpecObject(bl))&&%IsSloppyModeFunction(bk)); } var bn=new d(v); var J=(%_IsArray(o)); var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk); for(var t=0;t>>0); var bn=InnerArrayMap(bk,bl,o,v); var N=new c(); %MoveArrayContents(bn,N); return N; } function InnerArrayIndexOf(aG,Y,v){ if(v==0)return-1; if((Y===(void 0))){ Y=0; }else{ Y=(%_IsSmi(%IS_VAR(Y))?Y:%NumberToInteger($toNumber(Y))); if(Y<0){ Y=v+Y; if(Y<0)Y=0; } } var br=Y; var ba=v; if(UseSparseVariant(this,v,(%_IsArray(this)),ba-br)){ %NormalizeElements(this); var p=%GetArrayKeys(this,v); if((typeof(p)==='number')){ ba=p; }else{ if(p.length==0)return-1; var bs=GetSortedArrayKeys(this,p); var ad=bs.length; var t=0; while(t>>0); return %_CallFunction(this,aG,Y,v,InnerArrayIndexOf); } function InnerArrayLastIndexOf(aG,Y,v,bt){ if(v==0)return-1; if(bt<2){ Y=v-1; }else{ Y=(%_IsSmi(%IS_VAR(Y))?Y:%NumberToInteger($toNumber(Y))); if(Y<0)Y+=v; if(Y<0)return-1; else if(Y>=v)Y=v-1; } var br=0; var ba=Y; if(UseSparseVariant(this,v,(%_IsArray(this)),Y)){ %NormalizeElements(this); var p=%GetArrayKeys(this,Y+1); if((typeof(p)==='number')){ ba=p; }else{ if(p.length==0)return-1; var bs=GetSortedArrayKeys(this,p); var t=bs.length-1; while(t>=0){ var x=bs[t]; if(!(x===(void 0))&&this[x]===aG)return x; t--; } return-1; } } if(!(aG===(void 0))){ for(var t=ba;t>=br;t--){ if(this[t]===aG)return t; } return-1; } for(var t=ba;t>=br;t--){ if((this[t]===(void 0))&&t in this){ return t; } } return-1; } function ArrayLastIndexOf(aG,Y){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.lastIndexOf"); var v=(this.length>>>0); return %_CallFunction(this,aG,Y,v, %_ArgumentsLength(),InnerArrayLastIndexOf); } function InnerArrayReduce(bu,T,o,v,bt){ if(!(%_ClassOf(bu)==='Function')){ throw MakeTypeError(12,bu); } var J=(%_IsArray(o)); var t=0; find_initial:if(bt<2){ for(;t=0;t--){ if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t=0;t--){ if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t1){ B=%_Arguments(1); B=(%_IsSmi(%IS_VAR(B))?B:%NumberToInteger($toNumber(B))); if(B<0)B=0; if(B>A.length)B=A.length; } return %StringIndexOf(A,z,B); } function StringLastIndexOfJS(C){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.lastIndexOf"); var D=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)); var E=D.length; var C=((typeof(%IS_VAR(C))==='string')?C:$nonStringToString(C)); var F=C.length; var B=E-F; if(%_ArgumentsLength()>1){ var G=$toNumber(%_Arguments(1)); if(!(!%_IsSmi(%IS_VAR(G))&&!(G==G))){ G=(%_IsSmi(%IS_VAR(G))?G:%NumberToInteger($toNumber(G))); if(G<0){ G=0; } if(G+F0xFF&& (typeof(O)==='string')&& %StringIndexOf(O,'$',0)<0){ return %StringReplaceOneCharWithString(A,N,O); } var S=%StringIndexOf(A,N,0); if(S<0)return A; var T=S+N.length; var r=%_SubString(A,0,S); if((%_ClassOf(O)==='Function')){ var U=(void 0); r+=%_CallFunction(U,N,S,A,O); }else{ M[3]=S; M[4]=T; r=ExpandReplacement(((typeof(%IS_VAR(O))==='string')?O:$nonStringToString(O)), A, M, r); } return r+%_SubString(A,T,A.length); } function ExpandReplacement(V,A,W,r){ var X=V.length; var Y=%StringIndexOf(V,'$',0); if(Y<0){ if(X>0)r+=V; return r; } if(Y>0)r+=%_SubString(V,0,Y); while(true){ var Z='$'; var G=Y+1; if(G=48&&aa<=57){ var ab=(aa-48)<<1; var ac=1; var ad=((W)[0]); if(G+1=48&&Y<=57){ var ae=ab*10+((Y-48)<<1); if(ae=0){ r+= %_SubString(A,S,W[(3+(ab+1))]); } G+=ac; }else{ r+='$'; } }else{ r+='$'; } }else{ r+='$'; } Y=%StringIndexOf(V,'$',G); if(Y<0){ if(GG){ r+=%_SubString(V,G,Y); } } return r; } function CaptureString(V,af,B){ var ag=B<<1; var S=af[(3+(ag))]; if(S<0)return; var T=af[(3+(ag+1))]; return %_SubString(V,S,T); } var ah=new e(4); function StringReplaceGlobalRegExpWithFunction(A,H,O){ var ai=ah; if(ai){ ah=null; }else{ ai=new e(16); } var aj=%RegExpExecMultiple(H, A, n, ai); H.lastIndex=0; if((aj===null)){ ah=ai; return A; } var u=aj.length; if(((n)[0])==2){ var ak=0; var al=new g(null,0,A); for(var x=0;x0){ ak=(am>>11)+(am&0x7ff); }else{ ak=aj[++x]-am; } }else{ al[0]=am; al[1]=ak; $regexpLastMatchInfoOverride=al; var an= %_CallFunction((void 0),am,ak,A,O); aj[x]=((typeof(%IS_VAR(an))==='string')?an:$nonStringToString(an)); ak+=am.length; } } }else{ for(var x=0;x>1; var aq; if(ap==1){ var ar=%_SubString(A,B,ao); aq=%_CallFunction((void 0),ar,B,A,O); }else{ var as=new e(ap+2); for(var at=0;atav){ return''; } } if(ax<0){ ax+=av; if(ax<0){ return''; } }else{ if(ax>av){ ax=av; } } if(ax<=aw){ return''; } return %_SubString(ar,aw,ax); } function StringSplitJS(ay,az){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.split"); var A=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)); az=((az===(void 0)))?0xffffffff:(az>>>0); var X=A.length; if(!(%_IsRegExp(ay))){ var aA=((typeof(%IS_VAR(ay))==='string')?ay:$nonStringToString(ay)); if(az===0)return[]; if((ay===(void 0)))return[A]; var aB=aA.length; if(aB===0)return %StringToArray(A,az); var r=%StringSplit(A,aA,az); return r; } if(az===0)return[]; return StringSplitOnRegExp(A,ay,az,X); } function StringSplitOnRegExp(A,ay,az,X){ if(X===0){ if(l(ay,A,0,0)!=null){ return[]; } return[A]; } var aC=0; var aD=0; var aE=0; var r=new e(); outer_loop: while(true){ if(aD===X){ r[r.length]=%_SubString(A,aC,X); break; } var W=l(ay,A,aD); if(W==null||X===(aE=W[3])){ r[r.length]=%_SubString(A,aC,X); break; } var aF=W[4]; if(aD===aF&&aF===aC){ aD++; continue; } r[r.length]=%_SubString(A,aC,aE); if(r.length===az)break; var aG=((W)[0])+3; for(var x=3+2;xav){ aw=av; } var ax=av; if(!(T===(void 0))){ ax=(%_IsSmi(%IS_VAR(T))?T:%NumberToInteger($toNumber(T))); if(ax>av){ ax=av; }else{ if(ax<0)ax=0; if(aw>ax){ var aI=ax; ax=aw; aw=aI; } } } return %_SubString(ar,aw,ax); } function StringSubstr(S,aJ){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.substr"); var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)); var u; if((aJ===(void 0))){ u=ar.length; }else{ u=(%_IsSmi(%IS_VAR(aJ))?aJ:%NumberToInteger($toNumber(aJ))); if(u<=0)return''; } if((S===(void 0))){ S=0; }else{ S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S))); if(S>=ar.length)return''; if(S<0){ S+=ar.length; if(S<0)S=0; } } var T=S+u; if(T>ar.length)T=ar.length; return %_SubString(ar,S,T); } function StringToLowerCaseJS(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.toLowerCase"); return %StringToLowerCase(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))); } function StringToLocaleLowerCase(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.toLocaleLowerCase"); return %StringToLowerCase(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))); } function StringToUpperCaseJS(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.toUpperCase"); return %StringToUpperCase(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))); } function StringToLocaleUpperCase(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.toLocaleUpperCase"); return %StringToUpperCase(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))); } function StringTrimJS(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.trim"); return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)),true,true); } function StringTrimLeft(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.trimLeft"); return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)),true,false); } function StringTrimRight(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.trimRight"); return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)),false,true); } function StringFromCharCode(aK){ var aJ=%_ArgumentsLength(); if(aJ==1){ if(!%_IsSmi(aK))aK=$toNumber(aK); return %_StringCharFromCode(aK&0xffff); } var aL=%NewString(aJ,true); var x; for(x=0;x0xff)break; %_OneByteSeqStringSetChar(x,aK,aL); } if(x==aJ)return aL; aL=%TruncateString(aL,x); var aM=%NewString(aJ-x,false); for(var at=0;x"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+ ""; } function StringBig(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.big"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+""; } function StringBlink(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.blink"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+""; } function StringBold(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.bold"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+""; } function StringFixed(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.fixed"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+""; } function StringFontcolor(aP){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.fontcolor"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+ ""; } function StringFontsize(aQ){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.fontsize"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+ ""; } function StringItalics(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.italics"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+""; } function StringLink(ar){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.link"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+""; } function StringSmall(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.small"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+""; } function StringStrike(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.strike"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+""; } function StringSub(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.sub"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+""; } function StringSup(){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.sup"); return""+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+""; } function StringRepeat(aR){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.repeat"); var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)); var aJ=$toInteger(aR); if(aJ<0||aJ>%_MaxSmi())throw MakeRangeError(127); var aS=""; while(true){ if(aJ&1)aS+=ar; aJ>>=1; if(aJ===0)return aS; ar+=ar; } } function StringStartsWith(aT){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.startsWith"); var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)); if((%_IsRegExp(aT))){ throw MakeTypeError(28,"String.prototype.startsWith"); } var aU=((typeof(%IS_VAR(aT))==='string')?aT:$nonStringToString(aT)); var q=0; if(%_ArgumentsLength()>1){ q=%_Arguments(1); q=$toInteger(q); } var av=ar.length; var S=k(j(q,0),av); var aV=aU.length; if(aV+S>av){ return false; } return %StringIndexOf(ar,aU,S)===S; } function StringEndsWith(aT){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.endsWith"); var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)); if((%_IsRegExp(aT))){ throw MakeTypeError(28,"String.prototype.endsWith"); } var aU=((typeof(%IS_VAR(aT))==='string')?aT:$nonStringToString(aT)); var av=ar.length; var q=av; if(%_ArgumentsLength()>1){ var aW=%_Arguments(1); if(!(aW===(void 0))){ q=$toInteger(aW); } } var T=k(j(q,0),av); var aV=aU.length; var S=T-aV; if(S<0){ return false; } return %StringLastIndexOf(ar,aU,S)===S; } function StringIncludes(aT){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.includes"); var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)); if((%_IsRegExp(aT))){ throw MakeTypeError(28,"String.prototype.includes"); } var aU=((typeof(%IS_VAR(aT))==='string')?aT:$nonStringToString(aT)); var q=0; if(%_ArgumentsLength()>1){ q=%_Arguments(1); q=$toInteger(q); } var av=ar.length; var S=k(j(q,0),av); var aV=aU.length; if(aV+S>av){ return false; } return %StringIndexOf(ar,aU,S)!==-1; } function StringCodePointAt(q){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.codePointAt"); var V=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)); var aQ=V.length; q=(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q))); if(q<0||q>=aQ){ return(void 0); } var aX=%_StringCharCodeAt(V,q); if(aX<0xD800||aX>0xDBFF||q+1==aQ){ return aX; } var aY=%_StringCharCodeAt(V,q+1); if(aY<0xDC00||aY>0xDFFF){ return aX; } return(aX-0xD800)*0x400+aY+0x2400; } function StringFromCodePoint(aZ){ var aK; var X=%_ArgumentsLength(); var B; var r=""; for(B=0;B0x10FFFF||aK!==(%_IsSmi(%IS_VAR(aK))?aK:%NumberToInteger($toNumber(aK)))){ throw MakeRangeError(126,aK); } if(aK<=0xFFFF){ r+=%_StringCharFromCode(aK); }else{ aK-=0x10000; r+=%_StringCharFromCode((aK>>>10)&0x3FF|0xD800); r+=%_StringCharFromCode(aK&0x3FF|0xDC00); } } return r; } function StringRaw(ba){ var bb=%_ArgumentsLength(); var bc=$toObject(ba); var bd=$toObject(bc.raw); var be=$toLength(bd.length); if(be<=0)return""; var r=$toString(bd[0]); for(var x=1;x=48&&g<=57)return g-48; if(g>=65&&g<=70)return g-55; if(g>=97&&g<=102)return g-87; return-1; } function isAlphaNumeric(h){ if(97<=h&&h<=122)return true; if(65<=h&&h<=90)return true; if(48<=h&&h<=57)return true; return false; } var i=0; function URIAddEncodedOctetToBuffer(j,k,l){ k[l++]=37; k[l++]=i[j>>4]; k[l++]=i[j&0x0F]; return l; } function URIEncodeOctets(m,k,l){ if(i===0){ i=[48,49,50,51,52,53,54,55,56,57, 65,66,67,68,69,70]; } l=URIAddEncodedOctetToBuffer(m[0],k,l); if(m[1])l=URIAddEncodedOctetToBuffer(m[1],k,l); if(m[2])l=URIAddEncodedOctetToBuffer(m[2],k,l); if(m[3])l=URIAddEncodedOctetToBuffer(m[3],k,l); return l; } function URIEncodeSingle(h,k,l){ var n=(h>>12)&0xF; var o=(h>>6)&63; var p=h&63; var m=new d(3); if(h<=0x007F){ m[0]=h; }else if(h<=0x07FF){ m[0]=o+192; m[1]=p+128; }else{ m[0]=n+224; m[1]=o+128; m[2]=p+128; } return URIEncodeOctets(m,k,l); } function URIEncodePair(q,r,k,l){ var t=((q>>6)&0xF)+1; var u=(q>>2)&0xF; var n=q&3; var o=(r>>6)&0xF; var p=r&63; var m=new d(4); m[0]=(t>>2)+240; m[1]=(((t&3)<<4)|u)+128; m[2]=((n<<4)|o)+128; m[3]=p+128; return URIEncodeOctets(m,k,l); } function URIHexCharsToCharCode(v,w){ var x=HexValueOf(v); var y=HexValueOf(w); if(x==-1||y==-1)throw MakeURIError(); return(x<<4)|y; } function URIDecodeOctets(m,k,l){ var z; var A=m[0]; if(A<0x80){ z=A; }else if(A<0xc2){ throw MakeURIError(); }else{ var B=m[1]; if(A<0xe0){ var C=A&0x1f; if((B<0x80)||(B>0xbf))throw MakeURIError(); var D=B&0x3f; z=(C<<6)+D; if(z<0x80||z>0x7ff)throw MakeURIError(); }else{ var E=m[2]; if(A<0xf0){ var C=A&0x0f; if((B<0x80)||(B>0xbf))throw MakeURIError(); var D=B&0x3f; if((E<0x80)||(E>0xbf))throw MakeURIError(); var F=E&0x3f; z=(C<<12)+(D<<6)+F; if((z<0x800)||(z>0xffff))throw MakeURIError(); }else{ var G=m[3]; if(A<0xf8){ var C=(A&0x07); if((B<0x80)||(B>0xbf))throw MakeURIError(); var D=(B&0x3f); if((E<0x80)||(E>0xbf)){ throw MakeURIError(); } var F=(E&0x3f); if((G<0x80)||(G>0xbf))throw MakeURIError(); var H=(G&0x3f); z=(C<<18)+(D<<12)+(F<<6)+H; if((z<0x10000)||(z>0x10ffff))throw MakeURIError(); }else{ throw MakeURIError(); } } } } if(0xD800<=z&&z<=0xDFFF)throw MakeURIError(); if(z<0x10000){ %_TwoByteSeqStringSetChar(l++,z,k); }else{ %_TwoByteSeqStringSetChar(l++,(z>>10)+0xd7c0,k); %_TwoByteSeqStringSetChar(l++,(z&0x3ff)+0xdc00,k); } return l; } function Encode(I,J){ I=((typeof(%IS_VAR(I))==='string')?I:$nonStringToString(I)); var K=I.length; var L=new e(K); var l=0; for(var M=0;M=0xDC00&&q<=0xDFFF)throw MakeURIError(); if(q<0xD800||q>0xDBFF){ l=URIEncodeSingle(q,L,l); }else{ M++; if(M==K)throw MakeURIError(); var r=%_StringCharCodeAt(I,M); if(r<0xDC00||r>0xDFFF)throw MakeURIError(); l=URIEncodePair(q,r,L,l); } } } var k=%NewString(L.length,true); for(var N=0;N=K)throw MakeURIError(); var h=URIHexCharsToCharCode(%_StringCharCodeAt(I,M+1), %_StringCharCodeAt(I,M+2)); if(h>>7)break; if(O(h)){ %_OneByteSeqStringSetChar(l++,37,P); %_OneByteSeqStringSetChar(l++,%_StringCharCodeAt(I,M+1), P); %_OneByteSeqStringSetChar(l++,%_StringCharCodeAt(I,M+2), P); }else{ %_OneByteSeqStringSetChar(l++,h,P); } M+=2; }else{ if(g>0x7f)break; %_OneByteSeqStringSetChar(l++,g,P); } } P=%TruncateString(P,l); if(M==K)return P; var Q=%NewString(K-M,false); l=0; for(;M=K)throw MakeURIError(); var h=URIHexCharsToCharCode(%_StringCharCodeAt(I,++M), %_StringCharCodeAt(I,++M)); if(h>>7){ var R=0; while(((h<<++R)&0x80)!=0){} if(R==1||R>4)throw MakeURIError(); var m=new d(R); m[0]=h; if(M+3*(R-1)>=K)throw MakeURIError(); for(var N=1;N0)?e:0-e; } function MathAcosJS(e){ return %_MathAcos(+e); } function MathAsinJS(e){ return %_MathAsin(+e); } function MathAtanJS(e){ return %_MathAtan(+e); } function MathAtan2JS(g,e){ g=+g; e=+e; return %_MathAtan2(g,e); } function MathCeil(e){ return-%_MathFloor(-e); } function MathExp(e){ return %MathExpRT(((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e))); } function MathFloorJS(e){ return %_MathFloor(+e); } function MathLog(e){ return %_MathLogRT(((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e))); } function MathMax(h,i){ var j=%_ArgumentsLength(); if(j==2){ h=((typeof(%IS_VAR(h))==='number')?h:$nonNumberToNumber(h)); i=((typeof(%IS_VAR(i))==='number')?i:$nonNumberToNumber(i)); if(i>h)return i; if(h>i)return h; if(h==i){ return(h===0&&%_IsMinusZero(h))?i:h; } return $NaN; } var k=-(1/0); for(var l=0;lk||(k===0&&m===0&&%_IsMinusZero(k))){ k=m; } } return k; } function MathMin(h,i){ var j=%_ArgumentsLength(); if(j==2){ h=((typeof(%IS_VAR(h))==='number')?h:$nonNumberToNumber(h)); i=((typeof(%IS_VAR(i))==='number')?i:$nonNumberToNumber(i)); if(i>h)return h; if(h>i)return i; if(h==i){ return(h===0&&%_IsMinusZero(h))?h:i; } return $NaN; } var k=(1/0); for(var l=0;l>>16))|0; rngstate[0]=n; var o=(MathImul(36969,rngstate[1]&0xFFFF)+(rngstate[1]>>>16))|0; rngstate[1]=o; var e=((n<<16)+(o&0xFFFF))|0; return(e<0?(e+0x100000000):e)*2.3283064365386962890625e-10; } function MathRandomRaw(){ var n=(MathImul(18030,rngstate[0]&0xFFFF)+(rngstate[0]>>>16))|0; rngstate[0]=n; var o=(MathImul(36969,rngstate[1]&0xFFFF)+(rngstate[1]>>>16))|0; rngstate[1]=o; var e=((n<<16)+(o&0xFFFF))|0; return e&0x3fffffff; } function MathRound(e){ return %RoundNumber(((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e))); } function MathSqrtJS(e){ return %_MathSqrt(+e); } function MathImul(e,g){ return %NumberImul(((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)),((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g))); } function MathSign(e){ e=+e; if(e>0)return 1; if(e<0)return-1; return e; } function MathTrunc(e){ e=+e; if(e>0)return %_MathFloor(e); if(e<0)return-%_MathFloor(-e); return e; } function MathTanh(e){ e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)); if(e===0)return e; if(!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return MathSign(e); var p=MathExp(e); var q=MathExp(-e); return(p-q)/(p+q); } function MathAsinh(e){ e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)); if(e===0||!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return e; if(e>0)return MathLog(e+%_MathSqrt(e*e+1)); return-MathLog(-e+%_MathSqrt(e*e+1)); } function MathAcosh(e){ e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)); if(e<1)return $NaN; if(!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return e; return MathLog(e+%_MathSqrt(e+1)*%_MathSqrt(e-1)); } function MathAtanh(e){ e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)); if(e===0)return e; if(!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return $NaN; return 0.5*MathLog((1+e)/(1-e)); } function MathHypot(e,g){ var j=%_ArgumentsLength(); var r=new d(j); var t=0; for(var l=0;lt)t=m; r[l]=m; } if(t===0)t=1; var u=0; var v=0; for(var l=0;l>>0); } function MathCbrt(e){ e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)); if(e==0||!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return e; return e>=0?CubeRoot(e):-CubeRoot(-e); } function CubeRoot(e){ var y=MathFloorJS(%_DoubleHi(e)/3)+0x2A9F7893; var z=%_ConstructDouble(y,0); z=(1.0/3.0)*(e/(z*z)+2*z); ; z=(1.0/3.0)*(e/(z*z)+2*z); ; z=(1.0/3.0)*(e/(z*z)+2*z); ; return(1.0/3.0)*(e/(z*z)+2*z); ; } function MathConstructor(){} var A=new MathConstructor(); %InternalSetPrototype(A,c.prototype); %AddNamedProperty(a,"Math",A,2); %FunctionSetInstanceClassName(MathConstructor,'Math'); %AddNamedProperty(A,symbolToStringTag,"Math",1|2); b.InstallConstants(A,[ "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(A,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(B){ B.MathAbs=MathAbs; B.MathExp=MathExp; B.MathFloor=MathFloorJS; B.IntRandom=MathRandomRaw; B.MathMax=MathMax; B.MathMin=MathMin; }); }) fdlibme¨ var kMath; var rempio2result; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Math; var d; var e; b.Import(function(g){ d=g.MathAbs; e=g.MathExp; }); function KernelTan(h,i,j){ var k; var l; var m=%_DoubleHi(h); var n=m&0x7fffffff; if(n<0x3e300000){ if(((n|%_DoubleLo(h))|(j+1))==0){ return 1/d(h); }else{ if(j==1){ return h; }else{ var l=h+i; var k=%_ConstructDouble(%_DoubleHi(l),0); var o=i-(k-h); var p=-1/l; var q=%_ConstructDouble(%_DoubleHi(p),0); var r=1+q*k; return q+p*(r+q*o); } } } if(n>=0x3fe59428){ if(h<0){ h=-h; i=-i; } k=kMath[32]-h; l=kMath[33]-i; h=k+l; i=0; } k=h*h; l=k*k; var t=kMath[19+1] +l*(kMath[19+3] +l*(kMath[19+5] + l*(kMath[19+7] +l*(kMath[19+9] +l*kMath[19+11] )))); var o=k*(kMath[19+2] +l*(kMath[19+4] +l*(kMath[19+6] + l*(kMath[19+8] +l*(kMath[19+10] +l*kMath[19+12] ))))); var r=k*h; t=i+k*(r*(t+o)+i); t=t+kMath[19+0] *r; l=h+t; if(n>=0x3fe59428){ return(1-((m>>30)&2))* (j-2.0*(h-(l*l/(l+j)-t))); } if(j==1){ return l; }else{ k=%_ConstructDouble(%_DoubleHi(l),0); o=t-(k-h); var p=-1/l; var q=%_ConstructDouble(%_DoubleHi(p),0); r=1+q*k; return q+p*(r+q*o); } } function MathSinSlow(h){ var u,v,w; var m=%_DoubleHi(h); var n=m&0x7fffffff; if(n<0x4002d97c){ if(m>0){ var k=h-kMath[1]; if(n!=0x3ff921fb){ v=k-kMath[2]; w=(k-v)-kMath[2]; }else{ k-=kMath[3]; v=k-kMath[4]; w=(k-v)-kMath[4]; } u=1; }else{ var k=h+kMath[1]; if(n!=0x3ff921fb){ v=k+kMath[2]; w=(k-v)+kMath[2]; }else{ k+=kMath[3]; v=k+kMath[4]; w=(k-v)+kMath[4]; } u=-1; } }else if(n<=0x413921fb){ var q=d(h); u=(q*kMath[0]+0.5)|0; var t=q-u*kMath[1]; var l=u*kMath[2]; v=t-l; if(n-(%_DoubleHi(v)&0x7ff00000)>0x1000000){ q=t; l=u*kMath[3]; t=q-l; l=u*kMath[4]-((q-t)-l); v=t-l; if(n-(%_DoubleHi(v)&0x7ff00000)>0x3100000){ q=t; l=u*kMath[5]; t=q-l; l=u*kMath[6]-((q-t)-l); v=t-l; } } w=(t-v)-l; if(m<0){ u=-u; v=-v; w=-w; } }else{ u=%RemPiO2(h,rempio2result); v=rempio2result[0]; w=rempio2result[1]; } ; var x=1-(u&2); if(u&1){ var n=%_DoubleHi(v)&0x7fffffff; var k=v*v; var t=k*(4.16666666666666019037e-02+k*(-1.38888888888741095749e-03+k*(2.48015872894767294178e-05+k*(-2.75573143513906633035e-07+k*(2.08757232129817482790e-09+k*-1.13596475577881948265e-11))))); if(n<0x3fd33333){ return(1-(0.5*k-(k*t-v*w)))*x; }else{ var y; if(n>0x3fe90000){ y=0.28125; }else{ y=%_ConstructDouble(%_DoubleHi(0.25*v),0); } var z=0.5*k-y; return(1-y-(z-(k*t-v*w)))*x; } ; }else{ var k=v*v; var o=k*v; var t=8.33333333332248946124e-03+k*(-1.98412698298579493134e-04+k*(2.75573137070700676789e-06+k*(-2.50507602534068634195e-08+k*1.58969099521155010221e-10))); return(v-((k*(0.5*w-o*t)-w)-o*-1.66666666666666324348e-01))*x; ; } } function MathCosSlow(h){ var u,v,w; var m=%_DoubleHi(h); var n=m&0x7fffffff; if(n<0x4002d97c){ if(m>0){ var k=h-kMath[1]; if(n!=0x3ff921fb){ v=k-kMath[2]; w=(k-v)-kMath[2]; }else{ k-=kMath[3]; v=k-kMath[4]; w=(k-v)-kMath[4]; } u=1; }else{ var k=h+kMath[1]; if(n!=0x3ff921fb){ v=k+kMath[2]; w=(k-v)+kMath[2]; }else{ k+=kMath[3]; v=k+kMath[4]; w=(k-v)+kMath[4]; } u=-1; } }else if(n<=0x413921fb){ var q=d(h); u=(q*kMath[0]+0.5)|0; var t=q-u*kMath[1]; var l=u*kMath[2]; v=t-l; if(n-(%_DoubleHi(v)&0x7ff00000)>0x1000000){ q=t; l=u*kMath[3]; t=q-l; l=u*kMath[4]-((q-t)-l); v=t-l; if(n-(%_DoubleHi(v)&0x7ff00000)>0x3100000){ q=t; l=u*kMath[5]; t=q-l; l=u*kMath[6]-((q-t)-l); v=t-l; } } w=(t-v)-l; if(m<0){ u=-u; v=-v; w=-w; } }else{ u=%RemPiO2(h,rempio2result); v=rempio2result[0]; w=rempio2result[1]; } ; if(u&1){ var x=(u&2)-1; var k=v*v; var o=k*v; var t=8.33333333332248946124e-03+k*(-1.98412698298579493134e-04+k*(2.75573137070700676789e-06+k*(-2.50507602534068634195e-08+k*1.58969099521155010221e-10))); return(v-((k*(0.5*w-o*t)-w)-o*-1.66666666666666324348e-01))*x; ; }else{ var x=1-(u&2); var n=%_DoubleHi(v)&0x7fffffff; var k=v*v; var t=k*(4.16666666666666019037e-02+k*(-1.38888888888741095749e-03+k*(2.48015872894767294178e-05+k*(-2.75573143513906633035e-07+k*(2.08757232129817482790e-09+k*-1.13596475577881948265e-11))))); if(n<0x3fd33333){ return(1-(0.5*k-(k*t-v*w)))*x; }else{ var y; if(n>0x3fe90000){ y=0.28125; }else{ y=%_ConstructDouble(%_DoubleHi(0.25*v),0); } var z=0.5*k-y; return(1-y-(z-(k*t-v*w)))*x; } ; } } function MathSin(h){ h=+h; if((%_DoubleHi(h)&0x7fffffff)<=0x3fe921fb){ var k=h*h; var o=k*h; var t=8.33333333332248946124e-03+k*(-1.98412698298579493134e-04+k*(2.75573137070700676789e-06+k*(-2.50507602534068634195e-08+k*1.58969099521155010221e-10))); return(h-((k*(0.5*0-o*t)-0)-o*-1.66666666666666324348e-01)); ; } return+MathSinSlow(h); } function MathCos(h){ h=+h; if((%_DoubleHi(h)&0x7fffffff)<=0x3fe921fb){ var n=%_DoubleHi(h)&0x7fffffff; var k=h*h; var t=k*(4.16666666666666019037e-02+k*(-1.38888888888741095749e-03+k*(2.48015872894767294178e-05+k*(-2.75573143513906633035e-07+k*(2.08757232129817482790e-09+k*-1.13596475577881948265e-11))))); if(n<0x3fd33333){ return(1-(0.5*k-(k*t-h*0))); }else{ var y; if(n>0x3fe90000){ y=0.28125; }else{ y=%_ConstructDouble(%_DoubleHi(0.25*h),0); } var z=0.5*k-y; return(1-y-(z-(k*t-h*0))); } ; } return+MathCosSlow(h); } function MathTan(h){ h=h*1; if((%_DoubleHi(h)&0x7fffffff)<=0x3fe921fb){ return KernelTan(h,0,1); } var u,v,w; var m=%_DoubleHi(h); var n=m&0x7fffffff; if(n<0x4002d97c){ if(m>0){ var k=h-kMath[1]; if(n!=0x3ff921fb){ v=k-kMath[2]; w=(k-v)-kMath[2]; }else{ k-=kMath[3]; v=k-kMath[4]; w=(k-v)-kMath[4]; } u=1; }else{ var k=h+kMath[1]; if(n!=0x3ff921fb){ v=k+kMath[2]; w=(k-v)+kMath[2]; }else{ k+=kMath[3]; v=k+kMath[4]; w=(k-v)+kMath[4]; } u=-1; } }else if(n<=0x413921fb){ var q=d(h); u=(q*kMath[0]+0.5)|0; var t=q-u*kMath[1]; var l=u*kMath[2]; v=t-l; if(n-(%_DoubleHi(v)&0x7ff00000)>0x1000000){ q=t; l=u*kMath[3]; t=q-l; l=u*kMath[4]-((q-t)-l); v=t-l; if(n-(%_DoubleHi(v)&0x7ff00000)>0x3100000){ q=t; l=u*kMath[5]; t=q-l; l=u*kMath[6]-((q-t)-l); v=t-l; } } w=(t-v)-l; if(m<0){ u=-u; v=-v; w=-w; } }else{ u=%RemPiO2(h,rempio2result); v=rempio2result[0]; w=rempio2result[1]; } ; return KernelTan(v,w,(u&1)?-1:1); } function MathLog1p(h){ h=h*1; var m=%_DoubleHi(h); var A=m&0x7fffffff; var B=1; var C=h; var D=1; var E=0; var F=h; if(m<0x3fda827a){ if(A>=0x3ff00000){ if(h===-1){ return-(1/0); }else{ return $NaN; } }else if(A<0x3c900000){ return h; }else if(A<0x3e200000){ return h-h*h*0.5; } if((m>0)||(m<=-0x402D413D)){ B=0; } } if(m>=0x7ff00000)return h; if(B!==0){ if(m<0x43400000){ F=1+h; D=%_DoubleHi(F); B=(D>>20)-1023; E=(B>0)?1-(F-h):h-(F-1); E=E/F; }else{ D=%_DoubleHi(F); B=(D>>20)-1023; } D=D&0xfffff; if(D<0x6a09e){ F=%_ConstructDouble(D|0x3ff00000,%_DoubleLo(F)); }else{ ++B; F=%_ConstructDouble(D|0x3fe00000,%_DoubleLo(F)); D=(0x00100000-D)>>2; } C=F-1; } var G=0.5*C*C; if(D===0){ if(C===0){ if(B===0){ return 0.0; }else{ return B*kMath[34]+(E+B*kMath[35]); } } var H=G*(1-kMath[36]*C); if(B===0){ return C-H; }else{ return B*kMath[34]-((H-(B*kMath[35]+E))-C); } } var r=C/(2+C); var k=r*r; var H=k*((kMath[37+0]) +k*((kMath[37+1]) +k* ((kMath[37+2]) +k*((kMath[37+3]) +k* ((kMath[37+4]) +k*((kMath[37+5]) +k*(kMath[37+6]) )))))); if(B===0){ return C-(G-r*(G+H)); }else{ return B*kMath[34]-((G-(r*(G+H)+(B*kMath[35]+E)))-C); } } function MathExpm1(h){ h=h*1; var i; var I; var J; var B; var q; var E; var m=%_DoubleHi(h); var K=m&0x80000000; var i=(K===0)?h:-h; m&=0x7fffffff; if(m>=0x4043687a){ if(m>=0x40862e42){ if(m>=0x7ff00000){ return(h===-(1/0))?-1:h; } if(h>kMath[44])return(1/0); } if(K!=0)return-1; } if(m>0x3fd62e42){ if(m<0x3ff0a2b2){ if(K===0){ I=h-kMath[34]; J=kMath[35]; B=1; }else{ I=h+kMath[34]; J=-kMath[35]; B=-1; } }else{ B=(kMath[45]*h+((K===0)?0.5:-0.5))|0; q=B; I=h-q*kMath[34]; J=q*kMath[35]; } h=I-J; E=(I-h)-J; }else if(m<0x3c900000){ return h; }else{ B=0; } var L=0.5*h; var M=h*L; var N=1+M*((kMath[46+0]) +M*((kMath[46+1]) +M* ((kMath[46+2]) +M*((kMath[46+3]) +M*(kMath[46+4]) )))); q=3-N*L; var O=M*((N-q)/(6-h*q)); if(B===0){ return h-(h*O-M); }else{ O=(h*(O-E)-E); O-=M; if(B===-1)return 0.5*(h-O)-0.5; if(B===1){ if(h<-0.25)return-2*(O-(h+0.5)); return 1+2*(h-O); } if(B<=-2||B>56){ i=1-(O-h); i=%_ConstructDouble(%_DoubleHi(i)+(B<<20),%_DoubleLo(i)); return i-1; } if(B<20){ q=%_ConstructDouble(0x3ff00000-(0x200000>>B),0); i=q-(O-h); i=%_ConstructDouble(%_DoubleHi(i)+(B<<20),%_DoubleLo(i)); }else{ q=%_ConstructDouble((0x3ff-B)<<20,0); i=h-(O+q); i+=1; i=%_ConstructDouble(%_DoubleHi(i)+(B<<20),%_DoubleLo(i)); } } return i; } function MathSinh(h){ h=h*1; var P=(h<0)?-0.5:0.5; var A=d(h); if(A<22){ if(A<3.725290298461914e-9)return h; var q=MathExpm1(A); if(A<1)return P*(2*q-q*q/(q+1)); return P*(q+q/(q+1)); } if(A<709.7822265625)return P*e(A); if(A<=kMath[51]){ var l=e(0.5*A); var q=P*l; return q*l; } return h*(1/0); } function MathCosh(h){ h=h*1; var n=%_DoubleHi(h)&0x7fffffff; if(n<0x3fd62e43){ var q=MathExpm1(d(h)); var l=1+q; if(n<0x3c800000)return l; return 1+(q*q)/(l+l); } if(n<0x40360000){ var q=e(d(h)); return 0.5*q+0.5/q; } if(n<0x40862e42)return 0.5*e(d(h)); if(d(h)<=kMath[51]){ var l=e(0.5*d(h)); var q=0.5*l; return q*l; } if((!%_IsSmi(%IS_VAR(h))&&!(h==h)))return h; return(1/0); } function MathLog10(h){ h=h*1; var m=%_DoubleHi(h); var Q=%_DoubleLo(h); var B=0; if(m<0x00100000){ if(((m&0x7fffffff)|Q)===0)return-(1/0); if(m<0)return $NaN; B-=54; h*=18014398509481984; m=%_DoubleHi(h); Q=%_DoubleLo(h); } if(m>=0x7ff00000)return h; B+=(m>>20)-1023; var R=(B&0x80000000)>>>31; m=(m&0x000fffff)|((0x3ff-R)<<20); var i=B+R; h=%_ConstructDouble(m,Q); var k=i*kMath[54]+kMath[52]*%_MathLogRT(h); return k+i*kMath[53]; } function MathLog2(h){ h=h*1; var A=d(h); var m=%_DoubleHi(h); var Q=%_DoubleLo(h); var n=m&0x7fffffff; if((n|Q)==0)return-(1/0); if(m<0)return $NaN; if(n>=0x7ff00000)return h; var u=0; if(n<0x00100000){ A*=9007199254740992; u-=53; n=%_DoubleHi(A); } u+=(n>>20)-0x3ff; var S=n&0x000fffff; n=S|0x3ff00000; var T=1; var U=0; var V=0; if(S>0x3988e){ if(S<0xbb67a){ T=1.5; U=kMath[64]; V=kMath[65]; }else{ u+=1; n-=0x00100000; } } A=%_ConstructDouble(n,%_DoubleLo(A)); var F=A-T; var o=1/(A+T); var W=F*o; var X=%_ConstructDouble(%_DoubleHi(W),0); var Y=%_ConstructDouble(%_DoubleHi(A+T),0) var Z=A-(Y-T); var aa=o*((F-X*Y)-X*Z); var ab=W*W; var t=ab*ab*((kMath[55+0]) +ab*((kMath[55+1]) +ab*((kMath[55+2]) +ab*( (kMath[55+3]) +ab*((kMath[55+4]) +ab*(kMath[55+5]) ))))); t+=aa*(X+W); ab=X*X; Y=%_ConstructDouble(%_DoubleHi(3.0+ab+t),0); Z=t-((Y-3.0)-ab); F=X*Y; o=aa*Y+Z*W; p_h=%_ConstructDouble(%_DoubleHi(F+o),0); p_l=o-(p_h-F); z_h=kMath[62]*p_h; z_l=kMath[63]*p_h+p_l*kMath[61]+V; var q=u; var ac=%_ConstructDouble(%_DoubleHi(((z_h+z_l)+U)+q),0); var ad=z_l-(((ac-q)-U)-z_h); return ac+ad; } 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=b.InternalArray; var e; var g; var h; b.Import(function(i){ e=i.IsFinite; g=i.MathAbs; h=i.MathFloor; }); var j=$NaN; var k; function LocalTimezone(l){ if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return""; CheckDateCacheCurrent(); if(l==j){ return k; } var m=%DateLocalTimezone(l); j=l; k=m; return m; } function UTC(n){ if((!%_IsSmi(%IS_VAR(n))&&!(n==n)))return n; return %DateToUTC(n); } function MakeTime(o,p,q,r){ if(!e(o))return $NaN; if(!e(p))return $NaN; if(!e(q))return $NaN; if(!e(r))return $NaN; return(%_IsSmi(%IS_VAR(o))?o:%NumberToInteger($toNumber(o)))*3600000 +(%_IsSmi(%IS_VAR(p))?p:%NumberToInteger($toNumber(p)))*60000 +(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q)))*1000 +(%_IsSmi(%IS_VAR(r))?r:%NumberToInteger($toNumber(r))); } function TimeInYear(t){ return DaysInYear(t)*86400000; } function MakeDay(t,u,v){ if(!e(t)||!e(u)||!e(v))return $NaN; t=(%_IsSmi(%IS_VAR(t))?t:%NumberToIntegerMapMinusZero($toNumber(t))); u=(%_IsSmi(%IS_VAR(u))?u:%NumberToIntegerMapMinusZero($toNumber(u))); v=(%_IsSmi(%IS_VAR(v))?v:%NumberToIntegerMapMinusZero($toNumber(v))); if(t<-1000000||t>1000000|| u<-10000000||u>10000000){ return $NaN; } return %DateMakeDay(t|0,u|0)+v-1; } function MakeDate(w,n){ var n=w*86400000+n; if(g(n)>8640002592000000)return $NaN; return n; } function TimeClip(n){ if(!e(n))return $NaN; if(g(n)>8640000000000000)return $NaN; return(%_IsSmi(%IS_VAR(n))?n:%NumberToInteger($toNumber(n))); } var x={ time:0, string:null }; function DateConstructor(t,u,v,y,z,A,r){ 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{ var n=$toPrimitive(t,1); C=(typeof(n)==='string')?DateParse(n):$toNumber(n); } (%DateSetValue(this,C,1)); }else{ t=$toNumber(t); u=$toNumber(u); v=B>2?$toNumber(v):1; y=B>3?$toNumber(y):0; z=B>4?$toNumber(z):0; A=B>5?$toNumber(A):0; r=B>6?$toNumber(r):0; t=(!(!%_IsSmi(%IS_VAR(t))&&!(t==t))&& 0<=(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))&& (%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))<=99)?1900+(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t))):t; var w=MakeDay(t,u,v); var n=MakeTime(y,z,A,r); C=MakeDate(w,n); (%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 m=LocalTimezone((%_DateField(v,0))); var I=-(%_DateField(v,21)); var J=(I>=0)?1:-1; var y=h((J*I)/60); var p=h((J*I)%60); var K=' GMT'+((J==1)?'+':'-')+ TwoDigitString(y)+TwoDigitString(p); return K+' ('+m+')'; } function DatePrintString(v){ if(!%_IsDate(v))%_ThrowNotDateError(); return DateString(v)+' '+TimeString(v); } var L=new d(8); function DateParse(M){ var N=%DateParseString($toString(M),L); if((N===null))return $NaN; var w=MakeDay(N[0],N[1],N[2]); var n=MakeTime(N[3],N[4],N[5],N[6]); var v=MakeDate(w,n); if((N[7]===null)){ return TimeClip(UTC(v)); }else{ return TimeClip(v-N[7]*1000); } } function DateUTC(t,u,v,y,z,A,r){ t=$toNumber(t); u=$toNumber(u); var B=%_ArgumentsLength(); v=B>2?$toNumber(v):1; y=B>3?$toNumber(y):0; z=B>4?$toNumber(z):0; A=B>5?$toNumber(A):0; r=B>6?$toNumber(r):0; t=(!(!%_IsSmi(%IS_VAR(t))&&!(t==t))&& 0<=(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))&& (%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))<=99)?1900+(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t))):t; var w=MakeDay(t,u,v); var n=MakeTime(y,z,A,r); return TimeClip(MakeDate(w,n)); } function DateNow(){ return %DateCurrentTime(); } function DateToString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)) if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date'; var O=LocalTimezoneString(this) return DatePrintString(this)+O; } function DateToDateString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date'; return DateString(this); } function DateToTimeString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))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 l=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date'; return LongDateString(this); } function DateToLocaleTimeString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))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(r){ if(!%_IsDate(this))%_ThrowNotDateError(); (%DateSetValue(this,$toNumber(r),1)); return(%_DateField(this,0)); } function DateSetMilliseconds(r){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)+%_DateField(this,21)); r=$toNumber(r); var n=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),(%_DateField(this,7)),r); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0)); } function DateSetUTCMilliseconds(r){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)); r=$toNumber(r); var n=MakeTime((%_DateField(this,15)), (%_DateField(this,16)), (%_DateField(this,17)), r); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1)); } function DateSetSeconds(q,r){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)+%_DateField(this,21)); q=$toNumber(q); r=%_ArgumentsLength()<2?(%_DateField(this,8)):$toNumber(r); var n=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),q,r); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0)); } function DateSetUTCSeconds(q,r){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)); q=$toNumber(q); r=%_ArgumentsLength()<2?(%_DateField(this,18)):$toNumber(r); var n=MakeTime((%_DateField(this,15)),(%_DateField(this,16)),q,r); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1)); } function DateSetMinutes(p,q,r){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)+%_DateField(this,21)); p=$toNumber(p); var B=%_ArgumentsLength(); q=B<2?(%_DateField(this,7)):$toNumber(q); r=B<3?(%_DateField(this,8)):$toNumber(r); var n=MakeTime((%_DateField(this,5)),p,q,r); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0)); } function DateSetUTCMinutes(p,q,r){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)); p=$toNumber(p); var B=%_ArgumentsLength(); q=B<2?(%_DateField(this,17)):$toNumber(q); r=B<3?(%_DateField(this,18)):$toNumber(r); var n=MakeTime((%_DateField(this,15)),p,q,r); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1)); } function DateSetHours(o,p,q,r){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)+%_DateField(this,21)); o=$toNumber(o); var B=%_ArgumentsLength(); p=B<2?(%_DateField(this,6)):$toNumber(p); q=B<3?(%_DateField(this,7)):$toNumber(q); r=B<4?(%_DateField(this,8)):$toNumber(r); var n=MakeTime(o,p,q,r); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0)); } function DateSetUTCHours(o,p,q,r){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)); o=$toNumber(o); var B=%_ArgumentsLength(); p=B<2?(%_DateField(this,16)):$toNumber(p); q=B<3?(%_DateField(this,17)):$toNumber(q); r=B<4?(%_DateField(this,18)):$toNumber(r); var n=MakeTime(o,p,q,r); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1)); } function DateSetDate(v){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)+%_DateField(this,21)); v=$toNumber(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 l=(%_DateField(this,0)); v=$toNumber(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 l=(%_DateField(this,0)+%_DateField(this,21)); u=$toNumber(u); v=%_ArgumentsLength()<2?(%_DateField(this,3)):$toNumber(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 l=(%_DateField(this,0)); u=$toNumber(u); v=%_ArgumentsLength()<2?(%_DateField(this,13)):$toNumber(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 l=(%_DateField(this,0)+%_DateField(this,21)); t=$toNumber(t); var B=%_ArgumentsLength(); var n; if((!%_IsSmi(%IS_VAR(l))&&!(l==l))){ u=B<2?0:$toNumber(u); v=B<3?1:$toNumber(v); n=0; }else{ u=B<2?(%_DateField(this,2)):$toNumber(u); v=B<3?(%_DateField(this,3)):$toNumber(v); n=(%_DateField(this,10)); } var w=MakeDay(t,u,v); return(%DateSetValue(this,MakeDate(w,n),0)); } function DateSetUTCFullYear(t,u,v){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)); t=$toNumber(t); var B=%_ArgumentsLength(); var n; if((!%_IsSmi(%IS_VAR(l))&&!(l==l))){ u=B<2?0:$toNumber(u); v=B<3?1:$toNumber(v); n=0; }else{ u=B<2?(%_DateField(this,12)):$toNumber(u); v=B<3?(%_DateField(this,13)):$toNumber(v); n=(%_DateField(this,20)); } var w=MakeDay(t,u,v); return(%DateSetValue(this,MakeDate(w,n),1)); } function DateToUTCString(){ if(!%_IsDate(this))%_ThrowNotDateError(); var l=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))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=$toNumber(t); if((!%_IsSmi(%IS_VAR(t))&&!(t==t)))return(%DateSetValue(this,$NaN,1)); t=(0<=(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))&&(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))<=99) ?1900+(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t))):t; var l=(%_DateField(this,0)+%_DateField(this,21)); var u,v,n; if((!%_IsSmi(%IS_VAR(l))&&!(l==l))){ u=0; v=1; n=0; }else{ u=(%_DateField(this,2)); v=(%_DateField(this,3)); n=(%_DateField(this,10)); } var w=MakeDay(t,u,v); return(%DateSetValue(this,MakeDate(w,n),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 l=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))throw MakeRangeError(136); 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=$defaultNumber(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]; j=$NaN; k=(void 0); x.time=$NaN; x.string=null; } function CreateDate(n){ var v=new c(); v.setTime(n); return v; } %SetCode(c,DateConstructor); %FunctionSetPrototype(c,new c($NaN)); 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 ]); $createDate=CreateDate; }) regexp f var $regexpLastMatchInfoOverride; var harmony_regexps=false; var harmony_unicode_regexps=false; (function(a,b){ %CheckIsBootstrapping(); var c=a.RegExp; var d=b.InternalPackedArray; var e=new d( 2, "", (void 0), 0, 0 ); $regexpLastMatchInfoOverride=null; function DoConstructRegExp(g,h,i){ if((%_IsRegExp(h))){ if(!(i===(void 0)))throw MakeTypeError(93); i=(h.global?'g':'') +(h.ignoreCase?'i':'') +(h.multiline?'m':''); if(harmony_unicode_regexps) i+=(h.unicode?'u':''); if(harmony_regexps) i+=(h.sticky?'y':''); h=h.source; } h=(h===(void 0))?'':$toString(h); i=(i===(void 0))?'':$toString(i); %RegExpInitializeAndCompile(g,h,i); } function RegExpConstructor(h,i){ if(%_IsConstructCall()){ DoConstructRegExp(this,h,i); }else{ if((%_IsRegExp(h))&&(i===(void 0))){ return h; } return new c(h,i); } } function RegExpCompileJS(h,i){ if(this==c.prototype){ throw MakeTypeError(33, 'RegExp.prototype.compile',this); } if((h===(void 0))&&%_ArgumentsLength()!=0){ DoConstructRegExp(this,'undefined',i); }else{ DoConstructRegExp(this,h,i); } } function DoRegExpExec(j,k,l){ var m=%_RegExpExec(j,k,l,e); if(m!==null)$regexpLastMatchInfoOverride=null; return m; } function RegExpExecNoTests(j,k,n){ var o=%_RegExpExec(j,k,n,e); if(o!==null){ $regexpLastMatchInfoOverride=null; var p=((o)[0])>>1; var n=o[3]; var q=o[4]; var r=%_SubString(k,n,q); var m=%_RegExpConstructResult(p,n,k); m[0]=r; if(p==1)return m; var t=3+2; for(var u=1;uk.length){ this.lastIndex=0; return null; } }else{ u=0; } var x=%_RegExpExec(this,k,u,e); if((x===null)){ this.lastIndex=0; return null; } $regexpLastMatchInfoOverride=null; if(w){ this.lastIndex=e[4]; } var p=((x)[0])>>1; var n=x[3]; var q=x[4]; var r=%_SubString(k,n,q); var m=%_RegExpConstructResult(p,n,k); m[0]=r; if(p==1)return m; var t=3+2; for(var u=1;uk.length){ this.lastIndex=0; return false; } var x=%_RegExpExec(this,k,u,e); if((x===null)){ this.lastIndex=0; return false; } $regexpLastMatchInfoOverride=null; this.lastIndex=e[4]; return true; }else{ var j=this; if(j.source.length>=3&& %_StringCharCodeAt(j.source,0)==46&& %_StringCharCodeAt(j.source,1)==42&& %_StringCharCodeAt(j.source,2)!=63){ j=TrimRegExp(j); } var x=%_RegExpExec(j,k,0,e); if((x===null)){ this.lastIndex=0; return false; } $regexpLastMatchInfoOverride=null; return true; } } function TrimRegExp(j){ if(!%_ObjectEquals(y,j)){ y=j; z= new c(%_SubString(j.source,2,j.source.length), (j.ignoreCase?j.multiline?"im":"i" :j.multiline?"m":"")); } return z; } function RegExpToString(){ if(!(%_IsRegExp(this))){ throw MakeTypeError(33, 'RegExp.prototype.toString',this); } var m='/'+this.source+'/'; if(this.global)m+='g'; if(this.ignoreCase)m+='i'; if(this.multiline)m+='m'; if(harmony_unicode_regexps&&this.unicode)m+='u'; if(harmony_regexps&&this.sticky)m+='y'; return m; } function RegExpGetLastMatch(){ if($regexpLastMatchInfoOverride!==null){ return(($regexpLastMatchInfoOverride)[0]); } var A=((e)[1]); return %_SubString(A, e[3], e[4]); } function RegExpGetLastParen(){ if($regexpLastMatchInfoOverride){ var B=$regexpLastMatchInfoOverride; if(B.length<=3)return''; return B[B.length-3]; } var C=((e)[0]); if(C<=2)return''; var A=((e)[1]); var n=e[(3+(C-2))]; var q=e[(3+(C-1))]; if(n!=-1&&q!=-1){ return %_SubString(A,n,q); } return""; } function RegExpGetLeftContext(){ var D; var E; if(!$regexpLastMatchInfoOverride){ D=e[3]; E=((e)[1]); }else{ var B=$regexpLastMatchInfoOverride; D=((B)[(B).length-2]); E=((B)[(B).length-1]); } return %_SubString(E,0,D); } function RegExpGetRightContext(){ var D; var E; if(!$regexpLastMatchInfoOverride){ D=e[4]; E=((e)[1]); }else{ var B=$regexpLastMatchInfoOverride; E=((B)[(B).length-1]); var F=((B)[0]); D=((B)[(B).length-2])+F.length; } return %_SubString(E,D,E.length); } function RegExpMakeCaptureGetter(G){ return function foo(){ if($regexpLastMatchInfoOverride){ if(G<$regexpLastMatchInfoOverride.length-2){ return(($regexpLastMatchInfoOverride)[(G)]); } return''; } var l=G*2; if(l>=((e)[0]))return''; var H=e[(3+(l))]; var I=e[(3+(l+1))]; if(H==-1||I==-1)return''; return %_SubString(((e)[1]),H,I); }; } %FunctionSetInstanceClassName(c,'RegExp'); %AddNamedProperty( c.prototype,'constructor',c,2); %SetCode(c,RegExpConstructor); b.InstallFunctions(c.prototype,2,[ "exec",RegExpExecJS, "test",RegExpTest, "toString",RegExpToString, "compile",RegExpCompileJS ]); %FunctionSetLength(c.prototype.compile,1); var J=function(){ var K=((e)[2]); return(K===(void 0))?"":K; }; var L=function(k){ ((e)[2])=$toString(k); }; %OptimizeObjectForAddingMultipleProperties(c,22); %DefineAccessorPropertyUnchecked(c,'input',J, L,4); %DefineAccessorPropertyUnchecked(c,'$_',J, L,2|4); var M=false; var N=function(){return M;}; var O=function(P){M=P?true:false;}; %DefineAccessorPropertyUnchecked(c,'multiline',N, O,4); %DefineAccessorPropertyUnchecked(c,'$*',N, O, 2|4); var Q=function(R){}; %DefineAccessorPropertyUnchecked(c,'lastMatch',RegExpGetLastMatch, Q,4); %DefineAccessorPropertyUnchecked(c,'$&',RegExpGetLastMatch, Q,2|4); %DefineAccessorPropertyUnchecked(c,'lastParen',RegExpGetLastParen, Q,4); %DefineAccessorPropertyUnchecked(c,'$+',RegExpGetLastParen, Q,2|4); %DefineAccessorPropertyUnchecked(c,'leftContext', RegExpGetLeftContext,Q, 4); %DefineAccessorPropertyUnchecked(c,'$`',RegExpGetLeftContext, Q,2|4); %DefineAccessorPropertyUnchecked(c,'rightContext', RegExpGetRightContext,Q, 4); %DefineAccessorPropertyUnchecked(c,"$'",RegExpGetRightContext, Q,2|4); for(var u=1;u<10;++u){ %DefineAccessorPropertyUnchecked(c,'$'+u, RegExpMakeCaptureGetter(u),Q, 4); } %ToFastProperties(c); b.Export(function(S){ S.RegExpExec=DoRegExpExec; S.RegExpExecNoTests=RegExpExecNoTests; S.RegExpLastMatchInfo=e; S.RegExpTest=RegExpTest; }); }) ,arraybufferi (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.ArrayBuffer; var d=a.Object; var e; var g; b.Import(function(h){ e=h.MathMax; g=h.MathMin; }); function ArrayBufferConstructor(i){ if(%_IsConstructCall()){ var j=$toPositiveInteger(i,124); %ArrayBufferInitialize(this,j,false); }else{ throw MakeTypeError(20,"ArrayBuffer"); } } function ArrayBufferGetByteLen(){ if(!(%_ClassOf(this)==='ArrayBuffer')){ throw MakeTypeError(33, 'ArrayBuffer.prototype.byteLength',this); } return %_ArrayBufferGetByteLength(this); } function ArrayBufferSlice(k,l){ if(!(%_ClassOf(this)==='ArrayBuffer')){ throw MakeTypeError(33, 'ArrayBuffer.prototype.slice',this); } var m=(%_IsSmi(%IS_VAR(k))?k:%NumberToInteger($toNumber(k))); if(!(l===(void 0))){ l=(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger($toNumber(l))); } var n; var o=%_ArrayBufferGetByteLength(this); if(m<0){ n=e(o+m,0); }else{ n=g(m,o); } var p=(l===(void 0))?o:l; var q; if(p<0){ q=e(o+p,0); }else{ q=g(p,o); } if(qz){ throw MakeRangeError(139); } } var B; var C; if((y===(void 0))){ if(z % 1!==0){ throw MakeRangeError(137, "byte length","Uint8Array",1); } B=z-A; C=B/1; }else{ var C=y; B=C*1; } if((A+B>z) ||(C>%_MaxSmi())){ throw MakeRangeError(138); } %_TypedArrayInitialize(v,1,w,A,B,true); } function Uint8ArrayConstructByLength(v,y){ var D=(y===(void 0))? 0:$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var E=D*1; if(E>%_TypedArrayMaxSizeInHeap()){ var w=new d(E); %_TypedArrayInitialize(v,1,w,0,E,true); }else{ %_TypedArrayInitialize(v,1,null,0,E,true); } } function Uint8ArrayConstructByArrayLike(v,F){ var y=F.length; var D=$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var G=false; var E=D*1; if(E<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(v,1,null,0,E,false); }else{ G= %TypedArrayInitializeFromArrayLike(v,1,F,D); } if(!G){ for(var H=0;Hz){ throw MakeRangeError(139); } } var B; var C; if((y===(void 0))){ if(z % 1!==0){ throw MakeRangeError(137, "byte length","Int8Array",1); } B=z-A; C=B/1; }else{ var C=y; B=C*1; } if((A+B>z) ||(C>%_MaxSmi())){ throw MakeRangeError(138); } %_TypedArrayInitialize(v,2,w,A,B,true); } function Int8ArrayConstructByLength(v,y){ var D=(y===(void 0))? 0:$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var E=D*1; if(E>%_TypedArrayMaxSizeInHeap()){ var w=new d(E); %_TypedArrayInitialize(v,2,w,0,E,true); }else{ %_TypedArrayInitialize(v,2,null,0,E,true); } } function Int8ArrayConstructByArrayLike(v,F){ var y=F.length; var D=$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var G=false; var E=D*1; if(E<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(v,2,null,0,E,false); }else{ G= %TypedArrayInitializeFromArrayLike(v,2,F,D); } if(!G){ for(var H=0;Hz){ throw MakeRangeError(139); } } var B; var C; if((y===(void 0))){ if(z % 2!==0){ throw MakeRangeError(137, "byte length","Uint16Array",2); } B=z-A; C=B/2; }else{ var C=y; B=C*2; } if((A+B>z) ||(C>%_MaxSmi())){ throw MakeRangeError(138); } %_TypedArrayInitialize(v,3,w,A,B,true); } function Uint16ArrayConstructByLength(v,y){ var D=(y===(void 0))? 0:$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var E=D*2; if(E>%_TypedArrayMaxSizeInHeap()){ var w=new d(E); %_TypedArrayInitialize(v,3,w,0,E,true); }else{ %_TypedArrayInitialize(v,3,null,0,E,true); } } function Uint16ArrayConstructByArrayLike(v,F){ var y=F.length; var D=$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var G=false; var E=D*2; if(E<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(v,3,null,0,E,false); }else{ G= %TypedArrayInitializeFromArrayLike(v,3,F,D); } if(!G){ for(var H=0;Hz){ throw MakeRangeError(139); } } var B; var C; if((y===(void 0))){ if(z % 2!==0){ throw MakeRangeError(137, "byte length","Int16Array",2); } B=z-A; C=B/2; }else{ var C=y; B=C*2; } if((A+B>z) ||(C>%_MaxSmi())){ throw MakeRangeError(138); } %_TypedArrayInitialize(v,4,w,A,B,true); } function Int16ArrayConstructByLength(v,y){ var D=(y===(void 0))? 0:$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var E=D*2; if(E>%_TypedArrayMaxSizeInHeap()){ var w=new d(E); %_TypedArrayInitialize(v,4,w,0,E,true); }else{ %_TypedArrayInitialize(v,4,null,0,E,true); } } function Int16ArrayConstructByArrayLike(v,F){ var y=F.length; var D=$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var G=false; var E=D*2; if(E<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(v,4,null,0,E,false); }else{ G= %TypedArrayInitializeFromArrayLike(v,4,F,D); } if(!G){ for(var H=0;Hz){ throw MakeRangeError(139); } } var B; var C; if((y===(void 0))){ if(z % 4!==0){ throw MakeRangeError(137, "byte length","Uint32Array",4); } B=z-A; C=B/4; }else{ var C=y; B=C*4; } if((A+B>z) ||(C>%_MaxSmi())){ throw MakeRangeError(138); } %_TypedArrayInitialize(v,5,w,A,B,true); } function Uint32ArrayConstructByLength(v,y){ var D=(y===(void 0))? 0:$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var E=D*4; if(E>%_TypedArrayMaxSizeInHeap()){ var w=new d(E); %_TypedArrayInitialize(v,5,w,0,E,true); }else{ %_TypedArrayInitialize(v,5,null,0,E,true); } } function Uint32ArrayConstructByArrayLike(v,F){ var y=F.length; var D=$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var G=false; var E=D*4; if(E<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(v,5,null,0,E,false); }else{ G= %TypedArrayInitializeFromArrayLike(v,5,F,D); } if(!G){ for(var H=0;Hz){ throw MakeRangeError(139); } } var B; var C; if((y===(void 0))){ if(z % 4!==0){ throw MakeRangeError(137, "byte length","Int32Array",4); } B=z-A; C=B/4; }else{ var C=y; B=C*4; } if((A+B>z) ||(C>%_MaxSmi())){ throw MakeRangeError(138); } %_TypedArrayInitialize(v,6,w,A,B,true); } function Int32ArrayConstructByLength(v,y){ var D=(y===(void 0))? 0:$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var E=D*4; if(E>%_TypedArrayMaxSizeInHeap()){ var w=new d(E); %_TypedArrayInitialize(v,6,w,0,E,true); }else{ %_TypedArrayInitialize(v,6,null,0,E,true); } } function Int32ArrayConstructByArrayLike(v,F){ var y=F.length; var D=$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var G=false; var E=D*4; if(E<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(v,6,null,0,E,false); }else{ G= %TypedArrayInitializeFromArrayLike(v,6,F,D); } if(!G){ for(var H=0;Hz){ throw MakeRangeError(139); } } var B; var C; if((y===(void 0))){ if(z % 4!==0){ throw MakeRangeError(137, "byte length","Float32Array",4); } B=z-A; C=B/4; }else{ var C=y; B=C*4; } if((A+B>z) ||(C>%_MaxSmi())){ throw MakeRangeError(138); } %_TypedArrayInitialize(v,7,w,A,B,true); } function Float32ArrayConstructByLength(v,y){ var D=(y===(void 0))? 0:$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var E=D*4; if(E>%_TypedArrayMaxSizeInHeap()){ var w=new d(E); %_TypedArrayInitialize(v,7,w,0,E,true); }else{ %_TypedArrayInitialize(v,7,null,0,E,true); } } function Float32ArrayConstructByArrayLike(v,F){ var y=F.length; var D=$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var G=false; var E=D*4; if(E<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(v,7,null,0,E,false); }else{ G= %TypedArrayInitializeFromArrayLike(v,7,F,D); } if(!G){ for(var H=0;Hz){ throw MakeRangeError(139); } } var B; var C; if((y===(void 0))){ if(z % 8!==0){ throw MakeRangeError(137, "byte length","Float64Array",8); } B=z-A; C=B/8; }else{ var C=y; B=C*8; } if((A+B>z) ||(C>%_MaxSmi())){ throw MakeRangeError(138); } %_TypedArrayInitialize(v,8,w,A,B,true); } function Float64ArrayConstructByLength(v,y){ var D=(y===(void 0))? 0:$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var E=D*8; if(E>%_TypedArrayMaxSizeInHeap()){ var w=new d(E); %_TypedArrayInitialize(v,8,w,0,E,true); }else{ %_TypedArrayInitialize(v,8,null,0,E,true); } } function Float64ArrayConstructByArrayLike(v,F){ var y=F.length; var D=$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var G=false; var E=D*8; if(E<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(v,8,null,0,E,false); }else{ G= %TypedArrayInitializeFromArrayLike(v,8,F,D); } if(!G){ for(var H=0;Hz){ throw MakeRangeError(139); } } var B; var C; if((y===(void 0))){ if(z % 1!==0){ throw MakeRangeError(137, "byte length","Uint8ClampedArray",1); } B=z-A; C=B/1; }else{ var C=y; B=C*1; } if((A+B>z) ||(C>%_MaxSmi())){ throw MakeRangeError(138); } %_TypedArrayInitialize(v,9,w,A,B,true); } function Uint8ClampedArrayConstructByLength(v,y){ var D=(y===(void 0))? 0:$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var E=D*1; if(E>%_TypedArrayMaxSizeInHeap()){ var w=new d(E); %_TypedArrayInitialize(v,9,w,0,E,true); }else{ %_TypedArrayInitialize(v,9,null,0,E,true); } } function Uint8ClampedArrayConstructByArrayLike(v,F){ var y=F.length; var D=$toPositiveInteger(y,138); if(D>%_MaxSmi()){ throw MakeRangeError(138); } var G=false; var E=D*1; if(E<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(v,9,null,0,E,false); }else{ G= %TypedArrayInitializeFromArrayLike(v,9,F,D); } if(!G){ for(var H=0;H0){ for(var H=0;H=ae&&ac>=ad; af--){ X[A+af]=Y[af]; ac-=ab; ad-=aa; } return af; } var af=CopyRightPart(); var ag=new c(af+1-ae); for(var H=ae;H<=af;H++){ ag[H-ae]=Y[H]; } for(H=ae;H<=af;H++){ X[A+H]=ag[H-ae]; } } function TypedArraySet(v,A){ var ah=(A===(void 0))?0:(%_IsSmi(%IS_VAR(A))?A:%NumberToInteger($toNumber(A))); if(ah<0)throw MakeTypeError(147); if(ah>%_MaxSmi()){ throw MakeRangeError(148); } switch(%TypedArraySetFastCases(this,v,ah)){ case 0: return; case 1: TypedArraySetFromOverlappingTypedArray(this,v,ah); return; case 2: TypedArraySetFromArrayLike(this,v,v.length,ah); return; case 3: var D=v.length; if((D===(void 0))){ if((typeof(v)==='number')){ throw MakeTypeError(36); } return; } if(ah+D>this.length){ throw MakeRangeError(148); } TypedArraySetFromArrayLike(this,v,D,ah); return; } } function TypedArrayGetToStringTag(){ if(!%_IsTypedArray(this))return; var ai=%_ClassOf(this); if((ai===(void 0)))return; return ai; } %SetCode(h,Uint8ArrayConstructor); %FunctionSetPrototype(h,new g()); %AddNamedProperty(h,"BYTES_PER_ELEMENT",1, 1|2|4); %AddNamedProperty(h.prototype, "constructor",a.Uint8Array,2); %AddNamedProperty(h.prototype, "BYTES_PER_ELEMENT",1, 1|2|4); b.InstallGetter(h.prototype,"buffer",Uint8Array_GetBuffer); b.InstallGetter(h.prototype,"byteOffset",Uint8Array_GetByteOffset, 2|4); b.InstallGetter(h.prototype,"byteLength",Uint8Array_GetByteLength, 2|4); b.InstallGetter(h.prototype,"length",Uint8Array_GetLength, 2|4); b.InstallGetter(h.prototype,symbolToStringTag, TypedArrayGetToStringTag); b.InstallFunctions(h.prototype,2,[ "subarray",Uint8ArraySubArray, "set",TypedArraySet ]); %SetCode(i,Int8ArrayConstructor); %FunctionSetPrototype(i,new g()); %AddNamedProperty(i,"BYTES_PER_ELEMENT",1, 1|2|4); %AddNamedProperty(i.prototype, "constructor",a.Int8Array,2); %AddNamedProperty(i.prototype, "BYTES_PER_ELEMENT",1, 1|2|4); b.InstallGetter(i.prototype,"buffer",Int8Array_GetBuffer); b.InstallGetter(i.prototype,"byteOffset",Int8Array_GetByteOffset, 2|4); b.InstallGetter(i.prototype,"byteLength",Int8Array_GetByteLength, 2|4); b.InstallGetter(i.prototype,"length",Int8Array_GetLength, 2|4); b.InstallGetter(i.prototype,symbolToStringTag, TypedArrayGetToStringTag); b.InstallFunctions(i.prototype,2,[ "subarray",Int8ArraySubArray, "set",TypedArraySet ]); %SetCode(j,Uint16ArrayConstructor); %FunctionSetPrototype(j,new g()); %AddNamedProperty(j,"BYTES_PER_ELEMENT",2, 1|2|4); %AddNamedProperty(j.prototype, "constructor",a.Uint16Array,2); %AddNamedProperty(j.prototype, "BYTES_PER_ELEMENT",2, 1|2|4); b.InstallGetter(j.prototype,"buffer",Uint16Array_GetBuffer); b.InstallGetter(j.prototype,"byteOffset",Uint16Array_GetByteOffset, 2|4); b.InstallGetter(j.prototype,"byteLength",Uint16Array_GetByteLength, 2|4); b.InstallGetter(j.prototype,"length",Uint16Array_GetLength, 2|4); b.InstallGetter(j.prototype,symbolToStringTag, TypedArrayGetToStringTag); b.InstallFunctions(j.prototype,2,[ "subarray",Uint16ArraySubArray, "set",TypedArraySet ]); %SetCode(k,Int16ArrayConstructor); %FunctionSetPrototype(k,new g()); %AddNamedProperty(k,"BYTES_PER_ELEMENT",2, 1|2|4); %AddNamedProperty(k.prototype, "constructor",a.Int16Array,2); %AddNamedProperty(k.prototype, "BYTES_PER_ELEMENT",2, 1|2|4); b.InstallGetter(k.prototype,"buffer",Int16Array_GetBuffer); b.InstallGetter(k.prototype,"byteOffset",Int16Array_GetByteOffset, 2|4); b.InstallGetter(k.prototype,"byteLength",Int16Array_GetByteLength, 2|4); b.InstallGetter(k.prototype,"length",Int16Array_GetLength, 2|4); b.InstallGetter(k.prototype,symbolToStringTag, TypedArrayGetToStringTag); b.InstallFunctions(k.prototype,2,[ "subarray",Int16ArraySubArray, "set",TypedArraySet ]); %SetCode(l,Uint32ArrayConstructor); %FunctionSetPrototype(l,new g()); %AddNamedProperty(l,"BYTES_PER_ELEMENT",4, 1|2|4); %AddNamedProperty(l.prototype, "constructor",a.Uint32Array,2); %AddNamedProperty(l.prototype, "BYTES_PER_ELEMENT",4, 1|2|4); b.InstallGetter(l.prototype,"buffer",Uint32Array_GetBuffer); b.InstallGetter(l.prototype,"byteOffset",Uint32Array_GetByteOffset, 2|4); b.InstallGetter(l.prototype,"byteLength",Uint32Array_GetByteLength, 2|4); b.InstallGetter(l.prototype,"length",Uint32Array_GetLength, 2|4); b.InstallGetter(l.prototype,symbolToStringTag, TypedArrayGetToStringTag); b.InstallFunctions(l.prototype,2,[ "subarray",Uint32ArraySubArray, "set",TypedArraySet ]); %SetCode(m,Int32ArrayConstructor); %FunctionSetPrototype(m,new g()); %AddNamedProperty(m,"BYTES_PER_ELEMENT",4, 1|2|4); %AddNamedProperty(m.prototype, "constructor",a.Int32Array,2); %AddNamedProperty(m.prototype, "BYTES_PER_ELEMENT",4, 1|2|4); b.InstallGetter(m.prototype,"buffer",Int32Array_GetBuffer); b.InstallGetter(m.prototype,"byteOffset",Int32Array_GetByteOffset, 2|4); b.InstallGetter(m.prototype,"byteLength",Int32Array_GetByteLength, 2|4); b.InstallGetter(m.prototype,"length",Int32Array_GetLength, 2|4); b.InstallGetter(m.prototype,symbolToStringTag, TypedArrayGetToStringTag); b.InstallFunctions(m.prototype,2,[ "subarray",Int32ArraySubArray, "set",TypedArraySet ]); %SetCode(n,Float32ArrayConstructor); %FunctionSetPrototype(n,new g()); %AddNamedProperty(n,"BYTES_PER_ELEMENT",4, 1|2|4); %AddNamedProperty(n.prototype, "constructor",a.Float32Array,2); %AddNamedProperty(n.prototype, "BYTES_PER_ELEMENT",4, 1|2|4); b.InstallGetter(n.prototype,"buffer",Float32Array_GetBuffer); b.InstallGetter(n.prototype,"byteOffset",Float32Array_GetByteOffset, 2|4); b.InstallGetter(n.prototype,"byteLength",Float32Array_GetByteLength, 2|4); b.InstallGetter(n.prototype,"length",Float32Array_GetLength, 2|4); b.InstallGetter(n.prototype,symbolToStringTag, TypedArrayGetToStringTag); b.InstallFunctions(n.prototype,2,[ "subarray",Float32ArraySubArray, "set",TypedArraySet ]); %SetCode(o,Float64ArrayConstructor); %FunctionSetPrototype(o,new g()); %AddNamedProperty(o,"BYTES_PER_ELEMENT",8, 1|2|4); %AddNamedProperty(o.prototype, "constructor",a.Float64Array,2); %AddNamedProperty(o.prototype, "BYTES_PER_ELEMENT",8, 1|2|4); b.InstallGetter(o.prototype,"buffer",Float64Array_GetBuffer); b.InstallGetter(o.prototype,"byteOffset",Float64Array_GetByteOffset, 2|4); b.InstallGetter(o.prototype,"byteLength",Float64Array_GetByteLength, 2|4); b.InstallGetter(o.prototype,"length",Float64Array_GetLength, 2|4); b.InstallGetter(o.prototype,symbolToStringTag, TypedArrayGetToStringTag); b.InstallFunctions(o.prototype,2,[ "subarray",Float64ArraySubArray, "set",TypedArraySet ]); %SetCode(p,Uint8ClampedArrayConstructor); %FunctionSetPrototype(p,new g()); %AddNamedProperty(p,"BYTES_PER_ELEMENT",1, 1|2|4); %AddNamedProperty(p.prototype, "constructor",a.Uint8ClampedArray,2); %AddNamedProperty(p.prototype, "BYTES_PER_ELEMENT",1, 1|2|4); b.InstallGetter(p.prototype,"buffer",Uint8ClampedArray_GetBuffer); b.InstallGetter(p.prototype,"byteOffset",Uint8ClampedArray_GetByteOffset, 2|4); b.InstallGetter(p.prototype,"byteLength",Uint8ClampedArray_GetByteLength, 2|4); b.InstallGetter(p.prototype,"length",Uint8ClampedArray_GetLength, 2|4); b.InstallGetter(p.prototype,symbolToStringTag, TypedArrayGetToStringTag); b.InstallFunctions(p.prototype,2,[ "subarray",Uint8ClampedArraySubArray, "set",TypedArraySet ]); function DataViewConstructor(w,x,E){ if(%_IsConstructCall()){ if(!(%_ClassOf(w)==='ArrayBuffer'))throw MakeTypeError(22); if(!(x===(void 0))){ x=$toPositiveInteger(x,131); } if(!(E===(void 0))){ E=(%_IsSmi(%IS_VAR(E))?E:%NumberToInteger($toNumber(E))); } var z=%_ArrayBufferGetByteLength(w); var A=(x===(void 0))?0:x; if(A>z)throw MakeRangeError(131); var y=(E===(void 0)) ?z-A :E; if(y<0||A+y>z){ throw new MakeRangeError(130); } %_DataViewInitialize(this,w,A,y); }else{ throw MakeTypeError(20,"DataView"); } } function DataViewGetBufferJS(){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33,'DataView.buffer',this); } return %DataViewGetBuffer(this); } function DataViewGetByteOffset(){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.byteOffset',this); } return %_ArrayBufferViewGetByteOffset(this); } function DataViewGetByteLength(){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.byteLength',this); } return %_ArrayBufferViewGetByteLength(this); } function DataViewGetInt8JS(A,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.getInt8',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(36); A=$toPositiveInteger(A,129); return %DataViewGetInt8(this,A,!!aj); } function DataViewSetInt8JS(A,N,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.setInt8',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(36); A=$toPositiveInteger(A,129); %DataViewSetInt8(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj); } function DataViewGetUint8JS(A,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.getUint8',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(36); A=$toPositiveInteger(A,129); return %DataViewGetUint8(this,A,!!aj); } function DataViewSetUint8JS(A,N,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.setUint8',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(36); A=$toPositiveInteger(A,129); %DataViewSetUint8(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj); } function DataViewGetInt16JS(A,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.getInt16',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(36); A=$toPositiveInteger(A,129); return %DataViewGetInt16(this,A,!!aj); } function DataViewSetInt16JS(A,N,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.setInt16',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(36); A=$toPositiveInteger(A,129); %DataViewSetInt16(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj); } function DataViewGetUint16JS(A,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.getUint16',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(36); A=$toPositiveInteger(A,129); return %DataViewGetUint16(this,A,!!aj); } function DataViewSetUint16JS(A,N,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.setUint16',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(36); A=$toPositiveInteger(A,129); %DataViewSetUint16(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj); } function DataViewGetInt32JS(A,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.getInt32',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(36); A=$toPositiveInteger(A,129); return %DataViewGetInt32(this,A,!!aj); } function DataViewSetInt32JS(A,N,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.setInt32',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(36); A=$toPositiveInteger(A,129); %DataViewSetInt32(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj); } function DataViewGetUint32JS(A,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.getUint32',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(36); A=$toPositiveInteger(A,129); return %DataViewGetUint32(this,A,!!aj); } function DataViewSetUint32JS(A,N,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.setUint32',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(36); A=$toPositiveInteger(A,129); %DataViewSetUint32(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj); } function DataViewGetFloat32JS(A,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.getFloat32',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(36); A=$toPositiveInteger(A,129); return %DataViewGetFloat32(this,A,!!aj); } function DataViewSetFloat32JS(A,N,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.setFloat32',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(36); A=$toPositiveInteger(A,129); %DataViewSetFloat32(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj); } function DataViewGetFloat64JS(A,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.getFloat64',this); } if(%_ArgumentsLength()<1)throw MakeTypeError(36); A=$toPositiveInteger(A,129); return %DataViewGetFloat64(this,A,!!aj); } function DataViewSetFloat64JS(A,N,aj){ if(!(%_ClassOf(this)==='DataView')){ throw MakeTypeError(33, 'DataView.setFloat64',this); } if(%_ArgumentsLength()<2)throw MakeTypeError(36); A=$toPositiveInteger(A,129); %DataViewSetFloat64(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj); } %SetCode(e,DataViewConstructor); %FunctionSetPrototype(e,new g); %AddNamedProperty(e.prototype,"constructor",e, 2); %AddNamedProperty(e.prototype,symbolToStringTag,"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; function IteratorPrototypeIterator(){ return this; } b.SetFunctionName(IteratorPrototypeIterator,symbolIterator); %AddNamedProperty($iteratorPrototype,symbolIterator, IteratorPrototypeIterator,2); }) $generatorá (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Function; var d; b.Import(function(e){ d=e.NewFunctionString; }); function GeneratorObjectNext(g){ if(!(%_ClassOf(this)==='Generator')){ throw MakeTypeError(33, '[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(31); } } function GeneratorObjectThrow(i){ if(!(%_ClassOf(this)==='Generator')){ throw MakeTypeError(33, '[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(31); } } 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, symbolToStringTag,"Generator",2|1); %InternalSetPrototype(GeneratorFunctionPrototype,c.prototype); %AddNamedProperty(GeneratorFunctionPrototype, symbolToStringTag,"GeneratorFunction",2|1); %AddNamedProperty(GeneratorFunctionPrototype,"constructor", GeneratorFunction,2|1); %InternalSetPrototype(GeneratorFunction,c); %SetCode(GeneratorFunction,GeneratorFunctionConstructor); }) 8object-observei® var $observeNotifyChange; var $observeEnqueueSpliceRecord; var $observeBeginPerformSplice; var $observeEndPerformSplice; var $observeNativeObjectObserve; var $observeNativeObjectGetNotifier; var $observeNativeObjectNotifierPerformChange; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Array; var d=a.Object; var e=b.InternalArray; var g; var h; b.Import(function(i){ g=i.ObjectFreeze; h=i.ObjectIsFrozen; }); var j; var k={}; function GetObservationStateJS(){ if((j===(void 0))){ j=%GetObservationState(); } if((j.callbackInfoMap===(void 0))){ j.callbackInfoMap=%ObservationWeakMapCreate(); j.objectInfoMap=%ObservationWeakMapCreate(); j.notifierObjectInfoMap=%ObservationWeakMapCreate(); j.pendingObservers=null; j.nextCallbackPriority=0; j.lastMicrotaskId=0; } return j; } function GetPendingObservers(){ return GetObservationStateJS().pendingObservers; } function SetPendingObservers(l){ GetObservationStateJS().pendingObservers=l; } function GetNextCallbackPriority(){ return GetObservationStateJS().nextCallbackPriority++; } function nullProtoObject(){ return{__proto__:null}; } function TypeMapCreate(){ return nullProtoObject(); } function TypeMapAddType(m,n,o){ m[n]=o?1:(m[n]||0)+1; } function TypeMapRemoveType(m,n){ m[n]--; } function TypeMapCreateFromList(p,q){ var m=TypeMapCreate(); for(var r=0;r0?A.performing:null; } function ConvertAcceptListToTypeMap(G){ if((G===(void 0))) return G; if(!(%_IsSpecObject(G)))throw MakeTypeError(67); var H=$toInteger(G.length); if(H<0)H=0; return TypeMapCreateFromList(G,H); } function CallbackInfoGet(x){ return %WeakCollectionGet(GetObservationStateJS().callbackInfoMap,x, $getHash(x)); } function CallbackInfoSet(x,E){ %WeakCollectionSet(GetObservationStateJS().callbackInfoMap, x,E,$getHash(x)); } function CallbackInfoGetOrCreate(x){ var E=CallbackInfoGet(x); if(!(E===(void 0))) return E; var F=GetNextCallbackPriority(); CallbackInfoSet(x,F); return F; } function CallbackInfoGetPriority(E){ if((typeof(E)==='number')) return E; else return E.priority; } function CallbackInfoNormalize(x){ var E=CallbackInfoGet(x); if((typeof(E)==='number')){ var F=E; E=new e; E.priority=F; CallbackInfoSet(x,E); } return E; } function ObjectObserve(B,x,y){ if(!(%_IsSpecObject(B))) throw MakeTypeError(69,"observe","observe"); if(%IsJSGlobalProxy(B)) throw MakeTypeError(66,"observe"); if(!(%_ClassOf(x)==='Function')) throw MakeTypeError(68,"observe"); if(h(x)) throw MakeTypeError(65); var I=%GetObjectContextObjectObserve(B); return I(B,x,y); } function NativeObjectObserve(B,x,y){ var A=ObjectInfoGetOrCreate(B); var p=ConvertAcceptListToTypeMap(y); ObjectInfoAddObserver(A,x,p); return B; } function ObjectUnobserve(B,x){ if(!(%_IsSpecObject(B))) throw MakeTypeError(69,"unobserve","unobserve"); if(%IsJSGlobalProxy(B)) throw MakeTypeError(66,"unobserve"); if(!(%_ClassOf(x)==='Function')) throw MakeTypeError(68,"unobserve"); var A=ObjectInfoGet(B); if((A===(void 0))) return B; ObjectInfoRemoveObserver(A,x); return B; } function ArrayObserve(B,x){ return ObjectObserve(B,x,['add', 'update', 'delete', 'splice']); } function ArrayUnobserve(B,x){ return ObjectUnobserve(B,x); } function ObserverEnqueueIfActive(z,A,J){ if(!ObserverIsActive(z,A)|| !TypeMapHasType(ObserverGetAcceptTypes(z),J.type)){ return; } var x=ObserverGetCallback(z); if(!%ObserverObjectAndRecordHaveSameOrigin(x,J.object, J)){ return; } var E=CallbackInfoNormalize(x); if((GetPendingObservers()===null)){ SetPendingObservers(nullProtoObject()); if((%_DebugIsActive()!=0)){ var K=++GetObservationStateJS().lastMicrotaskId; var L="Object.observe"; %EnqueueMicrotask(function(){ %DebugAsyncTaskEvent({type:"willHandle",id:K,name:L}); ObserveMicrotaskRunner(); %DebugAsyncTaskEvent({type:"didHandle",id:K,name:L}); }); %DebugAsyncTaskEvent({type:"enqueue",id:K,name:L}); }else{ %EnqueueMicrotask(ObserveMicrotaskRunner); } } GetPendingObservers()[E.priority]=x; E.push(J); } function ObjectInfoEnqueueExternalChangeRecord(A,J,n){ if(!ObjectInfoHasActiveObservers(A)) return; var M=!(n===(void 0)); var N=M? {object:A.object,type:n}: {object:A.object}; for(var O in J){ if(O==='object'||(M&&O==='type'))continue; %DefineDataPropertyUnchecked( N,O,J[O],1+4); } g(N); ObjectInfoEnqueueInternalChangeRecord(A,N); } function ObjectInfoEnqueueInternalChangeRecord(A,J){ if((typeof(J.name)==='symbol'))return; if(ChangeObserversIsOptimized(A.changeObservers)){ var z=A.changeObservers; ObserverEnqueueIfActive(z,A,J); return; } for(var F in A.changeObservers){ var z=A.changeObservers[F]; if((z===null)) continue; ObserverEnqueueIfActive(z,A,J); } } function BeginPerformSplice(P){ var A=ObjectInfoGet(P); if(!(A===(void 0))) ObjectInfoAddPerformingType(A,'splice'); } function EndPerformSplice(P){ var A=ObjectInfoGet(P); if(!(A===(void 0))) ObjectInfoRemovePerformingType(A,'splice'); } function EnqueueSpliceRecord(P,Q,R,S){ var A=ObjectInfoGet(P); if(!ObjectInfoHasActiveObservers(A)) return; var J={ type:'splice', object:P, index:Q, removed:R, addedCount:S }; g(J); g(J.removed); ObjectInfoEnqueueInternalChangeRecord(A,J); } function NotifyChange(n,B,L,T){ var A=ObjectInfoGet(B); if(!ObjectInfoHasActiveObservers(A)) return; var J; if(arguments.length==2){ J={type:n,object:B}; }else if(arguments.length==3){ J={type:n,object:B,name:L}; }else{ J={ type:n, object:B, name:L, oldValue:T }; } g(J); ObjectInfoEnqueueInternalChangeRecord(A,J); } function ObjectNotifierNotify(J){ if(!(%_IsSpecObject(this))) throw MakeTypeError(13,"notify"); var A=ObjectInfoGetFromNotifier(this); if((A===(void 0))) throw MakeTypeError(70); if(!(typeof(J.type)==='string')) throw MakeTypeError(73); ObjectInfoEnqueueExternalChangeRecord(A,J); } function ObjectNotifierPerformChange(U,V){ if(!(%_IsSpecObject(this))) throw MakeTypeError(13,"performChange"); var A=ObjectInfoGetFromNotifier(this); if((A===(void 0))) throw MakeTypeError(70); if(!(typeof(U)==='string')) throw MakeTypeError(72); if(!(%_ClassOf(V)==='Function')) throw MakeTypeError(71); var W=%GetObjectContextNotifierPerformChange(A); W(A,U,V); } function NativeObjectNotifierPerformChange(A,U,V){ ObjectInfoAddPerformingType(A,U); var J; try{ J=%_CallFunction((void 0),V); }finally{ ObjectInfoRemovePerformingType(A,U); } if((%_IsSpecObject(J))) ObjectInfoEnqueueExternalChangeRecord(A,J,U); } function ObjectGetNotifier(B){ if(!(%_IsSpecObject(B))) throw MakeTypeError(69,"getNotifier","getNotifier"); if(%IsJSGlobalProxy(B)) throw MakeTypeError(66,"getNotifier"); if(h(B))return null; if(!%ObjectWasCreatedInCurrentOrigin(B))return null; var X=%GetObjectContextObjectGetNotifier(B); return X(B); } function NativeObjectGetNotifier(B){ var A=ObjectInfoGetOrCreate(B); return ObjectInfoGetNotifier(A); } function CallbackDeliverPending(x){ var E=CallbackInfoGet(x); if((E===(void 0))||(typeof(E)==='number')) return false; var F=E.priority; CallbackInfoSet(x,F); var l=GetPendingObservers(); if(!(l===null)) delete l[F]; var Y=[]; %MoveArrayContents(E,Y); %DeliverObservationChangeRecords(x,Y); return true; } function ObjectDeliverChangeRecords(x){ if(!(%_ClassOf(x)==='Function')) throw MakeTypeError(68,"deliverChangeRecords"); while(CallbackDeliverPending(x)){} } function ObserveMicrotaskRunner(){ var l=GetPendingObservers(); if(!(l===null)){ SetPendingObservers(null); for(var r in l){ CallbackDeliverPending(l[r]); } } } b.InstallFunctions(d,2,[ "deliverChangeRecords",ObjectDeliverChangeRecords, "getNotifier",ObjectGetNotifier, "observe",ObjectObserve, "unobserve",ObjectUnobserve ]); b.InstallFunctions(c,2,[ "observe",ArrayObserve, "unobserve",ArrayUnobserve ]); b.InstallFunctions(k,2,[ "notify",ObjectNotifierNotify, "performChange",ObjectNotifierPerformChange ]); $observeNotifyChange=NotifyChange; $observeEnqueueSpliceRecord=EnqueueSpliceRecord; $observeBeginPerformSplice=BeginPerformSplice; $observeEndPerformSplice=EndPerformSplice; $observeNativeObjectObserve=NativeObjectObserve; $observeNativeObjectGetNotifier=NativeObjectGetNotifier; $observeNativeObjectNotifierPerformChange=NativeObjectNotifierPerformChange; }) (collection• var $getHash; var $getExistingHash; var $mapSet; var $mapHas; var $mapDelete; var $setAdd; var $setHas; var $setDelete; var $mapFromArray; var $setFromArray; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Map; var d=a.Object; var e=a.Set; var g; b.Import(function(h){ g=h.IntRandom; }); var i; b.Import(function(h){ i=h.NumberIsNaN; }); function HashToEntry(j,k,l){ var m=(k&((l)-1)); return((%_FixedArrayGet(j,(3+(m))|0))); } %SetForceInlineFlag(HashToEntry); function SetFindEntry(j,l,n,k){ var o=HashToEntry(j,k,l); if(o===-1)return o; var p=((%_FixedArrayGet(j,((3+(l)+((o)<<1)))|0))); if(n===p)return o; var q=i(n); while(true){ if(q&&i(p)){ return o; } o=((%_FixedArrayGet(j,((3+(l)+((o)<<1))+1)|0))); if(o===-1)return o; p=((%_FixedArrayGet(j,((3+(l)+((o)<<1)))|0))); if(n===p)return o; } return-1; } %SetForceInlineFlag(SetFindEntry); function MapFindEntry(j,l,n,k){ var o=HashToEntry(j,k,l); if(o===-1)return o; var p=((%_FixedArrayGet(j,((3+(l)+((o)*3)))|0))); if(n===p)return o; var q=i(n); while(true){ if(q&&i(p)){ return o; } o=((%_FixedArrayGet(j,((3+(l)+((o)*3))+2)|0))); if(o===-1)return o; p=((%_FixedArrayGet(j,((3+(l)+((o)*3)))|0))); if(n===p)return o; } return-1; } %SetForceInlineFlag(MapFindEntry); function ComputeIntegerHash(n,r){ var k=n; k=k^r; k=~k+(k<<15); k=k^(k>>>12); k=k+(k<<2); k=k^(k>>>4); k=(k*2057)|0; k=k^(k>>>16); return k&0x3fffffff; } %SetForceInlineFlag(ComputeIntegerHash); var t=(%CreateGlobalPrivateSymbol("hash_code_symbol")); function GetExistingHash(n){ if(%_IsSmi(n)){ return ComputeIntegerHash(n,0); } if((typeof(n)==='string')){ var u=%_StringGetRawHashField(n); if((u&1)===0){ return u>>>2; } }else if((%_IsSpecObject(n))&&!%_IsJSProxy(n)&&!(%_ClassOf(n)==='global')){ var k=(n[t]); return k; } return %GenericHash(n); } %SetForceInlineFlag(GetExistingHash); function GetHash(n){ var k=GetExistingHash(n); if((k===(void 0))){ k=g()|0; if(k===0)k=1; (n[t]=k); } return k; } %SetForceInlineFlag(GetHash); function SetConstructor(v){ if(!%_IsConstructCall()){ throw MakeTypeError(20,"Set"); } %_SetInitialize(this); if(!(v==null)){ var w=this.add; if(!(%_ClassOf(w)==='Function')){ throw MakeTypeError(77,'add',this); } for(var x of v){ %_CallFunction(this,x,w); } } } function SetAdd(n){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(33,'Set.prototype.add',this); } if(n===0){ n=0; } var j=%_JSCollectionGetTable(this); var l=((%_FixedArrayGet(j,(0)|0))); var k=GetHash(n); if(SetFindEntry(j,l,n,k)!==-1)return this; var y=((%_FixedArrayGet(j,(1)|0))); var z=((%_FixedArrayGet(j,(2)|0))); var A=l<<1; if((y+z)>=A){ %SetGrow(this); j=%_JSCollectionGetTable(this); l=((%_FixedArrayGet(j,(0)|0))); y=((%_FixedArrayGet(j,(1)|0))); z=((%_FixedArrayGet(j,(2)|0))); } var o=y+z; var B=(3+(l)+((o)<<1)); var m=(k&((l)-1)); var C=((%_FixedArrayGet(j,(3+(m))|0))); ((%_FixedArraySet(j,(3+(m))|0,o))); (((%_FixedArraySet(j,(1)|0,(y+1)|0)))); (%_FixedArraySet(j,(B)|0,n)); ((%_FixedArraySet(j,(B+1)|0,(C)|0))); return this; } function SetHas(n){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(33,'Set.prototype.has',this); } var j=%_JSCollectionGetTable(this); var l=((%_FixedArrayGet(j,(0)|0))); var k=GetExistingHash(n); if((k===(void 0)))return false; return SetFindEntry(j,l,n,k)!==-1; } function SetDelete(n){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(33, 'Set.prototype.delete',this); } var j=%_JSCollectionGetTable(this); var l=((%_FixedArrayGet(j,(0)|0))); var k=GetExistingHash(n); if((k===(void 0)))return false; var o=SetFindEntry(j,l,n,k); if(o===-1)return false; var y=((%_FixedArrayGet(j,(1)|0)))-1; var z=((%_FixedArrayGet(j,(2)|0)))+1; var B=(3+(l)+((o)<<1)); (%_FixedArraySet(j,(B)|0,%_TheHole())); (((%_FixedArraySet(j,(1)|0,(y)|0)))); (((%_FixedArraySet(j,(2)|0,(z)|0)))); if(y<(l>>>1))%SetShrink(this); return true; } function SetGetSize(){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(33, 'Set.prototype.size',this); } var j=%_JSCollectionGetTable(this); return((%_FixedArrayGet(j,(1)|0))); } function SetClearJS(){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(33, 'Set.prototype.clear',this); } %_SetClear(this); } function SetForEach(D,E){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError(33, 'Set.prototype.forEach',this); } if(!(%_ClassOf(D)==='Function'))throw MakeTypeError(12,D); var F=false; if((E===null)){ if(%IsSloppyModeFunction(D))E=(void 0); }else if(!(E===(void 0))){ F=(!(%_IsSpecObject(E))&&%IsSloppyModeFunction(D)); } var G=new SetIterator(this,2); var n; var H=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(D); var I=[(void 0)]; while(%SetIteratorNext(G,I)){ if(H)%DebugPrepareStepInIfStepping(D); n=I[0]; var J=F?$toObject(E):E; %_CallFunction(J,n,n,this,D); } } %SetCode(e,SetConstructor); %FunctionSetLength(e,0); %FunctionSetPrototype(e,new d()); %AddNamedProperty(e.prototype,"constructor",e,2); %AddNamedProperty(e.prototype,symbolToStringTag,"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(v){ if(!%_IsConstructCall()){ throw MakeTypeError(20,"Map"); } %_MapInitialize(this); if(!(v==null)){ var w=this.set; if(!(%_ClassOf(w)==='Function')){ throw MakeTypeError(77,'set',this); } for(var K of v){ if(!(%_IsSpecObject(K))){ throw MakeTypeError(39,K); } %_CallFunction(this,K[0],K[1],w); } } } function MapGet(n){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(33, 'Map.prototype.get',this); } var j=%_JSCollectionGetTable(this); var l=((%_FixedArrayGet(j,(0)|0))); var k=GetExistingHash(n); if((k===(void 0)))return(void 0); var o=MapFindEntry(j,l,n,k); if(o===-1)return(void 0); return((%_FixedArrayGet(j,((3+(l)+((o)*3))+1)|0))); } function MapSet(n,x){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(33, 'Map.prototype.set',this); } if(n===0){ n=0; } var j=%_JSCollectionGetTable(this); var l=((%_FixedArrayGet(j,(0)|0))); var k=GetHash(n); var o=MapFindEntry(j,l,n,k); if(o!==-1){ var L=(3+(l)+((o)*3)); (%_FixedArraySet(j,(L+1)|0,x)); return this; } var y=((%_FixedArrayGet(j,(1)|0))); var z=((%_FixedArrayGet(j,(2)|0))); var A=l<<1; if((y+z)>=A){ %MapGrow(this); j=%_JSCollectionGetTable(this); l=((%_FixedArrayGet(j,(0)|0))); y=((%_FixedArrayGet(j,(1)|0))); z=((%_FixedArrayGet(j,(2)|0))); } o=y+z; var B=(3+(l)+((o)*3)); var m=(k&((l)-1)); var C=((%_FixedArrayGet(j,(3+(m))|0))); ((%_FixedArraySet(j,(3+(m))|0,o))); (((%_FixedArraySet(j,(1)|0,(y+1)|0)))); (%_FixedArraySet(j,(B)|0,n)); (%_FixedArraySet(j,(B+1)|0,x)); (%_FixedArraySet(j,(B+2)|0,C)); return this; } function MapHas(n){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(33, 'Map.prototype.has',this); } var j=%_JSCollectionGetTable(this); var l=((%_FixedArrayGet(j,(0)|0))); var k=GetHash(n); return MapFindEntry(j,l,n,k)!==-1; } function MapDelete(n){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(33, 'Map.prototype.delete',this); } var j=%_JSCollectionGetTable(this); var l=((%_FixedArrayGet(j,(0)|0))); var k=GetHash(n); var o=MapFindEntry(j,l,n,k); if(o===-1)return false; var y=((%_FixedArrayGet(j,(1)|0)))-1; var z=((%_FixedArrayGet(j,(2)|0)))+1; var B=(3+(l)+((o)*3)); (%_FixedArraySet(j,(B)|0,%_TheHole())); (%_FixedArraySet(j,(B+1)|0,%_TheHole())); (((%_FixedArraySet(j,(1)|0,(y)|0)))); (((%_FixedArraySet(j,(2)|0,(z)|0)))); if(y<(l>>>1))%MapShrink(this); return true; } function MapGetSize(){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(33, 'Map.prototype.size',this); } var j=%_JSCollectionGetTable(this); return((%_FixedArrayGet(j,(1)|0))); } function MapClearJS(){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(33, 'Map.prototype.clear',this); } %_MapClear(this); } function MapForEach(D,E){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError(33, 'Map.prototype.forEach',this); } if(!(%_ClassOf(D)==='Function'))throw MakeTypeError(12,D); var F=false; if((E===null)){ if(%IsSloppyModeFunction(D))E=(void 0); }else if(!(E===(void 0))){ F=(!(%_IsSpecObject(E))&&%IsSloppyModeFunction(D)); } var G=new MapIterator(this,3); var H=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(D); var I=[(void 0),(void 0)]; while(%MapIteratorNext(G,I)){ if(H)%DebugPrepareStepInIfStepping(D); var J=F?$toObject(E):E; %_CallFunction(J,I[1],I[0],this,D); } } %SetCode(c,MapConstructor); %FunctionSetLength(c,0); %FunctionSetPrototype(c,new d()); %AddNamedProperty(c.prototype,"constructor",c,2); %AddNamedProperty( c.prototype,symbolToStringTag,"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; $mapGet=MapGet; $mapSet=MapSet; $mapHas=MapHas; $mapDelete=MapDelete; $setAdd=SetAdd; $setHas=SetHas; $setDelete=SetDelete; $mapFromArray=function(M){ var N=new c; var O=M.length; for(var P=0;P0?"Promise.resolve":"Promise.reject"; %DebugAsyncTaskEvent({type:"enqueue",id:C,name:D}); } } function PromiseIdResolveHandler(o){return o} function PromiseIdRejectHandler(p){throw p} function PromiseNopResolver(){} function IsPromise(o){ return(%_IsSpecObject(o))&&(!(o[d]===(void 0))); } function PromiseCreate(){ return new l(PromiseNopResolver) } function PromiseResolve(n,o){ PromiseDone(n,+1,o,g) } function PromiseReject(n,p){ if((n[d])==0){ var G=(%_DebugIsActive()!=0); if(G||!(!(n[j]===(void 0)))){ %PromiseRejectEvent(n,p,G); } } PromiseDone(n,-1,p,h) } function PromiseDeferred(){ if(this===l){ var n=PromiseInit(new l(i)); return{ promise:n, resolve:function(o){PromiseResolve(n,o)}, reject:function(p){PromiseReject(n,p)} }; }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(o){ if(this===l){ return PromiseCreateAndSet(+1,o); }else{ return new this(function(H,I){H(o)}); } } function PromiseRejected(p){ var n; if(this===l){ n=PromiseCreateAndSet(-1,p); %PromiseRejectEvent(n,p,false); }else{ n=new this(function(H,I){I(p)}); } return n; } function PromiseChain(t,u){ t=(t===(void 0))?PromiseIdResolveHandler:t; u=(u===(void 0))?PromiseIdRejectHandler:u; var z=%_CallFunction(this.constructor,PromiseDeferred); switch((this[d])){ case(void 0): throw MakeTypeError(51,this); case 0: (this[g]).push(t,z); (this[h]).push(u,z); break; case+1: PromiseEnqueue((this[e]), [t,z], +1); break; case-1: if(!(!(this[j]===(void 0)))){ %PromiseRevokeReject(this); } PromiseEnqueue((this[e]), [u,z], -1); break; } (this[j]=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=(%_ClassOf(t)==='Function')?t :PromiseIdResolveHandler; u=(%_ClassOf(u)==='Function')?u :PromiseIdRejectHandler; var J=this; var x=this.constructor; return %_CallFunction( this, function(o){ o=PromiseCoerce(x,o); if(o===J){ if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(u)))%DebugPrepareStepInIfStepping(u); return u(MakeTypeError(75,o)); }else if(IsPromise(o)){ return o.then(t,u); }else{ if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(t)))%DebugPrepareStepInIfStepping(t); return t(o); } }, u, PromiseChain ); } function PromiseCast(o){ return IsPromise(o)?o:new this(function(H){H(o)}); } function PromiseAll(K){ var z=%_CallFunction(this,PromiseDeferred); var L=[]; try{ var M=0; var F=0; for(var r of K){ this.resolve(r).then( (function(F){ return function(o){ L[F]=o; if(--M===0)z.resolve(L); } })(F), function(p){z.reject(p);}); ++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 r of K){ this.resolve(r).then( function(o){z.resolve(o)}, function(p){z.reject(p)}); } }catch(e){ z.reject(e) } return z.promise; } function PromiseHasUserDefinedRejectHandlerRecursive(n){ var N=(n[h]); if((N===(void 0)))return false; for(var F=0;F128){ v=%_SubString(v,0,111)+"......"+ %_SubString(v,v.length-2,v.length); } return v; } if((typeof(u)==='symbol'))return %_CallFunction(u,$symbolToString); if((%_IsObject(u)) &&%GetDataProperty(u,"toString")===h){ var w=%GetDataProperty(u,"constructor"); if(typeof w=="function"){ var x=w.name; if((typeof(x)==='string')&&x!==""){ return"#<"+x+">"; } } } if(CanBeSafelyTreatedAsAnErrorObject(u)){ return %_CallFunction(u,ErrorToString); } return %_CallFunction(u,NoSideEffectsObjectToString); } function CanBeSafelyTreatedAsAnErrorObject(u){ switch(%_ClassOf(u)){ case'Error': case'EvalError': case'RangeError': case'ReferenceError': case'SyntaxError': case'TypeError': case'URIError': return true; } var y=%GetDataProperty(u,"toString"); return u instanceof m&&y===ErrorToString; } function ToStringCheckErrorObject(u){ if(CanBeSafelyTreatedAsAnErrorObject(u)){ return %_CallFunction(u,ErrorToString); }else{ return $toString(u); } } function ToDetailString(u){ if(u!=null&&(%_IsObject(u))&&u.toString===h){ var w=u.constructor; if(typeof w=="function"){ var x=w.name; if((typeof(x)==='string')&&x!==""){ return"#<"+x+">"; } } } return ToStringCheckErrorObject(u); } function MakeGenericError(w,z,A,B,C){ if((A===(void 0))&&(typeof(z)==='string'))A=[]; return new w(FormatMessage(z,A,B,C)); } %FunctionSetInstanceClassName(Script,'Script'); %AddNamedProperty(Script.prototype,'constructor',Script, 2|4|1); %SetCode(Script,function(D){ throw MakeError(5); }); function FormatMessage(z,A,B,C){ var A=NoSideEffectToString(A); var B=NoSideEffectToString(B); var C=NoSideEffectToString(C); try{ return %FormatMessageString(z,A,B,C); }catch(e){ return""; } } function GetLineNumber(E){ var F=%MessageGetStartPosition(E); if(F==-1)return 0; var G=%MessageGetScript(E); var H=G.locationFromPosition(F,true); if(H==null)return 0; return H.line+1; } function GetSourceLine(E){ var G=%MessageGetScript(E); var F=%MessageGetStartPosition(E); var H=G.locationFromPosition(F,true); if(H==null)return""; return H.sourceText(); } function ScriptLineFromPosition(I){ var J=0; var K=this.lineCount()-1; var L=this.line_ends; if(I>L[K]){ return-1; } if(I<=L[0]){ return 0; } while(K>=1){ var M=(J+K)>>1; if(I>L[M]){ J=M+1; }else if(I<=L[M-1]){ K=M-1; }else{ return M; } } return-1; } function ScriptLocationFromPosition(I, include_resource_offset){ var N=this.lineFromPosition(I); if(N==-1)return null; var L=this.line_ends; var O=N==0?0:L[N-1]+1; var P=L[N]; if(P>0&&%_CallFunction(this.source,P-1,i)=='\r'){ P--; } var Q=I-O; if(include_resource_offset){ N+=this.line_offset; if(N==this.line_offset){ Q+=this.column_offset; } } return new SourceLocation(this,I,N,Q,O,P); } function ScriptLocationFromLine(R,S,T){ var N=0; if(!(R===(void 0))){ N=R-this.line_offset; } var Q=S||0; if(N==0){ Q-=this.column_offset; } var U=T||0; if(N<0||Q<0||U<0)return null; if(N==0){ return this.locationFromPosition(U+Q,false); }else{ var V=this.lineFromPosition(U); if(V==-1||V+N>=this.lineCount()){ return null; } return this.locationFromPosition( this.line_ends[V+N-1]+1+Q); } } function ScriptSourceSlice(W,X){ var Y=(W===(void 0))?this.line_offset :W; var Z=(X===(void 0))?this.line_offset+this.lineCount() :X; Y-=this.line_offset; Z-=this.line_offset; if(Y<0)Y=0; if(Z>this.lineCount())Z=this.lineCount(); if(Y>=this.lineCount()|| Z<0|| Y>Z){ return null; } var L=this.line_ends; var aa=Y==0?0:L[Y-1]+1; var ab=Z==0?0:L[Z-1]+1; return new SourceSlice(this, Y+this.line_offset, Z+this.line_offset, aa,ab); } function ScriptSourceLine(R){ var N=0; if(!(R===(void 0))){ N=R-this.line_offset; } if(N<0||this.lineCount()<=N){ return null; } var L=this.line_ends; var O=N==0?0:L[N-1]+1; var P=L[N]; return %_CallFunction(this.source,O,P,k); } function ScriptLineCount(){ return this.line_ends.length; } function ScriptLineEnd(ac){ return this.line_ends[ac]; } 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(G,I,N,Q,O,P){ this.script=G; this.position=I; this.line=N; this.column=Q; this.start=O; this.end=P; } function SourceLocationSourceText(){ return %_CallFunction(this.script.source, this.start, this.end, k); } b.SetUpLockedPrototype(SourceLocation, ["script","position","line","column","start","end"], ["sourceText",SourceLocationSourceText] ); function SourceSlice(G,Y,Z,aa,ab){ this.script=G; this.from_line=Y; this.to_line=Z; this.from_position=aa; this.to_position=ab; } function SourceSliceSourceText(){ return %_CallFunction(this.script.source, this.from_position, this.to_position, k); } b.SetUpLockedPrototype(SourceSlice, ["script","from_line","to_line","from_position","to_position"], ["sourceText",SourceSliceSourceText] ); function GetPositionInLine(E){ var G=%MessageGetScript(E); var F=%MessageGetStartPosition(E); var H=G.locationFromPosition(F,false); if(H==null)return-1; return F-H.start; } function GetStackTraceLine(ad,ae,af,ag){ return new CallSite(ad,ae,af,false).toString(); } var ah=(%CreatePrivateSymbol("CallSite#receiver")); var ai=(%CreatePrivateSymbol("CallSite#function")); var aj=(%CreatePrivateSymbol("CallSite#position")); var ak=(%CreatePrivateSymbol("CallSite#strict_mode")); function CallSite(al,ae,af,am){ (this[ah]=al); (this[ai]=ae); (this[aj]=af); (this[ak]=am); } function CallSiteGetThis(){ return(this[ak]) ?(void 0):(this[ah]); } function CallSiteGetFunction(){ return(this[ak]) ?(void 0):(this[ai]); } function CallSiteGetPosition(){ return(this[aj]); } function CallSiteGetTypeName(){ return GetTypeName((this[ah]),false); } function CallSiteIsToplevel(){ var al=(this[ah]); var ae=(this[ai]); var af=(this[aj]); return %CallSiteIsToplevelRT(al,ae,af); } function CallSiteIsEval(){ var al=(this[ah]); var ae=(this[ai]); var af=(this[aj]); return %CallSiteIsEvalRT(al,ae,af); } function CallSiteGetEvalOrigin(){ var G=%FunctionGetScript((this[ai])); return FormatEvalOrigin(G); } function CallSiteGetScriptNameOrSourceURL(){ var al=(this[ah]); var ae=(this[ai]); var af=(this[aj]); return %CallSiteGetScriptNameOrSourceUrlRT(al,ae,af); } function CallSiteGetFunctionName(){ var al=(this[ah]); var ae=(this[ai]); var af=(this[aj]); return %CallSiteGetFunctionNameRT(al,ae,af); } function CallSiteGetMethodName(){ var al=(this[ah]); var ae=(this[ai]); var af=(this[aj]); return %CallSiteGetMethodNameRT(al,ae,af); } function CallSiteGetFileName(){ var al=(this[ah]); var ae=(this[ai]); var af=(this[aj]); return %CallSiteGetFileNameRT(al,ae,af); } function CallSiteGetLineNumber(){ var al=(this[ah]); var ae=(this[ai]); var af=(this[aj]); return %CallSiteGetLineNumberRT(al,ae,af); } function CallSiteGetColumnNumber(){ var al=(this[ah]); var ae=(this[ai]); var af=(this[aj]); return %CallSiteGetColumnNumberRT(al,ae,af); } function CallSiteIsNative(){ var al=(this[ah]); var ae=(this[ai]); var af=(this[aj]); return %CallSiteIsNativeRT(al,ae,af); } function CallSiteIsConstructor(){ var al=(this[ah]); var ae=(this[ai]); var af=(this[aj]); return %CallSiteIsConstructorRT(al,ae,af); } function CallSiteToString(){ var an; var ao=""; if(this.isNative()){ ao="native"; }else{ an=this.getScriptNameOrSourceURL(); if(!an&&this.isEval()){ ao=this.getEvalOrigin(); ao+=", "; } if(an){ ao+=an; }else{ ao+=""; } var ap=this.getLineNumber(); if(ap!=null){ ao+=":"+ap; var aq=this.getColumnNumber(); if(aq){ ao+=":"+aq; } } } var N=""; var ar=this.getFunctionName(); var as=true; var at=this.isConstructor(); var au=!(this.isToplevel()||at); if(au){ var av=GetTypeName((this[ah]),true); var aw=this.getMethodName(); if(ar){ if(av&& %_CallFunction(ar,av,j)!=0){ N+=av+"."; } N+=ar; if(aw&& (%_CallFunction(ar,"."+aw,j)!= ar.length-aw.length-1)){ N+=" [as "+aw+"]"; } }else{ N+=av+"."+(aw||""); } }else if(at){ N+="new "+(ar||""); }else if(ar){ N+=ar; }else{ N+=ao; as=false; } if(as){ N+=" ("+ao+")"; } return N; } 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(G){ var ax=G.nameOrSourceURL(); if(ax){ return ax; } var ay="eval at "; if(G.eval_from_function_name){ ay+=G.eval_from_function_name; }else{ ay+=""; } var az=G.eval_from_script; if(az){ if(az.compilation_type==1){ ay+=" ("+FormatEvalOrigin(az)+")"; }else{ if(az.name){ ay+=" ("+az.name; var H=az.locationFromPosition( G.eval_from_script_position,true); if(H){ ay+=":"+(H.line+1); ay+=":"+(H.column+1); } ay+=")"; }else{ ay+=" (unknown source)"; } } } return ay; } function FormatErrorString(aA){ try{ return %_CallFunction(aA,ErrorToString); }catch(e){ try{ return""; }catch(ee){ return""; } } } function GetStackFrames(aB){ var aC=new d(); var aD=aB[0]; for(var M=1;M"; }catch(ee){ N=""; } } aJ.push(" at "+N); } return %_CallFunction(aJ,"\n",g); } function GetTypeName(al,aL){ if((al==null))return null; var w=al.constructor; if(!w){ return aL?null: %_CallFunction(al,NoSideEffectsObjectToString); } var x=w.name; if(!x){ return aL?null: %_CallFunction(al,NoSideEffectsObjectToString); } return x; } var aM=(%CreatePrivateSymbol("formatted stack trace")); var aN=function(){ var aO=(void 0); var aP=this; while(aP){ var aO= (aP[aM]); if((aO===(void 0))){ var aI=(aP[$stackTraceSymbol]); if((aI===(void 0))){ aP=%_GetPrototype(aP); continue; } aO=FormatStackTrace(aP,aI); (aP[$stackTraceSymbol]=(void 0)); (aP[aM]=aO); } return aO; } return(void 0); }; var aQ=function(aR){ if((%HasOwnProperty(this,$stackTraceSymbol))){ (this[$stackTraceSymbol]=(void 0)); (this[aM]=aR); } }; var aS=function(){}; function DefineError(a,aT){ var aU=aT.name; %AddNamedProperty(a,aU,aT,2); if(aU=='Error'){ var aV=function(){}; %FunctionSetPrototype(aV,c.prototype); %FunctionSetInstanceClassName(aV,'Error'); %FunctionSetPrototype(aT,new aV()); }else{ %FunctionSetPrototype(aT,new m()); %InternalSetPrototype(aT,m); } %FunctionSetInstanceClassName(aT,'Error'); %AddNamedProperty(aT.prototype,'constructor',aT,2); %AddNamedProperty(aT.prototype,'name',aU,2); %SetCode(aT,function(aW){ if(%_IsConstructCall()){ try{aS(this,aT);}catch(e){} if(!(aW===(void 0))){ %AddNamedProperty(this,'message',$toString(aW),2); } }else{ return new aT(aW); } }); %SetNativeFlag(aT); return aT; }; m=DefineError(a,function Error(){}); t=DefineError(a,function EvalError(){}); o=DefineError(a,function RangeError(){}); r=DefineError(a,function ReferenceError(){}); q=DefineError(a,function SyntaxError(){}); n=DefineError(a,function TypeError(){}); p=DefineError(a,function URIError(){}); %AddNamedProperty(m.prototype,'message','',2); var aX=new d(); var aY=new c(); function GetPropertyWithoutInvokingMonkeyGetters(aA,aU){ var aZ=aA; while(aZ&&!%HasOwnProperty(aZ,aU)){ aZ=%_GetPrototype(aZ); } if((aZ===null))return(void 0); if(!(%_IsObject(aZ)))return aA[aU]; var ba=%GetOwnProperty(aZ,aU); if(ba&&ba[0]){ var bb=aU==="name"; if(aZ===r.prototype) return bb?"ReferenceError":(void 0); if(aZ===q.prototype) return bb?"SyntaxError":(void 0); if(aZ===n.prototype) return bb?"TypeError":(void 0); } return aA[aU]; } function ErrorToStringDetectCycle(aA){ if(!%PushIfAbsent(aX,aA))throw aY; try{ var aU=GetPropertyWithoutInvokingMonkeyGetters(aA,"name"); aU=(aU===(void 0))?"Error":((typeof(%IS_VAR(aU))==='string')?aU:$nonStringToString(aU)); var E=GetPropertyWithoutInvokingMonkeyGetters(aA,"message"); E=(E===(void 0))?"":((typeof(%IS_VAR(E))==='string')?E:$nonStringToString(E)); if(aU==="")return E; if(E==="")return aU; return aU+": "+E; }finally{ aX.length=aX.length-1; } } function ErrorToString(){ if(!(%_IsSpecObject(this))){ throw MakeTypeError(13,"Error.prototype.toString"); } try{ return ErrorToStringDetectCycle(this); }catch(e){ if(e===aY){ return''; } throw e; } } b.InstallFunctions(m.prototype,2, ['toString',ErrorToString]); $errorToString=ErrorToString; $getStackTraceLine=GetStackTraceLine; $messageGetPositionInLine=GetPositionInLine; $messageGetLineNumber=GetLineNumber; $messageGetSourceLine=GetSourceLine; $noSideEffectToString=NoSideEffectToString; $toDetailString=ToDetailString; $Error=m; $EvalError=t; $RangeError=o; $ReferenceError=r; $SyntaxError=q; $TypeError=n; $URIError=p; MakeError=function(z,A,B,C){ return MakeGenericError(m,z,A,B,C); } MakeEvalError=function(z,A,B,C){ return MakeGenericError(t,z,A,B,C); } MakeRangeError=function(z,A,B,C){ return MakeGenericError(o,z,A,B,C); } MakeReferenceError=function(z,A,B,C){ return MakeGenericError(r,z,A,B,C); } MakeSyntaxError=function(z,A,B,C){ return MakeGenericError(q,z,A,B,C); } MakeTypeError=function(z,A,B,C){ return MakeGenericError(n,z,A,B,C); } MakeURIError=function(){ return MakeGenericError(p,232); } $stackOverflowBoilerplate=MakeRangeError(144); %DefineAccessorPropertyUnchecked($stackOverflowBoilerplate,'stack', aN,aQ, 2); aS=function captureStackTrace(u,bc){ e(u,'stack',{get:aN, set:aQ, configurable:true}); %CollectStackTrace(u,bc?bc:aS); }; m.captureStackTrace=aS; }); jsonÉ: var $jsonSerializeAdapter; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.JSON; var d=b.InternalArray; var e; var g; var h; b.Import(function(i){ e=i.MathMax; g=i.MathMin; h=i.ObjectHasOwnProperty; }); function Revive(j,k,l){ var m=j[k]; if((%_IsObject(m))){ if((%_IsArray(m))){ var n=m.length; for(var o=0;o0){ 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(17); var z=x; x+=y; var A=new d(); if((%_IsArray(v))){ var n=v.length; for(var o=0;o0){ var E=",\n"+x; D="{\n"+x+A.join(E)+"\n"+ z+"}"; }else{ D="{}"; } w.pop(); return D; } function JSONSerialize(G,j,v,w,x,y){ var u=j[G]; if((%_IsSpecObject(u))){ var H=u.toJSON; if((%_ClassOf(H)==='Function')){ u=%_CallFunction(u,G,H); } } if((%_ClassOf(v)==='Function')){ u=%_CallFunction(j,G,u,v); } 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=$toNumber(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 n=v.length; for(var o=0;o10){ y=%_SubString(I,0,10); }else{ y=I; } }else{ y=""; } return JSONSerialize('',{'':u},v,new d(),"",y); } %AddNamedProperty(c,symbolToStringTag,"JSON",1|2); b.InstallFunctions(c,2,[ "parse",JSONParse, "stringify",JSONStringify ]); $jsonSerializeAdapter=function(G,N){ var j={}; j[G]=N; return JSONSerialize(G,j,(void 0),new d(),"",""); } }) 8array-iteratoriA var $arrayValues; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Array; var d=a.Uint8Array; var e=a.Int8Array; var g=a.Uint16Array; var h=a.Int16Array; var i=a.Uint32Array; var j=a.Int32Array; var k=a.Float32Array; var l=a.Float64Array; var m=a.Uint8ClampedArray; var n=(%CreateGlobalPrivateSymbol("ArrayIterator#object")); var o=(%CreateGlobalPrivateSymbol("ArrayIterator#next")); var p=(%CreateGlobalPrivateSymbol("ArrayIterator#kind")); function ArrayIterator(){} function CreateArrayIterator(q,r){ var t=$toObject(q); var u=new ArrayIterator; (u[n]=t); (u[o]=0); (u[p]=r); return u; } function CreateIteratorResultObject(v,w){ return{value:v,done:w}; } function ArrayIteratorIterator(){ return this; } function ArrayIteratorNext(){ var u=$toObject(this); if(!(!(u[o]===(void 0)))){ throw MakeTypeError(33, 'Array Iterator.prototype.next',this); } var q=(u[n]); if((q===(void 0))){ return CreateIteratorResultObject((void 0),true); } var x=(u[o]); var y=(u[p]); var z=(q.length>>>0); if(x>=z){ (u[n]=(void 0)); return CreateIteratorResultObject((void 0),true); } (u[o]=x+1); if(y==2){ return CreateIteratorResultObject(q[x],false); } if(y==3){ return CreateIteratorResultObject([x,q[x]],false); } return CreateIteratorResultObject(x,false); } 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,symbolIterator); %AddNamedProperty(ArrayIterator.prototype,symbolIterator, ArrayIteratorIterator,2); %AddNamedProperty(ArrayIterator.prototype,symbolToStringTag, "Array Iterator",1|2); b.InstallFunctions(c.prototype,2,[ 'entries',ArrayEntries, 'keys',ArrayKeys ]); %AddNamedProperty(c.prototype,symbolIterator,ArrayValues, 2); %AddNamedProperty(d.prototype,'entries',ArrayEntries,2); %AddNamedProperty(d.prototype,'values',ArrayValues,2); %AddNamedProperty(d.prototype,'keys',ArrayKeys,2); %AddNamedProperty(d.prototype,symbolIterator,ArrayValues, 2); %AddNamedProperty(e.prototype,'entries',ArrayEntries,2); %AddNamedProperty(e.prototype,'values',ArrayValues,2); %AddNamedProperty(e.prototype,'keys',ArrayKeys,2); %AddNamedProperty(e.prototype,symbolIterator,ArrayValues, 2); %AddNamedProperty(g.prototype,'entries',ArrayEntries,2); %AddNamedProperty(g.prototype,'values',ArrayValues,2); %AddNamedProperty(g.prototype,'keys',ArrayKeys,2); %AddNamedProperty(g.prototype,symbolIterator,ArrayValues, 2); %AddNamedProperty(h.prototype,'entries',ArrayEntries,2); %AddNamedProperty(h.prototype,'values',ArrayValues,2); %AddNamedProperty(h.prototype,'keys',ArrayKeys,2); %AddNamedProperty(h.prototype,symbolIterator,ArrayValues, 2); %AddNamedProperty(i.prototype,'entries',ArrayEntries,2); %AddNamedProperty(i.prototype,'values',ArrayValues,2); %AddNamedProperty(i.prototype,'keys',ArrayKeys,2); %AddNamedProperty(i.prototype,symbolIterator,ArrayValues, 2); %AddNamedProperty(j.prototype,'entries',ArrayEntries,2); %AddNamedProperty(j.prototype,'values',ArrayValues,2); %AddNamedProperty(j.prototype,'keys',ArrayKeys,2); %AddNamedProperty(j.prototype,symbolIterator,ArrayValues, 2); %AddNamedProperty(k.prototype,'entries',ArrayEntries,2); %AddNamedProperty(k.prototype,'values',ArrayValues,2); %AddNamedProperty(k.prototype,'keys',ArrayKeys,2); %AddNamedProperty(k.prototype,symbolIterator,ArrayValues, 2); %AddNamedProperty(l.prototype,'entries',ArrayEntries,2); %AddNamedProperty(l.prototype,'values',ArrayValues,2); %AddNamedProperty(l.prototype,'keys',ArrayKeys,2); %AddNamedProperty(l.prototype,symbolIterator,ArrayValues, 2); %AddNamedProperty(m.prototype,'entries',ArrayEntries,2); %AddNamedProperty(m.prototype,'values',ArrayValues,2); %AddNamedProperty(m.prototype,'keys',ArrayKeys,2); %AddNamedProperty(m.prototype,symbolIterator,ArrayValues, 2); b.Export(function(A){ A.ArrayIteratorCreateResultObject=CreateIteratorResultObject; }); $arrayValues=ArrayValues; }) >>0); if(l>=m){ (k[g]=(void 0)); return d((void 0),true); } var n=%_StringCharCodeAt(j,l); var o=%_StringCharFromCode(n); l++; if(n>=0xD800&&n<=0xDBFF&&l=0xDC00&&p<=0xDFFF){ o+=%_StringCharFromCode(p); l++; } } (k[h]=l); return d(o,false); } function StringPrototypeIterator(){ return CreateStringIterator(this); } %FunctionSetPrototype(StringIterator,{__proto__:$iteratorPrototype}); %FunctionSetInstanceClassName(StringIterator,'String Iterator'); b.InstallFunctions(StringIterator.prototype,2,[ 'next',StringIteratorNext ]); %AddNamedProperty(StringIterator.prototype,symbolToStringTag, "String Iterator",1|2); b.SetFunctionName(StringPrototypeIterator,symbolIterator); %AddNamedProperty(c.prototype,symbolIterator, StringPrototypeIterator,2); }) $templatesÉ var $getTemplateCallSite; (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Map; var d=b.InternalArray; var e=new c; var g=c.prototype.get; var h=c.prototype.set; function SameCallSiteElements(i,j){ var k=i.length; var j=j.raw; if(k!==j.length)return false; for(var l=0;l0){ if(l in p){ p[r]=p[l]; }else{ delete p[r]; } l=l+v; r=r+v; u--; } return p; } function ArrayCopyWithin(m,n,o){ if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.copyWithin"); var p=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)); var q=$toLength(p.length); return InnerArrayCopyWithin(m,n,o,p,q); } function InnerArrayFind(w,x,p,q){ if(!(%_ClassOf(w)==='Function')){ throw MakeTypeError(12,w); } var y=false; if((x===null)){ if(%IsSloppyModeFunction(w))x=(void 0); }else if(!(x===(void 0))){ y=(!(%_IsSpecObject(x))&&%IsSloppyModeFunction(w)); } for(var z=0;zq)z=q; } if(o<0){ o+=q; if(o<0)o=0; }else{ if(o>q)o=q; } if((o-z)>0&&j(p)){ throw MakeTypeError(9); } for(;z>>0); return InnerArrayFill(C,n,o,p,q); } function AddArrayElement(D,p,z,C){ if(D===c){ %AddElement(p,z,C); }else{ k(p,z,{ value:C,writable:true,configurable:true,enumerable:true }); } } function ArrayFrom(E,F,G){ var H=$toObject(E); var I=!(F===(void 0)); if(I){ if(!(%_ClassOf(F)==='Function')){ throw MakeTypeError(12,F); }else if(%IsSloppyModeFunction(F)){ if((G===null)){ G=(void 0); }else if(!(G===(void 0))){ G=((%_IsSpecObject(%IS_VAR(G)))?G:$toObject(G)); } } } var J=g(H,symbolIterator); var K; var L; var M; var N; if(!(J===(void 0))){ L=%IsConstructor(this)?new this():[]; var O=e(H,J); K=0; while(true){ var P=O.next(); if(!(%_IsObject(P))){ throw MakeTypeError(38,P); } if(P.done){ L.length=K; return L; } N=P.value; if(I){ M=%_CallFunction(G,N,K,F); }else{ M=N; } AddArrayElement(this,L,K,M); K++; } }else{ var Q=$toLength(H.length); L=%IsConstructor(this)?new this(Q):new c(Q); for(K=0;K0){ return N(Q,%_Arguments(0)); }else{ return N(Q); } } } k(R,P); %FunctionRemovePrototype(R); %SetNativeFlag(R); this[P]=R; } return this[P]; } k(getter,M); %FunctionRemovePrototype(getter); %SetNativeFlag(getter); j(L.prototype,M,{ get:getter, enumerable:false, configurable:true }); } function supportedLocalesOf(U,V,W){ if((%_CallFunction(U,GetServiceRE(),u)===null)){ throw MakeError(6,U); } if((W===(void 0))){ W={}; }else{ W=$toObject(W); } var X=W.localeMatcher; if(!(X===(void 0))){ X=h(X); if(X!=='lookup'&&X!=='best fit'){ throw MakeRangeError(140,X); } }else{ X='best fit'; } var Y=initializeLocaleList(V); if((B[U]===(void 0))){ B[U]=getAvailableLocalesOf(U); } if(X==='best fit'){ return initializeLocaleList(bestFitSupportedLocalesOf( Y,B[U])); } return initializeLocaleList(lookupSupportedLocalesOf( Y,B[U])); } function lookupSupportedLocalesOf(Y,Z){ var aa=[]; for(var ab=0;ab=3&&O<=8&&!(aq===(void 0))){ ap[aq]=ar; aq=(void 0); }else{ return{}; } } return ap; } function setOptions(as,ap,at,af,au){ var an=''; var av=function updateExtension(aw,ak){ return'-'+aw+'-'+h(ak); } var ax=function updateProperty(ag,ah,ak){ if(ah==='boolean'&&(typeof ak==='string')){ ak=(ak==='true')?true:false; } if(!(ag===(void 0))){ defineWEProperty(au,ag,ak); } } for(var aw in at){ if(%HasOwnProperty(at,aw)){ var ak=(void 0); var ay=at[aw]; if(!(ay.property===(void 0))){ ak=af(ay.property,ay.type,ay.values); } if(!(ak===(void 0))){ ax(ay.property,ay.type,ak); an+=av(aw,ak); continue; } if(%HasOwnProperty(ap,aw)){ ak=ap[aw]; if(!(ak===(void 0))){ ax(ay.property,ay.type,ak); an+=av(aw,ak); }else if(ay.type==='boolean'){ ax(ay.property,ay.type,true); an+=av(aw,true); } } } } return an===''?'':'-u'+an; } function freezeArray(az){ var aA=az.length; for(var ab=0;ab>>0); for(var aN=0;aNbq){ throw MakeRangeError(143,ag); } return p(ak); } return br; } function initializeNumberFormat(bs,V,W){ if(%IsInitializedIntlObject(bs)){ throw MakeTypeError(94,"NumberFormat"); } if((W===(void 0))){ W={}; } var af=getGetOption(W,'numberformat'); var ac=resolveLocale('numberformat',V,W); var bg={}; defineWEProperty(bg,'style',af( 'style','string',['decimal','percent','currency'],'decimal')); var bo=af('currency','string'); if(!(bo===(void 0))&&!isWellFormedCurrencyCode(bo)){ throw MakeRangeError(128,bo); } if(bg.style==='currency'&&(bo===(void 0))){ throw MakeTypeError(21); } var bt=af( 'currencyDisplay','string',['code','symbol','name'],'symbol'); if(bg.style==='currency'){ defineWEProperty(bg,'currency',%StringToUpperCase(bo)); defineWEProperty(bg,'currencyDisplay',bt); } var bu=getNumberOption(W,'minimumIntegerDigits',1,21,1); defineWEProperty(bg,'minimumIntegerDigits',bu); var bv=getNumberOption(W,'minimumFractionDigits',0,20,0); defineWEProperty(bg,'minimumFractionDigits',bv); var bw=getNumberOption(W,'maximumFractionDigits',bv,20,3); defineWEProperty(bg,'maximumFractionDigits',bw); var bx=W['minimumSignificantDigits']; var by=W['maximumSignificantDigits']; if(!(bx===(void 0))||!(by===(void 0))){ bx=getNumberOption(W,'minimumSignificantDigits',1,21,0); defineWEProperty(bg,'minimumSignificantDigits',bx); by=getNumberOption(W,'maximumSignificantDigits',bx,21,21); defineWEProperty(bg,'maximumSignificantDigits',by); } defineWEProperty(bg,'useGrouping',af( 'useGrouping','boolean',(void 0),true)); var ap=parseExtension(ac.extension); var bz={ 'nu':{'property':(void 0),'type':'string'} }; var an=setOptions(W,ap,bz, af,bg); var bl=ac.locale+an; var al=i({},{ currency:{writable:true}, currencyDisplay:{writable:true}, locale:{writable:true}, maximumFractionDigits:{writable:true}, minimumFractionDigits:{writable:true}, minimumIntegerDigits:{writable:true}, numberingSystem:{writable:true}, requestedLocale:{value:bl,writable:true}, style:{value:bg.style,writable:true}, useGrouping:{writable:true} }); if(%HasOwnProperty(bg,'minimumSignificantDigits')){ defineWEProperty(al,'minimumSignificantDigits',(void 0)); } if(%HasOwnProperty(bg,'maximumSignificantDigits')){ defineWEProperty(al,'maximumSignificantDigits',(void 0)); } var bA=%CreateNumberFormat(bl, bg, al); if(bg.style==='currency'){ j(al,'currencyDisplay',{value:bt, writable:true}); } %MarkAsInitializedIntlObjectOfType(bs,'numberformat',bA); j(bs,'resolved',{value:al}); return bs; } %AddNamedProperty(A,'NumberFormat',function(){ var V=%_Arguments(0); var W=%_Arguments(1); if(!this||this===A){ return new A.NumberFormat(V,W); } return initializeNumberFormat($toObject(this),V,W); }, 2 ); %AddNamedProperty(A.NumberFormat.prototype,'resolvedOptions',function(){ if(%_IsConstructCall()){ throw MakeTypeError(74); } if(!%IsInitializedIntlObjectOfType(this,'numberformat')){ throw MakeTypeError(95,"NumberFormat"); } var bB=this; var ac=getOptimalLanguageTag(bB.resolved.requestedLocale, bB.resolved.locale); var bC={ locale:ac, numberingSystem:bB.resolved.numberingSystem, style:bB.resolved.style, useGrouping:bB.resolved.useGrouping, minimumIntegerDigits:bB.resolved.minimumIntegerDigits, minimumFractionDigits:bB.resolved.minimumFractionDigits, maximumFractionDigits:bB.resolved.maximumFractionDigits, }; if(bC.style==='currency'){ defineWECProperty(bC,'currency',bB.resolved.currency); defineWECProperty(bC,'currencyDisplay', bB.resolved.currencyDisplay); } if(%HasOwnProperty(bB.resolved,'minimumSignificantDigits')){ defineWECProperty(bC,'minimumSignificantDigits', bB.resolved.minimumSignificantDigits); } if(%HasOwnProperty(bB.resolved,'maximumSignificantDigits')){ defineWECProperty(bC,'maximumSignificantDigits', bB.resolved.maximumSignificantDigits); } return bC; }, 2 ); k(A.NumberFormat.prototype.resolvedOptions,'resolvedOptions'); %FunctionRemovePrototype(A.NumberFormat.prototype.resolvedOptions); %SetNativeFlag(A.NumberFormat.prototype.resolvedOptions); %AddNamedProperty(A.NumberFormat,'supportedLocalesOf',function(V){ if(%_IsConstructCall()){ throw MakeTypeError(74); } return supportedLocalesOf('numberformat',V,%_Arguments(1)); }, 2 ); k(A.NumberFormat.supportedLocalesOf,'supportedLocalesOf'); %FunctionRemovePrototype(A.NumberFormat.supportedLocalesOf); %SetNativeFlag(A.NumberFormat.supportedLocalesOf); function formatNumber(bA,ak){ var bD=$toNumber(ak)+0; return %InternalNumberFormat(%GetImplFromInitializedIntlObject(bA), bD); } function parseNumber(bA,ak){ return %InternalNumberParse(%GetImplFromInitializedIntlObject(bA), h(ak)); } addBoundMethod(A.NumberFormat,'format',formatNumber,1); addBoundMethod(A.NumberFormat,'v8Parse',parseNumber,1); function toLDMLString(W){ var af=getGetOption(W,'dateformat'); var bE=''; var bF=af('weekday','string',['narrow','short','long']); bE+=appendToLDMLString( bF,{narrow:'EEEEE',short:'EEE',long:'EEEE'}); bF=af('era','string',['narrow','short','long']); bE+=appendToLDMLString( bF,{narrow:'GGGGG',short:'GGG',long:'GGGG'}); bF=af('year','string',['2-digit','numeric']); bE+=appendToLDMLString(bF,{'2-digit':'yy','numeric':'y'}); bF=af('month','string', ['2-digit','numeric','narrow','short','long']); bE+=appendToLDMLString(bF,{'2-digit':'MM','numeric':'M', 'narrow':'MMMMM','short':'MMM','long':'MMMM'}); bF=af('day','string',['2-digit','numeric']); bE+=appendToLDMLString( bF,{'2-digit':'dd','numeric':'d'}); var bG=af('hour12','boolean'); bF=af('hour','string',['2-digit','numeric']); if((bG===(void 0))){ bE+=appendToLDMLString(bF,{'2-digit':'jj','numeric':'j'}); }else if(bG===true){ bE+=appendToLDMLString(bF,{'2-digit':'hh','numeric':'h'}); }else{ bE+=appendToLDMLString(bF,{'2-digit':'HH','numeric':'H'}); } bF=af('minute','string',['2-digit','numeric']); bE+=appendToLDMLString(bF,{'2-digit':'mm','numeric':'m'}); bF=af('second','string',['2-digit','numeric']); bE+=appendToLDMLString(bF,{'2-digit':'ss','numeric':'s'}); bF=af('timeZoneName','string',['short','long']); bE+=appendToLDMLString(bF,{short:'z',long:'zzzz'}); return bE; } function appendToLDMLString(bF,bH){ if(!(bF===(void 0))){ return bH[bF]; }else{ return''; } } function fromLDMLString(bE){ bE=%_CallFunction(bE,GetQuotedStringRE(),'', v); var W={}; var bI=%_CallFunction(bE,/E{3,5}/g,u); W=appendToDateTimeObject( W,'weekday',bI,{EEEEE:'narrow',EEE:'short',EEEE:'long'}); bI=%_CallFunction(bE,/G{3,5}/g,u); W=appendToDateTimeObject( W,'era',bI,{GGGGG:'narrow',GGG:'short',GGGG:'long'}); bI=%_CallFunction(bE,/y{1,2}/g,u); W=appendToDateTimeObject( W,'year',bI,{y:'numeric',yy:'2-digit'}); bI=%_CallFunction(bE,/M{1,5}/g,u); W=appendToDateTimeObject(W,'month',bI,{MM:'2-digit', M:'numeric',MMMMM:'narrow',MMM:'short',MMMM:'long'}); bI=%_CallFunction(bE,/L{1,5}/g,u); W=appendToDateTimeObject(W,'month',bI,{LL:'2-digit', L:'numeric',LLLLL:'narrow',LLL:'short',LLLL:'long'}); bI=%_CallFunction(bE,/d{1,2}/g,u); W=appendToDateTimeObject( W,'day',bI,{d:'numeric',dd:'2-digit'}); bI=%_CallFunction(bE,/h{1,2}/g,u); if(bI!==null){ W['hour12']=true; } W=appendToDateTimeObject( W,'hour',bI,{h:'numeric',hh:'2-digit'}); bI=%_CallFunction(bE,/H{1,2}/g,u); if(bI!==null){ W['hour12']=false; } W=appendToDateTimeObject( W,'hour',bI,{H:'numeric',HH:'2-digit'}); bI=%_CallFunction(bE,/m{1,2}/g,u); W=appendToDateTimeObject( W,'minute',bI,{m:'numeric',mm:'2-digit'}); bI=%_CallFunction(bE,/s{1,2}/g,u); W=appendToDateTimeObject( W,'second',bI,{s:'numeric',ss:'2-digit'}); bI=%_CallFunction(bE,/z|zzzz/g,u); W=appendToDateTimeObject( W,'timeZoneName',bI,{z:'short',zzzz:'long'}); return W; } function appendToDateTimeObject(W,bF,bI,bH){ if((bI===null)){ if(!%HasOwnProperty(W,bF)){ defineWEProperty(W,bF,(void 0)); } return W; } var ag=bI[0]; defineWEProperty(W,bF,bH[ag]); return W; } function toDateTimeOptions(W,bJ,bK){ if((W===(void 0))){ W={}; }else{ W=((%_IsSpecObject(%IS_VAR(W)))?W:$toObject(W)); } var bL=true; if((bJ==='date'||bJ==='any')&& (!(W.weekday===(void 0))||!(W.year===(void 0))|| !(W.month===(void 0))||!(W.day===(void 0)))){ bL=false; } if((bJ==='time'||bJ==='any')&& (!(W.hour===(void 0))||!(W.minute===(void 0))|| !(W.second===(void 0)))){ bL=false; } if(bL&&(bK==='date'||bK==='all')){ j(W,'year',{value:'numeric', writable:true, enumerable:true, configurable:true}); j(W,'month',{value:'numeric', writable:true, enumerable:true, configurable:true}); j(W,'day',{value:'numeric', writable:true, enumerable:true, configurable:true}); } if(bL&&(bK==='time'||bK==='all')){ j(W,'hour',{value:'numeric', writable:true, enumerable:true, configurable:true}); j(W,'minute',{value:'numeric', writable:true, enumerable:true, configurable:true}); j(W,'second',{value:'numeric', writable:true, enumerable:true, configurable:true}); } return W; } function initializeDateTimeFormat(bM,V,W){ if(%IsInitializedIntlObject(bM)){ throw MakeTypeError(94,"DateTimeFormat"); } if((W===(void 0))){ W={}; } var ac=resolveLocale('dateformat',V,W); W=toDateTimeOptions(W,'any','date'); var af=getGetOption(W,'dateformat'); var X=af('formatMatcher','string', ['basic','best fit'],'best fit'); var bE=toLDMLString(W); var bN=canonicalizeTimeZoneID(W.timeZone); var bg={}; var ap=parseExtension(ac.extension); var bO={ 'ca':{'property':(void 0),'type':'string'}, 'nu':{'property':(void 0),'type':'string'} }; var an=setOptions(W,ap,bO, af,bg); var bl=ac.locale+an; var al=i({},{ 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:bl,writable:true}, second:{writable:true}, timeZone:{writable:true}, timeZoneName:{writable:true}, tz:{value:bN,writable:true}, weekday:{writable:true}, year:{writable:true} }); var bA=%CreateDateTimeFormat( bl,{skeleton:bE,timeZone:bN},al); if(!(bN===(void 0))&&bN!==al.timeZone){ throw MakeRangeError(149,bN); } %MarkAsInitializedIntlObjectOfType(bM,'dateformat',bA); j(bM,'resolved',{value:al}); return bM; } %AddNamedProperty(A,'DateTimeFormat',function(){ var V=%_Arguments(0); var W=%_Arguments(1); if(!this||this===A){ return new A.DateTimeFormat(V,W); } return initializeDateTimeFormat($toObject(this),V,W); }, 2 ); %AddNamedProperty(A.DateTimeFormat.prototype,'resolvedOptions',function(){ if(%_IsConstructCall()){ throw MakeTypeError(74); } if(!%IsInitializedIntlObjectOfType(this,'dateformat')){ throw MakeTypeError(95,"DateTimeFormat"); } var bP={ '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 bB=this; var bQ=fromLDMLString(bB.resolved.pattern); var bR=bP[bB.resolved.calendar]; if((bR===(void 0))){ bR=bB.resolved.calendar; } var ac=getOptimalLanguageTag(bB.resolved.requestedLocale, bB.resolved.locale); var bC={ locale:ac, numberingSystem:bB.resolved.numberingSystem, calendar:bR, timeZone:bB.resolved.timeZone }; addWECPropertyIfDefined(bC,'timeZoneName',bQ.timeZoneName); addWECPropertyIfDefined(bC,'era',bQ.era); addWECPropertyIfDefined(bC,'year',bQ.year); addWECPropertyIfDefined(bC,'month',bQ.month); addWECPropertyIfDefined(bC,'day',bQ.day); addWECPropertyIfDefined(bC,'weekday',bQ.weekday); addWECPropertyIfDefined(bC,'hour12',bQ.hour12); addWECPropertyIfDefined(bC,'hour',bQ.hour); addWECPropertyIfDefined(bC,'minute',bQ.minute); addWECPropertyIfDefined(bC,'second',bQ.second); return bC; }, 2 ); k(A.DateTimeFormat.prototype.resolvedOptions, 'resolvedOptions'); %FunctionRemovePrototype(A.DateTimeFormat.prototype.resolvedOptions); %SetNativeFlag(A.DateTimeFormat.prototype.resolvedOptions); %AddNamedProperty(A.DateTimeFormat,'supportedLocalesOf',function(V){ if(%_IsConstructCall()){ throw MakeTypeError(74); } return supportedLocalesOf('dateformat',V,%_Arguments(1)); }, 2 ); k(A.DateTimeFormat.supportedLocalesOf,'supportedLocalesOf'); %FunctionRemovePrototype(A.DateTimeFormat.supportedLocalesOf); %SetNativeFlag(A.DateTimeFormat.supportedLocalesOf); function formatDate(bA,bS){ var bT; if((bS===(void 0))){ bT=%DateCurrentTime(); }else{ bT=$toNumber(bS); } if(!n(bT))throw MakeRangeError(122); return %InternalDateFormat(%GetImplFromInitializedIntlObject(bA), new d(bT)); } function parseDate(bA,ak){ return %InternalDateParse(%GetImplFromInitializedIntlObject(bA), h(ak)); } addBoundMethod(A.DateTimeFormat,'format',formatDate,0); addBoundMethod(A.DateTimeFormat,'v8Parse',parseDate,1); function canonicalizeTimeZoneID(bU){ if((bU===(void 0))){ return bU; } var bV=%StringToUpperCase(bU); if(bV==='UTC'||bV==='GMT'|| bV==='ETC/UTC'||bV==='ETC/GMT'){ return'UTC'; } var bI=%_CallFunction(bU,GetTimezoneNameCheckRE(),u); if((bI===null))throw MakeRangeError(123,bU); var bC=toTitleCaseWord(bI[1])+'/'+toTitleCaseWord(bI[2]); var ab=3; while(!(bI[ab]===(void 0))&&ab0){ if((%_DebugIsActive()!=0))%DebugPrepareStepInIfStepping(this); try{ return %_GeneratorNext(this,f); }catch(e){ %GeneratorClose(this); throw e; } }else if(g==0){ return{value:void 0,done:true}; }else{ throw MakeTypeError(31); } } function GeneratorObjectThrow(h){ if(!(%_ClassOf(this)==='Generator')){ throw MakeTypeError(33, '[Generator].prototype.throw',this); } var g=%GeneratorGetContinuation(this); if(g>0){ try{ return %_GeneratorThrow(this,h); }catch(e){ %GeneratorClose(this); throw e; } }else if(g==0){ throw h; }else{ throw MakeTypeError(31); } } function GeneratorFunctionConstructor(i){ var j=d(arguments,'function*'); var k=%GlobalProxy(GeneratorFunctionConstructor); var l=%_CallFunction(k,%CompileString(j,true)); %FunctionMarkNameShouldPrintAsAnonymous(l); return l; } %NeverOptimizeFunction(GeneratorObjectNext); %NeverOptimizeFunction(GeneratorObjectThrow); var m=GeneratorFunctionPrototype.prototype; b.InstallFunctions(m, 2, ["next",GeneratorObjectNext, "throw",GeneratorObjectThrow]); %AddNamedProperty(m,"constructor", GeneratorFunctionPrototype,2|1); %AddNamedProperty(m, symbolToStringTag,"Generator",2|1); %InternalSetPrototype(GeneratorFunctionPrototype,c.prototype); %AddNamedProperty(GeneratorFunctionPrototype, symbolToStringTag,"GeneratorFunction",2|1); %AddNamedProperty(GeneratorFunctionPrototype,"constructor", GeneratorFunction,2|1); %InternalSetPrototype(GeneratorFunction,c); %SetCode(GeneratorFunction,GeneratorFunctionConstructor); }) =d.length){ return(void 0); } return %_AtomicsCompareExchange(d,f,g,h); } function AtomicsLoadJS(d,f){ CheckSharedTypedArray(d); f=$toInteger(f); if(f<0||f>=d.length){ return(void 0); } return %_AtomicsLoad(d,f); } function AtomicsStoreJS(d,f,i){ CheckSharedTypedArray(d); f=$toInteger(f); if(f<0||f>=d.length){ return(void 0); } return %_AtomicsStore(d,f,i); } function AtomicsAddJS(e,f,i){ CheckSharedIntegerTypedArray(e); f=$toInteger(f); if(f<0||f>=e.length){ return(void 0); } return %_AtomicsAdd(e,f,i); } function AtomicsSubJS(e,f,i){ CheckSharedIntegerTypedArray(e); f=$toInteger(f); if(f<0||f>=e.length){ return(void 0); } return %_AtomicsSub(e,f,i); } function AtomicsAndJS(e,f,i){ CheckSharedIntegerTypedArray(e); f=$toInteger(f); if(f<0||f>=e.length){ return(void 0); } return %_AtomicsAnd(e,f,i); } function AtomicsOrJS(e,f,i){ CheckSharedIntegerTypedArray(e); f=$toInteger(f); if(f<0||f>=e.length){ return(void 0); } return %_AtomicsOr(e,f,i); } function AtomicsXorJS(e,f,i){ CheckSharedIntegerTypedArray(e); f=$toInteger(f); if(f<0||f>=e.length){ return(void 0); } return %_AtomicsXor(e,f,i); } function AtomicsExchangeJS(e,f,i){ CheckSharedIntegerTypedArray(e); f=$toInteger(f); if(f<0||f>=e.length){ return(void 0); } return %_AtomicsExchange(e,f,i); } function AtomicsIsLockFreeJS(j){ return %_AtomicsIsLockFree(j); } function AtomicsConstructor(){} var k=new AtomicsConstructor(); %InternalSetPrototype(k,c.prototype); %AddNamedProperty(a,"Atomics",k,2); %FunctionSetInstanceClassName(AtomicsConstructor,'Atomics'); %AddNamedProperty(k,symbolToStringTag,"Atomics",1|2); b.InstallFunctions(k,2,[ "compareExchange",AtomicsCompareExchangeJS, "load",AtomicsLoadJS, "store",AtomicsStoreJS, "add",AtomicsAddJS, "sub",AtomicsSubJS, "and",AtomicsAndJS, "or",AtomicsOrJS, "xor",AtomicsXorJS, "exchange",AtomicsExchangeJS, "isLockFree",AtomicsIsLockFreeJS, ]); }) Xharmony-array-includesñ (function(a,b){ 'use strict'; %CheckIsBootstrapping(); var c=a.Array; function ArrayIncludes(d,e){ var f=$toObject(this); var g=$toLength(f.length); 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