mirrors–t (function(a,b){ "use strict"; var c; var d=a.Array; var e=a.isNaN; var f=a.JSON.stringify; var g; var h; var i; var j=a.Math.min; var k=b.ImportNow("promise_status_symbol"); var l=b.ImportNow("promise_value_symbol"); var m; var n; var o; b.Import(function(p){ c=p.ErrorToString; g=p.MakeError; h=p.MapEntries; i=p.MapIteratorNext; m=p.SetIteratorNext; n=p.SetValues; o=p.SymbolToString; }); var q={ UNDEFINED_TYPE:'undefined', NULL_TYPE:'null', BOOLEAN_TYPE:'boolean', NUMBER_TYPE:'number', STRING_TYPE:'string', SYMBOL_TYPE:'symbol', OBJECT_TYPE:'object', FUNCTION_TYPE:'function', REGEXP_TYPE:'regexp', ERROR_TYPE:'error', PROPERTY_TYPE:'property', INTERNAL_PROPERTY_TYPE:'internalProperty', FRAME_TYPE:'frame', SCRIPT_TYPE:'script', CONTEXT_TYPE:'context', SCOPE_TYPE:'scope', PROMISE_TYPE:'promise', MAP_TYPE:'map', SET_TYPE:'set', ITERATOR_TYPE:'iterator', GENERATOR_TYPE:'generator', } var r=0; var s=-1; var t=[]; var u=true; function MirrorCacheIsEmpty(){ return r==0&&t.length==0; } function ToggleMirrorCache(v){ u=v; ClearMirrorCache(); } function ClearMirrorCache(v){ r=0; t=[]; } function ObjectIsPromise(v){ return(%_IsJSReceiver(v))&& !(%DebugGetProperty(v,k)===(void 0)); } function MakeMirror(v,w){ var x; if(!w&&u){ for(var y in t){ x=t[y]; if(x.value()===v){ return x; } if(x.isNumber()&&e(x.value())&& typeof v=='number'&&e(v)){ return x; } } } if((v===(void 0))){ x=new UndefinedMirror(); }else if((v===null)){ x=new NullMirror(); }else if((typeof(v)==='boolean')){ x=new BooleanMirror(v); }else if((typeof(v)==='number')){ x=new NumberMirror(v); }else if((typeof(v)==='string')){ x=new StringMirror(v); }else if((typeof(v)==='symbol')){ x=new SymbolMirror(v); }else if((%_IsArray(v))){ x=new ArrayMirror(v); }else if((%_IsDate(v))){ x=new DateMirror(v); }else if((%_IsFunction(v))){ x=new FunctionMirror(v); }else if((%_IsRegExp(v))){ x=new RegExpMirror(v); }else if((%_ClassOf(v)==='Error')){ x=new ErrorMirror(v); }else if((%_ClassOf(v)==='Script')){ x=new ScriptMirror(v); }else if((%_ClassOf(v)==='Map')||(%_ClassOf(v)==='WeakMap')){ x=new MapMirror(v); }else if((%_ClassOf(v)==='Set')||(%_ClassOf(v)==='WeakSet')){ x=new SetMirror(v); }else if((%_ClassOf(v)==='Map Iterator')||(%_ClassOf(v)==='Set Iterator')){ x=new IteratorMirror(v); }else if(ObjectIsPromise(v)){ x=new PromiseMirror(v); }else if((%_ClassOf(v)==='Generator')){ x=new GeneratorMirror(v); }else{ x=new ObjectMirror(v,q.OBJECT_TYPE,w); } if(u)t[x.handle()]=x; return x; } function LookupMirror(z){ if(!u){ throw g(2,"Mirror cache is disabled"); } return t[z]; } function GetUndefinedMirror(){ return MakeMirror((void 0)); } function inherits(A,B){ var C=function(){}; C.prototype=B.prototype; A.super_=B.prototype; A.prototype=new C(); A.prototype.constructor=A; } var D=80; var E={}; E.Data=0; E.DataConstant=2; E.AccessorConstant=3; var F={}; F.None=0; F.ReadOnly=1; F.DontEnum=2; F.DontDelete=4; var G={Global:0, Local:1, With:2, Closure:3, Catch:4, Block:5, Script:6}; function Mirror(H){ this.type_=H; } Mirror.prototype.type=function(){ return this.type_; }; Mirror.prototype.isValue=function(){ return this instanceof ValueMirror; }; Mirror.prototype.isUndefined=function(){ return this instanceof UndefinedMirror; }; Mirror.prototype.isNull=function(){ return this instanceof NullMirror; }; Mirror.prototype.isBoolean=function(){ return this instanceof BooleanMirror; }; Mirror.prototype.isNumber=function(){ return this instanceof NumberMirror; }; Mirror.prototype.isString=function(){ return this instanceof StringMirror; }; Mirror.prototype.isSymbol=function(){ return this instanceof SymbolMirror; }; Mirror.prototype.isObject=function(){ return this instanceof ObjectMirror; }; Mirror.prototype.isFunction=function(){ return this instanceof FunctionMirror; }; Mirror.prototype.isUnresolvedFunction=function(){ return this instanceof UnresolvedFunctionMirror; }; Mirror.prototype.isArray=function(){ return this instanceof ArrayMirror; }; Mirror.prototype.isDate=function(){ return this instanceof DateMirror; }; Mirror.prototype.isRegExp=function(){ return this instanceof RegExpMirror; }; Mirror.prototype.isError=function(){ return this instanceof ErrorMirror; }; Mirror.prototype.isPromise=function(){ return this instanceof PromiseMirror; }; Mirror.prototype.isGenerator=function(){ return this instanceof GeneratorMirror; }; Mirror.prototype.isProperty=function(){ return this instanceof PropertyMirror; }; Mirror.prototype.isInternalProperty=function(){ return this instanceof InternalPropertyMirror; }; Mirror.prototype.isFrame=function(){ return this instanceof FrameMirror; }; Mirror.prototype.isScript=function(){ return this instanceof ScriptMirror; }; Mirror.prototype.isContext=function(){ return this instanceof ContextMirror; }; Mirror.prototype.isScope=function(){ return this instanceof ScopeMirror; }; Mirror.prototype.isMap=function(){ return this instanceof MapMirror; }; Mirror.prototype.isSet=function(){ return this instanceof SetMirror; }; Mirror.prototype.isIterator=function(){ return this instanceof IteratorMirror; }; Mirror.prototype.allocateHandle_=function(){ if(u)this.handle_=r++; }; Mirror.prototype.allocateTransientHandle_=function(){ this.handle_=s--; }; Mirror.prototype.toText=function(){ return"#<"+this.constructor.name+">"; }; function ValueMirror(H,v,I){ %_Call(Mirror,this,H); this.value_=v; if(!I){ this.allocateHandle_(); }else{ this.allocateTransientHandle_(); } } inherits(ValueMirror,Mirror); Mirror.prototype.handle=function(){ return this.handle_; }; ValueMirror.prototype.isPrimitive=function(){ var H=this.type(); return H==='undefined'|| H==='null'|| H==='boolean'|| H==='number'|| H==='string'|| H==='symbol'; }; ValueMirror.prototype.value=function(){ return this.value_; }; function UndefinedMirror(){ %_Call(ValueMirror,this,q.UNDEFINED_TYPE,(void 0)); } inherits(UndefinedMirror,ValueMirror); UndefinedMirror.prototype.toText=function(){ return'undefined'; }; function NullMirror(){ %_Call(ValueMirror,this,q.NULL_TYPE,null); } inherits(NullMirror,ValueMirror); NullMirror.prototype.toText=function(){ return'null'; }; function BooleanMirror(v){ %_Call(ValueMirror,this,q.BOOLEAN_TYPE,v); } inherits(BooleanMirror,ValueMirror); BooleanMirror.prototype.toText=function(){ return this.value_?'true':'false'; }; function NumberMirror(v){ %_Call(ValueMirror,this,q.NUMBER_TYPE,v); } inherits(NumberMirror,ValueMirror); NumberMirror.prototype.toText=function(){ return %_NumberToString(this.value_); }; function StringMirror(v){ %_Call(ValueMirror,this,q.STRING_TYPE,v); } inherits(StringMirror,ValueMirror); StringMirror.prototype.length=function(){ return this.value_.length; }; StringMirror.prototype.getTruncatedValue=function(J){ if(J!=-1&&this.length()>J){ return this.value_.substring(0,J)+ '... (length: '+this.length()+')'; } return this.value_; }; StringMirror.prototype.toText=function(){ return this.getTruncatedValue(D); }; function SymbolMirror(v){ %_Call(ValueMirror,this,q.SYMBOL_TYPE,v); } inherits(SymbolMirror,ValueMirror); SymbolMirror.prototype.description=function(){ return %SymbolDescription(%_ValueOf(this.value_)); } SymbolMirror.prototype.toText=function(){ return %_Call(o,this.value_); } function ObjectMirror(v,H,I){ H=H||q.OBJECT_TYPE; %_Call(ValueMirror,this,H,v,I); } 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 K=%GetInterceptorInfo(this.value_); return(K&2)!=0; }; ObjectMirror.prototype.hasIndexedInterceptor=function(){ var K=%GetInterceptorInfo(this.value_); return(K&1)!=0; }; ObjectMirror.prototype.propertyNames=function(){ return %GetOwnPropertyKeys(this.value_,0); }; ObjectMirror.prototype.properties=function(){ var L=this.propertyNames(); var M=new d(L.length); for(var N=0;N'; }; ObjectMirror.GetInternalProperties=function(v){ var M=%DebugGetInternalProperties(v); var S=[]; for(var N=0;NZ)return new d(); var aa=new d(Z-Y+1); for(var N=Y;N<=Z;N++){ var P=%DebugGetPropertyDetails(this.value_,(%_ToString(N))); var v; if(P){ v=new PropertyMirror(this,N,P); }else{ v=GetUndefinedMirror(); } aa[N-Y]=v; } return aa; }; function DateMirror(v){ %_Call(ObjectMirror,this,v); } inherits(DateMirror,ObjectMirror); DateMirror.prototype.toText=function(){ var ab=f(this.value_); return ab.substring(1,ab.length-1); }; function RegExpMirror(v){ %_Call(ObjectMirror,this,v,q.REGEXP_TYPE); } 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(v){ %_Call(ObjectMirror,this,v,q.ERROR_TYPE); } inherits(ErrorMirror,ObjectMirror); ErrorMirror.prototype.message=function(){ return this.value_.message; }; ErrorMirror.prototype.toText=function(){ var ac; try{ ac=%_Call(c,this.value_); }catch(e){ ac='#'; } return ac; }; function PromiseMirror(v){ %_Call(ObjectMirror,this,v,q.PROMISE_TYPE); } inherits(PromiseMirror,ObjectMirror); function PromiseGetStatus_(v){ var ad=%DebugGetProperty(v,k); if(ad==0)return"pending"; if(ad==1)return"resolved"; return"rejected"; } function PromiseGetValue_(v){ return %DebugGetProperty(v,l); } PromiseMirror.prototype.status=function(){ return PromiseGetStatus_(this.value_); }; PromiseMirror.prototype.promiseValue=function(){ return MakeMirror(PromiseGetValue_(this.value_)); }; function MapMirror(v){ %_Call(ObjectMirror,this,v,q.MAP_TYPE); } inherits(MapMirror,ObjectMirror); MapMirror.prototype.entries=function(ae){ var S=[]; if((%_ClassOf(this.value_)==='WeakMap')){ var af=%GetWeakMapEntries(this.value_,ae||0); for(var N=0;N3){ this.exception_=P[3]; this.getter_=P[4]; this.setter_=P[5]; } } inherits(PropertyMirror,Mirror); PropertyMirror.prototype.isReadOnly=function(){ return(this.attributes()&F.ReadOnly)!=0; }; PropertyMirror.prototype.isEnum=function(){ return(this.attributes()&F.DontEnum)==0; }; PropertyMirror.prototype.canDelete=function(){ return(this.attributes()&F.DontDelete)==0; }; PropertyMirror.prototype.name=function(){ return this.name_; }; PropertyMirror.prototype.isIndexed=function(){ for(var N=0;N0; }; FrameDetails.prototype.inlinedFrameIndex=function(){ %CheckExecutionState(this.break_id_); var aC=aA; return(this.details_[at]&aC)>>2; }; FrameDetails.prototype.argumentCount=function(){ %CheckExecutionState(this.break_id_); return this.details_[ao]; }; FrameDetails.prototype.argumentName=function(V){ %CheckExecutionState(this.break_id_); if(V>=0&&V=0&&V=0&&V=0&&V0){ for(var N=0;N0){ S+=this.lineOffset(); S+='-'; S+=this.lineOffset()+this.lineCount()-1; }else{ S+=this.lineCount(); } S+=')'; return S; }; function ContextMirror(bg){ %_Call(Mirror,this,q.CONTEXT_TYPE); this.data_=bg; this.allocateHandle_(); } inherits(ContextMirror,Mirror); ContextMirror.prototype.data=function(){ return this.data_; }; function MakeMirrorSerializer(P,bh){ return new JSONProtocolSerializer(P,bh); } function JSONProtocolSerializer(P,bh){ this.details_=P; this.options_=bh; this.mirrors_=[]; } JSONProtocolSerializer.prototype.serializeReference=function(x){ return this.serialize_(x,true,true); }; JSONProtocolSerializer.prototype.serializeValue=function(x){ var bi=this.serialize_(x,false,true); return bi; }; JSONProtocolSerializer.prototype.serializeReferencedObjects=function(){ var bj=[]; var bk=this.mirrors_.length; for(var N=0;Nthis.maxStringLength_()){ var bm=x.getTruncatedValue(this.maxStringLength_()); bj.value=bm; bj.fromIndex=0; bj.toIndex=this.maxStringLength_(); }else{ bj.value=x.value(); } bj.length=x.length(); break; case q.SYMBOL_TYPE: bj.description=x.description(); break; case q.OBJECT_TYPE: case q.FUNCTION_TYPE: case q.ERROR_TYPE: case q.REGEXP_TYPE: case q.PROMISE_TYPE: case q.GENERATOR_TYPE: this.serializeObject_(x,bj,P); break; case q.PROPERTY_TYPE: case q.INTERNAL_PROPERTY_TYPE: throw g(2, 'PropertyMirror cannot be serialized independently'); break; case q.FRAME_TYPE: this.serializeFrame_(x,bj); break; case q.SCOPE_TYPE: this.serializeScope_(x,bj); break; case q.SCRIPT_TYPE: if(x.name()){ bj.name=x.name(); } bj.id=x.id(); bj.lineOffset=x.lineOffset(); bj.columnOffset=x.columnOffset(); bj.lineCount=x.lineCount(); if(x.data()){ bj.data=x.data(); } if(this.includeSource_()){ bj.source=x.source(); }else{ var bn=x.source().substring(0,80); bj.sourceStart=bn; } bj.sourceLength=x.source().length; bj.scriptType=x.scriptType(); bj.compilationType=x.compilationType(); if(x.compilationType()==1&& x.evalFromScript()){ bj.evalFromScript= this.serializeReference(x.evalFromScript()); var bo=x.evalFromLocation(); if(bo){ bj.evalFromLocation={line:bo.line, column:bo.column}; } if(x.evalFromFunctionName()){ bj.evalFromFunctionName=x.evalFromFunctionName(); } } if(x.context()){ bj.context=this.serializeReference(x.context()); } break; case q.CONTEXT_TYPE: bj.data=x.data(); break; } bj.text=x.toText(); return bj; }; JSONProtocolSerializer.prototype.serializeObject_=function(x,bj, P){ bj.className=x.className(); bj.constructorFunction= this.serializeReference(x.constructorFunction()); bj.protoObject=this.serializeReference(x.protoObject()); bj.prototypeObject=this.serializeReference(x.prototypeObject()); if(x.hasNamedInterceptor()){ bj.namedInterceptor=true; } if(x.hasIndexedInterceptor()){ bj.indexedInterceptor=true; } if(x.isFunction()){ bj.name=x.name(); if(!(x.inferredName()===(void 0))){ bj.inferredName=x.inferredName(); } bj.resolved=x.resolved(); if(x.resolved()){ bj.source=x.source(); } if(x.script()){ bj.script=this.serializeReference(x.script()); bj.scriptId=x.script().id(); serializeLocationFields(x.sourceLocation(),bj); } bj.scopes=[]; for(var N=0;N0){ var bs=[]; for(var N=0;N0){ return'Infinity'; }else{ return'-Infinity'; } } return v; } b.InstallFunctions(a,2,[ "MakeMirror",MakeMirror, "MakeMirrorSerializer",MakeMirrorSerializer, "LookupMirror",LookupMirror, "ToggleMirrorCache",ToggleMirrorCache, "MirrorCacheIsEmpty",MirrorCacheIsEmpty, ]); b.InstallConstants(a,[ "ScopeType",G, "PropertyType",E, "PropertyAttribute",F, "Mirror",Mirror, "ValueMirror",ValueMirror, "UndefinedMirror",UndefinedMirror, "NullMirror",NullMirror, "BooleanMirror",BooleanMirror, "NumberMirror",NumberMirror, "StringMirror",StringMirror, "SymbolMirror",SymbolMirror, "ObjectMirror",ObjectMirror, "FunctionMirror",FunctionMirror, "UnresolvedFunctionMirror",UnresolvedFunctionMirror, "ArrayMirror",ArrayMirror, "DateMirror",DateMirror, "RegExpMirror",RegExpMirror, "ErrorMirror",ErrorMirror, "PromiseMirror",PromiseMirror, "MapMirror",MapMirror, "SetMirror",SetMirror, "IteratorMirror",IteratorMirror, "GeneratorMirror",GeneratorMirror, "PropertyMirror",PropertyMirror, "InternalPropertyMirror",InternalPropertyMirror, "FrameMirror",FrameMirror, "ScriptMirror",ScriptMirror, "ScopeMirror",ScopeMirror, "FrameDetails",FrameDetails, ]); b.InstallFunctions(b,2,[ "ClearMirrorCache",ClearMirrorCache ]); b.Export(function(bA){ bA.MirrorType=q; }); }) debugNƒ (function(a,b){ "use strict"; var c=a.FrameMirror; var d=a.Array; var e=a.RegExp; var f=a.isNaN; var g=a.JSON.parse; var h=a.JSON.stringify; var i=a.LookupMirror; var j; var k; var l=a.MakeMirror; var m=a.MakeMirrorSerializer; var n=a.Math.min; var o=a.Mirror; var p; var q=a.parseInt; var r=a.ValueMirror; b.Import(function(s){ j=s.MakeError; k=s.MakeTypeError; p=s.MirrorType; }); var t=10; var u={}; var v=/^(?:\s*(?:\/\*.*?\*\/)*)*/; u.DebugEvent={Break:1, Exception:2, NewFunction:3, BeforeCompile:4, AfterCompile:5, CompileError:6, PromiseEvent:7, AsyncTaskEvent:8}; u.ExceptionBreak={Caught:0, Uncaught:1}; u.StepAction={StepOut:0, StepNext:1, StepIn:2, StepFrame:3}; u.ScriptType={Native:0, Extension:1, Normal:2}; u.ScriptCompilationType={Host:0, Eval:1, JSON:2}; u.ScriptBreakPointType={ScriptId:0, ScriptName:1, ScriptRegExp:2}; u.BreakPositionAlignment={ Statement:0, BreakPosition:1 }; function ScriptTypeFlag(w){ return(1<0){ this.ignoreCount_--; return false; } return true; }; function IsBreakPointTriggered(K,F){ return F.isTriggered(MakeExecutionState(K)); } function ScriptBreakPoint(w,script_id_or_name,opt_line,opt_column, opt_groupId,opt_position_alignment){ this.type_=w; if(w==u.ScriptBreakPointType.ScriptId){ this.script_id_=script_id_or_name; }else if(w==u.ScriptBreakPointType.ScriptName){ this.script_name_=script_id_or_name; }else if(w==u.ScriptBreakPointType.ScriptRegExp){ this.script_regexp_object_=new e(script_id_or_name); }else{ throw j(2,"Unexpected breakpoint type "+w); } this.line_=opt_line||0; this.column_=opt_column; this.groupId_=opt_groupId; this.position_alignment_=(opt_position_alignment===(void 0)) ?u.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(L){ var M=new ScriptBreakPoint(u.ScriptBreakPointType.ScriptId, L.id,this.line_,this.column_,this.groupId_, this.position_alignment_); M.number_=y++; A.push(M); M.hit_count_=this.hit_count_; M.active_=this.active_; M.condition_=this.condition_; M.ignoreCount_=this.ignoreCount_; return M; }; 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 N=[]; for(var O=0;O=this.frameCount()){ throw k(31); } return new c(this.break_id,aB); }; ExecutionState.prototype.setSelectedFrame=function(aC){ var O=(%_ToNumber(aC)); if(O<0||O>=this.frameCount()){ throw k(31); } this.selected_frame=O; }; ExecutionState.prototype.selectedFrame=function(){ return this.selected_frame; }; ExecutionState.prototype.debugCommandProcessor=function(aD){ return new DebugCommandProcessor(this,aD); }; function MakeBreakEvent(K,aE){ return new BreakEvent(K,aE); } function BreakEvent(K,aE){ this.frame_=new c(K,0); this.break_points_hit_=aE; } BreakEvent.prototype.eventType=function(){ return u.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 aF={seq:x++, type:"event", event:"break", body:{invocationText:this.frame_.invocationText()} }; var R=this.func().script(); if(R){ aF.body.sourceLine=this.sourceLine(), aF.body.sourceColumn=this.sourceColumn(), aF.body.sourceLineText=this.sourceLineText(), aF.body.script=MakeScriptObject_(R,false); } if(this.breakPointsHit()){ aF.body.breakpoints=[]; for(var O=0;O0){ aF.body.sourceLine=this.sourceLine(); aF.body.sourceColumn=this.sourceColumn(); aF.body.sourceLineText=this.sourceLineText(); var R=this.func().script(); if(R){ aF.body.script=MakeScriptObject_(R,false); } }else{ aF.body.sourceLine=-1; } return aF.toJSONProtocol(); }; function MakeCompileEvent(R,w){ return new CompileEvent(R,w); } function CompileEvent(R,w){ this.script_=l(R); this.type_=w; } CompileEvent.prototype.eventType=function(){ return this.type_; }; CompileEvent.prototype.script=function(){ return this.script_; }; CompileEvent.prototype.toJSONProtocol=function(){ var aF=new ProtocolMessage(); aF.running=true; switch(this.type_){ case u.DebugEvent.BeforeCompile: aF.event="beforeCompile"; break; case u.DebugEvent.AfterCompile: aF.event="afterCompile"; break; case u.DebugEvent.CompileError: aF.event="compileError"; break; } aF.body={}; aF.body.script=this.script_; return aF.toJSONProtocol(); }; function MakeScriptObject_(R,aL){ var aF={id:R.id(), name:R.name(), lineOffset:R.lineOffset(), columnOffset:R.columnOffset(), lineCount:R.lineCount(), }; if(!(R.data()===(void 0))){ aF.data=R.data(); } if(aL){ aF.source=R.source(); } return aF; } function MakePromiseEvent(aM){ return new PromiseEvent(aM); } function PromiseEvent(aM){ this.promise_=aM.promise; this.parentPromise_=aM.parentPromise; this.status_=aM.status; this.value_=aM.value; } PromiseEvent.prototype.promise=function(){ return l(this.promise_); } PromiseEvent.prototype.parentPromise=function(){ return l(this.parentPromise_); } PromiseEvent.prototype.status=function(){ return this.status_; } PromiseEvent.prototype.value=function(){ return l(this.value_); } function MakeAsyncTaskEvent(aM){ return new AsyncTaskEvent(aM); } function AsyncTaskEvent(aM){ this.type_=aM.type; this.name_=aM.name; this.id_=aM.id; } AsyncTaskEvent.prototype.type=function(){ return this.type_; } AsyncTaskEvent.prototype.name=function(){ return this.name_; } AsyncTaskEvent.prototype.id=function(){ return this.id_; } function DebugCommandProcessor(I,aD){ this.exec_state_=I; this.running_=aD||false; } DebugCommandProcessor.prototype.processDebugRequest=function(aN){ return this.processDebugJSONRequest(aN); }; function ProtocolMessage(aN){ this.seq=x++; if(aN){ this.type='response'; this.request_seq=aN.seq; this.command=aN.command; }else{ this.type='event'; } this.success=true; this.running=(void 0); } ProtocolMessage.prototype.setOption=function(aO,C){ if(!this.options_){ this.options_={}; } this.options_[aO]=C; }; ProtocolMessage.prototype.failed=function(aP,aQ){ this.success=false; this.message=aP; if((typeof(aQ)==='object')){ this.error_details=aQ; } }; ProtocolMessage.prototype.toJSONProtocol=function(){ var aR={}; aR.seq=this.seq; if(this.request_seq){ aR.request_seq=this.request_seq; } aR.type=this.type; if(this.event){ aR.event=this.event; } if(this.command){ aR.command=this.command; } if(this.success){ aR.success=this.success; }else{ aR.success=false; } if(this.body){ var aS; var aT=m(true,this.options_); if(this.body instanceof o){ aS=aT.serializeValue(this.body); }else if(this.body instanceof d){ aS=[]; for(var O=0;O=this.exec_state_.frameCount()){ return aU.failed('Invalid frame "'+bs+'"'); } aU.body=this.exec_state_.frame(bJ).evaluate( bD,(!!(bE)),bG); return; }else{ aU.body=this.exec_state_.frame().evaluate( bD,(!!(bE)),bG); return; } }; DebugCommandProcessor.prototype.lookupRequest_=function(aN,aU){ if(!aN.arguments){ return aU.failed('Missing arguments'); } var bK=aN.arguments.handles; if((bK===(void 0))){ return aU.failed('Argument "handles" missing'); } if(!(aN.arguments.includeSource===(void 0))){ var bL=(!!(aN.arguments.includeSource)); aU.setOption('includeSource',bL); } var bM={}; for(var O=0;O=this.exec_state_.frameCount()){ return aU.failed('Invalid frame "'+bs+'"'); } bs=this.exec_state_.frame(bJ); } } var R=bs.func().script(); if(!R){ return aU.failed('No source'); } var bP=R.sourceSlice(bN,bO); if(!bP){ return aU.failed('Invalid line interval'); } aU.body={}; aU.body.source=bP.sourceText(); aU.body.fromLine=bP.from_line; aU.body.toLine=bP.to_line; aU.body.fromPosition=bP.from_position; aU.body.toPosition=bP.to_position; aU.body.totalLines=R.lineCount(); }; DebugCommandProcessor.prototype.scriptsRequest_=function(aN,aU){ var bQ=ScriptTypeFlag(u.ScriptType.Normal); var bL=false; var bR=null; if(aN.arguments){ if(!(aN.arguments.types===(void 0))){ bQ=(%_ToNumber(aN.arguments.types)); if(f(bQ)||bQ<0){ return aU.failed('Invalid types "'+ aN.arguments.types+'"'); } } if(!(aN.arguments.includeSource===(void 0))){ bL=(!!(aN.arguments.includeSource)); aU.setOption('includeSource',bL); } if((%_IsArray(aN.arguments.ids))){ bR={}; var bS=aN.arguments.ids; for(var O=0;O=0){ bW=true; } } if(!bW)continue; } if(bQ&ScriptTypeFlag(ae[O].type)){ aU.body.push(l(ae[O])); } } }; DebugCommandProcessor.prototype.threadsRequest_=function(aN,aU){ var bX=this.exec_state_.threadCount(); var bY=[]; for(var O=0;O=this.exec_state_.frameCount()){ return aU.failed('Invalid frame "'+bs+'"'); } ch=this.exec_state_.frame(bJ); }else{ ch=this.exec_state_.frame(); } var cg=u.LiveEdit.RestartFrame(ch); aU.body={result:cg}; }; DebugCommandProcessor.prototype.debuggerFlagsRequest_=function(aN, aU){ if(!aN.arguments){ aU.failed('Missing arguments'); return; } var ci=aN.arguments.flags; aU.body={flags:[]}; if(!(ci===(void 0))){ for(var O=0;OP[E].start_position){ R=E; } } if(R!=x){ var S=P[R]; var T=Q[R]; P[R]=P[x]; Q[R]=Q[x]; P[x]=S; Q[x]=T; } } var U=0; function ResetIndexes(V,W){ var X=-1; while(U=aK.pos1+aK.len1){ return aE+aK.pos2+aK.len2-aK.pos1-aK.len1; } if(!aF){ aF=PosTranslator.DefaultInsideChunkHandler; } return aF(aE,aK); }; PosTranslator.DefaultInsideChunkHandler=function(aE,aL){ Assert(false,"Cannot translate position in changed area"); }; PosTranslator.ShiftWithTopInsideChunkHandler= function(aE,aL){ return aE-aL.pos1+aL.pos2; }; var i={ UNCHANGED:"unchanged", SOURCE_CHANGED:"source changed", CHANGED:"changed", DAMAGED:"damaged" }; function CodeInfoTreeNode(aM,aN,aO){ this.info=aM; this.children=aN; this.array_index=aO; this.parent=(void 0); this.status=i.UNCHANGED; this.status_explanation=(void 0); this.new_start_pos=(void 0); this.new_end_pos=(void 0); this.corresponding_node=(void 0); this.unmatched_new_nodes=(void 0); this.textual_corresponding_node=(void 0); this.textually_unmatched_new_nodes=(void 0); this.live_shared_function_infos=(void 0); } function BuildCodeInfoTree(aP){ var aQ=0; function BuildNode(){ var aR=aQ; aQ++; var aS=new e(); while(aQ=ay.length;}; this.TranslatePos=function(aE){return aE+aX;}; }; function ProcessInternals(aY){ aY.new_start_pos=aV.TranslatePos( aY.info.start_position); var aZ=0; var ba=false; var bb=false; while(!aV.done()&& aV.current().pos1= aV.current().pos1+aV.current().len1){ ba=true; aV.next(); continue; }else if(bc.info.start_position<=aV.current().pos1&& bc.info.end_position>=aV.current().pos1+ aV.current().len1){ ProcessInternals(bc); bb=bb|| (bc.status!=i.UNCHANGED); ba=ba|| (bc.status==i.DAMAGED); aZ++; continue; }else{ ba=true; bc.status=i.DAMAGED; bc.status_explanation= "Text diff overlaps with function boundary"; aZ++; continue; } }else{ if(aV.current().pos1+aV.current().len1<= aY.info.end_position){ aY.status=i.CHANGED; aV.next(); continue; }else{ aY.status=i.DAMAGED; aY.status_explanation= "Text diff overlaps with function boundary"; return; } } Assert("Unreachable",false); } while(aZ0){ return bp; } } function TraverseTree(w){ w.live_shared_function_infos=FindFunctionInfos(w.info); for(var x=0;x ["+bx+"]"; } return; } var by; function CheckStackActivations(old_shared_wrapper_list, new_shared_list, Z){ var bz=new e(); for(var x=0;x0){ Z.push({dropped_from_stack:bC}); } if(bB.length>0){ Z.push({functions_on_stack:bB}); throw new Failure("Blocked by functions on stack"); } return bC.length; } var by={ 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, BLOCKED_NO_NEW_TARGET_ON_RESTART:8 }; by.SymbolName=function(bF){ var bG=by; for(var bH in bG){ if(bG[bH]==bF){ return bH; } } }; function Failure(as){ this.message=as; } Failure.prototype.toString=function(){ return"LiveEdit Failure: "+this.message; }; function CopyErrorPositionToDetails(bI,p){ function createPositionStruct(N,bJ){ if(bJ==-1)return; var bK=N.locationFromPosition(bJ,true); if(bK==null)return; return{ line:bK.line+1, column:bK.column+1, position:bJ }; } if(!("scriptObject"in bI)||!("startPosition"in bI)){ return; } var N=bI.scriptObject; var bL={ start:createPositionStruct(N,bI.startPosition), end:createPositionStruct(N,bI.endPosition) }; p.position=bL; } function GetPcFromSourcePos(bM,bN){ return %GetFunctionCodePositionFromSource(bM,bN); } function SetScriptSource(N,bO,bP,Z){ var j=N.source; var bQ=CompareStrings(j,bO); return ApplyPatchMultiChunk(N,bQ,bO,bP, Z); } function CompareStrings(bR,bS){ return %LiveEditCompareStrings(bR,bS); } function ApplySingleChunkPatch(N,change_pos,change_len,new_str, Z){ var j=N.source; var bO=j.substring(0,change_pos)+ new_str+j.substring(change_pos+change_len); return ApplyPatchMultiChunk(N, [change_pos,change_pos+change_len,change_pos+new_str.length], bO,false,Z); } function DescribeChangeTree(bd){ function ProcessOldNode(w){ var bT=[]; for(var x=0;x>1); var m=2|4|1; for(var n=0;n>1); for(var n=0;n>1)+(fields?fields.length:0); if(u>=4){ %OptimizeObjectForAddingMultipleProperties(t,u); } if(fields){ for(var n=0;n>>0)&&o!==4294967295){ %AddElement(q,o,r); }else{ %AddNamedProperty(q,(%_ToString(o)),r,0); } } %SetForceInlineFlag(AddIndexedProperty); function ToPositiveInteger(l,s){ var t=(%_IsSmi(%IS_VAR(l))?l:%NumberToIntegerMapMinusZero(l)); if(t<0)throw g(s); return t; } function MaxSimple(u,v){ return u>v?u:v; } function MinSimple(u,v){ return u>v?v:u; } %SetForceInlineFlag(MaxSimple); %SetForceInlineFlag(MinSimple); function SpeciesConstructor(w,x,y){ if(c){ var z=w.constructor; if((z===(void 0))){ return x; } if(!(%_IsJSReceiver(z))){ throw h(27); } var A=z[i]; if((A==null)){ return x; } if(%IsConstructor(A)){ return A; } throw h(235); }else{ return y?x:w.constructor; } } %FunctionSetPrototype(d,new d(0)); b.Export(function(B){ B.AddIndexedProperty=AddIndexedProperty; B.MaxSimple=MaxSimple; B.MinSimple=MinSimple; B.SameValue=SameValue; B.SameValueZero=SameValueZero; B.ToPositiveInteger=ToPositiveInteger; B.SpeciesConstructor=SpeciesConstructor; }); %InstallToContext([ "concat_iterable_to_array_builtin",CONCAT_ITERABLE_TO_ARRAY, ]); %InstallToContext([ "concat_iterable_to_array",ConcatIterableToArray, ]); }) $v8nativesÚ# (function(a,b){ %CheckIsBootstrapping(); var c=a.Array; var d=a.Boolean; var e=a.Number; var f=a.Object; var g=b.InternalArray; var h=b.ImportNow("iterator_symbol"); var i; var j; var k; var l; var m=%GetRootNaN(); var n=b.ImportNow("object_to_string"); var o; var p; var q; var r=b.ImportNow("SameValue"); var s=b.ImportNow("to_string_tag_symbol"); b.Import(function(t){ i=t.MakeRangeError; j=t.MakeSyntaxError; k=t.MakeTypeError; l=t.MathAbs; o=t.ObserveBeginPerformSplice; p=t.ObserveEndPerformSplice; q=t.ObserveEnqueueSpliceRecord; }); function GlobalIsNaN(u){ u=(%_ToNumber(u)); return(!%_IsSmi(%IS_VAR(u))&&!(u==u)); } function GlobalIsFinite(u){ u=(%_ToNumber(u)); return(%_IsSmi(%IS_VAR(u))||((u==u)&&(u!=1/0)&&(u!=-1/0))); } function GlobalParseInt(v,w){ if((w===(void 0))||w===10||w===0){ if(%_IsSmi(v))return v; if((typeof(v)==='number')&& ((0.01>>0); var ai=false; if((%_ToString(ah))==U&&ah!=4294967295){ var aj=H.length; if(ah>=aj&&%IsObserved(H)){ ai=true; o(H); } var ak=GetOwnPropertyJS(H,"length"); if((ah>=aj&&!ak.isWritable())|| !DefineObjectProperty(H,U,G,true)){ if(ai) p(H); if(Y){ throw k(34,U); }else{ return false; } } if(ah>=aj){ H.length=ah+1; } if(ai){ p(H); q(H,aj,[],ah+1-aj); } return true; } } return DefineObjectProperty(H,U,G,Y); } function DefineOwnProperty(H,U,G,Y){ if((%_IsJSProxy(H))){ if((typeof(U)==='symbol'))return false; var x=FromGenericPropertyDescriptor(G); return DefineProxyProperty(H,U,x,Y); }else if((%_IsArray(H))){ return DefineArrayProperty(H,U,G,Y); }else{ return DefineObjectProperty(H,U,G,Y); } } function ObjectGetPrototypeOf(H){ return %_GetPrototype((%_ToObject(H))); } function ObjectSetPrototypeOf(H,al){ if((%IS_VAR(H)===null)||(H===(void 0)))throw k(17,"Object.setPrototypeOf"); if(al!==null&&!(%_IsJSReceiver(al))){ throw k(92,al); } if((%_IsJSReceiver(H))){ %SetPrototype(H,al); } return H; } function ObjectGetOwnPropertyDescriptor(H,U){ return %GetOwnProperty(H,U); } function ObjectGetOwnPropertyNames(H){ H=(%_ToObject(H)); return %GetOwnPropertyKeys(H,16); } function ObjectDefineProperty(H,U,x){ if(%IsObserved(H)){ if(!(%_IsJSReceiver(H))){ throw k(16,"Object.defineProperty"); } var z=(%_ToName(U)); var G=ToPropertyDescriptor(x); DefineOwnProperty(H,z,G,true); return H; } return %ObjectDefineProperty(H,U,x); } function GetOwnEnumerablePropertyNames(A){ return %GetOwnPropertyKeys(A,2); } function ObjectDefineProperties(H,am){ if(%IsObserved(H)){ if(!(%_IsJSReceiver(H))){ throw k(16,"Object.defineProperties"); } var W=(%_ToObject(am)); var an=GetOwnEnumerablePropertyNames(W); var ao=new g(); for(var ap=0;ap36)throw i(189); return %NumberToRadixString(u,w); } function NumberToLocaleString(){ return %_Call(NumberToStringJS,this); } function NumberValueOf(){ if(!(typeof(this)==='number')&&!(%_ClassOf(this)==='Number')){ throw k(65,'Number.prototype.valueOf'); } return %_ValueOf(this); } function NumberToFixedJS(ar){ var R=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw k(42, "Number.prototype.toFixed",this); } R=%_ValueOf(this); } var as=(%_ToInteger(ar)); if(as<0||as>20){ throw i(185,"toFixed() digits"); } if((!%_IsSmi(%IS_VAR(R))&&!(R==R)))return"NaN"; if(R==(1/0))return"Infinity"; if(R==-(1/0))return"-Infinity"; return %NumberToFixed(R,as); } function NumberToExponentialJS(ar){ var R=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw k(42, "Number.prototype.toExponential",this); } R=%_ValueOf(this); } var as=(ar===(void 0))?(void 0):(%_ToInteger(ar)); if((!%_IsSmi(%IS_VAR(R))&&!(R==R)))return"NaN"; if(R==(1/0))return"Infinity"; if(R==-(1/0))return"-Infinity"; if((as===(void 0))){ as=-1; }else if(as<0||as>20){ throw i(185,"toExponential()"); } return %NumberToExponential(R,as); } function NumberToPrecisionJS(at){ var R=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw k(42, "Number.prototype.toPrecision",this); } R=%_ValueOf(this); } if((at===(void 0)))return(%_ToString(R)); var U=(%_ToInteger(at)); if((!%_IsSmi(%IS_VAR(R))&&!(R==R)))return"NaN"; if(R==(1/0))return"Infinity"; if(R==-(1/0))return"-Infinity"; if(U<1||U>21){ throw i(188); } return %NumberToPrecision(R,U); } function NumberIsFinite(u){ return(typeof(u)==='number')&&(%_IsSmi(%IS_VAR(u))||((u==u)&&(u!=1/0)&&(u!=-1/0))); } function NumberIsInteger(u){ return NumberIsFinite(u)&&(%_ToInteger(u))==u; } function NumberIsNaN(u){ return(typeof(u)==='number')&&(!%_IsSmi(%IS_VAR(u))&&!(u==u)); } function NumberIsSafeInteger(u){ if(NumberIsFinite(u)){ var au=(%_ToInteger(u)); if(au==u){ return l(au)<=9007199254740991; } } return false; } %FunctionSetPrototype(e,new e(0)); %OptimizeObjectForAddingMultipleProperties(e.prototype,8); %AddNamedProperty(e.prototype,"constructor",e, 2); b.InstallConstants(e,[ "MAX_VALUE",1.7976931348623157e+308, "MIN_VALUE",5e-324, "NaN",m, "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(e.prototype,2,[ "toString",NumberToStringJS, "toLocaleString",NumberToLocaleString, "valueOf",NumberValueOf, "toFixed",NumberToFixedJS, "toExponential",NumberToExponentialJS, "toPrecision",NumberToPrecisionJS ]); b.InstallFunctions(e,2,[ "isFinite",NumberIsFinite, "isInteger",NumberIsInteger, "isNaN",NumberIsNaN, "isSafeInteger",NumberIsSafeInteger, "parseInt",GlobalParseInt, "parseFloat",GlobalParseFloat ]); %SetForceInlineFlag(NumberIsNaN); function GetIterator(H,av){ if((av===(void 0))){ av=H[h]; } if(!(typeof(av)==='function')){ throw k(66,H); } var aw=%_Call(av,H); if(!(%_IsJSReceiver(aw))){ throw k(60,aw); } return aw; } b.Export(function(ax){ ax.GetIterator=GetIterator; ax.GetMethod=GetMethod; ax.IsFinite=GlobalIsFinite; ax.IsNaN=GlobalIsNaN; ax.NumberIsNaN=NumberIsNaN; ax.ObjectDefineProperties=ObjectDefineProperties; ax.ObjectDefineProperty=ObjectDefineProperty; ax.ObjectHasOwnProperty=ObjectHasOwnProperty; }); %InstallToContext([ "object_value_of",ObjectValueOf, ]); }) symbol9 (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Object; var d=a.Symbol; var e=b.ImportNow("has_instance_symbol"); var f= b.ImportNow("is_concat_spreadable_symbol"); var g=b.ImportNow("iterator_symbol"); var h; var i=b.ImportNow("to_primitive_symbol"); var j=b.ImportNow("to_string_tag_symbol"); var k=b.ImportNow("unscopables_symbol"); b.Import(function(l){ h=l.MakeTypeError; }); function SymbolToPrimitive(m){ if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ throw h(42, "Symbol.prototype [ @@toPrimitive ]",this); } return %_ValueOf(this); } function SymbolToString(){ if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ throw h(42, "Symbol.prototype.toString",this); } return %SymbolDescriptiveString(%_ValueOf(this)); } function SymbolValueOf(){ if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ throw h(42, "Symbol.prototype.valueOf",this); } return %_ValueOf(this); } function SymbolFor(n){ n=(%_ToString(n)); var o=%SymbolRegistry(); if((o.for[n]===(void 0))){ var p=%CreateSymbol(n); o.for[n]=p; o.keyFor[p]=n; } return o.for[n]; } function SymbolKeyFor(p){ if(!(typeof(p)==='symbol'))throw h(148,p); return %SymbolRegistry().keyFor[p]; } function ObjectGetOwnPropertySymbols(q){ q=(%_ToObject(q)); return %GetOwnPropertyKeys(q,8); } %FunctionSetPrototype(d,new c()); b.InstallConstants(d,[ "iterator",g, "toPrimitive",i, "unscopables",k, ]); b.InstallFunctions(d,2,[ "for",SymbolFor, "keyFor",SymbolKeyFor ]); %AddNamedProperty( d.prototype,"constructor",d,2); %AddNamedProperty( d.prototype,j,"Symbol",2|1); b.InstallFunctions(d.prototype,2|1,[ i,SymbolToPrimitive ]); b.InstallFunctions(d.prototype,2,[ "toString",SymbolToString, "valueOf",SymbolValueOf ]); b.InstallFunctions(c,2,[ "getOwnPropertySymbols",ObjectGetOwnPropertySymbols ]); b.Export(function(r){ r.SymbolToString=SymbolToString; }) }) array¦± (function(a,b,c){ "use strict"; %CheckIsBootstrapping(); var d; var e; var f; var g; var h; var i=a.Array; var j=b.InternalArray; var k=b.InternalPackedArray; var l; var m; var n; var o; var p; var q=b.ImportNow("object_to_string"); var r; var s; var t; var u; var v=b.ImportNow("iterator_symbol"); var w=b.ImportNow("unscopables_symbol"); b.Import(function(x){ d=x.AddIndexedProperty; g=x.GetIterator; h=x.GetMethod; l=x.MakeTypeError; m=x.MaxSimple; n=x.MinSimple; o=x.ObjectDefineProperty; p=x.ObjectHasOwnProperty; r=x.ObserveBeginPerformSplice; s=x.ObserveEndPerformSplice; t=x.ObserveEnqueueSpliceRecord; u=x.SameValueZero; }); b.ImportFromExperimental(function(x){ e=x.FLAG_harmony_tolength; f=x.FLAG_harmony_species; }); function ArraySpeciesCreate(y,z){ var A; if(f){ A=%ArraySpeciesConstructor(y); }else{ A=i; } return new A(z); } function DefineIndexedProperty(y,B,C){ if(f){ var D=o(y,B,{ value:C,writable:true,configurable:true,enumerable:true }); if(!D)throw l(137,B); }else{ d(y,B,C); } } var E=new j(); function GetSortedArrayKeys(y,F){ var G=new j(); if((typeof(F)==='number')){ var H=F; for(var B=0;B>2; var Z=%EstimateNumberOfElements(y); return(ZZ*4); } function Join(y,z,P,O){ if(z==0)return''; var W=(%_IsArray(y)); if(W){ if(!%PushIfAbsent(E,y))return''; } try{ if(UseSparseVariant(y,z,W,z)){ %NormalizeElements(y); if(P.length==0){ return SparseJoin(y,z,O); }else{ return SparseJoinWithSeparatorJS(y,z,O,P); } } if(z==1){ var I=y[0]; if((typeof(I)==='string'))return I; return O(I); } var R=new j(z); if(P.length==0){ var V=0; for(var B=0;B=ab){ var ae=y[K]; if(!(ae===(void 0))||K in y){ DefineIndexedProperty(ad,K-ab,ae); } } } } } } function SparseMove(y,ab,ac,N,af){ if(af===ac)return; var ag=new j( n(N-ac+af,0xffffffff)); var ah; var F=%GetArrayKeys(y,N); if((typeof(F)==='number')){ var H=F; for(var B=0;B=ab+ac){ var ae=y[K]; if(!(ae===(void 0))||K in y){ var ai=K-ac+af; ag[ai]=ae; if(ai>0xfffffffe){ ah=ah||new j(); ah.push(ai); } } } } } } %MoveArrayContents(ag,y); if(!(ah===(void 0))){ var z=ah.length; for(var B=0;Bac){ for(var B=N-ac;B>ab;B--){ var ak=B+ac-1; var al=B+af-1; if(((W&&%_HasFastPackedElements(%IS_VAR(y)))?(akN-ac+af;B--){ delete y[B-1]; } } } } function ArrayToString(){ var y; var am; if((%_IsArray(this))){ am=this.join; if(am===ArrayJoin){ return Join(this,this.length,',',ConvertToString); } y=this; }else{ y=(%_ToObject(this)); am=y.join; } if(!(typeof(am)==='function')){ return %_Call(q,y); } return %_Call(am,y); } function InnerArrayToLocaleString(y,z){ var N=(e?(%_ToLength(z)):((z)>>>0)); if(N===0)return""; return Join(y,N,',',ConvertToLocaleString); } function ArrayToLocaleString(){ var y=(%_ToObject(this)); var an=y.length; return InnerArrayToLocaleString(y,an); } function InnerArrayJoin(P,y,z){ if((P===(void 0))){ P=','; }else{ P=(%_ToString(P)); } var D=%_FastOneByteArrayJoin(y,P); if(!(D===(void 0)))return D; if(z===1){ var I=y[0]; if((I==null))return''; return(%_ToString(I)); } return Join(y,z,P,ConvertToString); } function ArrayJoin(P){ if((%IS_VAR(this)===null)||(this===(void 0)))throw l(17,"Array.prototype.join"); var y=(%_ToObject(this)); var z=(e?(%_ToLength(y.length)):((y.length)>>>0)); return InnerArrayJoin(P,y,z); } function ObservedArrayPop(ao){ ao--; var C=this[ao]; try{ r(this); delete this[ao]; this.length=ao; }finally{ s(this); t(this,ao,[C],0); } return C; } function ArrayPop(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw l(17,"Array.prototype.pop"); var y=(%_ToObject(this)); var ao=(e?(%_ToLength(y.length)):((y.length)>>>0)); if(ao==0){ y.length=ao; return; } if(%IsObserved(y)) return ObservedArrayPop.call(y,ao); ao--; var C=y[ao]; %DeleteProperty_Strict(y,ao); y.length=ao; return C; } function ObservedArrayPush(){ var ao=(e?(%_ToLength(this.length)):((this.length)>>>0)); var ap=%_ArgumentsLength(); try{ r(this); for(var B=0;B>>0)); var ap=%_ArgumentsLength(); if(ap>(1<<30)||(ao-(1<<30))+ap>9007199254740991-(1<<30)){ throw l(228,ap,ao); } for(var B=0;B=B){ av=B; while(G[++as]==B){} aw=N-B-1; } var ax=y[av]; if(!(ax===(void 0))||av in y){ var ay=y[aw]; if(!(ay===(void 0))||aw in y){ y[av]=ay; y[aw]=ax; }else{ y[aw]=ax; delete y[av]; } }else{ var ay=y[aw]; if(!(ay===(void 0))||aw in y){ y[av]=ay; delete y[aw]; } } } } function PackedArrayReverse(y,N){ var at=N-1; for(var B=0;B>>0)); var az=(%_IsArray(y)); if(UseSparseVariant(y,N,az,N)){ %NormalizeElements(y); SparseReverse(y,N); return y; }else if(az&&%_HasFastPackedElements(y)){ return PackedArrayReverse(y,N); }else{ return GenericArrayReverse(y,N); } } function ObservedArrayShift(N){ var aA=this[0]; try{ r(this); SimpleMove(this,0,1,N,0); this.length=N-1; }finally{ s(this); t(this,0,[aA],0); } return aA; } function ArrayShift(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw l(17,"Array.prototype.shift"); var y=(%_ToObject(this)); var N=(e?(%_ToLength(y.length)):((y.length)>>>0)); if(N===0){ y.length=0; return; } if(%object_is_sealed(y))throw l(13); if(%IsObserved(y)) return ObservedArrayShift.call(y,N); var aA=y[0]; if(UseSparseVariant(y,N,(%_IsArray(y)),N)){ SparseMove(y,0,1,N,0); }else{ SimpleMove(y,0,1,N,0); } y.length=N-1; return aA; } function ObservedArrayUnshift(){ var N=(e?(%_ToLength(this.length)):((this.length)>>>0)); var aB=%_ArgumentsLength(); try{ r(this); SimpleMove(this,0,0,N,aB); for(var B=0;B>>0)); var aB=%_ArgumentsLength(); if(N>0&&UseSparseVariant(y,N,(%_IsArray(y)),N)&& !%object_is_sealed(y)){ SparseMove(y,0,0,N,aB); }else{ SimpleMove(y,0,0,N,aB); } for(var B=0;B>>0)); var ab=(%_ToInteger(aD)); var aF=N; if(!(aE===(void 0)))aF=(%_ToInteger(aE)); if(ab<0){ ab+=N; if(ab<0)ab=0; }else{ if(ab>N)ab=N; } if(aF<0){ aF+=N; if(aF<0)aF=0; }else{ if(aF>N)aF=N; } var D=ArraySpeciesCreate(y,m(aF-ab,0)); if(aFN?N:ab; } function ComputeSpliceDeleteCount(aG,aB,N,ab){ var ac=0; if(aB==1) return N-ab; ac=(%_ToInteger(aG)); if(ac<0) return 0; if(ac>N-ab) return N-ab; return ac; } function ObservedArraySplice(aD,aG){ var aB=%_ArgumentsLength(); var N=(e?(%_ToLength(this.length)):((this.length)>>>0)); var ab=ComputeSpliceStartIndex((%_ToInteger(aD)),N); var ac=ComputeSpliceDeleteCount(aG,aB,N, ab); var ad=[]; ad.length=ac; var aH=aB>2?aB-2:0; try{ r(this); SimpleSlice(this,ab,ac,N,ad); SimpleMove(this,ab,ac,N,aH); var B=ab; var aI=2; var aJ=%_ArgumentsLength(); while(aI>>0)); var ab=ComputeSpliceStartIndex((%_ToInteger(aD)),N); var ac=ComputeSpliceDeleteCount(aG,aB,N, ab); var ad=ArraySpeciesCreate(y,ac); ad.length=ac; var aH=aB>2?aB-2:0; if(ac!=aH&&%object_is_sealed(y)){ throw l(13); }else if(ac>0&&%object_is_frozen(y)){ throw l(12); } var aK=ac; if(aH!=ac){ aK+=N-ab-ac; } if(UseSparseVariant(y,N,(%_IsArray(y)),aK)){ %NormalizeElements(y); %NormalizeElements(ad); SparseSlice(y,ab,ac,N,ad); SparseMove(y,ab,ac,N,aH); }else{ SimpleSlice(y,ab,ac,N,ad); SimpleMove(y,ab,ac,N,aH); } var B=ab; var aI=2; var aJ=%_ArgumentsLength(); while(aI=x;at--){ var aQ=L[at]; var aR=aL(aQ,aP); if(aR>0){ L[at+1]=aQ; }else{ break; } } L[at+1]=aP; } }; var aS=function(L,x,aO){ var aT=new j(); var aU=200+((aO-x)&15); var at=0; x+=1; aO-=1; for(var B=x;B>1][0]; return aV; } var aW=function QuickSort(L,x,aO){ var aV=0; while(true){ if(aO-x<=10){ aN(L,x,aO); return; } if(aO-x>1000){ aV=aS(L,x,aO); }else{ aV=x+((aO-x)>>1); } var aX=L[x]; var aY=L[aO-1]; var aZ=L[aV]; var ba=aL(aX,aY); if(ba>0){ var aQ=aX; aX=aY; aY=aQ; } var bb=aL(aX,aZ); if(bb>=0){ var aQ=aX; aX=aZ; aZ=aY; aY=aQ; }else{ var bc=aL(aY,aZ); if(bc>0){ var aQ=aY; aY=aZ; aZ=aQ; } } L[x]=aX; L[aO-1]=aZ; var bd=aY; var be=x+1; var bf=aO-1; L[aV]=L[be]; L[be]=bd; partition:for(var B=be+1;B0){ do{ bf--; if(bf==B)break partition; var bg=L[bf]; aR=aL(bg,bd); }while(aR>0); L[B]=L[bf]; L[bf]=aP; if(aR<0){ aP=L[B]; L[B]=L[be]; L[be]=aP; be++; } } } if(aO-bf=bj){bj=B+1;} } } }else{ for(var B=0;B=bj){bj=aj+1;} } } } } return bj; }; var bm=function(bi,x,aO){ for(var bk=%_GetPrototype(bi);bk;bk=%_GetPrototype(bk)){ var F=%GetArrayKeys(bk,aO); if((typeof(F)==='number')){ var bl=F; for(var B=x;B>>0)); return InnerArraySort(y,z,aL); } function InnerArrayFilter(bt,bu,y,z,D){ var bv=0; var W=(%_IsArray(y)); for(var B=0;B>>0)); if(!(typeof(bt)==='function'))throw l(15,bt); var D=ArraySpeciesCreate(y,0); return InnerArrayFilter(bt,bu,y,z,D); } function InnerArrayForEach(bt,bu,y,z){ if(!(typeof(bt)==='function'))throw l(15,bt); var W=(%_IsArray(y)); for(var B=0;B>>0)); InnerArrayForEach(bt,bu,y,z); } function InnerArraySome(bt,bu,y,z){ if(!(typeof(bt)==='function'))throw l(15,bt); var W=(%_IsArray(y)); for(var B=0;B>>0)); return InnerArraySome(bt,bu,y,z); } function InnerArrayEvery(bt,bu,y,z){ if(!(typeof(bt)==='function'))throw l(15,bt); var W=(%_IsArray(y)); for(var B=0;B>>0)); return InnerArrayEvery(bt,bu,y,z); } function ArrayMap(bt,bu){ if((%IS_VAR(this)===null)||(this===(void 0)))throw l(17,"Array.prototype.map"); var y=(%_ToObject(this)); var z=(e?(%_ToLength(y.length)):((y.length)>>>0)); if(!(typeof(bt)==='function'))throw l(15,bt); var D=ArraySpeciesCreate(y,z); var W=(%_IsArray(y)); for(var B=0;B>>0)); return InnerArrayIndexOf(this,aP,aj,z); } function InnerArrayLastIndexOf(y,aP,aj,z,by){ if(z==0)return-1; if(by<2){ aj=z-1; }else{ aj=(%_ToInteger(aj)); if(aj<0)aj+=z; if(aj<0)return-1; else if(aj>=z)aj=z-1; } var bw=0; var bj=aj; if(UseSparseVariant(y,z,(%_IsArray(y)),aj)){ %NormalizeElements(y); var F=%GetArrayKeys(y,aj+1); if((typeof(F)==='number')){ bj=F; }else{ if(F.length==0)return-1; var bx=GetSortedArrayKeys(y,F); var B=bx.length-1; while(B>=0){ var K=bx[B]; if(!(K===(void 0))&&y[K]===aP)return K; B--; } return-1; } } if(!(aP===(void 0))){ for(var B=bj;B>=bw;B--){ if(y[B]===aP)return B; } return-1; } for(var B=bj;B>=bw;B--){ if((y[B]===(void 0))&&B in y){ return B; } } return-1; } function ArrayLastIndexOf(aP,aj){ if((%IS_VAR(this)===null)||(this===(void 0)))throw l(17,"Array.prototype.lastIndexOf"); var z=(e?(%_ToLength(this.length)):((this.length)>>>0)); return InnerArrayLastIndexOf(this,aP,aj,z, %_ArgumentsLength()); } function InnerArrayReduce(bz,ae,y,z,by){ if(!(typeof(bz)==='function')){ throw l(15,bz); } var W=(%_IsArray(y)); var B=0; find_initial:if(by<2){ for(;B>>0)); return InnerArrayReduce(bz,ae,y,z, %_ArgumentsLength()); } function InnerArrayReduceRight(bz,ae,y,z, by){ if(!(typeof(bz)==='function')){ throw l(15,bz); } var W=(%_IsArray(y)); var B=z-1; find_initial:if(by<2){ for(;B>=0;B--){ if(((W&&%_HasFastPackedElements(%IS_VAR(y)))?(B=0;B--){ if(((W&&%_HasFastPackedElements(%IS_VAR(y)))?(B>>0)); return InnerArrayReduceRight(bz,ae,y,z, %_ArgumentsLength()); } function InnerArrayCopyWithin(bA,aD,aE,y,z){ bA=(%_ToInteger(bA)); var aO; if(bA<0){ aO=m(z+bA,0); }else{ aO=n(bA,z); } aD=(%_ToInteger(aD)); var x; if(aD<0){ x=m(z+aD,0); }else{ x=n(aD,z); } aE=(aE===(void 0))?z:(%_ToInteger(aE)); var bB; if(aE<0){ bB=m(z+aE,0); }else{ bB=n(aE,z); } var bC=n(bB-x,z-aO); var bD=1; if(x0){ if(x in y){ y[aO]=y[x]; }else{ delete y[aO]; } x=x+bD; aO=aO+bD; bC--; } return y; } function ArrayCopyWithin(bA,aD,aE){ if((%IS_VAR(this)===null)||(this===(void 0)))throw l(17,"Array.prototype.copyWithin"); var y=(%_ToObject(this)); var z=(%_ToLength(y.length)); return InnerArrayCopyWithin(bA,aD,aE,y,z); } function InnerArrayFind(bE,bF,y,z){ if(!(typeof(bE)==='function')){ throw l(15,bE); } for(var B=0;Bz)B=z; } if(aE<0){ aE+=z; if(aE<0)aE=0; }else{ if(aE>z)aE=z; } if((aE-B)>0&&%object_is_frozen(y)){ throw l(12); } for(;B>>0)); return InnerArrayFill(C,aD,aE,y,z); } function InnerArrayIncludes(bG,bH,y,z){ if(z===0){ return false; } var ao=(%_ToInteger(bH)); var J; if(ao>=0){ J=ao; }else{ J=z+ao; if(J<0){ J=0; } } while(J1){ D=%_Arguments(1); D=(%_ToInteger(D)); if(D<0)D=0; if(D>C.length)D=C.length; } return %StringIndexOf(C,B,D); } function StringLastIndexOfJS(E){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.lastIndexOf"); var F=(%_ToString(this)); var G=F.length; var E=(%_ToString(E)); var H=E.length; var D=G-H; if(%_ArgumentsLength()>1){ var I=(%_ToNumber(%_Arguments(1))); if(!(!%_IsSmi(%IS_VAR(I))&&!(I==I))){ I=(%_ToInteger(I)); if(I<0){ I=0; } if(I+H0xFF&& (typeof(S)==='string')&& %StringIndexOf(S,'$',0)<0){ return %StringReplaceOneCharWithString(C,R,S); } var U=%StringIndexOf(C,R,0); if(U<0)return C; var V=U+R.length; var u=%_SubString(C,0,U); if((typeof(S)==='function')){ u+=S(R,U,C); }else{ Q[3]=U; Q[4]=V; u=ExpandReplacement((%_ToString(S)), C, Q, u); } return u+%_SubString(C,V,C.length); } function ExpandReplacement(W,C,X,u){ var Y=W.length; var Z=%StringIndexOf(W,'$',0); if(Z<0){ if(Y>0)u+=W; return u; } if(Z>0)u+=%_SubString(W,0,Z); while(true){ var aa='$'; var I=Z+1; if(I=48&&ab<=57){ var ac=(ab-48)<<1; var ad=1; var ae=((X)[0]); if(I+1=48&&Z<=57){ var af=ac*10+((Z-48)<<1); if(af=0){ u+= %_SubString(C,U,X[(3+(ac+1))]); } I+=ad; }else{ u+='$'; } }else{ u+='$'; } }else{ u+='$'; } Z=%StringIndexOf(W,'$',I); if(Z<0){ if(II){ u+=%_SubString(W,I,Z); } } return u; } function CaptureString(W,ag,D){ var ah=D<<1; var U=ag[(3+(ah))]; if(U<0)return; var V=ag[(3+(ah+1))]; return %_SubString(W,U,V); } var ai=new g(4); function StringReplaceGlobalRegExpWithFunction(C,K,S){ var aj=ai; if(aj){ ai=null; }else{ aj=new g(16); } var ak=%RegExpExecMultiple(K, C, p, aj); K.lastIndex=0; if((ak===null)){ ai=aj; return C; } var w=ak.length; if(((p)[0])==2){ var al=0; for(var z=0;z0){ al=(am>>11)+(am&0x7ff); }else{ al=ak[++z]-am; } }else{ var an=S(am,al,C); ak[z]=(%_ToString(an)); al+=am.length; } } }else{ for(var z=0;z>1; var aq; if(ap==1){ var L=%_SubString(C,D,ao); aq=S(L,D,C); }else{ var ar=new g(ap+2); for(var as=0;asau){ return''; } } if(aw<0){ aw+=au; if(aw<0){ return''; } }else{ if(aw>au){ aw=au; } } if(aw<=av){ return''; } return %_SubString(L,av,aw); } function StringSplitJS(ax,ay){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.split"); if(!(ax==null)){ var az=ax[r]; if(!(az===(void 0))){ return %_Call(az,ax,this,ay); } } var C=(%_ToString(this)); ay=((ay===(void 0)))?4294967295:((ay)>>>0); var Y=C.length; var aA=(%_ToString(ax)); if(ay===0)return[]; if((ax===(void 0)))return[C]; var aB=aA.length; if(aB===0)return %StringToArray(C,ay); return %StringSplit(C,aA,ay); } function StringSubstring(U,V){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.subString"); var L=(%_ToString(this)); var au=L.length; var av=(%_ToInteger(U)); if(av<0){ av=0; }else if(av>au){ av=au; } var aw=au; if(!(V===(void 0))){ aw=(%_ToInteger(V)); if(aw>au){ aw=au; }else{ if(aw<0)aw=0; if(av>aw){ var aC=aw; aw=av; av=aC; } } } return %_SubString(L,av,aw); } function StringSubstr(U,aD){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.substr"); var L=(%_ToString(this)); var w; if((aD===(void 0))){ w=L.length; }else{ w=(%_ToInteger(aD)); if(w<=0)return''; } if((U===(void 0))){ U=0; }else{ U=(%_ToInteger(U)); if(U>=L.length)return''; if(U<0){ U+=L.length; if(U<0)U=0; } } var V=U+w; if(V>L.length)V=L.length; return %_SubString(L,U,V); } function StringToLowerCaseJS(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.toLowerCase"); return %StringToLowerCase((%_ToString(this))); } function StringToLocaleLowerCase(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.toLocaleLowerCase"); return %StringToLowerCase((%_ToString(this))); } function StringToUpperCaseJS(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.toUpperCase"); return %StringToUpperCase((%_ToString(this))); } function StringToLocaleUpperCase(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.toLocaleUpperCase"); return %StringToUpperCase((%_ToString(this))); } function StringTrimJS(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.trim"); return %StringTrim((%_ToString(this)),true,true); } function StringTrimLeft(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.trimLeft"); return %StringTrim((%_ToString(this)),true,false); } function StringTrimRight(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.trimRight"); return %StringTrim((%_ToString(this)),false,true); } function StringFromCharCode(aE){ var aD=%_ArgumentsLength(); if(aD==1)return %_StringCharFromCode(aE&0xffff); var aF=%NewString(aD,true); var z; for(z=0;z0xff)break; %_OneByteSeqStringSetChar(z,aE,aF); } if(z==aD)return aF; aF=%TruncateString(aF,z); var aG=%NewString(aD-z,false); %_TwoByteSeqStringSetChar(0,aE,aG); z++; for(var as=1;z"+(%_ToString(this))+ ""; } function StringBig(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.big"); return""+(%_ToString(this))+""; } function StringBlink(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.blink"); return""+(%_ToString(this))+""; } function StringBold(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.bold"); return""+(%_ToString(this))+""; } function StringFixed(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.fixed"); return""+(%_ToString(this))+""; } function StringFontcolor(aJ){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.fontcolor"); return""+(%_ToString(this))+ ""; } function StringFontsize(aK){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.fontsize"); return""+(%_ToString(this))+ ""; } function StringItalics(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.italics"); return""+(%_ToString(this))+""; } function StringLink(L){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.link"); return""+(%_ToString(this))+""; } function StringSmall(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.small"); return""+(%_ToString(this))+""; } function StringStrike(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.strike"); return""+(%_ToString(this))+""; } function StringSub(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.sub"); return""+(%_ToString(this))+""; } function StringSup(){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.sup"); return""+(%_ToString(this))+""; } function StringRepeat(aL){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.repeat"); var L=(%_ToString(this)); var aD=(%_ToInteger(aL)); if(aD<0||aD===(1/0))throw i(168); if(L.length===0)return""; if(aD>%_MaxSmi())throw i(168); var aM=""; while(true){ if(aD&1)aM+=L; aD>>=1; if(aD===0)return aM; L+=L; } } function StringStartsWith(aN){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.startsWith"); var L=(%_ToString(this)); if((%_IsRegExp(aN))){ throw j(38,"String.prototype.startsWith"); } var aO=(%_ToString(aN)); var t=0; if(%_ArgumentsLength()>1){ var aP=%_Arguments(1); if(!(aP===(void 0))){ t=(%_ToInteger(aP)); } } var au=L.length; var U=l(k(t,0),au); var aQ=aO.length; if(aQ+U>au){ return false; } return %_SubString(L,U,U+aQ)===aO; } function StringEndsWith(aN){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.endsWith"); var L=(%_ToString(this)); if((%_IsRegExp(aN))){ throw j(38,"String.prototype.endsWith"); } var aO=(%_ToString(aN)); var au=L.length; var t=au; if(%_ArgumentsLength()>1){ var aP=%_Arguments(1); if(!(aP===(void 0))){ t=(%_ToInteger(aP)); } } var V=l(k(t,0),au); var aQ=aO.length; var U=V-aQ; if(U<0){ return false; } return %_SubString(L,U,U+aQ)===aO; } function StringIncludes(aN){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.includes"); var W=(%_ToString(this)); if((%_IsRegExp(aN))){ throw j(38,"String.prototype.includes"); } aN=(%_ToString(aN)); var t=0; if(%_ArgumentsLength()>1){ t=%_Arguments(1); t=(%_ToInteger(t)); } var aR=W.length; if(t<0)t=0; if(t>aR)t=aR; var aS=aN.length; if(aS+t>aR){ return false; } return %StringIndexOf(W,aN,t)!==-1; } function StringCodePointAt(t){ if((%IS_VAR(this)===null)||(this===(void 0)))throw j(17,"String.prototype.codePointAt"); var W=(%_ToString(this)); var aK=W.length; t=(%_ToInteger(t)); if(t<0||t>=aK){ return(void 0); } var aT=%_StringCharCodeAt(W,t); if(aT<0xD800||aT>0xDBFF||t+1==aK){ return aT; } var aU=%_StringCharCodeAt(W,t+1); if(aU<0xDC00||aU>0xDFFF){ return aT; } return(aT-0xD800)*0x400+aU+0x2400; } function StringFromCodePoint(aV){ var aE; var Y=%_ArgumentsLength(); var D; var u=""; for(D=0;D0x10FFFF||aE!==(%_ToInteger(aE))){ throw i(167,aE); } if(aE<=0xFFFF){ u+=%_StringCharFromCode(aE); }else{ aE-=0x10000; u+=%_StringCharFromCode((aE>>>10)&0x3FF|0xD800); u+=%_StringCharFromCode(aE&0x3FF|0xDC00); } } return u; } function StringRaw(aW){ var aX=%_ArgumentsLength(); var aY=(%_ToObject(aW)); var aZ=(%_ToObject(aY.raw)); var ba=(%_ToLength(aZ.length)); if(ba<=0)return""; var u=(%_ToString(aZ[0])); for(var z=1;z=48&&h<=57)return h-48; if(h>=65&&h<=70)return h-55; if(h>=97&&h<=102)return h-87; return-1; } function isAlphaNumeric(i){ if(97<=i&&i<=122)return true; if(65<=i&&i<=90)return true; if(48<=i&&i<=57)return true; return false; } var j=0; function URIAddEncodedOctetToBuffer(k,l,m){ l[m++]=37; l[m++]=j[k>>4]; l[m++]=j[k&0x0F]; return m; } function URIEncodeOctets(n,l,m){ if(j===0){ j=[48,49,50,51,52,53,54,55,56,57, 65,66,67,68,69,70]; } m=URIAddEncodedOctetToBuffer(n[0],l,m); if(n[1])m=URIAddEncodedOctetToBuffer(n[1],l,m); if(n[2])m=URIAddEncodedOctetToBuffer(n[2],l,m); if(n[3])m=URIAddEncodedOctetToBuffer(n[3],l,m); return m; } function URIEncodeSingle(i,l,m){ var o=(i>>12)&0xF; var p=(i>>6)&63; var q=i&63; var n=new d(3); if(i<=0x007F){ n[0]=i; }else if(i<=0x07FF){ n[0]=p+192; n[1]=q+128; }else{ n[0]=o+224; n[1]=p+128; n[2]=q+128; } return URIEncodeOctets(n,l,m); } function URIEncodePair(r,s,l,m){ var t=((r>>6)&0xF)+1; var u=(r>>2)&0xF; var o=r&3; var p=(s>>6)&0xF; var q=s&63; var n=new d(4); n[0]=(t>>2)+240; n[1]=(((t&3)<<4)|u)+128; n[2]=((o<<4)|p)+128; n[3]=q+128; return URIEncodeOctets(n,l,m); } function URIHexCharsToCharCode(v,w){ var x=HexValueOf(v); var y=HexValueOf(w); if(x==-1||y==-1)throw f(); return(x<<4)|y; } function URIDecodeOctets(n,l,m){ var z; var A=n[0]; if(A<0x80){ z=A; }else if(A<0xc2){ throw f(); }else{ var B=n[1]; if(A<0xe0){ var C=A&0x1f; if((B<0x80)||(B>0xbf))throw f(); var D=B&0x3f; z=(C<<6)+D; if(z<0x80||z>0x7ff)throw f(); }else{ var E=n[2]; if(A<0xf0){ var C=A&0x0f; if((B<0x80)||(B>0xbf))throw f(); var D=B&0x3f; if((E<0x80)||(E>0xbf))throw f(); var F=E&0x3f; z=(C<<12)+(D<<6)+F; if((z<0x800)||(z>0xffff))throw f(); }else{ var G=n[3]; if(A<0xf8){ var C=(A&0x07); if((B<0x80)||(B>0xbf))throw f(); var D=(B&0x3f); if((E<0x80)||(E>0xbf)){ throw f(); } var F=(E&0x3f); if((G<0x80)||(G>0xbf))throw f(); var H=(G&0x3f); z=(C<<18)+(D<<12)+(F<<6)+H; if((z<0x10000)||(z>0x10ffff))throw f(); }else{ throw f(); } } } } if(0xD800<=z&&z<=0xDFFF)throw f(); if(z<0x10000){ %_TwoByteSeqStringSetChar(m++,z,l); }else{ %_TwoByteSeqStringSetChar(m++,(z>>10)+0xd7c0,l); %_TwoByteSeqStringSetChar(m++,(z&0x3ff)+0xdc00,l); } return m; } function Encode(I,J){ I=(%_ToString(I)); var K=I.length; var L=new e(K); var m=0; for(var M=0;M=0xDC00&&r<=0xDFFF)throw f(); if(r<0xD800||r>0xDBFF){ m=URIEncodeSingle(r,L,m); }else{ M++; if(M==K)throw f(); var s=%_StringCharCodeAt(I,M); if(s<0xDC00||s>0xDFFF)throw f(); m=URIEncodePair(r,s,L,m); } } } var l=%NewString(L.length,true); for(var N=0;N=K)throw f(); var i=URIHexCharsToCharCode(%_StringCharCodeAt(I,M+1), %_StringCharCodeAt(I,M+2)); if(i>>7)break; if(O(i)){ %_OneByteSeqStringSetChar(m++,37,P); %_OneByteSeqStringSetChar(m++,%_StringCharCodeAt(I,M+1), P); %_OneByteSeqStringSetChar(m++,%_StringCharCodeAt(I,M+2), P); }else{ %_OneByteSeqStringSetChar(m++,i,P); } M+=2; }else{ if(h>0x7f)break; %_OneByteSeqStringSetChar(m++,h,P); } } P=%TruncateString(P,m); if(M==K)return P; var Q=%NewString(K-M,false); m=0; for(;M=K)throw f(); var i=URIHexCharsToCharCode(%_StringCharCodeAt(I,++M), %_StringCharCodeAt(I,++M)); if(i>>7){ var R=0; while(((i<<++R)&0x80)!=0){} if(R==1||R>4)throw f(); var n=new d(R); n[0]=i; if(M+3*(R-1)>=K)throw f(); for(var N=1;N0)?k:0-k; } function MathAcosJS(k){ return %_MathAcos(+k); } function MathAsinJS(k){ return %_MathAsin(+k); } function MathAtanJS(k){ return %_MathAtan(+k); } function MathAtan2JS(l,k){ l=+l; k=+k; return %_MathAtan2(l,k); } function MathCeil(k){ return-%_MathFloor(-k); } function MathExp(k){ return %MathExpRT((%_ToNumber(k))); } function MathFloorJS(k){ return %_MathFloor(+k); } function MathLog(k){ return %_MathLogRT((%_ToNumber(k))); } function MathMax(m,n){ var o=%_ArgumentsLength(); if(o==2){ m=(%_ToNumber(m)); n=(%_ToNumber(n)); if(n>m)return n; if(m>n)return m; if(m==n){ return(m===0&&%_IsMinusZero(m))?n:m; } return g; } var p=-(1/0); for(var q=0;qp||(p===0&&r===0&&%_IsMinusZero(p))){ p=r; } } return p; } function MathMin(m,n){ var o=%_ArgumentsLength(); if(o==2){ m=(%_ToNumber(m)); n=(%_ToNumber(n)); if(n>m)return m; if(m>n)return n; if(m==n){ return(m===0&&%_IsMinusZero(m))?m:n; } return g; } var p=(1/0); for(var q=0;q=64){ i=%GenerateRandomNumbers(i); h=2; } return i[h++]; } function MathRandomRaw(){ if(h>=64){ i=%GenerateRandomNumbers(i); h=2; } return %_DoubleLo(i[h++])&0x3FFFFFFF; } function MathRound(k){ return %RoundNumber((%_ToNumber(k))); } function MathSqrtJS(k){ return %_MathSqrt(+k); } function MathImul(k,l){ return %NumberImul((%_ToNumber(k)),(%_ToNumber(l))); } function MathSign(k){ k=+k; if(k>0)return 1; if(k<0)return-1; return k; } function MathTrunc(k){ k=+k; if(k>0)return %_MathFloor(k); if(k<0)return-%_MathFloor(-k); return k; } function MathAsinh(k){ k=(%_ToNumber(k)); if(k===0||!(%_IsSmi(%IS_VAR(k))||((k==k)&&(k!=1/0)&&(k!=-1/0))))return k; if(k>0)return MathLog(k+%_MathSqrt(k*k+1)); return-MathLog(-k+%_MathSqrt(k*k+1)); } function MathAcosh(k){ k=(%_ToNumber(k)); if(k<1)return g; if(!(%_IsSmi(%IS_VAR(k))||((k==k)&&(k!=1/0)&&(k!=-1/0))))return k; return MathLog(k+%_MathSqrt(k+1)*%_MathSqrt(k-1)); } function MathAtanh(k){ k=(%_ToNumber(k)); if(k===0)return k; if(!(%_IsSmi(%IS_VAR(k))||((k==k)&&(k!=1/0)&&(k!=-1/0))))return g; return 0.5*MathLog((1+k)/(1-k)); } function MathHypot(k,l){ var o=%_ArgumentsLength(); var s=new f(o); var t=0; for(var q=0;qt)t=r; s[q]=r; } if(t===0)t=1; var u=0; var v=0; for(var q=0;q>>0); } function MathCbrt(k){ k=(%_ToNumber(k)); if(k==0||!(%_IsSmi(%IS_VAR(k))||((k==k)&&(k!=1/0)&&(k!=-1/0))))return k; return k>=0?CubeRoot(k):-CubeRoot(-k); } function CubeRoot(k){ var y=MathFloorJS(%_DoubleHi(k)/3)+0x2A9F7893; var z=%_ConstructDouble(y|0,0); z=(1.0/3.0)*(k/(z*z)+2*z); ; z=(1.0/3.0)*(k/(z*z)+2*z); ; z=(1.0/3.0)*(k/(z*z)+2*z); ; return(1.0/3.0)*(k/(z*z)+2*z); ; } %AddNamedProperty(d,j,"Math",1|2); b.InstallConstants(d,[ "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(d,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, "asinh",MathAsinh, "acosh",MathAcosh, "atanh",MathAtanh, "hypot",MathHypot, "fround",MathFroundJS, "clz32",MathClz32JS, "cbrt",MathCbrt ]); %SetForceInlineFlag(MathAbs); %SetForceInlineFlag(MathAcosJS); %SetForceInlineFlag(MathAsinJS); %SetForceInlineFlag(MathAtanJS); %SetForceInlineFlag(MathAtan2JS); %SetForceInlineFlag(MathCeil); %SetForceInlineFlag(MathClz32JS); %SetForceInlineFlag(MathFloorJS); %SetForceInlineFlag(MathRandom); %SetForceInlineFlag(MathSign); %SetForceInlineFlag(MathSqrtJS); %SetForceInlineFlag(MathTrunc); b.Export(function(A){ A.MathAbs=MathAbs; A.MathExp=MathExp; A.MathFloor=MathFloorJS; A.IntRandom=MathRandomRaw; A.MathMax=MathMax; A.MathMin=MathMin; }); }) fdlibmùÈ (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Float64Array; var d=a.Math; var e; var f; var g=%GetRootNaN(); var h; b.Import(function(i){ e=i.MathAbs; f=i.MathExp; }); b.CreateDoubleResultArray=function(a){ h=new c(2); }; function KernelTan(j,k,l){ var m; var n; var o=%_DoubleHi(j); var p=o&0x7fffffff; if(p<0x3e300000){ if(((p|%_DoubleLo(j))|(l+1))==0){ return 1/e(j); }else{ if(l==1){ return j; }else{ var n=j+k; var m=%_ConstructDouble(%_DoubleHi(n),0); var q=k-(m-j); var r=-1/n; var s=%_ConstructDouble(%_DoubleHi(r),0); var t=1+s*m; return s+r*(t+s*q); } } } if(p>=0x3fe59428){ if(j<0){ j=-j; k=-k; } m=7.85398163397448278999e-01-j; n=3.06161699786838301793e-17-k; j=m+n; k=0; } m=j*j; n=m*m; var u=1.33333333333201242699e-01+n*(2.18694882948595424599e-02+n*(3.59207910759131235356e-03+ n*(5.88041240820264096874e-04+n*(7.81794442939557092300e-05+n*-1.85586374855275456654e-05)))); var q=m*(5.39682539762260521377e-02+n*(8.86323982359930005737e-03+n*(1.45620945432529025516e-03+ n*(2.46463134818469906812e-04+n*(7.14072491382608190305e-05+n*2.59073051863633712884e-05))))); var t=m*j; u=k+m*(t*(u+q)+k); u=u+3.33333333333334091986e-01*t; n=j+u; if(p>=0x3fe59428){ return(1-((o>>30)&2))* (l-2.0*(j-(n*n/(n+l)-u))); } if(l==1){ return n; }else{ m=%_ConstructDouble(%_DoubleHi(n),0); q=u-(m-j); var r=-1/n; var s=%_ConstructDouble(%_DoubleHi(r),0); t=1+s*m; return s+r*(t+s*q); } } function MathSinSlow(j){ var v,w,x; var o=%_DoubleHi(j); var p=o&0x7fffffff; if(p<0x4002d97c){ if(o>0){ var m=j-1.57079632673412561417; if(p!=0x3ff921fb){ w=m-6.07710050650619224932e-11; x=(m-w)-6.07710050650619224932e-11; }else{ m-=6.07710050630396597660e-11; w=m-2.02226624879595063154e-21; x=(m-w)-2.02226624879595063154e-21; } v=1; }else{ var m=j+1.57079632673412561417; if(p!=0x3ff921fb){ w=m+6.07710050650619224932e-11; x=(m-w)+6.07710050650619224932e-11; }else{ m+=6.07710050630396597660e-11; w=m+2.02226624879595063154e-21; x=(m-w)+2.02226624879595063154e-21; } v=-1; } }else if(p<=0x413921fb){ var s=e(j); v=(s*6.36619772367581382433e-01+0.5)|0; var u=s-v*1.57079632673412561417; var n=v*6.07710050650619224932e-11; w=u-n; if(p-(%_DoubleHi(w)&0x7ff00000)>0x1000000){ s=u; n=v*6.07710050630396597660e-11; u=s-n; n=v*2.02226624879595063154e-21-((s-u)-n); w=u-n; if(p-(%_DoubleHi(w)&0x7ff00000)>0x3100000){ s=u; n=v*2.02226624871116645580e-21; u=s-n; n=v*8.47842766036889956997e-32-((s-u)-n); w=u-n; } } x=(u-w)-n; if(o<0){ v=-v; w=-w; x=-x; } }else{ v=%RemPiO2(j,h); w=h[0]; x=h[1]; } ; var y=1-(v&2); if(v&1){ var p=%_DoubleHi(w)&0x7fffffff; var m=w*w; var u=m*(4.16666666666666019037e-02+m*(-1.38888888888741095749e-03+m*(2.48015872894767294178e-05+m*(-2.75573143513906633035e-07+m*(2.08757232129817482790e-09+m*-1.13596475577881948265e-11))))); if(p<0x3fd33333){ return(1-(0.5*m-(m*u-w*x)))*y; }else{ var z; if(p>0x3fe90000){ z=0.28125; }else{ z=%_ConstructDouble(%_DoubleHi(0.25*w),0); } var A=0.5*m-z; return(1-z-(A-(m*u-w*x)))*y; } ; }else{ var m=w*w; var q=m*w; var u=8.33333333332248946124e-03+m*(-1.98412698298579493134e-04+m*(2.75573137070700676789e-06+m*(-2.50507602534068634195e-08+m*1.58969099521155010221e-10))); return(w-((m*(0.5*x-q*u)-x)-q*-1.66666666666666324348e-01))*y; ; } } function MathCosSlow(j){ var v,w,x; var o=%_DoubleHi(j); var p=o&0x7fffffff; if(p<0x4002d97c){ if(o>0){ var m=j-1.57079632673412561417; if(p!=0x3ff921fb){ w=m-6.07710050650619224932e-11; x=(m-w)-6.07710050650619224932e-11; }else{ m-=6.07710050630396597660e-11; w=m-2.02226624879595063154e-21; x=(m-w)-2.02226624879595063154e-21; } v=1; }else{ var m=j+1.57079632673412561417; if(p!=0x3ff921fb){ w=m+6.07710050650619224932e-11; x=(m-w)+6.07710050650619224932e-11; }else{ m+=6.07710050630396597660e-11; w=m+2.02226624879595063154e-21; x=(m-w)+2.02226624879595063154e-21; } v=-1; } }else if(p<=0x413921fb){ var s=e(j); v=(s*6.36619772367581382433e-01+0.5)|0; var u=s-v*1.57079632673412561417; var n=v*6.07710050650619224932e-11; w=u-n; if(p-(%_DoubleHi(w)&0x7ff00000)>0x1000000){ s=u; n=v*6.07710050630396597660e-11; u=s-n; n=v*2.02226624879595063154e-21-((s-u)-n); w=u-n; if(p-(%_DoubleHi(w)&0x7ff00000)>0x3100000){ s=u; n=v*2.02226624871116645580e-21; u=s-n; n=v*8.47842766036889956997e-32-((s-u)-n); w=u-n; } } x=(u-w)-n; if(o<0){ v=-v; w=-w; x=-x; } }else{ v=%RemPiO2(j,h); w=h[0]; x=h[1]; } ; if(v&1){ var y=(v&2)-1; var m=w*w; var q=m*w; var u=8.33333333332248946124e-03+m*(-1.98412698298579493134e-04+m*(2.75573137070700676789e-06+m*(-2.50507602534068634195e-08+m*1.58969099521155010221e-10))); return(w-((m*(0.5*x-q*u)-x)-q*-1.66666666666666324348e-01))*y; ; }else{ var y=1-(v&2); var p=%_DoubleHi(w)&0x7fffffff; var m=w*w; var u=m*(4.16666666666666019037e-02+m*(-1.38888888888741095749e-03+m*(2.48015872894767294178e-05+m*(-2.75573143513906633035e-07+m*(2.08757232129817482790e-09+m*-1.13596475577881948265e-11))))); if(p<0x3fd33333){ return(1-(0.5*m-(m*u-w*x)))*y; }else{ var z; if(p>0x3fe90000){ z=0.28125; }else{ z=%_ConstructDouble(%_DoubleHi(0.25*w),0); } var A=0.5*m-z; return(1-z-(A-(m*u-w*x)))*y; } ; } } function MathSin(j){ j=+j; if((%_DoubleHi(j)&0x7fffffff)<=0x3fe921fb){ var m=j*j; var q=m*j; var u=8.33333333332248946124e-03+m*(-1.98412698298579493134e-04+m*(2.75573137070700676789e-06+m*(-2.50507602534068634195e-08+m*1.58969099521155010221e-10))); return(j-((m*(0.5*0-q*u)-0)-q*-1.66666666666666324348e-01)); ; } return+MathSinSlow(j); } function MathCos(j){ j=+j; if((%_DoubleHi(j)&0x7fffffff)<=0x3fe921fb){ var p=%_DoubleHi(j)&0x7fffffff; var m=j*j; var u=m*(4.16666666666666019037e-02+m*(-1.38888888888741095749e-03+m*(2.48015872894767294178e-05+m*(-2.75573143513906633035e-07+m*(2.08757232129817482790e-09+m*-1.13596475577881948265e-11))))); if(p<0x3fd33333){ return(1-(0.5*m-(m*u-j*0))); }else{ var z; if(p>0x3fe90000){ z=0.28125; }else{ z=%_ConstructDouble(%_DoubleHi(0.25*j),0); } var A=0.5*m-z; return(1-z-(A-(m*u-j*0))); } ; } return+MathCosSlow(j); } function MathTan(j){ j=j*1; if((%_DoubleHi(j)&0x7fffffff)<=0x3fe921fb){ return KernelTan(j,0,1); } var v,w,x; var o=%_DoubleHi(j); var p=o&0x7fffffff; if(p<0x4002d97c){ if(o>0){ var m=j-1.57079632673412561417; if(p!=0x3ff921fb){ w=m-6.07710050650619224932e-11; x=(m-w)-6.07710050650619224932e-11; }else{ m-=6.07710050630396597660e-11; w=m-2.02226624879595063154e-21; x=(m-w)-2.02226624879595063154e-21; } v=1; }else{ var m=j+1.57079632673412561417; if(p!=0x3ff921fb){ w=m+6.07710050650619224932e-11; x=(m-w)+6.07710050650619224932e-11; }else{ m+=6.07710050630396597660e-11; w=m+2.02226624879595063154e-21; x=(m-w)+2.02226624879595063154e-21; } v=-1; } }else if(p<=0x413921fb){ var s=e(j); v=(s*6.36619772367581382433e-01+0.5)|0; var u=s-v*1.57079632673412561417; var n=v*6.07710050650619224932e-11; w=u-n; if(p-(%_DoubleHi(w)&0x7ff00000)>0x1000000){ s=u; n=v*6.07710050630396597660e-11; u=s-n; n=v*2.02226624879595063154e-21-((s-u)-n); w=u-n; if(p-(%_DoubleHi(w)&0x7ff00000)>0x3100000){ s=u; n=v*2.02226624871116645580e-21; u=s-n; n=v*8.47842766036889956997e-32-((s-u)-n); w=u-n; } } x=(u-w)-n; if(o<0){ v=-v; w=-w; x=-x; } }else{ v=%RemPiO2(j,h); w=h[0]; x=h[1]; } ; return KernelTan(w,x,(v&1)?-1:1); } function MathLog1p(j){ j=j*1; var o=%_DoubleHi(j); var B=o&0x7fffffff; var C=1; var D=j; var E=1; var F=0; var G=j; if(o<0x3fda827a){ if(B>=0x3ff00000){ if(j===-1){ return-(1/0); }else{ return g; } }else if(B<0x3c900000){ return j; }else if(B<0x3e200000){ return j-j*j*0.5; } if((o>0)||(o<=-0x402D413D)){ C=0; } } if(o>=0x7ff00000)return j; if(C!==0){ if(o<0x43400000){ G=1+j; E=%_DoubleHi(G); C=(E>>20)-1023; F=(C>0)?1-(G-j):j-(G-1); F=F/G; }else{ E=%_DoubleHi(G); C=(E>>20)-1023; } E=E&0xfffff; if(E<0x6a09e){ G=%_ConstructDouble(E|0x3ff00000,%_DoubleLo(G)); }else{ ++C; G=%_ConstructDouble(E|0x3fe00000,%_DoubleLo(G)); E=(0x00100000-E)>>2; } D=G-1; } var H=0.5*D*D; if(E===0){ if(D===0){ if(C===0){ return 0.0; }else{ return C*6.93147180369123816490e-01+(F+C*1.90821492927058770002e-10); } } var I=H*(1-6.666666666666666666e-01*D); if(C===0){ return D-I; }else{ return C*6.93147180369123816490e-01-((I-(C*1.90821492927058770002e-10+F))-D); } } var t=D/(2+D); var m=t*t; var I=m*(6.666666666666735130e-01+m*(3.999999999940941908e-01+m*(2.857142874366239149e-01+m*(2.222219843214978396e-01+ m*(1.818357216161805012e-01+m*(1.531383769920937332e-01+m*1.479819860511658591e-01)))))); if(C===0){ return D-(H-t*(H+I)); }else{ return C*6.93147180369123816490e-01-((H-(t*(H+I)+(C*1.90821492927058770002e-10+F)))-D); } } function MathExpm1(j){ j=j*1; var k; var J; var K; var C; var s; var F; var o=%_DoubleHi(j); var L=o&0x80000000; var k=(L===0)?j:-j; o&=0x7fffffff; if(o>=0x4043687a){ if(o>=0x40862e42){ if(o>=0x7ff00000){ return(j===-(1/0))?-1:j; } if(j>7.09782712893383973096e+02)return(1/0); } if(L!=0)return-1; } if(o>0x3fd62e42){ if(o<0x3ff0a2b2){ if(L===0){ J=j-6.93147180369123816490e-01; K=1.90821492927058770002e-10; C=1; }else{ J=j+6.93147180369123816490e-01; K=-1.90821492927058770002e-10; C=-1; } }else{ C=(1.44269504088896338700*j+((L===0)?0.5:-0.5))|0; s=C; J=j-s*6.93147180369123816490e-01; K=s*1.90821492927058770002e-10; } j=J-K; F=(J-j)-K; }else if(o<0x3c900000){ return j; }else{ C=0; } var M=0.5*j; var N=j*M; var O=1+N*(-3.33333333333331316428e-02+N*(1.58730158725481460165e-03+N* (-7.93650757867487942473e-05+N*(4.00821782732936239552e-06+N*-2.01099218183624371326e-07)))); s=3-O*M; var P=N*((O-s)/(6-j*s)); if(C===0){ return j-(j*P-N); }else{ P=(j*(P-F)-F); P-=N; if(C===-1)return 0.5*(j-P)-0.5; if(C===1){ if(j<-0.25)return-2*(P-(j+0.5)); return 1+2*(j-P); } if(C<=-2||C>56){ k=1-(P-j); k=%_ConstructDouble(%_DoubleHi(k)+(C<<20),%_DoubleLo(k)); return k-1; } if(C<20){ s=%_ConstructDouble(0x3ff00000-(0x200000>>C),0); k=s-(P-j); k=%_ConstructDouble(%_DoubleHi(k)+(C<<20),%_DoubleLo(k)); }else{ s=%_ConstructDouble((0x3ff-C)<<20,0); k=j-(P+s); k+=1; k=%_ConstructDouble(%_DoubleHi(k)+(C<<20),%_DoubleLo(k)); } } return k; } function MathSinh(j){ j=j*1; var Q=(j<0)?-0.5:0.5; var B=e(j); if(B<22){ if(B<3.725290298461914e-9)return j; var s=MathExpm1(B); if(B<1)return Q*(2*s-s*s/(s+1)); return Q*(s+s/(s+1)); } if(B<709.7822265625)return Q*f(B); if(B<=710.4758600739439){ var n=f(0.5*B); var s=Q*n; return s*n; } return j*(1/0); } function MathCosh(j){ j=j*1; var p=%_DoubleHi(j)&0x7fffffff; if(p<0x3fd62e43){ var s=MathExpm1(e(j)); var n=1+s; if(p<0x3c800000)return n; return 1+(s*s)/(n+n); } if(p<0x40360000){ var s=f(e(j)); return 0.5*s+0.5/s; } if(p<0x40862e42)return 0.5*f(e(j)); if(e(j)<=710.4758600739439){ var n=f(0.5*e(j)); var s=0.5*n; return s*n; } if((!%_IsSmi(%IS_VAR(j))&&!(j==j)))return j; return(1/0); } function MathTanh(j){ j=j*1; if(!(%_IsSmi(%IS_VAR(j))||((j==j)&&(j!=1/0)&&(j!=-1/0)))){ if(j>0)return 1; if(j<0)return-1; return j; } var B=e(j); var m; if(B<22){ if(B<2.77555756156289135105e-17){ return j; } if(B>=1){ var s=MathExpm1(2*B); m=1-2/(s+2); }else{ var s=MathExpm1(-2*B); m=-s/(s+2); } }else{ m=1; } return(j>=0)?m:-m; } function MathLog10(j){ j=j*1; var o=%_DoubleHi(j); var R=%_DoubleLo(j); var C=0; if(o<0x00100000){ if(((o&0x7fffffff)|R)===0)return-(1/0); if(o<0)return g; C-=54; j*=18014398509481984; o=%_DoubleHi(j); R=%_DoubleLo(j); } if(o>=0x7ff00000)return j; C+=(o>>20)-1023; var S=(C&0x80000000)>>>31; o=(o&0x000fffff)|((0x3ff-S)<<20); var k=C+S; j=%_ConstructDouble(o,R); var m=k*3.69423907715893078616e-13+4.34294481903251816668e-01*%_MathLogRT(j); return m+k*3.01029995663611771306e-01; } function MathLog2(j){ j=j*1; var B=e(j); var o=%_DoubleHi(j); var R=%_DoubleLo(j); var p=o&0x7fffffff; if((p|R)==0)return-(1/0); if(o<0)return g; if(p>=0x7ff00000)return j; var v=0; if(p<0x00100000){ B*=9007199254740992; v-=53; p=%_DoubleHi(B); } v+=(p>>20)-0x3ff; var T=p&0x000fffff; p=T|0x3ff00000; var U=1; var V=0; var W=0; if(T>0x3988e){ if(T<0xbb67a){ U=1.5; V=5.84962487220764160156e-01; W=1.35003920212974897128e-08; }else{ v+=1; p-=0x00100000; } } B=%_ConstructDouble(p,%_DoubleLo(B)); var G=B-U; var q=1/(B+U); var X=G*q; var Y=%_ConstructDouble(%_DoubleHi(X),0); var Z=%_ConstructDouble(%_DoubleHi(B+U),0) var aa=B-(Z-U); var ab=q*((G-Y*Z)-Y*aa); var ac=X*X; var u=ac*ac*(5.99999999999994648725e-01+ac*(4.28571428578550184252e-01+ac*(3.33333329818377432918e-01+ac*( 2.72728123808534006489e-01+ac*(2.30660745775561754067e-01+ac*2.06975017800338417784e-01))))); u+=ab*(Y+X); ac=Y*Y; Z=%_ConstructDouble(%_DoubleHi(3.0+ac+u),0); aa=u-((Z-3.0)-ac); G=Y*Z; q=ab*Z+aa*X; var ad=%_ConstructDouble(%_DoubleHi(G+q),0); var ae=q-(ad-G); var af=9.61796700954437255859e-01*ad; var ag=-7.02846165095275826516e-09*ad+ae*9.61796693925975554329e-01+W; var s=v; var ah=%_ConstructDouble(%_DoubleHi(((af+ag)+V)+s),0); var ai=ag-(((ah-s)-V)-af); return ah+ai; } b.InstallFunctions(d,2,[ "cos",MathCos, "sin",MathSin, "tan",MathTan, "sinh",MathSinh, "cosh",MathCosh, "tanh",MathTanh, "log10",MathLog10, "log2",MathLog2, "log1p",MathLog1p, "expm1",MathExpm1 ]); %SetForceInlineFlag(MathSin); %SetForceInlineFlag(MathCos); }) regexp… (function(a,b){ %CheckIsBootstrapping(); var c; var d=a.Object; var e=a.RegExp; var f; var g=b.InternalArray; var h=b.InternalPackedArray; var i; var j=b.ImportNow("match_symbol"); var k=b.ImportNow("search_symbol"); var l=b.ImportNow("split_symbol"); b.ImportFromExperimental(function(m){ c=m.FLAG_harmony_tolength; }); b.Import(function(m){ i=m.MakeTypeError; }); var n=new h( 2, "", (void 0), 0, 0 ); function IsRegExp(o){ if(!(%_IsJSReceiver(o)))return false; var p=o[j]; if(!(p===(void 0)))return(!!(p)); return(%_IsRegExp(o)); } function RegExpInitialize(q,r,s){ r=(r===(void 0))?'':(%_ToString(r)); s=(s===(void 0))?'':(%_ToString(s)); %RegExpInitializeAndCompile(q,r,s); return q; } function PatternFlags(r){ return((%_RegExpFlags(r)&1)?'g':'')+ ((%_RegExpFlags(r)&2)?'i':'')+ ((%_RegExpFlags(r)&4)?'m':'')+ ((%_RegExpFlags(r)&16)?'u':'')+ ((%_RegExpFlags(r)&8)?'y':''); } function RegExpConstructor(r,s){ var t=new.target; var u=IsRegExp(r); if((t===(void 0))){ t=e; if(u&&(s===(void 0))&& r.constructor===t){ return r; } } if((%_IsRegExp(r))){ if((s===(void 0)))s=PatternFlags(r); r=(%_RegExpSource(r)); }else if(u){ var v=r; r=r.source; if((s===(void 0)))s=v.flags; } var q=%NewObject(e,t); return RegExpInitialize(q,r,s); } function RegExpCompileJS(r,s){ if(!(%_IsRegExp(this))){ throw i(42, "RegExp.prototype.compile",this); } if((%_IsRegExp(r))){ if(!(s===(void 0)))throw i(129); s=PatternFlags(r); r=(%_RegExpSource(r)); } RegExpInitialize(this,r,s); } function DoRegExpExec(w,x,y){ return %_RegExpExec(w,x,y,n); } function RegExpExecNoTests(w,x,z){ var A=%_RegExpExec(w,x,z,n); if(A!==null){ if((%_RegExpFlags(w)&8))w.lastIndex=A[4]; var B=((A)[0])>>1; var z=A[3]; var C=A[4]; var D=%_SubString(x,z,C); var E=%_RegExpConstructResult(B,z,x); E[0]=D; if(B==1)return E; var F=3+2; for(var G=1;Gx.length){ this.lastIndex=0; return null; } }else{ G=0; } var J=%_RegExpExec(this,x,G,n); if((J===null)){ this.lastIndex=0; return null; } if(I){ this.lastIndex=n[4]; } var B=((J)[0])>>1; var z=J[3]; var C=J[4]; var D=%_SubString(x,z,C); var E=%_RegExpConstructResult(B,z,x); E[0]=D; if(B==1)return E; var F=3+2; for(var G=1;Gx.length){ this.lastIndex=0; return false; } var J=%_RegExpExec(this,x,G,n); if((J===null)){ this.lastIndex=0; return false; } this.lastIndex=n[4]; return true; }else{ var w=this; var M=(%_RegExpSource(w)); if(w.length>=3&& %_StringCharCodeAt(w,0)==46&& %_StringCharCodeAt(w,1)==42&& %_StringCharCodeAt(w,2)!=63){ w=TrimRegExp(w); } var J=%_RegExpExec(w,x,0,n); if((J===null)){ this.lastIndex=0; return false; } return true; } } function TrimRegExp(w){ if(!%_ObjectEquals(K,w)){ K=w; L= new e( %_SubString((%_RegExpSource(w)),2,(%_RegExpSource(w)).length), ((%_RegExpFlags(w)&2)?(%_RegExpFlags(w)&4)?"im":"i" :(%_RegExpFlags(w)&4)?"m":"")); } return L; } function RegExpToString(){ if(!(%_IsRegExp(this))){ if(this===f){ %IncrementUseCounter(12); return'/(?:)/'; } throw i(42, 'RegExp.prototype.toString',this); } var E='/'+(%_RegExpSource(this))+'/'; if((%_RegExpFlags(this)&1))E+='g'; if((%_RegExpFlags(this)&2))E+='i'; if((%_RegExpFlags(this)&4))E+='m'; if((%_RegExpFlags(this)&16))E+='u'; if((%_RegExpFlags(this)&8))E+='y'; return E; } function RegExpSplit(x,N){ if(!(%_IsRegExp(this))){ throw i(42, "RegExp.prototype.@@split",this); } var O=this; var P=(%_ToString(x)); N=((N===(void 0)))?4294967295:((N)>>>0); var Q=P.length; if(N===0)return[]; if(Q===0){ if(DoRegExpExec(O,P,0,0)!==null)return[]; return[P]; } var R=0; var S=0; var T=0; var E=new g(); outer_loop: while(true){ if(S===Q){ E[E.length]=%_SubString(P,R,Q); break; } var A=DoRegExpExec(O,P,S); if(A===null||Q===(T=A[3])){ E[E.length]=%_SubString(P,R,Q); break; } var U=A[4]; if(S===U&&U===R){ S++; continue; } E[E.length]=%_SubString(P,R,T); if(E.length===N)break; var V=((A)[0])+3; for(var G=3+2;G=((n)[0]))return''; var ab=n[(3+(y))]; var ac=n[(3+(y+1))]; if(ab==-1||ac==-1)return''; return %_SubString(((n)[1]),ab,ac); }; } function RegExpGetGlobal(){ if(!(%_IsRegExp(this))){ if(this===f){ return(void 0); } throw i(131,"RegExp.prototype.global"); } return!!(%_RegExpFlags(this)&1); } %FunctionSetName(RegExpGetGlobal,"RegExp.prototype.global"); %SetNativeFlag(RegExpGetGlobal); function RegExpGetIgnoreCase(){ if(!(%_IsRegExp(this))){ if(this===f){ return(void 0); } throw i(131,"RegExp.prototype.ignoreCase"); } return!!(%_RegExpFlags(this)&2); } %FunctionSetName(RegExpGetIgnoreCase,"RegExp.prototype.ignoreCase"); %SetNativeFlag(RegExpGetIgnoreCase); function RegExpGetMultiline(){ if(!(%_IsRegExp(this))){ if(this===f){ return(void 0); } throw i(131,"RegExp.prototype.multiline"); } return!!(%_RegExpFlags(this)&4); } %FunctionSetName(RegExpGetMultiline,"RegExp.prototype.multiline"); %SetNativeFlag(RegExpGetMultiline); function RegExpGetSource(){ if(!(%_IsRegExp(this))){ if(this===f){ return(void 0); } throw i(131,"RegExp.prototype.source"); } return(%_RegExpSource(this)); } %FunctionSetName(RegExpGetSource,"RegExp.prototype.source"); %SetNativeFlag(RegExpGetSource); %FunctionSetInstanceClassName(e,'RegExp'); f=new d(); %FunctionSetPrototype(e,f); %AddNamedProperty( e.prototype,'constructor',e,2); %SetCode(e,RegExpConstructor); b.InstallFunctions(e.prototype,2,[ "exec",RegExpExecJS, "test",RegExpTest, "toString",RegExpToString, "compile",RegExpCompileJS, j,RegExpMatch, k,RegExpSearch, l,RegExpSplit, ]); b.InstallGetter(e.prototype,'global',RegExpGetGlobal); b.InstallGetter(e.prototype,'ignoreCase',RegExpGetIgnoreCase); b.InstallGetter(e.prototype,'multiline',RegExpGetMultiline); b.InstallGetter(e.prototype,'source',RegExpGetSource); %FunctionSetLength(e.prototype.compile,1); var ad=function(){ var ae=((n)[2]); return(ae===(void 0))?"":ae; }; var af=function(x){ ((n)[2])=(%_ToString(x)); }; %OptimizeObjectForAddingMultipleProperties(e,22); b.InstallGetterSetter(e,'input',ad,af, 4); b.InstallGetterSetter(e,'$_',ad,af, 2|4); var ag=function(ah){}; b.InstallGetterSetter(e,'lastMatch',RegExpGetLastMatch, ag,4); b.InstallGetterSetter(e,'$&',RegExpGetLastMatch,ag, 2|4); b.InstallGetterSetter(e,'lastParen',RegExpGetLastParen, ag,4); b.InstallGetterSetter(e,'$+',RegExpGetLastParen,ag, 2|4); b.InstallGetterSetter(e,'leftContext',RegExpGetLeftContext, ag,4); b.InstallGetterSetter(e,'$`',RegExpGetLeftContext,ag, 2|4); b.InstallGetterSetter(e,'rightContext',RegExpGetRightContext, ag,4); b.InstallGetterSetter(e,"$'",RegExpGetRightContext,ag, 2|4); for(var G=1;G<10;++G){ b.InstallGetterSetter(e,'$'+G,RegExpMakeCaptureGetter(G), ag,4); } %ToFastProperties(e); b.Export(function(ai){ ai.RegExpExec=DoRegExpExec; ai.RegExpExecNoTests=RegExpExecNoTests; ai.RegExpLastMatchInfo=n; ai.RegExpTest=RegExpTest; }); }) ,arraybufferÍ (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.ArrayBuffer; var d; var e; var f; var g; b.Import(function(h){ d=h.MakeTypeError; e=h.MaxSimple; f=h.MinSimple; g=h.SpeciesConstructor; }); function ArrayBufferGetByteLen(){ if(!(%_ClassOf(this)==='ArrayBuffer')){ throw d(42, 'ArrayBuffer.prototype.byteLength',this); } return %_ArrayBufferGetByteLength(this); } function ArrayBufferSlice(i,j){ if(!(%_ClassOf(this)==='ArrayBuffer')){ throw d(42, 'ArrayBuffer.prototype.slice',this); } var k=(%_ToInteger(i)); if(!(j===(void 0))){ j=(%_ToInteger(j)); } var l; var m=%_ArrayBufferGetByteLength(this); if(k<0){ l=e(m+k,0); }else{ l=f(k,m); } var n=(j===(void 0))?m:j; var o; if(n<0){ o=e(m+n,0); }else{ o=f(n,m); } if(oah){ throw B(181); } } var aj; var ak; if((ag===(void 0))){ if(ah % 1!==0){ throw B(179, "byte length","Uint8Array",1); } aj=ah-ai; ak=aj/1; }else{ var ak=ag; aj=ak*1; } if((ai+aj>ah) ||(ak>%_MaxSmi())){ throw B(180); } %_TypedArrayInitialize(ad,1,ae,ai,aj,true); } function Uint8ArrayConstructByLength(ad,ag){ var al=(ag===(void 0))? 0:H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var am=al*1; if(am>%_TypedArrayMaxSizeInHeap()){ var ae=new g(am); %_TypedArrayInitialize(ad,1,ae,0,am,true); }else{ %_TypedArrayInitialize(ad,1,null,0,am,true); } } function Uint8ArrayConstructByArrayLike(ad,an){ var ag=an.length; var al=H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var ao=false; var am=al*1; if(am<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(ad,1,null,0,am,false); }else{ ao= %TypedArrayInitializeFromArrayLike(ad,1,an,al); } if(!ao){ for(var ap=0;apah){ throw B(181); } } var aj; var ak; if((ag===(void 0))){ if(ah % 1!==0){ throw B(179, "byte length","Int8Array",1); } aj=ah-ai; ak=aj/1; }else{ var ak=ag; aj=ak*1; } if((ai+aj>ah) ||(ak>%_MaxSmi())){ throw B(180); } %_TypedArrayInitialize(ad,2,ae,ai,aj,true); } function Int8ArrayConstructByLength(ad,ag){ var al=(ag===(void 0))? 0:H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var am=al*1; if(am>%_TypedArrayMaxSizeInHeap()){ var ae=new g(am); %_TypedArrayInitialize(ad,2,ae,0,am,true); }else{ %_TypedArrayInitialize(ad,2,null,0,am,true); } } function Int8ArrayConstructByArrayLike(ad,an){ var ag=an.length; var al=H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var ao=false; var am=al*1; if(am<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(ad,2,null,0,am,false); }else{ ao= %TypedArrayInitializeFromArrayLike(ad,2,an,al); } if(!ao){ for(var ap=0;apah){ throw B(181); } } var aj; var ak; if((ag===(void 0))){ if(ah % 2!==0){ throw B(179, "byte length","Uint16Array",2); } aj=ah-ai; ak=aj/2; }else{ var ak=ag; aj=ak*2; } if((ai+aj>ah) ||(ak>%_MaxSmi())){ throw B(180); } %_TypedArrayInitialize(ad,3,ae,ai,aj,true); } function Uint16ArrayConstructByLength(ad,ag){ var al=(ag===(void 0))? 0:H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var am=al*2; if(am>%_TypedArrayMaxSizeInHeap()){ var ae=new g(am); %_TypedArrayInitialize(ad,3,ae,0,am,true); }else{ %_TypedArrayInitialize(ad,3,null,0,am,true); } } function Uint16ArrayConstructByArrayLike(ad,an){ var ag=an.length; var al=H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var ao=false; var am=al*2; if(am<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(ad,3,null,0,am,false); }else{ ao= %TypedArrayInitializeFromArrayLike(ad,3,an,al); } if(!ao){ for(var ap=0;apah){ throw B(181); } } var aj; var ak; if((ag===(void 0))){ if(ah % 2!==0){ throw B(179, "byte length","Int16Array",2); } aj=ah-ai; ak=aj/2; }else{ var ak=ag; aj=ak*2; } if((ai+aj>ah) ||(ak>%_MaxSmi())){ throw B(180); } %_TypedArrayInitialize(ad,4,ae,ai,aj,true); } function Int16ArrayConstructByLength(ad,ag){ var al=(ag===(void 0))? 0:H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var am=al*2; if(am>%_TypedArrayMaxSizeInHeap()){ var ae=new g(am); %_TypedArrayInitialize(ad,4,ae,0,am,true); }else{ %_TypedArrayInitialize(ad,4,null,0,am,true); } } function Int16ArrayConstructByArrayLike(ad,an){ var ag=an.length; var al=H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var ao=false; var am=al*2; if(am<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(ad,4,null,0,am,false); }else{ ao= %TypedArrayInitializeFromArrayLike(ad,4,an,al); } if(!ao){ for(var ap=0;apah){ throw B(181); } } var aj; var ak; if((ag===(void 0))){ if(ah % 4!==0){ throw B(179, "byte length","Uint32Array",4); } aj=ah-ai; ak=aj/4; }else{ var ak=ag; aj=ak*4; } if((ai+aj>ah) ||(ak>%_MaxSmi())){ throw B(180); } %_TypedArrayInitialize(ad,5,ae,ai,aj,true); } function Uint32ArrayConstructByLength(ad,ag){ var al=(ag===(void 0))? 0:H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var am=al*4; if(am>%_TypedArrayMaxSizeInHeap()){ var ae=new g(am); %_TypedArrayInitialize(ad,5,ae,0,am,true); }else{ %_TypedArrayInitialize(ad,5,null,0,am,true); } } function Uint32ArrayConstructByArrayLike(ad,an){ var ag=an.length; var al=H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var ao=false; var am=al*4; if(am<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(ad,5,null,0,am,false); }else{ ao= %TypedArrayInitializeFromArrayLike(ad,5,an,al); } if(!ao){ for(var ap=0;apah){ throw B(181); } } var aj; var ak; if((ag===(void 0))){ if(ah % 4!==0){ throw B(179, "byte length","Int32Array",4); } aj=ah-ai; ak=aj/4; }else{ var ak=ag; aj=ak*4; } if((ai+aj>ah) ||(ak>%_MaxSmi())){ throw B(180); } %_TypedArrayInitialize(ad,6,ae,ai,aj,true); } function Int32ArrayConstructByLength(ad,ag){ var al=(ag===(void 0))? 0:H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var am=al*4; if(am>%_TypedArrayMaxSizeInHeap()){ var ae=new g(am); %_TypedArrayInitialize(ad,6,ae,0,am,true); }else{ %_TypedArrayInitialize(ad,6,null,0,am,true); } } function Int32ArrayConstructByArrayLike(ad,an){ var ag=an.length; var al=H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var ao=false; var am=al*4; if(am<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(ad,6,null,0,am,false); }else{ ao= %TypedArrayInitializeFromArrayLike(ad,6,an,al); } if(!ao){ for(var ap=0;apah){ throw B(181); } } var aj; var ak; if((ag===(void 0))){ if(ah % 4!==0){ throw B(179, "byte length","Float32Array",4); } aj=ah-ai; ak=aj/4; }else{ var ak=ag; aj=ak*4; } if((ai+aj>ah) ||(ak>%_MaxSmi())){ throw B(180); } %_TypedArrayInitialize(ad,7,ae,ai,aj,true); } function Float32ArrayConstructByLength(ad,ag){ var al=(ag===(void 0))? 0:H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var am=al*4; if(am>%_TypedArrayMaxSizeInHeap()){ var ae=new g(am); %_TypedArrayInitialize(ad,7,ae,0,am,true); }else{ %_TypedArrayInitialize(ad,7,null,0,am,true); } } function Float32ArrayConstructByArrayLike(ad,an){ var ag=an.length; var al=H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var ao=false; var am=al*4; if(am<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(ad,7,null,0,am,false); }else{ ao= %TypedArrayInitializeFromArrayLike(ad,7,an,al); } if(!ao){ for(var ap=0;apah){ throw B(181); } } var aj; var ak; if((ag===(void 0))){ if(ah % 8!==0){ throw B(179, "byte length","Float64Array",8); } aj=ah-ai; ak=aj/8; }else{ var ak=ag; aj=ak*8; } if((ai+aj>ah) ||(ak>%_MaxSmi())){ throw B(180); } %_TypedArrayInitialize(ad,8,ae,ai,aj,true); } function Float64ArrayConstructByLength(ad,ag){ var al=(ag===(void 0))? 0:H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var am=al*8; if(am>%_TypedArrayMaxSizeInHeap()){ var ae=new g(am); %_TypedArrayInitialize(ad,8,ae,0,am,true); }else{ %_TypedArrayInitialize(ad,8,null,0,am,true); } } function Float64ArrayConstructByArrayLike(ad,an){ var ag=an.length; var al=H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var ao=false; var am=al*8; if(am<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(ad,8,null,0,am,false); }else{ ao= %TypedArrayInitializeFromArrayLike(ad,8,an,al); } if(!ao){ for(var ap=0;apah){ throw B(181); } } var aj; var ak; if((ag===(void 0))){ if(ah % 1!==0){ throw B(179, "byte length","Uint8ClampedArray",1); } aj=ah-ai; ak=aj/1; }else{ var ak=ag; aj=ak*1; } if((ai+aj>ah) ||(ak>%_MaxSmi())){ throw B(180); } %_TypedArrayInitialize(ad,9,ae,ai,aj,true); } function Uint8ClampedArrayConstructByLength(ad,ag){ var al=(ag===(void 0))? 0:H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var am=al*1; if(am>%_TypedArrayMaxSizeInHeap()){ var ae=new g(am); %_TypedArrayInitialize(ad,9,ae,0,am,true); }else{ %_TypedArrayInitialize(ad,9,null,0,am,true); } } function Uint8ClampedArrayConstructByArrayLike(ad,an){ var ag=an.length; var al=H(ag,180); if(al>%_MaxSmi()){ throw B(180); } var ao=false; var am=al*1; if(am<=%_TypedArrayMaxSizeInHeap()){ %_TypedArrayInitialize(ad,9,null,0,am,false); }else{ ao= %TypedArrayInitializeFromArrayLike(ad,9,an,al); } if(!ao){ for(var ap=0;ap0){ for(var ap=0;ap=aK&&aI>=aJ; aL--){ aD[ai+aL]=aE[aL]; aI-=aH; aJ-=aG; } return aL; } var aL=CopyRightPart(); var aM=new f(aL+1-aK); for(var ap=aK;ap<=aL;ap++){ aM[ap-aK]=aE[ap]; } for(ap=aK;ap<=aL;ap++){ aD[ai+ap]=aM[ap-aK]; } } function TypedArraySet(ad,ai){ var aN=(ai===(void 0))?0:(%_ToInteger(ai)); if(aN<0)throw C(190); if(aN>%_MaxSmi()){ throw B(191); } switch(%TypedArraySetFastCases(this,ad,aN)){ case 0: return; case 1: TypedArraySetFromOverlappingTypedArray(this,ad,aN); return; case 2: TypedArraySetFromArrayLike(this,ad,ad.length,aN); return; case 3: var al=ad.length; if((al===(void 0))){ if((typeof(ad)==='number')){ throw C(45); } return; } al=(%_ToLength(al)); if(aN+al>this.length){ throw B(191); } TypedArraySetFromArrayLike(this,ad,al,aN); return; } } function TypedArrayGetToStringTag(){ if(!%_IsTypedArray(this))return; var aO=%_ClassOf(this); if((aO===(void 0)))return; return aO; } function TypedArrayCopyWithin(aD,aP,ay){ if(!%_IsTypedArray(this))throw C(68); var ag=%_TypedArrayGetLength(this); return k(aD,aP,ay,this,ag); } %FunctionSetLength(TypedArrayCopyWithin,2); function TypedArrayEvery(aQ,aR){ if(!%_IsTypedArray(this))throw C(68); var ag=%_TypedArrayGetLength(this); return l(aQ,aR,this,ag); } %FunctionSetLength(TypedArrayEvery,1); function TypedArrayForEach(aQ,aR){ if(!%_IsTypedArray(this))throw C(68); var ag=%_TypedArrayGetLength(this); q(aQ,aR,this,ag); } %FunctionSetLength(TypedArrayForEach,1); function TypedArrayFill(av,aP,ay){ if(!%_IsTypedArray(this))throw C(68); var ag=%_TypedArrayGetLength(this); return m(av,aP,ay,this,ag); } %FunctionSetLength(TypedArrayFill,1); function TypedArrayFilter(aQ,aS){ if(!%_IsTypedArray(this))throw C(68); var ag=%_TypedArrayGetLength(this); if(!(typeof(aQ)==='function'))throw C(15,aQ); var aT=new j(); n(aQ,aS,this,ag,aT); var aU=aT.length; var aV=TypedArraySpeciesCreate(this,aU); for(var ap=0;apah)throw B(172); var ag=(am===(void 0)) ?ah-ai :am; if(ag<0||ai+ag>ah){ throw new B(171); } var aT=%NewObject(h,new.target); %_DataViewInitialize(aT,ae,ai,ag); return aT; } function DataViewGetBufferJS(){ if(!(%_ClassOf(this)==='DataView')){ throw C(42,'DataView.buffer',this); } return %DataViewGetBuffer(this); } function DataViewGetByteOffset(){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.byteOffset',this); } return %_ArrayBufferViewGetByteOffset(this); } function DataViewGetByteLength(){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.byteLength',this); } return %_ArrayBufferViewGetByteLength(this); } function DataViewGetInt8JS(ai,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.getInt8',this); } if(%_ArgumentsLength()<1)throw C(45); ai=H(ai,170); return %DataViewGetInt8(this,ai,!!br); } function DataViewSetInt8JS(ai,av,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.setInt8',this); } if(%_ArgumentsLength()<2)throw C(45); ai=H(ai,170); %DataViewSetInt8(this,ai,(%_ToNumber(av)),!!br); } function DataViewGetUint8JS(ai,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.getUint8',this); } if(%_ArgumentsLength()<1)throw C(45); ai=H(ai,170); return %DataViewGetUint8(this,ai,!!br); } function DataViewSetUint8JS(ai,av,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.setUint8',this); } if(%_ArgumentsLength()<2)throw C(45); ai=H(ai,170); %DataViewSetUint8(this,ai,(%_ToNumber(av)),!!br); } function DataViewGetInt16JS(ai,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.getInt16',this); } if(%_ArgumentsLength()<1)throw C(45); ai=H(ai,170); return %DataViewGetInt16(this,ai,!!br); } function DataViewSetInt16JS(ai,av,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.setInt16',this); } if(%_ArgumentsLength()<2)throw C(45); ai=H(ai,170); %DataViewSetInt16(this,ai,(%_ToNumber(av)),!!br); } function DataViewGetUint16JS(ai,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.getUint16',this); } if(%_ArgumentsLength()<1)throw C(45); ai=H(ai,170); return %DataViewGetUint16(this,ai,!!br); } function DataViewSetUint16JS(ai,av,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.setUint16',this); } if(%_ArgumentsLength()<2)throw C(45); ai=H(ai,170); %DataViewSetUint16(this,ai,(%_ToNumber(av)),!!br); } function DataViewGetInt32JS(ai,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.getInt32',this); } if(%_ArgumentsLength()<1)throw C(45); ai=H(ai,170); return %DataViewGetInt32(this,ai,!!br); } function DataViewSetInt32JS(ai,av,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.setInt32',this); } if(%_ArgumentsLength()<2)throw C(45); ai=H(ai,170); %DataViewSetInt32(this,ai,(%_ToNumber(av)),!!br); } function DataViewGetUint32JS(ai,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.getUint32',this); } if(%_ArgumentsLength()<1)throw C(45); ai=H(ai,170); return %DataViewGetUint32(this,ai,!!br); } function DataViewSetUint32JS(ai,av,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.setUint32',this); } if(%_ArgumentsLength()<2)throw C(45); ai=H(ai,170); %DataViewSetUint32(this,ai,(%_ToNumber(av)),!!br); } function DataViewGetFloat32JS(ai,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.getFloat32',this); } if(%_ArgumentsLength()<1)throw C(45); ai=H(ai,170); return %DataViewGetFloat32(this,ai,!!br); } function DataViewSetFloat32JS(ai,av,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.setFloat32',this); } if(%_ArgumentsLength()<2)throw C(45); ai=H(ai,170); %DataViewSetFloat32(this,ai,(%_ToNumber(av)),!!br); } function DataViewGetFloat64JS(ai,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.getFloat64',this); } if(%_ArgumentsLength()<1)throw C(45); ai=H(ai,170); return %DataViewGetFloat64(this,ai,!!br); } function DataViewSetFloat64JS(ai,av,br){ if(!(%_ClassOf(this)==='DataView')){ throw C(42, 'DataView.setFloat64',this); } if(%_ArgumentsLength()<2)throw C(45); ai=H(ai,170); %DataViewSetFloat64(this,ai,(%_ToNumber(av)),!!br); } %SetCode(h,DataViewConstructor); %FunctionSetPrototype(h,new i); %AddNamedProperty(h.prototype,"constructor",h, 2); %AddNamedProperty(h.prototype,J,"DataView", 1|2); b.InstallGetter(h.prototype,"buffer",DataViewGetBufferJS); b.InstallGetter(h.prototype,"byteOffset", DataViewGetByteOffset); b.InstallGetter(h.prototype,"byteLength", DataViewGetByteLength); b.InstallFunctions(h.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Ñ (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Object; var d=b.ImportNow("IteratorPrototype"); var e=b.ImportNow("iterator_symbol"); function IteratorPrototypeIterator(){ return this; } b.SetFunctionName(IteratorPrototypeIterator,e); %AddNamedProperty(d,e, IteratorPrototypeIterator,2); }) $generator­ (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=b.ImportNow("GeneratorFunctionPrototype"); var d=b.ImportNow("GeneratorFunction"); var e=a.Function; var f; var g=b.ImportNow("to_string_tag_symbol"); b.Import(function(h){ f=h.MakeTypeError; }); function GeneratorObjectNext(i){ if(!(%_ClassOf(this)==='Generator')){ throw f(42, '[Generator].prototype.next',this); } var j=%GeneratorGetContinuation(this); if(j>0){ if(%_DebugIsActive()!=0)%DebugPrepareStepInIfStepping(this); try{ return %_GeneratorNext(this,i); }catch(e){ %GeneratorClose(this); throw e; } }else if(j==0){ return{value:void 0,done:true}; }else{ throw f(40); } } function GeneratorObjectThrow(k){ if(!(%_ClassOf(this)==='Generator')){ throw f(42, '[Generator].prototype.throw',this); } var j=%GeneratorGetContinuation(this); if(j>0){ try{ return %_GeneratorThrow(this,k); }catch(e){ %GeneratorClose(this); throw e; } }else if(j==0){ throw k; }else{ throw f(40); } } %NeverOptimizeFunction(GeneratorObjectNext); %NeverOptimizeFunction(GeneratorObjectThrow); var l=c.prototype; b.InstallFunctions(l, 2, ["next",GeneratorObjectNext, "throw",GeneratorObjectThrow]); %AddNamedProperty(l,"constructor", c,2|1); %AddNamedProperty(l, g,"Generator",2|1); %InternalSetPrototype(c,e.prototype); %AddNamedProperty(c, g,"GeneratorFunction",2|1); %AddNamedProperty(c,"constructor", d,2|1); %InternalSetPrototype(d,e); }) 8object-observeÑ­ (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c; var d=a.Array; var e=a.Object; var f=b.InternalArray; var g; b.Import(function(h){ c=h.GetHash; g=h.MakeTypeError; }); var i; var j={}; function GetObservationStateJS(){ if((i===(void 0))){ i=%GetObservationState(); } if((i.callbackInfoMap===(void 0))){ i.callbackInfoMap=%ObservationWeakMapCreate(); i.objectInfoMap=%ObservationWeakMapCreate(); i.notifierObjectInfoMap=%ObservationWeakMapCreate(); i.pendingObservers=null; i.nextCallbackPriority=0; i.lastMicrotaskId=0; } return i; } function GetPendingObservers(){ return GetObservationStateJS().pendingObservers; } function SetPendingObservers(k){ GetObservationStateJS().pendingObservers=k; } function GetNextCallbackPriority(){ return GetObservationStateJS().nextCallbackPriority++; } function nullProtoObject(){ return{__proto__:null}; } function TypeMapCreate(){ return nullProtoObject(); } function TypeMapAddType(l,m,n){ l[m]=n?1:(l[m]||0)+1; } function TypeMapRemoveType(l,m){ l[m]--; } function TypeMapCreateFromList(o,p){ var l=TypeMapCreate(); for(var q=0;q0?y.performing:null; } function ConvertAcceptListToTypeMap(E){ if((E===(void 0))) return E; if(!(%_IsJSReceiver(E)))throw g(80); var F=(%_ToInteger(E.length)); if(F<0)F=0; return TypeMapCreateFromList(E,F); } function CallbackInfoGet(v){ return %WeakCollectionGet(GetObservationStateJS().callbackInfoMap,v, c(v)); } function CallbackInfoSet(v,C){ %WeakCollectionSet(GetObservationStateJS().callbackInfoMap, v,C,c(v)); } function CallbackInfoGetOrCreate(v){ var C=CallbackInfoGet(v); if(!(C===(void 0))) return C; var D=GetNextCallbackPriority(); CallbackInfoSet(v,D); return D; } function CallbackInfoGetPriority(C){ if((typeof(C)==='number')) return C; else return C.priority; } function CallbackInfoNormalize(v){ var C=CallbackInfoGet(v); if((typeof(C)==='number')){ var D=C; C=new f; C.priority=D; CallbackInfoSet(v,C); } return C; } function ObjectObserve(z,v,w){ if(!(%_IsJSReceiver(z))) throw g(82,"observe","observe"); if(%IsJSGlobalProxy(z)) throw g(78,"observe"); if(%IsAccessCheckNeeded(z)) throw g(79,"observe"); if(!(typeof(v)==='function')) throw g(81,"observe"); if(%object_is_frozen(v)) throw g(77); var G=%GetObjectContextObjectObserve(z); return G(z,v,w); } function NativeObjectObserve(z,v,w){ var y=ObjectInfoGetOrCreate(z); var o=ConvertAcceptListToTypeMap(w); ObjectInfoAddObserver(y,v,o); return z; } function ObjectUnobserve(z,v){ if(!(%_IsJSReceiver(z))) throw g(82,"unobserve","unobserve"); if(%IsJSGlobalProxy(z)) throw g(78,"unobserve"); if(!(typeof(v)==='function')) throw g(81,"unobserve"); var y=ObjectInfoGet(z); if((y===(void 0))) return z; ObjectInfoRemoveObserver(y,v); return z; } function ArrayObserve(z,v){ return ObjectObserve(z,v,['add', 'update', 'delete', 'splice']); } function ArrayUnobserve(z,v){ return ObjectUnobserve(z,v); } function ObserverEnqueueIfActive(x,y,H){ if(!ObserverIsActive(x,y)|| !TypeMapHasType(ObserverGetAcceptTypes(x),H.type)){ return; } var v=ObserverGetCallback(x); if(!%ObserverObjectAndRecordHaveSameOrigin(v,H.object, H)){ return; } var C=CallbackInfoNormalize(v); if((GetPendingObservers()===null)){ SetPendingObservers(nullProtoObject()); if((%_DebugIsActive()!=0)){ var I=++GetObservationStateJS().lastMicrotaskId; var J="Object.observe"; %EnqueueMicrotask(function(){ %DebugAsyncTaskEvent({type:"willHandle",id:I,name:J}); ObserveMicrotaskRunner(); %DebugAsyncTaskEvent({type:"didHandle",id:I,name:J}); }); %DebugAsyncTaskEvent({type:"enqueue",id:I,name:J}); }else{ %EnqueueMicrotask(ObserveMicrotaskRunner); } } GetPendingObservers()[C.priority]=v; C.push(H); } function ObjectInfoEnqueueExternalChangeRecord(y,H,m){ if(!ObjectInfoHasActiveObservers(y)) return; var K=!(m===(void 0)); var L=K? {object:y.object,type:m}: {object:y.object}; for(var M in H){ if(M==='object'||(K&&M==='type'))continue; %DefineDataPropertyUnchecked( L,M,H[M],1+4); } %object_freeze(L); ObjectInfoEnqueueInternalChangeRecord(y,L); } function ObjectInfoEnqueueInternalChangeRecord(y,H){ if((typeof(H.name)==='symbol'))return; if(ChangeObserversIsOptimized(y.changeObservers)){ var x=y.changeObservers; ObserverEnqueueIfActive(x,y,H); return; } for(var D in y.changeObservers){ var x=y.changeObservers[D]; if((x===null)) continue; ObserverEnqueueIfActive(x,y,H); } } function BeginPerformSplice(N){ var y=ObjectInfoGet(N); if(!(y===(void 0))) ObjectInfoAddPerformingType(y,'splice'); } function EndPerformSplice(N){ var y=ObjectInfoGet(N); if(!(y===(void 0))) ObjectInfoRemovePerformingType(y,'splice'); } function EnqueueSpliceRecord(N,O,P,Q){ var y=ObjectInfoGet(N); if(!ObjectInfoHasActiveObservers(y)) return; var H={ type:'splice', object:N, index:O, removed:P, addedCount:Q }; %object_freeze(H); %object_freeze(H.removed); ObjectInfoEnqueueInternalChangeRecord(y,H); } function NotifyChange(m,z,J,R){ var y=ObjectInfoGet(z); if(!ObjectInfoHasActiveObservers(y)) return; var H; if(arguments.length==2){ H={type:m,object:z}; }else if(arguments.length==3){ H={type:m,object:z,name:J}; }else{ H={ type:m, object:z, name:J, oldValue:R }; } %object_freeze(H); ObjectInfoEnqueueInternalChangeRecord(y,H); } function ObjectNotifierNotify(H){ if(!(%_IsJSReceiver(this))) throw g(16,"notify"); var y=ObjectInfoGetFromNotifier(this); if((y===(void 0))) throw g(83); if(!(typeof(H.type)==='string')) throw g(86); ObjectInfoEnqueueExternalChangeRecord(y,H); } function ObjectNotifierPerformChange(S,T){ if(!(%_IsJSReceiver(this))) throw g(16,"performChange"); var y=ObjectInfoGetFromNotifier(this); if((y===(void 0))) throw g(83); if(!(typeof(S)==='string')) throw g(85); if(!(typeof(T)==='function')) throw g(84); var U=%GetObjectContextNotifierPerformChange(y); U(y,S,T); } function NativeObjectNotifierPerformChange(y,S,T){ ObjectInfoAddPerformingType(y,S); var H; try{ H=T(); }finally{ ObjectInfoRemovePerformingType(y,S); } if((%_IsJSReceiver(H))) ObjectInfoEnqueueExternalChangeRecord(y,H,S); } function ObjectGetNotifier(z){ if(!(%_IsJSReceiver(z))) throw g(82,"getNotifier","getNotifier"); if(%IsJSGlobalProxy(z)) throw g(78,"getNotifier"); if(%IsAccessCheckNeeded(z)) throw g(79,"getNotifier"); if(%object_is_frozen(z))return null; if(!%ObjectWasCreatedInCurrentOrigin(z))return null; var V=%GetObjectContextObjectGetNotifier(z); return V(z); } function NativeObjectGetNotifier(z){ var y=ObjectInfoGetOrCreate(z); return ObjectInfoGetNotifier(y); } function CallbackDeliverPending(v){ var C=CallbackInfoGet(v); if((C===(void 0))||(typeof(C)==='number')) return false; var D=C.priority; CallbackInfoSet(v,D); var k=GetPendingObservers(); if(!(k===null)) delete k[D]; var W=[]; %MoveArrayContents(C,W); %DeliverObservationChangeRecords(v,W); return true; } function ObjectDeliverChangeRecords(v){ if(!(typeof(v)==='function')) throw g(81,"deliverChangeRecords"); while(CallbackDeliverPending(v)){} } function ObserveMicrotaskRunner(){ var k=GetPendingObservers(); if(!(k===null)){ SetPendingObservers(null); for(var q in k){ CallbackDeliverPending(k[q]); } } } b.InstallFunctions(j,2,[ "notify",ObjectNotifierNotify, "performChange",ObjectNotifierPerformChange ]); var X=[ "deliverChangeRecords",ObjectDeliverChangeRecords, "getNotifier",ObjectGetNotifier, "observe",ObjectObserve, "unobserve",ObjectUnobserve ]; var Y=[ "observe",ArrayObserve, "unobserve",ArrayUnobserve ]; var Z=function(aa,q){ if(q % 2===1)%FunctionRemovePrototype(aa); }; X.forEach(Z); Y.forEach(Z); %InstallToContext([ "native_object_get_notifier",NativeObjectGetNotifier, "native_object_notifier_perform_change",NativeObjectNotifierPerformChange, "native_object_observe",NativeObjectObserve, "observers_begin_perform_splice",BeginPerformSplice, "observers_end_perform_splice",EndPerformSplice, "observers_enqueue_splice",EnqueueSpliceRecord, "observers_notify_change",NotifyChange, ]); b.Export(function(ab){ ab.ObserveArrayMethods=Y; ab.ObserveBeginPerformSplice=BeginPerformSplice; ab.ObserveEndPerformSplice=EndPerformSplice; ab.ObserveEnqueueSpliceRecord=EnqueueSpliceRecord; ab.ObserveObjectMethods=X; }); }) (collectionE} (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Map; var d=a.Object; var e=a.Set; var f=b.ImportNow("hash_code_symbol"); var g; var h; var i; var j; var k; var l=b.ImportNow("to_string_tag_symbol"); b.Import(function(m){ g=m.IntRandom; h=m.MakeTypeError; i=m.MapIterator; j=m.NumberIsNaN; k=m.SetIterator; }); function HashToEntry(n,o,p){ var q=(o&((p)-1)); return((%_FixedArrayGet(n,(3+(q))|0))); } %SetForceInlineFlag(HashToEntry); function SetFindEntry(n,p,r,o){ var s=HashToEntry(n,o,p); if(s===-1)return s; var t=((%_FixedArrayGet(n,((3+(p)+((s)<<1)))|0))); if(r===t)return s; var u=j(r); while(true){ if(u&&j(t)){ return s; } s=((%_FixedArrayGet(n,((3+(p)+((s)<<1))+1)|0))); if(s===-1)return s; t=((%_FixedArrayGet(n,((3+(p)+((s)<<1)))|0))); if(r===t)return s; } return-1; } %SetForceInlineFlag(SetFindEntry); function MapFindEntry(n,p,r,o){ var s=HashToEntry(n,o,p); if(s===-1)return s; var t=((%_FixedArrayGet(n,((3+(p)+((s)*3)))|0))); if(r===t)return s; var u=j(r); while(true){ if(u&&j(t)){ return s; } s=((%_FixedArrayGet(n,((3+(p)+((s)*3))+2)|0))); if(s===-1)return s; t=((%_FixedArrayGet(n,((3+(p)+((s)*3)))|0))); if(r===t)return s; } return-1; } %SetForceInlineFlag(MapFindEntry); function ComputeIntegerHash(r,v){ var o=r; o=o^v; o=~o+(o<<15); o=o^(o>>>12); o=o+(o<<2); o=o^(o>>>4); o=(o*2057)|0; o=o^(o>>>16); return o&0x3fffffff; } %SetForceInlineFlag(ComputeIntegerHash); function GetExistingHash(r){ if(%_IsSmi(r)){ return ComputeIntegerHash(r,0); } if((typeof(r)==='string')){ var w=%_StringGetRawHashField(r); if((w&1)===0){ return w>>>2; } }else if((%_IsJSReceiver(r))&&!(%_IsJSProxy(r))&&!(%_ClassOf(r)==='global')){ var o=(r[f]); return o; } return %GenericHash(r); } %SetForceInlineFlag(GetExistingHash); function GetHash(r){ var o=GetExistingHash(r); if((o===(void 0))){ o=g()|0; if(o===0)o=1; (r[f]=o); } return o; } %SetForceInlineFlag(GetHash); function SetConstructor(x){ if((new.target===(void 0))){ throw h(26,"Set"); } %_SetInitialize(this); if(!(x==null)){ var y=this.add; if(!(typeof(y)==='function')){ throw h(91,y,'add',this); } for(var z of x){ %_Call(y,this,z); } } } function SetAdd(r){ if(!(%_ClassOf(this)==='Set')){ throw h(42,'Set.prototype.add',this); } if(r===0){ r=0; } var n=%_JSCollectionGetTable(this); var p=((%_FixedArrayGet(n,(0)|0))); var o=GetHash(r); if(SetFindEntry(n,p,r,o)!==-1)return this; var A=((%_FixedArrayGet(n,(1)|0))); var B=((%_FixedArrayGet(n,(2)|0))); var C=p<<1; if((A+B)>=C){ %SetGrow(this); n=%_JSCollectionGetTable(this); p=((%_FixedArrayGet(n,(0)|0))); A=((%_FixedArrayGet(n,(1)|0))); B=((%_FixedArrayGet(n,(2)|0))); } var s=A+B; var D=(3+(p)+((s)<<1)); var q=(o&((p)-1)); var E=((%_FixedArrayGet(n,(3+(q))|0))); ((%_FixedArraySet(n,(3+(q))|0,s))); (((%_FixedArraySet(n,(1)|0,(A+1)|0)))); (%_FixedArraySet(n,(D)|0,r)); ((%_FixedArraySet(n,(D+1)|0,(E)|0))); return this; } function SetHas(r){ if(!(%_ClassOf(this)==='Set')){ throw h(42,'Set.prototype.has',this); } var n=%_JSCollectionGetTable(this); var p=((%_FixedArrayGet(n,(0)|0))); var o=GetExistingHash(r); if((o===(void 0)))return false; return SetFindEntry(n,p,r,o)!==-1; } function SetDelete(r){ if(!(%_ClassOf(this)==='Set')){ throw h(42, 'Set.prototype.delete',this); } var n=%_JSCollectionGetTable(this); var p=((%_FixedArrayGet(n,(0)|0))); var o=GetExistingHash(r); if((o===(void 0)))return false; var s=SetFindEntry(n,p,r,o); if(s===-1)return false; var A=((%_FixedArrayGet(n,(1)|0)))-1; var B=((%_FixedArrayGet(n,(2)|0)))+1; var D=(3+(p)+((s)<<1)); (%_FixedArraySet(n,(D)|0,%_TheHole())); (((%_FixedArraySet(n,(1)|0,(A)|0)))); (((%_FixedArraySet(n,(2)|0,(B)|0)))); if(A<(p>>>1))%SetShrink(this); return true; } function SetGetSize(){ if(!(%_ClassOf(this)==='Set')){ throw h(42, 'Set.prototype.size',this); } var n=%_JSCollectionGetTable(this); return((%_FixedArrayGet(n,(1)|0))); } function SetClearJS(){ if(!(%_ClassOf(this)==='Set')){ throw h(42, 'Set.prototype.clear',this); } %_SetClear(this); } function SetForEach(F,G){ if(!(%_ClassOf(this)==='Set')){ throw h(42, 'Set.prototype.forEach',this); } if(!(typeof(F)==='function'))throw h(15,F); var H=new k(this,2); var r; var I=[(void 0)]; while(%SetIteratorNext(H,I)){ r=I[0]; %_Call(F,G,r,r,this); } } %SetCode(e,SetConstructor); %FunctionSetLength(e,0); %FunctionSetPrototype(e,new d()); %AddNamedProperty(e.prototype,"constructor",e,2); %AddNamedProperty(e.prototype,l,"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(x){ if((new.target===(void 0))){ throw h(26,"Map"); } %_MapInitialize(this); if(!(x==null)){ var y=this.set; if(!(typeof(y)==='function')){ throw h(91,y,'set',this); } for(var J of x){ if(!(%_IsJSReceiver(J))){ throw h(49,J); } %_Call(y,this,J[0],J[1]); } } } function MapGet(r){ if(!(%_ClassOf(this)==='Map')){ throw h(42, 'Map.prototype.get',this); } var n=%_JSCollectionGetTable(this); var p=((%_FixedArrayGet(n,(0)|0))); var o=GetExistingHash(r); if((o===(void 0)))return(void 0); var s=MapFindEntry(n,p,r,o); if(s===-1)return(void 0); return((%_FixedArrayGet(n,((3+(p)+((s)*3))+1)|0))); } function MapSet(r,z){ if(!(%_ClassOf(this)==='Map')){ throw h(42, 'Map.prototype.set',this); } if(r===0){ r=0; } var n=%_JSCollectionGetTable(this); var p=((%_FixedArrayGet(n,(0)|0))); var o=GetHash(r); var s=MapFindEntry(n,p,r,o); if(s!==-1){ var K=(3+(p)+((s)*3)); (%_FixedArraySet(n,(K+1)|0,z)); return this; } var A=((%_FixedArrayGet(n,(1)|0))); var B=((%_FixedArrayGet(n,(2)|0))); var C=p<<1; if((A+B)>=C){ %MapGrow(this); n=%_JSCollectionGetTable(this); p=((%_FixedArrayGet(n,(0)|0))); A=((%_FixedArrayGet(n,(1)|0))); B=((%_FixedArrayGet(n,(2)|0))); } s=A+B; var D=(3+(p)+((s)*3)); var q=(o&((p)-1)); var E=((%_FixedArrayGet(n,(3+(q))|0))); ((%_FixedArraySet(n,(3+(q))|0,s))); (((%_FixedArraySet(n,(1)|0,(A+1)|0)))); (%_FixedArraySet(n,(D)|0,r)); (%_FixedArraySet(n,(D+1)|0,z)); (%_FixedArraySet(n,(D+2)|0,E)); return this; } function MapHas(r){ if(!(%_ClassOf(this)==='Map')){ throw h(42, 'Map.prototype.has',this); } var n=%_JSCollectionGetTable(this); var p=((%_FixedArrayGet(n,(0)|0))); var o=GetHash(r); return MapFindEntry(n,p,r,o)!==-1; } function MapDelete(r){ if(!(%_ClassOf(this)==='Map')){ throw h(42, 'Map.prototype.delete',this); } var n=%_JSCollectionGetTable(this); var p=((%_FixedArrayGet(n,(0)|0))); var o=GetHash(r); var s=MapFindEntry(n,p,r,o); if(s===-1)return false; var A=((%_FixedArrayGet(n,(1)|0)))-1; var B=((%_FixedArrayGet(n,(2)|0)))+1; var D=(3+(p)+((s)*3)); (%_FixedArraySet(n,(D)|0,%_TheHole())); (%_FixedArraySet(n,(D+1)|0,%_TheHole())); (((%_FixedArraySet(n,(1)|0,(A)|0)))); (((%_FixedArraySet(n,(2)|0,(B)|0)))); if(A<(p>>>1))%MapShrink(this); return true; } function MapGetSize(){ if(!(%_ClassOf(this)==='Map')){ throw h(42, 'Map.prototype.size',this); } var n=%_JSCollectionGetTable(this); return((%_FixedArrayGet(n,(1)|0))); } function MapClearJS(){ if(!(%_ClassOf(this)==='Map')){ throw h(42, 'Map.prototype.clear',this); } %_MapClear(this); } function MapForEach(F,G){ if(!(%_ClassOf(this)==='Map')){ throw h(42, 'Map.prototype.forEach',this); } if(!(typeof(F)==='function'))throw h(15,F); var H=new i(this,3); var I=[(void 0),(void 0)]; while(%MapIteratorNext(H,I)){ %_Call(F,G,I[1],I[0],this); } } %SetCode(c,MapConstructor); %FunctionSetLength(c,0); %FunctionSetPrototype(c,new d()); %AddNamedProperty(c.prototype,"constructor",c,2); %AddNamedProperty( c.prototype,l,"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 ]); %InstallToContext([ "map_get",MapGet, "map_set",MapSet, "map_has",MapHas, "map_delete",MapDelete, "set_add",SetAdd, "set_has",SetHas, "set_delete",SetDelete, ]); b.Export(function(L){ L.GetExistingHash=GetExistingHash; L.GetHash=GetHash; }); }) { if(r===true)return; r=true; PromiseResolve(q,value); }; var t=reason=>{ if(r===true)return; r=true; PromiseReject(q,reason); }; return{ __proto__:null, resolve:s, reject:t }; } var u=function Promise(v){ if(v===j){ return %NewObject(u,new.target); } if((new.target===(void 0)))throw e(61,this); if(!(typeof(v)==='function')) throw e(134,v); var q=PromiseInit(%NewObject(u,new.target)); var w=CreateResolvingFunctions(q); try{ %DebugPushPromise(q,Promise); v(w.resolve,w.reject); }catch(e){ %_Call(w.reject,(void 0),e); }finally{ %DebugPopPromise(); } return q; } function PromiseSet(q,x,y,z,A){ (q[k]=x); (q[l]=y); (q[i]=z); (q[h]=A); if((%_DebugIsActive()!=0)){ %DebugPromiseEvent({promise:q,status:x,value:y}); } return q; } function PromiseCreateAndSet(x,y){ var q=new u(j); if((%_DebugIsActive()!=0))PromiseSet(q,0,(void 0)); return PromiseSet(q,x,y); } function PromiseInit(q){ return PromiseSet( q,0,(void 0),new d,new d) } function PromiseDone(q,x,y,B){ if((q[k])===0){ var C=(q[B]); if(C.length)PromiseEnqueue(y,C,x); PromiseSet(q,x,y); } } function PromiseHandle(y,D,E){ try{ %DebugPushPromise(E.promise,PromiseHandle); var F=D(y); E.resolve(F); }catch(exception){ try{E.reject(exception);}catch(e){} }finally{ %DebugPopPromise(); } } function PromiseEnqueue(y,C,x){ var G,H,I=(%_DebugIsActive()!=0); %EnqueueMicrotask(function(){ if(I){ %DebugAsyncTaskEvent({type:"willHandle",id:G,name:H}); } for(var J=0;J0?"Promise.resolve":"Promise.reject"; %DebugAsyncTaskEvent({type:"enqueue",id:G,name:H}); } } function PromiseIdResolveHandler(K){return K} function PromiseIdRejectHandler(L){throw L} function PromiseNopResolver(){} function IsPromise(K){ return(%_IsJSReceiver(K))&&(!(K[k]===(void 0))); } function PromiseCreate(){ return new u(PromiseNopResolver) } function PromiseResolve(q,K){ if(K===q){ return PromiseReject(q,e(88,K)); } if((%_IsJSReceiver(K))){ try{ var M=K.then; }catch(e){ return PromiseReject(q,e); } if((typeof(M)==='function')){ var G,H,I=(%_DebugIsActive()!=0); %EnqueueMicrotask(function(){ if(I){ %DebugAsyncTaskEvent({type:"willHandle",id:G,name:H}); } var w=CreateResolvingFunctions(q); try{ %_Call(M,K,w.resolve,w.reject); }catch(e){ %_Call(w.reject,(void 0),e); } if(I){ %DebugAsyncTaskEvent({type:"didHandle",id:G,name:H}); } }); if(I){ G=++p; H="PromseResolveThenableJob"; %DebugAsyncTaskEvent({type:"enqueue",id:G,name:H}); } return; } } PromiseDone(q,+1,K,i); } function PromiseReject(q,L){ if((q[k])==0){ var N=(%_DebugIsActive()!=0); if(N|| !(!(q[g]===(void 0)))){ %PromiseRejectEvent(q,L,N); } } PromiseDone(q,-1,L,h) } function NewPromiseCapability(O){ if(O===u){ var q=PromiseInit(new u(j)); var w=CreateResolvingFunctions(q); return{ promise:q, resolve:w.resolve, reject:w.reject }; } var F={promise:(void 0),resolve:(void 0),reject:(void 0)}; F.promise=new O((s,t)=>{ if(!(F.resolve===(void 0))||!(F.reject===(void 0))) throw e(89); F.resolve=s; F.reject=t; }); return F; } function PromiseDeferred(){ %IncrementUseCounter(19); return NewPromiseCapability(this); } function PromiseResolved(K){ %IncrementUseCounter(18); return %_Call(PromiseCast,this,K); } function PromiseRejected(L){ if(!(%_IsJSReceiver(this))){ throw e(16,PromiseRejected); } if(this===u){ var q=PromiseCreateAndSet(-1,L); %PromiseRejectEvent(q,L,false); return q; }else{ var P=NewPromiseCapability(this); %_Call(P.reject,(void 0),L); return P.promise; } } function PromiseThen(z,A){ var x=(this[k]); if((x===(void 0))){ throw e(61,this); } var Q=m(this,u); z=(typeof(z)==='function')?z:PromiseIdResolveHandler; A=(typeof(A)==='function')?A:PromiseIdRejectHandler; var E=NewPromiseCapability(Q); switch(x){ case 0: (this[i]).push(z,E); (this[h]).push(A,E); break; case+1: PromiseEnqueue((this[l]), [z,E], +1); break; case-1: if(!(!(this[g]===(void 0)))){ %PromiseRevokeReject(this); } PromiseEnqueue((this[l]), [A,E], -1); break; } (this[g]=true); if((%_DebugIsActive()!=0)){ %DebugPromiseEvent({promise:E.promise,parentPromise:this}); } return E.promise; } function PromiseChain(z,A){ %IncrementUseCounter(17); return %_Call(PromiseThen,this,z,A); } function PromiseCatch(A){ return this.then((void 0),A); } function PromiseCast(K){ if(!(%_IsJSReceiver(this))){ throw e(16,PromiseCast); } if(IsPromise(K)&&K.constructor===this)return K; var P=NewPromiseCapability(this); var R=%_Call(P.resolve,(void 0),K); return P.promise; } function PromiseAll(S){ if(!(%_IsJSReceiver(this))){ throw e(16,"Promise.all"); } var E=NewPromiseCapability(this); var T=new d(); var U; function CreateResolveElementFunction(V,W,P){ var X=false; return(K)=>{ if(X===true)return; X=true; W[V]=K; if(--U===0){ var Y=[]; %MoveArrayContents(W,Y); %_Call(P.resolve,(void 0),Y); } }; } try{ var J=0; U=1; for(var y of S){ var Z=this.resolve(y); ++U; Z.then( CreateResolveElementFunction(J,T,E), E.reject); (E.reject[f]=E); ++J; } if(--U===0){ var Y=[]; %MoveArrayContents(T,Y); %_Call(E.resolve,(void 0),Y); } }catch(e){ %_Call(E.reject,(void 0),e); } return E.promise; } function PromiseRace(S){ if(!(%_IsJSReceiver(this))){ throw e(16,PromiseRace); } var E=NewPromiseCapability(this); try{ for(var y of S){ this.resolve(y).then(E.resolve,E.reject); (E.reject[f]=E); } }catch(e){ E.reject(e) } return E.promise; } function PromiseHasUserDefinedRejectHandlerRecursive(q){ var aa=(q[h]); if((aa===(void 0)))return false; for(var J=0;J%FunctionRemovePrototype(fn)); b.Export(function(ab){ ab.PromiseChain=PromiseChain; ab.PromiseDeferred=PromiseDeferred; ab.PromiseResolved=PromiseResolved; }); }) messagesá (function(a,b){ %CheckIsBootstrapping(); var c; var d; var e; var f; var g= b.ImportNow("call_site_receiver_symbol"); var h= b.ImportNow("call_site_function_symbol"); var i= b.ImportNow("call_site_position_symbol"); var j= b.ImportNow("call_site_strict_symbol"); var k; var l; var m= b.ImportNow("formatted_stack_trace_symbol"); var n=a.Object; var o; var p; var q; var r=b.InternalArray; var s=b.ImportNow("internal_error_symbol"); var t; var u=b.ImportNow("object_to_string"); var v=b.ImportNow("Script"); var w=b.ImportNow("stack_trace_symbol"); var x; var y; var z; var A; var B=b.ImportNow("to_string_tag_symbol"); var C; var D; var E; b.Import(function(F){ c=F.ArrayJoin; d=F.Bool16x8ToString; e=F.Bool32x4ToString; f=F.Bool8x16ToString; l=F.Float32x4ToString; o=F.Int16x8ToString; p=F.Int32x4ToString; q=F.Int8x16ToString; t=F.ObjectDefineProperty; x=F.StringCharAt; y=F.StringIndexOf; z=F.StringSubstring; A=F.SymbolToString; C=F.Uint16x8ToString; D=F.Uint32x4ToString; E=F.Uint8x16ToString; }); b.ImportFromExperimental(function(F){ k=F.FLAG_harmony_tostring; }); var G; var H; var I; var J; var K; var L; var M; function NoSideEffectsObjectToString(){ if((this===(void 0)))return"[object Undefined]"; if((this===null))return"[object Null]"; var N=(%_ToObject(this)); var O=%_ClassOf(N); var P; if(k){ P=%GetDataProperty(N,B); if(!(typeof(P)==='string')){ P=O; } }else{ P=O; } return`[object ${P}]`; } function IsErrorObject(Q){ return(%HasOwnProperty(Q,w)); } function NoSideEffectsErrorToString(){ var R=%GetDataProperty(this,"name"); var S=%GetDataProperty(this,"message"); R=(R===(void 0))?"Error":NoSideEffectsToString(R); S=(S===(void 0))?"":NoSideEffectsToString(S); if(R=="")return S; if(S=="")return R; return`${R}: ${S}`; } function NoSideEffectsToString(Q){ if((typeof(Q)==='string'))return Q; if((typeof(Q)==='number'))return %_NumberToString(Q); if((typeof(Q)==='boolean'))return Q?'true':'false'; if((Q===(void 0)))return'undefined'; if((Q===null))return'null'; if((%_IsFunction(Q))){ var T=%FunctionToString(Q); if(T.length>128){ T=%_SubString(T,0,111)+"......"+ %_SubString(T,T.length-2,T.length); } return T; } if((typeof(Q)==='symbol'))return %_Call(A,Q); if((%_IsSimdValue(Q))){ switch(typeof(Q)){ case'float32x4':return %_Call(l,Q); case'int32x4':return %_Call(p,Q); case'int16x8':return %_Call(o,Q); case'int8x16':return %_Call(q,Q); case'uint32x4':return %_Call(D,Q); case'uint16x8':return %_Call(C,Q); case'uint8x16':return %_Call(E,Q); case'bool32x4':return %_Call(e,Q); case'bool16x8':return %_Call(d,Q); case'bool8x16':return %_Call(f,Q); } } if((%_IsJSReceiver(Q))){ if(IsErrorObject(Q)|| %GetDataProperty(Q,"toString")===ErrorToString){ return %_Call(NoSideEffectsErrorToString,Q); } if(%GetDataProperty(Q,"toString")===u){ var U=%GetDataProperty(Q,"constructor"); if((%_IsFunction(U))){ var V=%FunctionGetName(U); if(V!="")return`#<${V}>`; } } } return %_Call(NoSideEffectsObjectToString,Q); } function MakeGenericError(U,W,X,Y,Z){ var aa=new U(FormatMessage(W,X,Y,Z)); aa[s]=true; return aa; } %FunctionSetInstanceClassName(v,'Script'); %AddNamedProperty(v.prototype,'constructor',v, 2|4|1); %SetCode(v,function(ab){ throw MakeError(6); }); function FormatMessage(W,X,Y,Z){ var X=NoSideEffectsToString(X); var Y=NoSideEffectsToString(Y); var Z=NoSideEffectsToString(Z); try{ return %FormatMessageString(W,X,Y,Z); }catch(e){ return""; } } function GetLineNumber(S){ var ac=%MessageGetStartPosition(S); if(ac==-1)return 0; var ad=%MessageGetScript(S); var ae=ad.locationFromPosition(ac,true); if(ae==null)return 0; return ae.line+1; } function GetColumnNumber(S){ var ad=%MessageGetScript(S); var ac=%MessageGetStartPosition(S); var ae=ad.locationFromPosition(ac,true); if(ae==null)return-1; return ae.column; } function GetSourceLine(S){ var ad=%MessageGetScript(S); var ac=%MessageGetStartPosition(S); var ae=ad.locationFromPosition(ac,true); if(ae==null)return""; return ae.sourceText(); } function ScriptLineFromPosition(af){ var ag=0; var ah=this.lineCount()-1; var ai=this.line_ends; if(af>ai[ah]){ return-1; } if(af<=ai[0]){ return 0; } while(ah>=1){ var aj=(ag+ah)>>1; if(af>ai[aj]){ ag=aj+1; }else if(af<=ai[aj-1]){ ah=aj-1; }else{ return aj; } } return-1; } function ScriptLocationFromPosition(af, include_resource_offset){ var ak=this.lineFromPosition(af); if(ak==-1)return null; var ai=this.line_ends; var al=ak==0?0:ai[ak-1]+1; var am=ai[ak]; if(am>0&&%_Call(x,this.source,am-1)=='\r'){ am--; } var an=af-al; if(include_resource_offset){ ak+=this.line_offset; if(ak==this.line_offset){ an+=this.column_offset; } } return new SourceLocation(this,af,ak,an,al,am); } function ScriptLocationFromLine(ao,ap,aq){ var ak=0; if(!(ao===(void 0))){ ak=ao-this.line_offset; } var an=ap||0; if(ak==0){ an-=this.column_offset; } var ar=aq||0; if(ak<0||an<0||ar<0)return null; if(ak==0){ return this.locationFromPosition(ar+an,false); }else{ var as=this.lineFromPosition(ar); if(as==-1||as+ak>=this.lineCount()){ return null; } return this.locationFromPosition( this.line_ends[as+ak-1]+1+an); } } function ScriptSourceSlice(at,au){ var av=(at===(void 0))?this.line_offset :at; var aw=(au===(void 0))?this.line_offset+this.lineCount() :au; av-=this.line_offset; aw-=this.line_offset; if(av<0)av=0; if(aw>this.lineCount())aw=this.lineCount(); if(av>=this.lineCount()|| aw<0|| av>aw){ return null; } var ai=this.line_ends; var ax=av==0?0:ai[av-1]+1; var ay=aw==0?0:ai[aw-1]+1; return new SourceSlice(this, av+this.line_offset, aw+this.line_offset, ax,ay); } function ScriptSourceLine(ao){ var ak=0; if(!(ao===(void 0))){ ak=ao-this.line_offset; } if(ak<0||this.lineCount()<=ak){ return null; } var ai=this.line_ends; var al=ak==0?0:ai[ak-1]+1; var am=ai[ak]; return %_Call(z,this.source,al,am); } function ScriptLineCount(){ return this.line_ends.length; } function ScriptLineEnd(az){ return this.line_ends[az]; } function ScriptNameOrSourceURL(){ if(this.source_url)return this.source_url; return this.name; } b.SetUpLockedPrototype(v,[ "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(ad,af,ak,an,al,am){ this.script=ad; this.position=af; this.line=ak; this.column=an; this.start=al; this.end=am; } function SourceLocationSourceText(){ return %_Call(z,this.script.source,this.start,this.end); } b.SetUpLockedPrototype(SourceLocation, ["script","position","line","column","start","end"], ["sourceText",SourceLocationSourceText] ); function SourceSlice(ad,av,aw,ax,ay){ this.script=ad; this.from_line=av; this.to_line=aw; this.from_position=ax; this.to_position=ay; } function SourceSliceSourceText(){ return %_Call(z, this.script.source, this.from_position, this.to_position); } b.SetUpLockedPrototype(SourceSlice, ["script","from_line","to_line","from_position","to_position"], ["sourceText",SourceSliceSourceText] ); function GetStackTraceLine(aA,aB,aC,aD){ return new CallSite(aA,aB,aC,false).toString(); } function CallSite(aE,aB,aC,aF){ if(!(%_IsFunction(aB))){ throw MakeTypeError(18,typeof aB); } if((new.target===(void 0))){ return new CallSite(aE,aB,aC,aF); } (this[g]=aE); (this[h]=aB); (this[i]=((aC)|0)); (this[j]=(!!(aF))); } function CallSiteGetThis(){ return(this[j]) ?(void 0):(this[g]); } function CallSiteGetFunction(){ return(this[j]) ?(void 0):(this[h]); } function CallSiteGetPosition(){ return(this[i]); } function CallSiteGetTypeName(){ return GetTypeName((this[g]),false); } function CallSiteIsToplevel(){ return %CallSiteIsToplevelRT(this); } function CallSiteIsEval(){ return %CallSiteIsEvalRT(this); } function CallSiteGetEvalOrigin(){ var ad=%FunctionGetScript((this[h])); return FormatEvalOrigin(ad); } function CallSiteGetScriptNameOrSourceURL(){ return %CallSiteGetScriptNameOrSourceUrlRT(this); } function CallSiteGetFunctionName(){ return %CallSiteGetFunctionNameRT(this); } function CallSiteGetMethodName(){ return %CallSiteGetMethodNameRT(this); } function CallSiteGetFileName(){ return %CallSiteGetFileNameRT(this); } function CallSiteGetLineNumber(){ return %CallSiteGetLineNumberRT(this); } function CallSiteGetColumnNumber(){ return %CallSiteGetColumnNumberRT(this); } function CallSiteIsNative(){ return %CallSiteIsNativeRT(this); } function CallSiteIsConstructor(){ return %CallSiteIsConstructorRT(this); } function CallSiteToString(){ var aG; var aH=""; if(this.isNative()){ aH="native"; }else{ aG=this.getScriptNameOrSourceURL(); if(!aG&&this.isEval()){ aH=this.getEvalOrigin(); aH+=", "; } if(aG){ aH+=aG; }else{ aH+=""; } var aI=this.getLineNumber(); if(aI!=null){ aH+=":"+aI; var aJ=this.getColumnNumber(); if(aJ){ aH+=":"+aJ; } } } var ak=""; var aK=this.getFunctionName(); var aL=true; var aM=this.isConstructor(); var aN=!(this.isToplevel()||aM); if(aN){ var aO=GetTypeName((this[g]),true); var aP=this.getMethodName(); if(aK){ if(aO&&%_Call(y,aK,aO)!=0){ ak+=aO+"."; } ak+=aK; if(aP&& (%_Call(y,aK,"."+aP)!= aK.length-aP.length-1)){ ak+=" [as "+aP+"]"; } }else{ ak+=aO+"."+(aP||""); } }else if(aM){ ak+="new "+(aK||""); }else if(aK){ ak+=aK; }else{ ak+=aH; aL=false; } if(aL){ ak+=" ("+aH+")"; } return ak; } 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(ad){ var aQ=ad.nameOrSourceURL(); if(aQ){ return aQ; } var aR="eval at "; if(ad.eval_from_function_name){ aR+=ad.eval_from_function_name; }else{ aR+=""; } var aS=ad.eval_from_script; if(aS){ if(aS.compilation_type==1){ aR+=" ("+FormatEvalOrigin(aS)+")"; }else{ if(aS.name){ aR+=" ("+aS.name; var ae=aS.locationFromPosition( ad.eval_from_script_position,true); if(ae){ aR+=":"+(ae.line+1); aR+=":"+(ae.column+1); } aR+=")"; }else{ aR+=" (unknown source)"; } } } return aR; } function FormatErrorString(aa){ try{ return %_Call(ErrorToString,aa); }catch(e){ try{ return""; }catch(ee){ return""; } } } function GetStackFrames(aT){ var aU=new r(); var aV=aT[0]; for(var aj=1;aj"; }catch(ee){ ak=""; } } bb.push(" at "+ak); } return %_Call(c,bb,"\n"); } function GetTypeName(aE,bd){ if((aE==null))return null; if((%_IsJSProxy(aE)))return"Proxy"; var U=%GetDataProperty((%_ToObject(aE)),"constructor"); if(!(%_IsFunction(U))){ return bd?null:%_Call(NoSideEffectsToString,aE); } return %FunctionGetName(U); } var be=function(){ var bf=(void 0); var bg=this; while(bg){ var bf= (bg[m]); if((bf===(void 0))){ var ba=(bg[w]); if((ba===(void 0))){ bg=%_GetPrototype(bg); continue; } bf=FormatStackTrace(bg,ba); (bg[w]=(void 0)); (bg[m]=bf); } return bf; } return(void 0); }; var bh=function(bi){ if(IsErrorObject(this)){ (this[w]=(void 0)); (this[m]=bi); } }; var bj=function(){}; function SetUpError(bk){ %FunctionSetInstanceClassName(bk,'Error'); var R=bk.name; var bl=new n(); if(R!=='Error'){ %InternalSetPrototype(bk,G); %InternalSetPrototype(bl,G.prototype); } %FunctionSetPrototype(bk,bl); %AddNamedProperty(bk.prototype,'name',R,2); %AddNamedProperty(bk.prototype,'message','',2); %AddNamedProperty( bk.prototype,'constructor',bk,2); %SetCode(bk,function(bm){ if((new.target===(void 0)))return new bk(bm); try{bj(this,bk);}catch(e){} if(!(bm===(void 0))){ %AddNamedProperty(this,'message',(%_ToString(bm)),2); } }); %SetNativeFlag(bk); return bk; }; G=SetUpError(a.Error); M=SetUpError(a.EvalError); I=SetUpError(a.RangeError); L=SetUpError(a.ReferenceError); K=SetUpError(a.SyntaxError); H=SetUpError(a.TypeError); J=SetUpError(a.URIError); b.InstallFunctions(G.prototype,2, ['toString',ErrorToString]); function ErrorToString(){ if(!(%_IsJSReceiver(this))){ throw MakeTypeError(16,"Error.prototype.toString"); } var R=this.name; R=(R===(void 0))?"Error":(%_ToString(R)); var S=this.message; S=(S===(void 0))?"":(%_ToString(S)); if(R=="")return S; if(S=="")return R; return`${R}: ${S}` } function MakeError(W,X,Y,Z){ return MakeGenericError(G,W,X,Y,Z); } function MakeRangeError(W,X,Y,Z){ return MakeGenericError(I,W,X,Y,Z); } function MakeSyntaxError(W,X,Y,Z){ return MakeGenericError(K,W,X,Y,Z); } function MakeTypeError(W,X,Y,Z){ return MakeGenericError(H,W,X,Y,Z); } function MakeURIError(){ return MakeGenericError(J,283); } var bn=MakeRangeError(187); b.InstallGetterSetter(bn,'stack', be,bh) bj=function captureStackTrace(Q,bo){ t(Q,'stack',{get:be, set:bh, configurable:true}); %CollectStackTrace(Q,bo?bo:bj); }; G.captureStackTrace=bj; %InstallToContext([ "get_stack_trace_line_fun",GetStackTraceLine, "make_error_function",MakeGenericError, "make_range_error",MakeRangeError, "make_type_error",MakeTypeError, "message_get_column_number",GetColumnNumber, "message_get_line_number",GetLineNumber, "message_get_source_line",GetSourceLine, "no_side_effects_to_string_fun",NoSideEffectsToString, "stack_overflow_boilerplate",bn, ]); b.Export(function(bp){ bp.ErrorToString=ErrorToString; bp.MakeError=MakeError; bp.MakeRangeError=MakeRangeError; bp.MakeSyntaxError=MakeSyntaxError; bp.MakeTypeError=MakeTypeError; bp.MakeURIError=MakeURIError; }); }); jsonE (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Date; var d=a.JSON; var e=a.Set; var f=b.InternalArray; var g; var h; var i; var j; var k=b.ImportNow("to_string_tag_symbol"); b.Import(function(l){ g=l.MakeTypeError; h=l.MaxSimple; i=l.MinSimple; j=l.ObjectHasOwnProperty; }); function CreateDataProperty(m,n,o){ var p={value:o,enumerable:true,writable:true,configurable:true}; return %reflect_define_property(m,n,p); } function InternalizeJSONProperty(q,r,s){ var t=q[r]; if((%_IsJSReceiver(t))){ if(%is_arraylike(t)){ var u=(%_ToLength(t.length)); for(var v=0;v0){ var J=",\n"+C; I="[\n"+C+F.join(J)+"\n"+ E+"]"; }else{ I="[]"; } B.pop(); return I; } function SerializeObject(z,A,B,C,D){ if(!%PushIfAbsent(B,z))throw g(22); var E=C; C+=D; var F=new f(); if((%_IsArray(A))){ var u=A.length; for(var v=0;v0){ var J=",\n"+C; I="{\n"+C+F.join(J)+"\n"+ E+"}"; }else{ I="{}"; } B.pop(); return I; } function JSONSerialize(L,q,A,B,C,D){ var z=q[L]; if((%_IsJSReceiver(z))){ var M=z.toJSON; if((typeof(M)==='function')){ z=%_Call(M,z,L); } } if((typeof(A)==='function')){ z=%_Call(A,q,L,z); } if((typeof(z)==='string')){ return %QuoteJSONString(z); }else if((typeof(z)==='number')){ return((%_IsSmi(%IS_VAR(z))||z-z==0)?%_NumberToString(z):"null"); }else if((typeof(z)==='boolean')){ return z?"true":"false"; }else if((z===null)){ return"null"; }else if((%_IsJSReceiver(z))&&!(typeof(z)==='function')){ if(%is_arraylike(z)){ return SerializeArray(z,A,B,C,D); }else if((%_ClassOf(z)==='Number')){ z=(%_ToNumber(z)); return((%_IsSmi(%IS_VAR(z))||z-z==0)?%_NumberToString(z):"null"); }else if((%_ClassOf(z)==='String')){ return %QuoteJSONString((%_ToString(z))); }else if((%_ClassOf(z)==='Boolean')){ return %_ValueOf(z)?"true":"false"; }else{ return SerializeObject(z,A,B,C,D); } } return(void 0); } function JSONStringify(z,A,N){ if(%_ArgumentsLength()==1&&!(%_IsJSProxy(z))){ return %BasicJSONStringify(z); } if(!(typeof(A)==='function')&&%is_arraylike(A)){ var O=new f(); var P=new e(); var u=(%_ToLength(A.length)); for(var v=0;v10){ D=%_SubString(N,0,10); }else{ D=N; } }else{ D=""; } return JSONSerialize('',{'':z},A,new f(),"",D); } %AddNamedProperty(d,k,"JSON",1|2); b.InstallFunctions(d,2,[ "parse",JSONParse, "stringify",JSONStringify ]); function DateToJSON(L){ var m=(%_ToObject(this)); var R=(%_ToPrimitive_Number(m)); if((typeof(R)==='number')&&!(%_IsSmi(%IS_VAR(R))||((R==R)&&(R!=1/0)&&(R!=-1/0)))){ return null; } return m.toISOString(); } b.InstallFunctions(c.prototype,2,[ "toJSON",DateToJSON ]); function JsonSerializeAdapter(L,S){ var q={}; q[L]=S; return JSONSerialize(L,q,(void 0),new f(),"",""); } %InstallToContext(["json_serialize_adapter",JsonSerializeAdapter]); }) 8array-iteratorÝ (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c= b.ImportNow("array_iteration_kind_symbol"); var d= b.ImportNow("array_iterator_next_symbol"); var e= b.ImportNow("array_iterator_object_symbol"); var f=a.Array; var g=b.ImportNow("IteratorPrototype"); var h=b.ImportNow("iterator_symbol"); var i; var j=b.ImportNow("to_string_tag_symbol"); var k=a.Uint8Array.__proto__; b.Import(function(l){ i=l.MakeTypeError; }) function ArrayIterator(){} function CreateArrayIterator(m,n){ var o=(%_ToObject(m)); var p=new ArrayIterator; (p[e]=o); (p[d]=0); (p[c]=n); return p; } function ArrayIteratorIterator(){ return this; } function ArrayIteratorNext(){ var p=this; var q=(void 0); var r=true; if(!(%_IsJSReceiver(p))|| !(!(p[d]===(void 0)))){ throw i(42, 'Array Iterator.prototype.next',this); } var m=(p[e]); if(!(m===(void 0))){ var s=(p[d]); var t=(p[c]); var u=((m.length)>>>0); if(s>=u){ (p[e]=(void 0)); }else{ (p[d]=s+1); if(t==2){ q=m[s]; }else if(t==3){ q=[s,m[s]]; }else{ q=s; } r=false; } } return %_CreateIterResultObject(q,r); } function ArrayEntries(){ return CreateArrayIterator(this,3); } function ArrayValues(){ return CreateArrayIterator(this,2); } function ArrayKeys(){ return CreateArrayIterator(this,1); } %FunctionSetPrototype(ArrayIterator,{__proto__:g}); %FunctionSetInstanceClassName(ArrayIterator,'Array Iterator'); b.InstallFunctions(ArrayIterator.prototype,2,[ 'next',ArrayIteratorNext ]); b.SetFunctionName(ArrayIteratorIterator,h); %AddNamedProperty(ArrayIterator.prototype,h, ArrayIteratorIterator,2); %AddNamedProperty(ArrayIterator.prototype,j, "Array Iterator",1|2); b.InstallFunctions(f.prototype,2,[ 'entries',ArrayEntries, 'keys',ArrayKeys ]); b.SetFunctionName(ArrayValues,'values'); %AddNamedProperty(f.prototype,h,ArrayValues, 2); %AddNamedProperty(k.prototype, 'entries',ArrayEntries,2); %AddNamedProperty(k.prototype,'values',ArrayValues,2); %AddNamedProperty(k.prototype,'keys',ArrayKeys,2); %AddNamedProperty(k.prototype, h,ArrayValues,2); b.Export(function(v){ v.ArrayValues=ArrayValues; }); %InstallToContext(["array_values_iterator",ArrayValues]); }) >>0); if(p>=q){ (m[g]=(void 0)); }else{ var r=%_StringCharCodeAt(l,p); n=%_StringCharFromCode(r); o=false; p++; if(r>=0xD800&&r<=0xDBFF&&p=0xDC00&&s<=0xDFFF){ n+=%_StringCharFromCode(s); p++; } } (m[h]=p); } } return %_CreateIterResultObject(n,o); } function StringPrototypeIterator(){ return CreateStringIterator(this); } %FunctionSetPrototype(StringIterator,{__proto__:d}); %FunctionSetInstanceClassName(StringIterator,'String Iterator'); b.InstallFunctions(StringIterator.prototype,2,[ 'next',StringIteratorNext ]); %AddNamedProperty(StringIterator.prototype,i, "String Iterator",1|2); b.SetFunctionName(StringPrototypeIterator,e); %AddNamedProperty(c.prototype,e, StringPrototypeIterator,2); }) $templates (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=a.Map; var d=b.InternalArray; var e=new c; var f=c.prototype.get; var g=c.prototype.set; function SameCallSiteElements(h,i){ var j=h.length; var i=i.raw; if(j!==i.length)return false; for(var k=0;k0){ return R(U,%_Arguments(0)); }else{ return R(U); } } } %FunctionSetName(V,T); %FunctionRemovePrototype(V); %SetNativeFlag(V); this[T]=V; } return this[T]; } %FunctionSetName(getter,Q); %FunctionRemovePrototype(getter); %SetNativeFlag(getter); r(P.prototype,Q,{ get:getter, enumerable:false, configurable:true }); } function supportedLocalesOf(Y,Z,aa){ if((%_Call(x,Y,GetServiceRE())===null)){ throw m(7,Y); } if((aa===(void 0))){ aa={}; }else{ aa=(%_ToObject(aa)); } var ab=aa.localeMatcher; if(!(ab===(void 0))){ ab=l(ab); if(ab!=='lookup'&&ab!=='best fit'){ throw n(183,ab); } }else{ ab='best fit'; } var ac=initializeLocaleList(Z); if((E[Y]===(void 0))){ E[Y]=getAvailableLocalesOf(Y); } if(ab==='best fit'){ return initializeLocaleList(bestFitSupportedLocalesOf( ac,E[Y])); } return initializeLocaleList(lookupSupportedLocalesOf( ac,E[Y])); } function lookupSupportedLocalesOf(ac,ad){ var ae=[]; for(var af=0;af=3&&S<=8&&!(au===(void 0))){ at[au]=av; au=(void 0); }else{ return{}; } } return at; } function setOptions(aw,at,ax,aj,ay){ var ar=''; var az=function updateExtension(aA,ao){ return'-'+aA+'-'+l(ao); } var aB=function updateProperty(ak,al,ao){ if(al==='boolean'&&(typeof ao==='string')){ ao=(ao==='true')?true:false; } if(!(ak===(void 0))){ defineWEProperty(ay,ak,ao); } } for(var aA in ax){ if(%HasOwnProperty(ax,aA)){ var ao=(void 0); var aC=ax[aA]; if(!(aC.property===(void 0))){ ao=aj(aC.property,aC.type,aC.values); } if(!(ao===(void 0))){ aB(aC.property,aC.type,ao); ar+=az(aA,ao); continue; } if(%HasOwnProperty(at,aA)){ ao=at[aA]; if(!(ao===(void 0))){ aB(aC.property,aC.type,ao); ar+=az(aA,ao); }else if(aC.type==='boolean'){ aB(aC.property,aC.type,true); ar+=az(aA,true); } } } } return ar===''?'':'-u'+ar; } function freezeArray(aD){ var aE=aD.length; for(var af=0;af>>0); for(var aX=0;aXbB){ throw n(186,ak); } return p(ao); } return bC; } var bD={ get(){ %IncrementUseCounter(15); return this[s]; }, set(ao){ this[s]=ao; } }; function initializeNumberFormat(bE,Z,aa){ if(%IsInitializedIntlObject(bE)){ throw o(132,"NumberFormat"); } if((aa===(void 0))){ aa={}; } var aj=getGetOption(aa,'numberformat'); var ag=resolveLocale('numberformat',Z,aa); var br={}; defineWEProperty(br,'style',aj( 'style','string',['decimal','percent','currency'],'decimal')); var bz=aj('currency','string'); if(!(bz===(void 0))&&!isWellFormedCurrencyCode(bz)){ throw n(169,bz); } if(br.style==='currency'&&(bz===(void 0))){ throw o(28); } var bF=aj( 'currencyDisplay','string',['code','symbol','name'],'symbol'); if(br.style==='currency'){ defineWEProperty(br,'currency',%StringToUpperCase(bz)); defineWEProperty(br,'currencyDisplay',bF); } var bG=getNumberOption(aa,'minimumIntegerDigits',1,21,1); defineWEProperty(br,'minimumIntegerDigits',bG); var bH=aa['minimumFractionDigits']; var bI=aa['maximumFractionDigits']; if(!(bH===(void 0))||br.style!=='currency'){ bH=getNumberOption(aa,'minimumFractionDigits',0,20,0); defineWEProperty(br,'minimumFractionDigits',bH); } if(!(bI===(void 0))||br.style!=='currency'){ var bJ=br.style==='percent'?0:3; bH=(bH===(void 0))?0:bH; var bK=(bH>bJ)?bH:bJ; bI=getNumberOption(aa,'maximumFractionDigits',bH,20,bK); defineWEProperty(br,'maximumFractionDigits',bI); } var bL=aa['minimumSignificantDigits']; var bM=aa['maximumSignificantDigits']; if(!(bL===(void 0))||!(bM===(void 0))){ bL=getNumberOption(aa,'minimumSignificantDigits',1,21,0); defineWEProperty(br,'minimumSignificantDigits',bL); bM=getNumberOption(aa,'maximumSignificantDigits',bL,21,21); defineWEProperty(br,'maximumSignificantDigits',bM); } defineWEProperty(br,'useGrouping',aj( 'useGrouping','boolean',(void 0),true)); var at=parseExtension(ag.extension); var bN={ 'nu':{'property':(void 0),'type':'string'} }; var ar=setOptions(aa,at,bN, aj,br); var bw=ag.locale+ar; var ap=q({},{ currency:{writable:true}, currencyDisplay:{writable:true}, locale:{writable:true}, maximumFractionDigits:{writable:true}, minimumFractionDigits:{writable:true}, minimumIntegerDigits:{writable:true}, numberingSystem:{writable:true}, pattern:bD, requestedLocale:{value:bw,writable:true}, style:{value:br.style,writable:true}, useGrouping:{writable:true} }); if(%HasOwnProperty(br,'minimumSignificantDigits')){ defineWEProperty(ap,'minimumSignificantDigits',(void 0)); } if(%HasOwnProperty(br,'maximumSignificantDigits')){ defineWEProperty(ap,'maximumSignificantDigits',(void 0)); } var bO=%CreateNumberFormat(bw, br, ap); if(br.style==='currency'){ r(ap,'currencyDisplay',{value:bF, writable:true}); } %MarkAsInitializedIntlObjectOfType(bE,'numberformat',bO); bE[u]=ap; r(bE,'resolved',bp); return bE; } %AddNamedProperty(D,'NumberFormat',function(){ var Z=%_Arguments(0); var aa=%_Arguments(1); if(!this||this===D){ return new D.NumberFormat(Z,aa); } return initializeNumberFormat((%_ToObject(this)),Z,aa); }, 2 ); %AddNamedProperty(D.NumberFormat.prototype,'resolvedOptions',function(){ if(!(new.target===(void 0))){ throw o(87); } if(!%IsInitializedIntlObjectOfType(this,'numberformat')){ throw o(133,"NumberFormat"); } var bP=this; var ag=getOptimalLanguageTag(bP[u].requestedLocale, bP[u].locale); var aN={ locale:ag, numberingSystem:bP[u].numberingSystem, style:bP[u].style, useGrouping:bP[u].useGrouping, minimumIntegerDigits:bP[u].minimumIntegerDigits, minimumFractionDigits:bP[u].minimumFractionDigits, maximumFractionDigits:bP[u].maximumFractionDigits, }; if(aN.style==='currency'){ defineWECProperty(aN,'currency',bP[u].currency); defineWECProperty(aN,'currencyDisplay', bP[u].currencyDisplay); } if(%HasOwnProperty(bP[u],'minimumSignificantDigits')){ defineWECProperty(aN,'minimumSignificantDigits', bP[u].minimumSignificantDigits); } if(%HasOwnProperty(bP[u],'maximumSignificantDigits')){ defineWECProperty(aN,'maximumSignificantDigits', bP[u].maximumSignificantDigits); } return aN; }, 2 ); %FunctionSetName(D.NumberFormat.prototype.resolvedOptions, 'resolvedOptions'); %FunctionRemovePrototype(D.NumberFormat.prototype.resolvedOptions); %SetNativeFlag(D.NumberFormat.prototype.resolvedOptions); %AddNamedProperty(D.NumberFormat,'supportedLocalesOf',function(Z){ if(!(new.target===(void 0))){ throw o(87); } return supportedLocalesOf('numberformat',Z,%_Arguments(1)); }, 2 ); %FunctionSetName(D.NumberFormat.supportedLocalesOf,'supportedLocalesOf'); %FunctionRemovePrototype(D.NumberFormat.supportedLocalesOf); %SetNativeFlag(D.NumberFormat.supportedLocalesOf); function formatNumber(bO,ao){ var bQ=(%_ToNumber(ao))+0; return %InternalNumberFormat(%GetImplFromInitializedIntlObject(bO), bQ); } function parseNumber(bO,ao){ return %InternalNumberParse(%GetImplFromInitializedIntlObject(bO), l(ao)); } addBoundMethod(D.NumberFormat,'format',formatNumber,1); addBoundMethod(D.NumberFormat,'v8Parse',parseNumber,1); function toLDMLString(aa){ var aj=getGetOption(aa,'dateformat'); var bR=''; var bS=aj('weekday','string',['narrow','short','long']); bR+=appendToLDMLString( bS,{narrow:'EEEEE',short:'EEE',long:'EEEE'}); bS=aj('era','string',['narrow','short','long']); bR+=appendToLDMLString( bS,{narrow:'GGGGG',short:'GGG',long:'GGGG'}); bS=aj('year','string',['2-digit','numeric']); bR+=appendToLDMLString(bS,{'2-digit':'yy','numeric':'y'}); bS=aj('month','string', ['2-digit','numeric','narrow','short','long']); bR+=appendToLDMLString(bS,{'2-digit':'MM','numeric':'M', 'narrow':'MMMMM','short':'MMM','long':'MMMM'}); bS=aj('day','string',['2-digit','numeric']); bR+=appendToLDMLString( bS,{'2-digit':'dd','numeric':'d'}); var bT=aj('hour12','boolean'); bS=aj('hour','string',['2-digit','numeric']); if((bT===(void 0))){ bR+=appendToLDMLString(bS,{'2-digit':'jj','numeric':'j'}); }else if(bT===true){ bR+=appendToLDMLString(bS,{'2-digit':'hh','numeric':'h'}); }else{ bR+=appendToLDMLString(bS,{'2-digit':'HH','numeric':'H'}); } bS=aj('minute','string',['2-digit','numeric']); bR+=appendToLDMLString(bS,{'2-digit':'mm','numeric':'m'}); bS=aj('second','string',['2-digit','numeric']); bR+=appendToLDMLString(bS,{'2-digit':'ss','numeric':'s'}); bS=aj('timeZoneName','string',['short','long']); bR+=appendToLDMLString(bS,{short:'z',long:'zzzz'}); return bR; } function appendToLDMLString(bS,bU){ if(!(bS===(void 0))){ return bU[bS]; }else{ return''; } } function fromLDMLString(bR){ bR=%_Call(y,bR,GetQuotedStringRE(),''); var aa={}; var aM=%_Call(x,bR,/E{3,5}/g); aa=appendToDateTimeObject( aa,'weekday',aM,{EEEEE:'narrow',EEE:'short',EEEE:'long'}); aM=%_Call(x,bR,/G{3,5}/g); aa=appendToDateTimeObject( aa,'era',aM,{GGGGG:'narrow',GGG:'short',GGGG:'long'}); aM=%_Call(x,bR,/y{1,2}/g); aa=appendToDateTimeObject( aa,'year',aM,{y:'numeric',yy:'2-digit'}); aM=%_Call(x,bR,/M{1,5}/g); aa=appendToDateTimeObject(aa,'month',aM,{MM:'2-digit', M:'numeric',MMMMM:'narrow',MMM:'short',MMMM:'long'}); aM=%_Call(x,bR,/L{1,5}/g); aa=appendToDateTimeObject(aa,'month',aM,{LL:'2-digit', L:'numeric',LLLLL:'narrow',LLL:'short',LLLL:'long'}); aM=%_Call(x,bR,/d{1,2}/g); aa=appendToDateTimeObject( aa,'day',aM,{d:'numeric',dd:'2-digit'}); aM=%_Call(x,bR,/h{1,2}/g); if(aM!==null){ aa['hour12']=true; } aa=appendToDateTimeObject( aa,'hour',aM,{h:'numeric',hh:'2-digit'}); aM=%_Call(x,bR,/H{1,2}/g); if(aM!==null){ aa['hour12']=false; } aa=appendToDateTimeObject( aa,'hour',aM,{H:'numeric',HH:'2-digit'}); aM=%_Call(x,bR,/m{1,2}/g); aa=appendToDateTimeObject( aa,'minute',aM,{m:'numeric',mm:'2-digit'}); aM=%_Call(x,bR,/s{1,2}/g); aa=appendToDateTimeObject( aa,'second',aM,{s:'numeric',ss:'2-digit'}); aM=%_Call(x,bR,/z|zzzz/g); aa=appendToDateTimeObject( aa,'timeZoneName',aM,{z:'short',zzzz:'long'}); return aa; } function appendToDateTimeObject(aa,bS,aM,bU){ if((aM===null)){ if(!%HasOwnProperty(aa,bS)){ defineWEProperty(aa,bS,(void 0)); } return aa; } var ak=aM[0]; defineWEProperty(aa,bS,bU[ak]); return aa; } function toDateTimeOptions(aa,bV,bW){ if((aa===(void 0))){ aa={}; }else{ aa=(%_ToObject(aa)); } var bX=true; if((bV==='date'||bV==='any')&& (!(aa.weekday===(void 0))||!(aa.year===(void 0))|| !(aa.month===(void 0))||!(aa.day===(void 0)))){ bX=false; } if((bV==='time'||bV==='any')&& (!(aa.hour===(void 0))||!(aa.minute===(void 0))|| !(aa.second===(void 0)))){ bX=false; } if(bX&&(bW==='date'||bW==='all')){ r(aa,'year',{value:'numeric', writable:true, enumerable:true, configurable:true}); r(aa,'month',{value:'numeric', writable:true, enumerable:true, configurable:true}); r(aa,'day',{value:'numeric', writable:true, enumerable:true, configurable:true}); } if(bX&&(bW==='time'||bW==='all')){ r(aa,'hour',{value:'numeric', writable:true, enumerable:true, configurable:true}); r(aa,'minute',{value:'numeric', writable:true, enumerable:true, configurable:true}); r(aa,'second',{value:'numeric', writable:true, enumerable:true, configurable:true}); } return aa; } function initializeDateTimeFormat(bY,Z,aa){ if(%IsInitializedIntlObject(bY)){ throw o(132,"DateTimeFormat"); } if((aa===(void 0))){ aa={}; } var ag=resolveLocale('dateformat',Z,aa); aa=toDateTimeOptions(aa,'any','date'); var aj=getGetOption(aa,'dateformat'); var ab=aj('formatMatcher','string', ['basic','best fit'],'best fit'); var bR=toLDMLString(aa); var bZ=canonicalizeTimeZoneID(aa.timeZone); var br={}; var at=parseExtension(ag.extension); var ca={ 'ca':{'property':(void 0),'type':'string'}, 'nu':{'property':(void 0),'type':'string'} }; var ar=setOptions(aa,at,ca, aj,br); var bw=ag.locale+ar; var ap=q({},{ 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}, [s]:{writable:true}, pattern:bD, requestedLocale:{value:bw,writable:true}, second:{writable:true}, timeZone:{writable:true}, timeZoneName:{writable:true}, tz:{value:bZ,writable:true}, weekday:{writable:true}, year:{writable:true} }); var bO=%CreateDateTimeFormat( bw,{skeleton:bR,timeZone:bZ},ap); if(ap.timeZone==="Etc/Unknown"){ throw n(192,bZ); } %MarkAsInitializedIntlObjectOfType(bY,'dateformat',bO); bY[u]=ap; r(bY,'resolved',bp); return bY; } %AddNamedProperty(D,'DateTimeFormat',function(){ var Z=%_Arguments(0); var aa=%_Arguments(1); if(!this||this===D){ return new D.DateTimeFormat(Z,aa); } return initializeDateTimeFormat((%_ToObject(this)),Z,aa); }, 2 ); %AddNamedProperty(D.DateTimeFormat.prototype,'resolvedOptions',function(){ if(!(new.target===(void 0))){ throw o(87); } if(!%IsInitializedIntlObjectOfType(this,'dateformat')){ throw o(133,"DateTimeFormat"); } var cb={ '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 bP=this; var cc=fromLDMLString(bP[u][s]); var cd=cb[bP[u].calendar]; if((cd===(void 0))){ cd=bP[u].calendar; } var ag=getOptimalLanguageTag(bP[u].requestedLocale, bP[u].locale); var aN={ locale:ag, numberingSystem:bP[u].numberingSystem, calendar:cd, timeZone:bP[u].timeZone }; addWECPropertyIfDefined(aN,'timeZoneName',cc.timeZoneName); addWECPropertyIfDefined(aN,'era',cc.era); addWECPropertyIfDefined(aN,'year',cc.year); addWECPropertyIfDefined(aN,'month',cc.month); addWECPropertyIfDefined(aN,'day',cc.day); addWECPropertyIfDefined(aN,'weekday',cc.weekday); addWECPropertyIfDefined(aN,'hour12',cc.hour12); addWECPropertyIfDefined(aN,'hour',cc.hour); addWECPropertyIfDefined(aN,'minute',cc.minute); addWECPropertyIfDefined(aN,'second',cc.second); return aN; }, 2 ); %FunctionSetName(D.DateTimeFormat.prototype.resolvedOptions, 'resolvedOptions'); %FunctionRemovePrototype(D.DateTimeFormat.prototype.resolvedOptions); %SetNativeFlag(D.DateTimeFormat.prototype.resolvedOptions); %AddNamedProperty(D.DateTimeFormat,'supportedLocalesOf',function(Z){ if(!(new.target===(void 0))){ throw o(87); } return supportedLocalesOf('dateformat',Z,%_Arguments(1)); }, 2 ); %FunctionSetName(D.DateTimeFormat.supportedLocalesOf,'supportedLocalesOf'); %FunctionRemovePrototype(D.DateTimeFormat.supportedLocalesOf); %SetNativeFlag(D.DateTimeFormat.supportedLocalesOf); function formatDate(bO,ce){ var cf; if((ce===(void 0))){ cf=%DateCurrentTime(); }else{ cf=(%_ToNumber(ce)); } if(!f(cf))throw n(161); return %InternalDateFormat(%GetImplFromInitializedIntlObject(bO), new i(cf)); } function parseDate(bO,ao){ return %InternalDateParse(%GetImplFromInitializedIntlObject(bO), l(ao)); } addBoundMethod(D.DateTimeFormat,'format',formatDate,0); addBoundMethod(D.DateTimeFormat,'v8Parse',parseDate,1); function canonicalizeTimeZoneID(cg){ if((cg===(void 0))){ return cg; } var ch=%StringToUpperCase(cg); if(ch==='UTC'||ch==='GMT'|| ch==='ETC/UTC'||ch==='ETC/GMT'){ return'UTC'; } var aM=%_Call(x,cg,GetTimezoneNameCheckRE()); if((aM===null))throw n(162,cg); var aN=toTitleCaseTimezoneLocation(aM[1])+'/'+ toTitleCaseTimezoneLocation(aM[2]); if(!(aM[3]===(void 0))&&3%JSProxyRevoke(h)}; } function ProxyEnumerate(i,g,f){ var j=%_Call(i,g,f); if(!(%_IsJSReceiver(j))){ throw d(99); } var k=[]; for(var l=j.next();!l.done;l=j.next()){ var m=l.value; if(!(typeof(m)==='string')){ throw d(100); } k.push(m); } return k; } b.InstallFunctions(c,2,[ "revocable",ProxyCreateRevocable ]); %InstallToContext([ "proxy_enumerate",ProxyEnumerate, ]); }) $generator­ (function(a,b){ "use strict"; %CheckIsBootstrapping(); var c=b.ImportNow("GeneratorFunctionPrototype"); var d=b.ImportNow("GeneratorFunction"); var e=a.Function; var f; var g=b.ImportNow("to_string_tag_symbol"); b.Import(function(h){ f=h.MakeTypeError; }); function GeneratorObjectNext(i){ if(!(%_ClassOf(this)==='Generator')){ throw f(42, '[Generator].prototype.next',this); } var j=%GeneratorGetContinuation(this); if(j>0){ if(%_DebugIsActive()!=0)%DebugPrepareStepInIfStepping(this); try{ return %_GeneratorNext(this,i); }catch(e){ %GeneratorClose(this); throw e; } }else if(j==0){ return{value:void 0,done:true}; }else{ throw f(40); } } function GeneratorObjectThrow(k){ if(!(%_ClassOf(this)==='Generator')){ throw f(42, '[Generator].prototype.throw',this); } var j=%GeneratorGetContinuation(this); if(j>0){ try{ return %_GeneratorThrow(this,k); }catch(e){ %GeneratorClose(this); throw e; } }else if(j==0){ throw k; }else{ throw f(40); } } %NeverOptimizeFunction(GeneratorObjectNext); %NeverOptimizeFunction(GeneratorObjectThrow); var l=c.prototype; b.InstallFunctions(l, 2, ["next",GeneratorObjectNext, "throw",GeneratorObjectThrow]); %AddNamedProperty(l,"constructor", c,2|1); %AddNamedProperty(l, g,"Generator",2|1); %InternalSetPrototype(c,e.prototype); %AddNamedProperty(c, g,"GeneratorFunction",2|1); %AddNamedProperty(c,"constructor", d,2|1); %InternalSetPrototype(d,e); }) =%_TypedArrayGetLength(i)){ return(void 0); } k=(%_ToNumber(k)); l=(%_ToNumber(l)); return %_AtomicsCompareExchange(i,j,k,l); } function AtomicsLoadJS(i,j){ CheckSharedIntegerTypedArray(i); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(i)){ return(void 0); } return %_AtomicsLoad(i,j); } function AtomicsStoreJS(i,j,m){ CheckSharedIntegerTypedArray(i); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(i)){ return(void 0); } m=(%_ToNumber(m)); return %_AtomicsStore(i,j,m); } function AtomicsAddJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=(%_ToNumber(m)); return %_AtomicsAdd(h,j,m); } function AtomicsSubJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=(%_ToNumber(m)); return %_AtomicsSub(h,j,m); } function AtomicsAndJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=(%_ToNumber(m)); return %_AtomicsAnd(h,j,m); } function AtomicsOrJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=(%_ToNumber(m)); return %_AtomicsOr(h,j,m); } function AtomicsXorJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=(%_ToNumber(m)); return %_AtomicsXor(h,j,m); } function AtomicsExchangeJS(h,j,m){ CheckSharedIntegerTypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } m=(%_ToNumber(m)); return %_AtomicsExchange(h,j,m); } function AtomicsIsLockFreeJS(n){ return %_AtomicsIsLockFree(n); } function AtomicsFutexWaitJS(h,j,m,o){ CheckSharedInteger32TypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } if((o===(void 0))){ o=(1/0); }else{ o=(%_ToNumber(o)); if((!%_IsSmi(%IS_VAR(o))&&!(o==o))){ o=(1/0); }else{ o=e(0,o); } } return %AtomicsFutexWait(h,j,m,o); } function AtomicsFutexWakeJS(h,j,p){ CheckSharedInteger32TypedArray(h); j=(%_ToInteger(j)); if(j<0||j>=%_TypedArrayGetLength(h)){ return(void 0); } p=e(0,(%_ToInteger(p))); return %AtomicsFutexWake(h,j,p); } function AtomicsFutexWakeOrRequeueJS(h,q,p,m,r){ CheckSharedInteger32TypedArray(h); q=(%_ToInteger(q)); p=e(0,(%_ToInteger(p))); m=((m)|0); r=(%_ToInteger(r)); if(q<0||q>=%_TypedArrayGetLength(h)|| r<0||r>=%_TypedArrayGetLength(h)){ return(void 0); } return %AtomicsFutexWakeOrRequeue(h,q,p,m,r); } function AtomicsConstructor(){} var s=new AtomicsConstructor(); %InternalSetPrototype(s,c.prototype); %AddNamedProperty(a,"Atomics",s,2); %FunctionSetInstanceClassName(AtomicsConstructor,'Atomics'); %AddNamedProperty(s,f,"Atomics",1|2); b.InstallConstants(s,[ "OK",0, "NOTEQUAL",-1, "TIMEDOUT",-2, ]); b.InstallFunctions(s,2,[ "compareExchange",AtomicsCompareExchangeJS, "load",AtomicsLoadJS, "store",AtomicsStoreJS, "add",AtomicsAddJS, "sub",AtomicsSubJS, "and",AtomicsAndJS, "or",AtomicsOrJS, "xor",AtomicsXorJS, "exchange",AtomicsExchangeJS, "isLockFree",AtomicsIsLockFreeJS, "futexWait",AtomicsFutexWaitJS, "futexWake",AtomicsFutexWakeJS, "futexWakeOrRequeue",AtomicsFutexWakeOrRequeueJS, ]); }) 8harmony-regexp% (function(a,b){ 'use strict'; %CheckIsBootstrapping(); var c=a.RegExp; var d=c.prototype; var e; var f=b.ImportNow("regexp_flags_symbol"); b.Import(function(g){ e=g.MakeTypeError; }); function RegExpGetFlags(){ if(!(%_IsJSReceiver(this))){ throw e( 130,"RegExp.prototype.flags",(%_ToString(this))); } var h=''; if(this.global)h+='g'; if(this.ignoreCase)h+='i'; if(this.multiline)h+='m'; if(this.unicode)h+='u'; if(this.sticky)h+='y'; return h; } function RegExpGetSticky(){ if(!(%_IsRegExp(this))){ if(this===d){ %IncrementUseCounter(11); return(void 0); } throw e(131,"RegExp.prototype.sticky"); } return!!(%_RegExpFlags(this)&8); } %FunctionSetName(RegExpGetSticky,"RegExp.prototype.sticky"); %SetNativeFlag(RegExpGetSticky); b.InstallGetter(c.prototype,'flags',RegExpGetFlags); b.InstallGetter(c.prototype,'sticky',RegExpGetSticky); }) `${name} must be a function or undefined`; class ReadableStream { constructor() { const underlyingSource = arguments[0] === undefined ? {} : arguments[0]; const strategy = arguments[1] === undefined ? {} : arguments[1]; const size = strategy.size; let highWaterMark = strategy.highWaterMark; if (highWaterMark === undefined) { highWaterMark = 1; } const normalizedStrategy = ValidateAndNormalizeQueuingStrategy(size, highWaterMark); this[readableStreamUnderlyingSource] = underlyingSource; this[readableStreamQueue] = new v8.InternalPackedArray(); this[readableStreamQueueSize] = 0; this[readableStreamState] = STATE_READABLE; this[readableStreamBits] = 0b0; this[readableStreamReader] = undefined; this[readableStreamStoredError] = undefined; this[readableStreamStrategySize] = normalizedStrategy.size; this[readableStreamStrategyHWM] = normalizedStrategy.highWaterMark; const controller = new ReadableStreamController(this); this[readableStreamController] = controller; const startResult = CallOrNoop( underlyingSource, 'start', controller, 'underlyingSource.start'); thenPromise(Promise_resolve(startResult), () => { this[readableStreamBits] |= STARTED; RequestReadableStreamPull(this); }, r => { if (this[readableStreamState] === STATE_READABLE) { return ErrorReadableStream(this, r); } }); } get locked() { if (IsReadableStream(this) === false) { throw new TypeError(errIllegalInvocation); } return IsReadableStreamLocked(this); } cancel(reason) { if (IsReadableStream(this) === false) { return Promise_reject(new TypeError(errIllegalInvocation)); } if (IsReadableStreamLocked(this) === true) { return Promise_reject(new TypeError(errCancelLockedStream)); } return CancelReadableStream(this, reason); } getReader() { if (IsReadableStream(this) === false) { throw new TypeError(errIllegalInvocation); } return AcquireReadableStreamReader(this); } tee() { if (IsReadableStream(this) === false) { throw new TypeError(errIllegalInvocation); } return TeeReadableStream(this); } } class ReadableStreamController { constructor(stream) { if (IsReadableStream(stream) === false) { throw new TypeError(errIllegalConstructor); } if (stream[readableStreamController] !== undefined) { throw new TypeError(errIllegalConstructor); } this[readableStreamControllerControlledReadableStream] = stream; } get desiredSize() { if (IsReadableStreamController(this) === false) { throw new TypeError(errIllegalInvocation); } return GetReadableStreamDesiredSize( this[readableStreamControllerControlledReadableStream]); } close() { if (IsReadableStreamController(this) === false) { throw new TypeError(errIllegalInvocation); } const stream = this[readableStreamControllerControlledReadableStream]; if (stream[readableStreamBits] & CLOSE_REQUESTED) { throw new TypeError(errCloseCloseRequestedStream); } if (stream[readableStreamState] === STATE_ERRORED) { throw new TypeError(errCloseErroredStream); } return CloseReadableStream(stream); } enqueue(chunk) { if (IsReadableStreamController(this) === false) { throw new TypeError(errIllegalInvocation); } const stream = this[readableStreamControllerControlledReadableStream]; if (stream[readableStreamState] === STATE_ERRORED) { throw stream[readableStreamStoredError]; } if (stream[readableStreamBits] & CLOSE_REQUESTED) { throw new TypeError(errEnqueueInCloseRequestedStream); } return EnqueueInReadableStream(stream, chunk); } error(e) { if (IsReadableStreamController(this) === false) { throw new TypeError(errIllegalInvocation); } const stream = this[readableStreamControllerControlledReadableStream]; const state = stream[readableStreamState]; if (state !== STATE_READABLE) { if (state === STATE_ERRORED) { throw new TypeError(errErrorErroredStream); } if (state === STATE_CLOSED) { throw new TypeError(errErrorClosedStream); } } return ErrorReadableStream(stream, e); } } class ReadableStreamReader { constructor(stream) { if (IsReadableStream(stream) === false) { throw new TypeError(errReaderConstructorBadArgument); } if (IsReadableStreamLocked(stream) === true) { throw new TypeError(errReaderConstructorStreamAlreadyLocked); } this[readableStreamReaderOwnerReadableStream] = stream; stream[readableStreamReader] = this; this[readableStreamReaderReadRequests] = new v8.InternalPackedArray(); switch (stream[readableStreamState]) { case STATE_READABLE: this[readableStreamReaderClosedPromise] = v8.createPromise(); break; case STATE_CLOSED: this[readableStreamReaderClosedPromise] = Promise_resolve(undefined); break; case STATE_ERRORED: this[readableStreamReaderClosedPromise] = Promise_reject(stream[readableStreamStoredError]); break; } } get closed() { if (IsReadableStreamReader(this) === false) { return Promise_reject(new TypeError(errIllegalInvocation)); } return this[readableStreamReaderClosedPromise]; } cancel(reason) { if (IsReadableStreamReader(this) === false) { return Promise_reject(new TypeError(errIllegalInvocation)); } const stream = this[readableStreamReaderOwnerReadableStream]; if (stream === undefined) { return Promise_reject(new TypeError(errCancelReleasedReader)); } return CancelReadableStream(stream, reason); } read() { if (IsReadableStreamReader(this) === false) { return Promise_reject(new TypeError(errIllegalInvocation)); } if (this[readableStreamReaderOwnerReadableStream] === undefined) { return Promise_reject(new TypeError(errReadReleasedReader)); } return ReadFromReadableStreamReader(this); } releaseLock() { if (IsReadableStreamReader(this) === false) { throw new TypeError(errIllegalInvocation); } const stream = this[readableStreamReaderOwnerReadableStream]; if (stream === undefined) { return undefined; } if (this[readableStreamReaderReadRequests].length > 0) { throw new TypeError(errReleaseReaderWithPendingRead); } if (stream[readableStreamState] === STATE_READABLE) { v8.rejectPromise(this[readableStreamReaderClosedPromise], new TypeError(errReleasedReaderClosedPromise)); } else { this[readableStreamReaderClosedPromise] = Promise_reject(new TypeError( errReleasedReaderClosedPromise)); } this[readableStreamReaderOwnerReadableStream][readableStreamReader] = undefined; this[readableStreamReaderOwnerReadableStream] = undefined; } } function AcquireReadableStreamReader(stream) { return new ReadableStreamReader(stream); } function CancelReadableStream(stream, reason) { stream[readableStreamBits] |= DISTURBED; const state = stream[readableStreamState]; if (state === STATE_CLOSED) { return Promise_resolve(undefined); } if (state === STATE_ERRORED) { return Promise_reject(stream[readableStreamStoredError]); } stream[readableStreamQueue] = new v8.InternalPackedArray(); FinishClosingReadableStream(stream); const underlyingSource = stream[readableStreamUnderlyingSource]; const sourceCancelPromise = PromiseCallOrNoop( underlyingSource, 'cancel', reason, 'underlyingSource.cancel'); return thenPromise(sourceCancelPromise, () => undefined); } function CloseReadableStream(stream) { if (stream[readableStreamState] === STATE_CLOSED) { return undefined; } stream[readableStreamBits] |= CLOSE_REQUESTED; if (stream[readableStreamQueue].length === 0) { return FinishClosingReadableStream(stream); } } function EnqueueInReadableStream(stream, chunk) { if (stream[readableStreamState] === STATE_CLOSED) { return undefined; } if (IsReadableStreamLocked(stream) === true && stream[readableStreamReader][readableStreamReaderReadRequests].length > 0) { const readRequest = stream[readableStreamReader][readableStreamReaderReadRequests] .shift(); v8.resolvePromise(readRequest, CreateIterResultObject(chunk, false)); } else { let chunkSize = 1; const strategySize = stream[readableStreamStrategySize]; if (strategySize !== undefined) { try { chunkSize = strategySize(chunk); } catch (chunkSizeE) { if (stream[readableStreamState] === STATE_READABLE) { ErrorReadableStream(stream, chunkSizeE); } throw chunkSizeE; } } try { EnqueueValueWithSize(stream, chunk, chunkSize); } catch (enqueueE) { if (stream[readableStreamState] === STATE_READABLE) { ErrorReadableStream(stream, enqueueE); } throw enqueueE; } } RequestReadableStreamPull(stream); } function ErrorReadableStream(stream, e) { stream[readableStreamQueue] = new v8.InternalPackedArray(); stream[readableStreamStoredError] = e; stream[readableStreamState] = STATE_ERRORED; const reader = stream[readableStreamReader]; if (reader === undefined) { return undefined; } const readRequests = reader[readableStreamReaderReadRequests]; for (let i = 0; i < readRequests.length; ++i) { v8.rejectPromise(readRequests[i], e); } reader[readableStreamReaderReadRequests] = new v8.InternalPackedArray(); v8.rejectPromise(reader[readableStreamReaderClosedPromise], e); } function FinishClosingReadableStream(stream) { stream[readableStreamState] = STATE_CLOSED; const reader = stream[readableStreamReader]; if (reader === undefined) { return undefined; } const readRequests = reader[readableStreamReaderReadRequests]; for (let i = 0; i < readRequests.length; ++i) { v8.resolvePromise( readRequests[i], CreateIterResultObject(undefined, true)); } reader[readableStreamReaderReadRequests] = new v8.InternalPackedArray(); v8.resolvePromise(reader[readableStreamReaderClosedPromise], undefined); } function GetReadableStreamDesiredSize(stream) { const queueSize = GetTotalQueueSize(stream); return stream[readableStreamStrategyHWM] - queueSize; } function IsReadableStream(x) { return hasOwnProperty(x, readableStreamUnderlyingSource); } function IsReadableStreamDisturbed(stream) { return stream[readableStreamBits] & DISTURBED; } function IsReadableStreamLocked(stream) { return stream[readableStreamReader] !== undefined; } function IsReadableStreamController(x) { return hasOwnProperty(x, readableStreamControllerControlledReadableStream); } function IsReadableStreamReader(x) { return hasOwnProperty(x, readableStreamReaderOwnerReadableStream); } function ReadFromReadableStreamReader(reader) { const stream = reader[readableStreamReaderOwnerReadableStream]; stream[readableStreamBits] |= DISTURBED; if (stream[readableStreamState] === STATE_CLOSED) { return Promise_resolve(CreateIterResultObject(undefined, true)); } if (stream[readableStreamState] === STATE_ERRORED) { return Promise_reject(stream[readableStreamStoredError]); } const queue = stream[readableStreamQueue]; if (queue.length > 0) { const chunk = DequeueValue(stream); if (stream[readableStreamBits] & CLOSE_REQUESTED && queue.length === 0) { FinishClosingReadableStream(stream); } else { RequestReadableStreamPull(stream); } return Promise_resolve(CreateIterResultObject(chunk, false)); } else { const readRequest = v8.createPromise(); reader[readableStreamReaderReadRequests].push(readRequest); RequestReadableStreamPull(stream); return readRequest; } } function RequestReadableStreamPull(stream) { const shouldPull = ShouldReadableStreamPull(stream); if (shouldPull === false) { return undefined; } if (stream[readableStreamBits] & PULLING) { stream[readableStreamBits] |= PULL_AGAIN; return undefined; } stream[readableStreamBits] |= PULLING; const underlyingSource = stream[readableStreamUnderlyingSource]; const controller = stream[readableStreamController]; const pullPromise = PromiseCallOrNoop( underlyingSource, 'pull', controller, 'underlyingSource.pull'); thenPromise(pullPromise, () => { stream[readableStreamBits] &= ~PULLING; if (stream[readableStreamBits] & PULL_AGAIN) { stream[readableStreamBits] &= ~PULL_AGAIN; return RequestReadableStreamPull(stream); } }, e => { if (stream[readableStreamState] === STATE_READABLE) { return ErrorReadableStream(stream, e); } }); } function ShouldReadableStreamPull(stream) { const state = stream[readableStreamState]; if (state === STATE_CLOSED || state === STATE_ERRORED) { return false; } if (stream[readableStreamBits] & CLOSE_REQUESTED) { return false; } if (!(stream[readableStreamBits] & STARTED)) { return false; } if (IsReadableStreamLocked(stream) === true) { const reader = stream[readableStreamReader]; const readRequests = reader[readableStreamReaderReadRequests]; if (readRequests.length > 0) { return true; } } const desiredSize = GetReadableStreamDesiredSize(stream); if (desiredSize > 0) { return true; } return false; } function TeeReadableStream(stream) { const reader = AcquireReadableStreamReader(stream); let closedOrErrored = false; let canceled1 = false; let canceled2 = false; let reason1; let reason2; let promise = v8.createPromise(); const branch1 = new ReadableStream({pull, cancel: cancel1}); const branch2 = new ReadableStream({pull, cancel: cancel2}); thenPromise( reader[readableStreamReaderClosedPromise], undefined, function(r) { if (closedOrErrored === true) { return; } ErrorReadableStream(branch1, r); ErrorReadableStream(branch2, r); closedOrErrored = true; }); return [branch1, branch2]; function pull() { return thenPromise( ReadFromReadableStreamReader(reader), function(result) { const value = result.value; const done = result.done; if (done === true && closedOrErrored === false) { CloseReadableStream(branch1); CloseReadableStream(branch2); closedOrErrored = true; } if (closedOrErrored === true) { return; } if (canceled1 === false) { EnqueueInReadableStream(branch1, value); } if (canceled2 === false) { EnqueueInReadableStream(branch2, value); } }); } function cancel1(reason) { canceled1 = true; reason1 = reason; if (canceled2 === true) { const compositeReason = [reason1, reason2]; const cancelResult = CancelReadableStream(stream, compositeReason); v8.resolvePromise(promise, cancelResult); } return promise; } function cancel2(reason) { canceled2 = true; reason2 = reason; if (canceled1 === true) { const compositeReason = [reason1, reason2]; const cancelResult = CancelReadableStream(stream, compositeReason); v8.resolvePromise(promise, cancelResult); } return promise; } } function DequeueValue(stream) { const result = stream[readableStreamQueue].shift(); stream[readableStreamQueueSize] -= result.size; return result.value; } function EnqueueValueWithSize(stream, value, size) { size = Number(size); if (Number_isNaN(size) || size === +Infinity || size < 0) { throw new RangeError(errInvalidSize); } stream[readableStreamQueueSize] += size; stream[readableStreamQueue].push({value, size}); } function GetTotalQueueSize(stream) { return stream[readableStreamQueueSize]; } function ValidateAndNormalizeQueuingStrategy(size, highWaterMark) { if (size !== undefined && typeof size !== 'function') { throw new TypeError(errSizeNotAFunction); } highWaterMark = Number(highWaterMark); if (Number_isNaN(highWaterMark)) { throw new TypeError(errInvalidHWM); } if (highWaterMark < 0) { throw new RangeError(errInvalidHWM); } return {size, highWaterMark}; } function CallOrNoop(O, P, arg, nameForError) { const method = O[P]; if (method === undefined) { return undefined; } if (typeof method !== 'function') { throw new TypeError(errTmplMustBeFunctionOrUndefined(nameForError)); } return callFunction(method, O, arg); } function PromiseCallOrNoop(O, P, arg, nameForError) { let method; try { method = O[P]; } catch (methodE) { return Promise_reject(methodE); } if (method === undefined) { return Promise_resolve(undefined); } if (typeof method !== 'function') { return Promise_reject(errTmplMustBeFunctionOrUndefined(nameForError)); } try { return Promise_resolve(callFunction(method, O, arg)); } catch (e) { return Promise_reject(e); } } function CreateIterResultObject(value, done) { return {value, done}; } defineProperty(global, 'ReadableStream', { value: ReadableStream, enumerable: false, configurable: true, writable: true }); binding.AcquireReadableStreamReader = AcquireReadableStreamReader; binding.IsReadableStream = IsReadableStream; binding.IsReadableStreamDisturbed = IsReadableStreamDisturbed; binding.IsReadableStreamLocked = IsReadableStreamLocked; binding.IsReadableStreamReader = IsReadableStreamReader; binding.ReadFromReadableStreamReader = ReadFromReadableStreamReader; });