Files
JiboSDK/node_modules/electron-prebuilt/dist/natives_blob.bin

18422 lines
401 KiB
Plaintext
Raw Normal View History

2026-03-22 03:21:45 +02:00
debug:<3A>
"use strict";
var kDefaultBacktraceLength=10;
var Debug={};
var sourceLineBeginningSkip=/^(?:\s*(?:\/\*.*?\*\/)*)*/;
Debug.DebugEvent={Break:1,
Exception:2,
NewFunction:3,
BeforeCompile:4,
AfterCompile:5,
CompileError:6,
PromiseEvent:7,
AsyncTaskEvent:8};
Debug.ExceptionBreak={Caught:0,
Uncaught:1};
Debug.StepAction={StepOut:0,
StepNext:1,
StepIn:2,
StepMin:3,
StepInMin:4,
StepFrame:5};
Debug.ScriptType={Native:0,
Extension:1,
Normal:2};
Debug.ScriptCompilationType={Host:0,
Eval:1,
JSON:2};
Debug.ScriptBreakPointType={ScriptId:0,
ScriptName:1,
ScriptRegExp:2};
Debug.BreakPositionAlignment={
Statement:0,
BreakPosition:1
};
function ScriptTypeFlag(a){
return(1<<a);
}
var next_response_seq=0;
var next_break_point_number=1;
var break_points=[];
var script_break_points=[];
var debugger_flags={
breakPointsActive:{
value:true,
getValue:function(){return this.value;},
setValue:function(a){
this.value=!!a;
%SetDisableBreak(!this.value);
}
},
breakOnCaughtException:{
getValue:function(){return Debug.isBreakOnException();},
setValue:function(a){
if(a){
Debug.setBreakOnException();
}else{
Debug.clearBreakOnException();
}
}
},
breakOnUncaughtException:{
getValue:function(){return Debug.isBreakOnUncaughtException();},
setValue:function(a){
if(a){
Debug.setBreakOnUncaughtException();
}else{
Debug.clearBreakOnUncaughtException();
}
}
},
};
function MakeBreakPoint(a,b){
var c=new BreakPoint(a,b);
break_points.push(c);
return c;
}
function BreakPoint(a,b){
this.source_position_=a;
if(b){
this.script_break_point_=b;
}else{
this.number_=next_break_point_number++;
}
this.hit_count_=0;
this.active_=true;
this.condition_=null;
this.ignoreCount_=0;
}
BreakPoint.prototype.number=function(){
return this.number_;
};
BreakPoint.prototype.func=function(){
return this.func_;
};
BreakPoint.prototype.source_position=function(){
return this.source_position_;
};
BreakPoint.prototype.hit_count=function(){
return this.hit_count_;
};
BreakPoint.prototype.active=function(){
if(this.script_break_point()){
return this.script_break_point().active();
}
return this.active_;
};
BreakPoint.prototype.condition=function(){
if(this.script_break_point()&&this.script_break_point().condition()){
return this.script_break_point().condition();
}
return this.condition_;
};
BreakPoint.prototype.ignoreCount=function(){
return this.ignoreCount_;
};
BreakPoint.prototype.script_break_point=function(){
return this.script_break_point_;
};
BreakPoint.prototype.enable=function(){
this.active_=true;
};
BreakPoint.prototype.disable=function(){
this.active_=false;
};
BreakPoint.prototype.setCondition=function(a){
this.condition_=a;
};
BreakPoint.prototype.setIgnoreCount=function(a){
this.ignoreCount_=a;
};
BreakPoint.prototype.isTriggered=function(a){
if(!this.active())return false;
if(this.condition()){
try{
var b=a.frame(0).evaluate(this.condition());
if(!(b instanceof ValueMirror)||
!builtins.$toBoolean(b.value_)){
return false;
}
}catch(e){
return false;
}
}
this.hit_count_++;
if(this.script_break_point_){
this.script_break_point_.hit_count_++;
}
if(this.ignoreCount_>0){
this.ignoreCount_--;
return false;
}
return true;
};
function IsBreakPointTriggered(a,b){
return b.isTriggered(MakeExecutionState(a));
}
function ScriptBreakPoint(type,script_id_or_name,opt_line,opt_column,
opt_groupId,opt_position_alignment){
this.type_=type;
if(type==Debug.ScriptBreakPointType.ScriptId){
this.script_id_=script_id_or_name;
}else if(type==Debug.ScriptBreakPointType.ScriptName){
this.script_name_=script_id_or_name;
}else if(type==Debug.ScriptBreakPointType.ScriptRegExp){
this.script_regexp_object_=new RegExp(script_id_or_name);
}else{
throw new Error("Unexpected breakpoint type "+type);
}
this.line_=opt_line||0;
this.column_=opt_column;
this.groupId_=opt_groupId;
this.position_alignment_=(opt_position_alignment===(void 0))
?Debug.BreakPositionAlignment.Statement:opt_position_alignment;
this.hit_count_=0;
this.active_=true;
this.condition_=null;
this.ignoreCount_=0;
this.break_points_=[];
}
ScriptBreakPoint.prototype.cloneForOtherScript=function(a){
var b=new ScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId,
a.id,this.line_,this.column_,this.groupId_,
this.position_alignment_);
b.number_=next_break_point_number++;
script_break_points.push(b);
b.hit_count_=this.hit_count_;
b.active_=this.active_;
b.condition_=this.condition_;
b.ignoreCount_=this.ignoreCount_;
return b;
};
ScriptBreakPoint.prototype.number=function(){
return this.number_;
};
ScriptBreakPoint.prototype.groupId=function(){
return this.groupId_;
};
ScriptBreakPoint.prototype.type=function(){
return this.type_;
};
ScriptBreakPoint.prototype.script_id=function(){
return this.script_id_;
};
ScriptBreakPoint.prototype.script_name=function(){
return this.script_name_;
};
ScriptBreakPoint.prototype.script_regexp_object=function(){
return this.script_regexp_object_;
};
ScriptBreakPoint.prototype.line=function(){
return this.line_;
};
ScriptBreakPoint.prototype.column=function(){
return this.column_;
};
ScriptBreakPoint.prototype.actual_locations=function(){
var a=[];
for(var b=0;b<this.break_points_.length;b++){
a.push(this.break_points_[b].actual_location);
}
return a;
};
ScriptBreakPoint.prototype.update_positions=function(a,b){
this.line_=a;
this.column_=b;
};
ScriptBreakPoint.prototype.hit_count=function(){
return this.hit_count_;
};
ScriptBreakPoint.prototype.active=function(){
return this.active_;
};
ScriptBreakPoint.prototype.condition=function(){
return this.condition_;
};
ScriptBreakPoint.prototype.ignoreCount=function(){
return this.ignoreCount_;
};
ScriptBreakPoint.prototype.enable=function(){
this.active_=true;
};
ScriptBreakPoint.prototype.disable=function(){
this.active_=false;
};
ScriptBreakPoint.prototype.setCondition=function(a){
this.condition_=a;
};
ScriptBreakPoint.prototype.setIgnoreCount=function(a){
this.ignoreCount_=a;
for(var b=0;b<this.break_points_.length;b++){
this.break_points_[b].setIgnoreCount(a);
}
};
ScriptBreakPoint.prototype.matchesScript=function(a){
if(this.type_==Debug.ScriptBreakPointType.ScriptId){
return this.script_id_==a.id;
}else{
if(!(a.line_offset<=this.line_&&
this.line_<a.line_offset+a.lineCount())){
return false;
}
if(this.type_==Debug.ScriptBreakPointType.ScriptName){
return this.script_name_==a.nameOrSourceURL();
}else if(this.type_==Debug.ScriptBreakPointType.ScriptRegExp){
return this.script_regexp_object_.test(a.nameOrSourceURL());
}else{
throw new Error("Unexpected breakpoint type "+this.type_);
}
}
};
ScriptBreakPoint.prototype.set=function(a){
var b=this.column();
var c=this.line();
if((b===(void 0))){
var d=a.sourceLine(this.line());
if(!a.sourceColumnStart_){
a.sourceColumnStart_=new Array(a.lineCount());
}
if((a.sourceColumnStart_[c]===(void 0))){
a.sourceColumnStart_[c]=
d.match(sourceLineBeginningSkip)[0].length;
}
b=a.sourceColumnStart_[c];
}
var e=Debug.findScriptSourcePosition(a,this.line(),b);
if((e===null))return;
var f=MakeBreakPoint(e,this);
f.setIgnoreCount(this.ignoreCount());
var g=%SetScriptBreakPoint(a,e,
this.position_alignment_,
f);
if((g===(void 0))){
g=e;
}
var h=a.locationFromPosition(g,true);
f.actual_location={line:h.line,
column:h.column,
script_id:a.id};
this.break_points_.push(f);
return f;
};
ScriptBreakPoint.prototype.clear=function(){
var a=[];
for(var b=0;b<break_points.length;b++){
if(break_points[b].script_break_point()&&
break_points[b].script_break_point()===this){
%ClearBreakPoint(break_points[b]);
}else{
a.push(break_points[b]);
}
}
break_points=a;
this.break_points_=[];
};
function UpdateScriptBreakPoints(a){
for(var b=0;b<script_break_points.length;b++){
var c=script_break_points[b];
if((c.type()==Debug.ScriptBreakPointType.ScriptName||
c.type()==Debug.ScriptBreakPointType.ScriptRegExp)&&
c.matchesScript(a)){
c.set(a);
}
}
}
function GetScriptBreakPoints(a){
var b=[];
for(var c=0;c<script_break_points.length;c++){
if(script_break_points[c].matchesScript(a)){
b.push(script_break_points[c]);
}
}
return b;
}
Debug.setListener=function(a,b){
if(!(%_IsFunction(a))&&!(a===(void 0))&&!(a===null)){
throw new Error('Parameters have wrong types.');
}
%SetDebugEventListener(a,b);
};
Debug.breakLocations=function(a,b){
if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.');
var c=(b===(void 0))
?Debug.BreakPositionAlignment.Statement:b;
return %GetBreakLocations(a,c);
};
Debug.findScript=function(a){
if((%_IsFunction(a))){
return %FunctionGetScript(a);
}else if((%_IsRegExp(a))){
var b=Debug.scripts();
var c=null;
var d=0;
for(var e in b){
var g=b[e];
if(a.test(g.name)){
c=g;
d++;
}
}
if(d==1){
return c;
}else{
return undefined;
}
}else{
return %GetScript(a);
}
};
Debug.scriptSource=function(a){
return this.findScript(a).source;
};
Debug.source=function(a){
if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.');
return %FunctionGetSourceCode(a);
};
Debug.sourcePosition=function(a){
if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.');
return %FunctionGetScriptSourcePosition(a);
};
Debug.findFunctionSourceLocation=function(a,b,c){
var d=%FunctionGetScript(a);
var e=%FunctionGetScriptSourcePosition(a);
return d.locationFromLine(b,c,e);
};
Debug.findScriptSourcePosition=function(a,b,c){
var d=a.locationFromLine(b,c);
return d?d.position:null;
};
Debug.findBreakPoint=function(a,b){
var c;
for(var d=0;d<break_points.length;d++){
if(break_points[d].number()==a){
c=break_points[d];
if(b){
break_points.splice(d,1);
}
break;
}
}
if(c){
return c;
}else{
return this.findScriptBreakPoint(a,b);
}
};
Debug.findBreakPointActualLocations=function(a){
for(var b=0;b<script_break_points.length;b++){
if(script_break_points[b].number()==a){
return script_break_points[b].actual_locations();
}
}
for(var b=0;b<break_points.length;b++){
if(break_points[b].number()==a){
return[break_points[b].actual_location];
}
}
return[];
};
Debug.setBreakPoint=function(a,b,c,d){
if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.');
if(%FunctionIsAPIFunction(a)){
throw new Error('Cannot set break point in native code.');
}
var e=
this.findFunctionSourceLocation(a,b,c).position;
var g=e-this.sourcePosition(a);
var h=%FunctionGetScript(a);
if(h.type==Debug.ScriptType.Native){
throw new Error('Cannot set break point in native code.');
}
if(h&&h.id){
g+=%FunctionGetScriptSourcePosition(a);
var i=h.locationFromPosition(g,false);
return this.setScriptBreakPointById(h.id,
i.line,i.column,
d);
}else{
var j=MakeBreakPoint(g);
var k=
%SetFunctionBreakPoint(a,g,j);
k+=this.sourcePosition(a);
var l=h.locationFromPosition(k,true);
j.actual_location={line:l.line,
column:l.column,
script_id:h.id};
j.setCondition(d);
return j.number();
}
};
Debug.setBreakPointByScriptIdAndPosition=function(script_id,position,
condition,enabled,
opt_position_alignment)
{
var a=MakeBreakPoint(position);
a.setCondition(condition);
if(!enabled){
a.disable();
}
var b=this.scripts();
var c=(opt_position_alignment===(void 0))
?Debug.BreakPositionAlignment.Statement:opt_position_alignment;
for(var d=0;d<b.length;d++){
if(script_id==b[d].id){
a.actual_position=%SetScriptBreakPoint(b[d],position,
c,a);
break;
}
}
return a;
};
Debug.enableBreakPoint=function(a){
var b=this.findBreakPoint(a,false);
if(b){
b.enable();
}
};
Debug.disableBreakPoint=function(a){
var b=this.findBreakPoint(a,false);
if(b){
b.disable();
}
};
Debug.changeBreakPointCondition=function(a,b){
var c=this.findBreakPoint(a,false);
c.setCondition(b);
};
Debug.changeBreakPointIgnoreCount=function(a,b){
if(b<0){
throw new Error('Invalid argument');
}
var c=this.findBreakPoint(a,false);
c.setIgnoreCount(b);
};
Debug.clearBreakPoint=function(a){
var b=this.findBreakPoint(a,true);
if(b){
return %ClearBreakPoint(b);
}else{
b=this.findScriptBreakPoint(a,true);
if(!b){
throw new Error('Invalid breakpoint');
}
}
};
Debug.clearAllBreakPoints=function(){
for(var a=0;a<break_points.length;a++){
var b=break_points[a];
%ClearBreakPoint(b);
}
break_points=[];
};
Debug.disableAllBreakPoints=function(){
for(var a=1;a<next_break_point_number;a++){
Debug.disableBreakPoint(a);
}
%ChangeBreakOnException(Debug.ExceptionBreak.Caught,false);
%ChangeBreakOnException(Debug.ExceptionBreak.Uncaught,false);
};
Debug.findScriptBreakPoint=function(a,b){
var c;
for(var d=0;d<script_break_points.length;d++){
if(script_break_points[d].number()==a){
c=script_break_points[d];
if(b){
c.clear();
script_break_points.splice(d,1);
}
break;
}
}
return c;
};
Debug.setScriptBreakPoint=function(type,script_id_or_name,
opt_line,opt_column,opt_condition,
opt_groupId,opt_position_alignment){
var a=
new ScriptBreakPoint(type,script_id_or_name,opt_line,opt_column,
opt_groupId,opt_position_alignment);
a.number_=next_break_point_number++;
a.setCondition(opt_condition);
script_break_points.push(a);
var b=this.scripts();
for(var c=0;c<b.length;c++){
if(a.matchesScript(b[c])){
a.set(b[c]);
}
}
return a.number();
};
Debug.setScriptBreakPointById=function(script_id,
opt_line,opt_column,
opt_condition,opt_groupId,
opt_position_alignment){
return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId,
script_id,opt_line,opt_column,
opt_condition,opt_groupId,
opt_position_alignment);
};
Debug.setScriptBreakPointByName=function(script_name,
opt_line,opt_column,
opt_condition,opt_groupId){
return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptName,
script_name,opt_line,opt_column,
opt_condition,opt_groupId);
};
Debug.setScriptBreakPointByRegExp=function(script_regexp,
opt_line,opt_column,
opt_condition,opt_groupId){
return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptRegExp,
script_regexp,opt_line,opt_column,
opt_condition,opt_groupId);
};
Debug.enableScriptBreakPoint=function(a){
var b=this.findScriptBreakPoint(a,false);
b.enable();
};
Debug.disableScriptBreakPoint=function(a){
var b=this.findScriptBreakPoint(a,false);
b.disable();
};
Debug.changeScriptBreakPointCondition=function(
break_point_number,condition){
var a=this.findScriptBreakPoint(break_point_number,false);
a.setCondition(condition);
};
Debug.changeScriptBreakPointIgnoreCount=function(
break_point_number,ignoreCount){
if(ignoreCount<0){
throw new Error('Invalid argument');
}
var a=this.findScriptBreakPoint(break_point_number,false);
a.setIgnoreCount(ignoreCount);
};
Debug.scriptBreakPoints=function(){
return script_break_points;
};
Debug.clearStepping=function(){
%ClearStepping();
};
Debug.setBreakOnException=function(){
return %ChangeBreakOnException(Debug.ExceptionBreak.Caught,true);
};
Debug.clearBreakOnException=function(){
return %ChangeBreakOnException(Debug.ExceptionBreak.Caught,false);
};
Debug.isBreakOnException=function(){
return!!%IsBreakOnException(Debug.ExceptionBreak.Caught);
};
Debug.setBreakOnUncaughtException=function(){
return %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught,true);
};
Debug.clearBreakOnUncaughtException=function(){
return %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught,false);
};
Debug.isBreakOnUncaughtException=function(){
return!!%IsBreakOnException(Debug.ExceptionBreak.Uncaught);
};
Debug.showBreakPoints=function(a,b,c){
if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.');
var d=b?this.scriptSource(a):this.source(a);
var e=b?this.sourcePosition(a):0;
var g=this.breakLocations(a,c);
if(!g)return d;
g.sort(function(h,i){return h-i;});
var j="";
var k=0;
var l;
for(var m=0;m<g.length;m++){
l=g[m]-e;
j+=d.slice(k,l);
j+="[B"+m+"]";
k=l;
}
l=d.length;
j+=d.substring(k,l);
return j;
};
Debug.scripts=function(){
return %DebugGetLoadedScripts();
};
Debug.debuggerFlags=function(){
return debugger_flags;
};
Debug.MakeMirror=MakeMirror;
function MakeExecutionState(a){
return new ExecutionState(a);
}
function ExecutionState(a){
this.break_id=a;
this.selected_frame=0;
}
ExecutionState.prototype.prepareStep=function(opt_action,opt_count,
opt_callframe){
var a=Debug.StepAction.StepIn;
if(!(opt_action===(void 0)))a=builtins.$toNumber(opt_action);
var b=opt_count?builtins.$toNumber(opt_count):1;
var c=0;
if(!(opt_callframe===(void 0))){
c=opt_callframe.details_.frameId();
}
return %PrepareStep(this.break_id,a,b,c);
};
ExecutionState.prototype.evaluateGlobal=function(source,disable_break,
opt_additional_context){
return MakeMirror(%DebugEvaluateGlobal(this.break_id,source,
Boolean(disable_break),
opt_additional_context));
};
ExecutionState.prototype.frameCount=function(){
return %GetFrameCount(this.break_id);
};
ExecutionState.prototype.threadCount=function(){
return %GetThreadCount(this.break_id);
};
ExecutionState.prototype.frame=function(a){
if(a==null)a=this.selected_frame;
if(a<0||a>=this.frameCount()){
throw new Error('Illegal frame index.');
}
return new FrameMirror(this.break_id,a);
};
ExecutionState.prototype.setSelectedFrame=function(a){
var b=builtins.$toNumber(a);
if(b<0||b>=this.frameCount())throw new Error('Illegal frame index.');
this.selected_frame=b;
};
ExecutionState.prototype.selectedFrame=function(){
return this.selected_frame;
};
ExecutionState.prototype.debugCommandProcessor=function(a){
return new DebugCommandProcessor(this,a);
};
function MakeBreakEvent(a,b){
return new BreakEvent(a,b);
}
function BreakEvent(a,b){
this.frame_=new FrameMirror(a,0);
this.break_points_hit_=b;
}
BreakEvent.prototype.eventType=function(){
return Debug.DebugEvent.Break;
};
BreakEvent.prototype.func=function(){
return this.frame_.func();
};
BreakEvent.prototype.sourceLine=function(){
return this.frame_.sourceLine();
};
BreakEvent.prototype.sourceColumn=function(){
return this.frame_.sourceColumn();
};
BreakEvent.prototype.sourceLineText=function(){
return this.frame_.sourceLineText();
};
BreakEvent.prototype.breakPointsHit=function(){
return this.break_points_hit_;
};
BreakEvent.prototype.toJSONProtocol=function(){
var a={seq:next_response_seq++,
type:"event",
event:"break",
body:{invocationText:this.frame_.invocationText()}
};
var b=this.func().script();
if(b){
a.body.sourceLine=this.sourceLine(),
a.body.sourceColumn=this.sourceColumn(),
a.body.sourceLineText=this.sourceLineText(),
a.body.script=MakeScriptObject_(b,false);
}
if(this.breakPointsHit()){
a.body.breakpoints=[];
for(var c=0;c<this.breakPointsHit().length;c++){
var d=this.breakPointsHit()[c];
var e=d.script_break_point();
var g;
if(e){
g=e.number();
}else{
g=d.number();
}
a.body.breakpoints.push(g);
}
}
return JSON.stringify(ObjectToProtocolObject_(a));
};
function MakeExceptionEvent(a,b,c,d){
return new ExceptionEvent(a,b,c,d);
}
function ExceptionEvent(a,b,c,d){
this.exec_state_=new ExecutionState(a);
this.exception_=b;
this.uncaught_=c;
this.promise_=d;
}
ExceptionEvent.prototype.eventType=function(){
return Debug.DebugEvent.Exception;
};
ExceptionEvent.prototype.exception=function(){
return this.exception_;
};
ExceptionEvent.prototype.uncaught=function(){
return this.uncaught_;
};
ExceptionEvent.prototype.promise=function(){
return this.promise_;
};
ExceptionEvent.prototype.func=function(){
return this.exec_state_.frame(0).func();
};
ExceptionEvent.prototype.sourceLine=function(){
return this.exec_state_.frame(0).sourceLine();
};
ExceptionEvent.prototype.sourceColumn=function(){
return this.exec_state_.frame(0).sourceColumn();
};
ExceptionEvent.prototype.sourceLineText=function(){
return this.exec_state_.frame(0).sourceLineText();
};
ExceptionEvent.prototype.toJSONProtocol=function(){
var a=new ProtocolMessage();
a.event="exception";
a.body={uncaught:this.uncaught_,
exception:MakeMirror(this.exception_)
};
if(this.exec_state_.frameCount()>0){
a.body.sourceLine=this.sourceLine();
a.body.sourceColumn=this.sourceColumn();
a.body.sourceLineText=this.sourceLineText();
var b=this.func().script();
if(b){
a.body.script=MakeScriptObject_(b,false);
}
}else{
a.body.sourceLine=-1;
}
return a.toJSONProtocol();
};
function MakeCompileEvent(a,b){
return new CompileEvent(a,b);
}
function CompileEvent(a,b){
this.script_=MakeMirror(a);
this.type_=b;
}
CompileEvent.prototype.eventType=function(){
return this.type_;
};
CompileEvent.prototype.script=function(){
return this.script_;
};
CompileEvent.prototype.toJSONProtocol=function(){
var a=new ProtocolMessage();
a.running=true;
switch(this.type_){
case Debug.DebugEvent.BeforeCompile:
a.event="beforeCompile";
break;
case Debug.DebugEvent.AfterCompile:
a.event="afterCompile";
break;
case Debug.DebugEvent.CompileError:
a.event="compileError";
break;
}
a.body={};
a.body.script=this.script_;
return a.toJSONProtocol();
};
function MakeScriptObject_(a,b){
var c={id:a.id(),
name:a.name(),
lineOffset:a.lineOffset(),
columnOffset:a.columnOffset(),
lineCount:a.lineCount(),
};
if(!(a.data()===(void 0))){
c.data=a.data();
}
if(b){
c.source=a.source();
}
return c;
}
function MakePromiseEvent(a){
return new PromiseEvent(a);
}
function PromiseEvent(a){
this.promise_=a.promise;
this.parentPromise_=a.parentPromise;
this.status_=a.status;
this.value_=a.value;
}
PromiseEvent.prototype.promise=function(){
return MakeMirror(this.promise_);
}
PromiseEvent.prototype.parentPromise=function(){
return MakeMirror(this.parentPromise_);
}
PromiseEvent.prototype.status=function(){
return this.status_;
}
PromiseEvent.prototype.value=function(){
return MakeMirror(this.value_);
}
function MakeAsyncTaskEvent(a){
return new AsyncTaskEvent(a);
}
function AsyncTaskEvent(a){
this.type_=a.type;
this.name_=a.name;
this.id_=a.id;
}
AsyncTaskEvent.prototype.type=function(){
return this.type_;
}
AsyncTaskEvent.prototype.name=function(){
return this.name_;
}
AsyncTaskEvent.prototype.id=function(){
return this.id_;
}
function DebugCommandProcessor(a,b){
this.exec_state_=a;
this.running_=b||false;
}
DebugCommandProcessor.prototype.processDebugRequest=function(a){
return this.processDebugJSONRequest(a);
};
function ProtocolMessage(a){
this.seq=next_response_seq++;
if(a){
this.type='response';
this.request_seq=a.seq;
this.command=a.command;
}else{
this.type='event';
}
this.success=true;
this.running=undefined;
}
ProtocolMessage.prototype.setOption=function(a,b){
if(!this.options_){
this.options_={};
}
this.options_[a]=b;
};
ProtocolMessage.prototype.failed=function(a,b){
this.success=false;
this.message=a;
if((%_IsObject(b))){
this.error_details=b;
}
};
ProtocolMessage.prototype.toJSONProtocol=function(){
var a={};
a.seq=this.seq;
if(this.request_seq){
a.request_seq=this.request_seq;
}
a.type=this.type;
if(this.event){
a.event=this.event;
}
if(this.command){
a.command=this.command;
}
if(this.success){
a.success=this.success;
}else{
a.success=false;
}
if(this.body){
var b;
var c=MakeMirrorSerializer(true,this.options_);
if(this.body instanceof Mirror){
b=c.serializeValue(this.body);
}else if(this.body instanceof Array){
b=[];
for(var d=0;d<this.body.length;d++){
if(this.body[d]instanceof Mirror){
b.push(c.serializeValue(this.body[d]));
}else{
b.push(ObjectToProtocolObject_(this.body[d],c));
}
}
}else{
b=ObjectToProtocolObject_(this.body,c);
}
a.body=b;
a.refs=c.serializeReferencedObjects();
}
if(this.message){
a.message=this.message;
}
if(this.error_details){
a.error_details=this.error_details;
}
a.running=this.running;
return JSON.stringify(a);
};
DebugCommandProcessor.prototype.createResponse=function(a){
return new ProtocolMessage(a);
};
DebugCommandProcessor.prototype.processDebugJSONRequest=function(
json_request){
var a;
var b;
try{
try{
a=JSON.parse(json_request);
b=this.createResponse(a);
if(!a.type){
throw new Error('Type not specified');
}
if(a.type!='request'){
throw new Error("Illegal type '"+a.type+"' in request");
}
if(!a.command){
throw new Error('Command not specified');
}
if(a.arguments){
var c=a.arguments;
if(c.inlineRefs||c.compactFormat){
b.setOption('inlineRefs',true);
}
if(!(c.maxStringLength===(void 0))){
b.setOption('maxStringLength',c.maxStringLength);
}
}
var d=a.command.toLowerCase();
var e=DebugCommandProcessor.prototype.dispatch_[d];
if((%_IsFunction(e))){
%_CallFunction(this,a,b,e);
}else{
throw new Error('Unknown command "'+a.command+'" in request');
}
}catch(e){
if(!b){
b=this.createResponse();
}
b.success=false;
b.message=builtins.$toString(e);
}
try{
if(!(b.running===(void 0))){
this.running_=b.running;
}
b.running=this.running_;
return b.toJSONProtocol();
}catch(e){
return'{"seq":'+b.seq+','+
'"request_seq":'+a.seq+','+
'"type":"response",'+
'"success":false,'+
'"message":"Internal error: '+builtins.$toString(e)+'"}';
}
}catch(e){
return'{"seq":0,"type":"response","success":false,"message":"Internal error"}';
}
};
DebugCommandProcessor.prototype.continueRequest_=function(a,b){
if(a.arguments){
var c=1;
var d=Debug.StepAction.StepIn;
var e=a.arguments.stepaction;
var g=a.arguments.stepcount;
if(g){
c=builtins.$toNumber(g);
if(c<0){
throw new Error('Invalid stepcount argument "'+g+'".');
}
}
if(e){
if(e=='in'){
d=Debug.StepAction.StepIn;
}else if(e=='min'){
d=Debug.StepAction.StepMin;
}else if(e=='next'){
d=Debug.StepAction.StepNext;
}else if(e=='out'){
d=Debug.StepAction.StepOut;
}else{
throw new Error('Invalid stepaction argument "'+e+'".');
}
}
this.exec_state_.prepareStep(d,c);
}
b.running=true;
};
DebugCommandProcessor.prototype.breakRequest_=function(a,b){
};
DebugCommandProcessor.prototype.setBreakPointRequest_=
function(a,b){
if(!a.arguments){
b.failed('Missing arguments');
return;
}
var c=a.arguments.type;
var d=a.arguments.target;
var e=a.arguments.line;
var g=a.arguments.column;
var h=(a.arguments.enabled===(void 0))?
true:a.arguments.enabled;
var i=a.arguments.condition;
var j=a.arguments.ignoreCount;
var k=a.arguments.groupId;
if(!c||(d===(void 0))){
b.failed('Missing argument "type" or "target"');
return;
}
var l;
if(c=='function'){
if(!(typeof(d)==='string')){
b.failed('Argument "target" is not a string value');
return;
}
var m;
try{
m=this.exec_state_.evaluateGlobal(d).value();
}catch(e){
b.failed('Error: "'+builtins.$toString(e)+
'" evaluating "'+d+'"');
return;
}
if(!(%_IsFunction(m))){
b.failed('"'+d+'" does not evaluate to a function');
return;
}
l=Debug.setBreakPoint(m,e,g,i);
}else if(c=='handle'){
var n=parseInt(d,10);
var o=LookupMirror(n);
if(!o){
return b.failed('Object #'+n+'# not found');
}
if(!o.isFunction()){
return b.failed('Object #'+n+'# is not a function');
}
l=Debug.setBreakPoint(o.value(),
e,g,i);
}else if(c=='script'){
l=
Debug.setScriptBreakPointByName(d,e,g,i,
k);
}else if(c=='scriptId'){
l=
Debug.setScriptBreakPointById(d,e,g,i,k);
}else if(c=='scriptRegExp'){
l=
Debug.setScriptBreakPointByRegExp(d,e,g,i,
k);
}else{
b.failed('Illegal type "'+c+'"');
return;
}
var p=Debug.findBreakPoint(l);
if(j){
Debug.changeBreakPointIgnoreCount(l,j);
}
if(!h){
Debug.disableBreakPoint(l);
}
b.body={type:c,
breakpoint:l};
if(p instanceof ScriptBreakPoint){
if(p.type()==Debug.ScriptBreakPointType.ScriptId){
b.body.type='scriptId';
b.body.script_id=p.script_id();
}else if(p.type()==Debug.ScriptBreakPointType.ScriptName){
b.body.type='scriptName';
b.body.script_name=p.script_name();
}else if(p.type()==Debug.ScriptBreakPointType.ScriptRegExp){
b.body.type='scriptRegExp';
b.body.script_regexp=p.script_regexp_object().source;
}else{
throw new Error("Internal error: Unexpected breakpoint type: "+
p.type());
}
b.body.line=p.line();
b.body.column=p.column();
b.body.actual_locations=p.actual_locations();
}else{
b.body.type='function';
b.body.actual_locations=[p.actual_location];
}
};
DebugCommandProcessor.prototype.changeBreakPointRequest_=function(
request,response){
if(!request.arguments){
response.failed('Missing arguments');
return;
}
var a=builtins.$toNumber(request.arguments.breakpoint);
var b=request.arguments.enabled;
var c=request.arguments.condition;
var d=request.arguments.ignoreCount;
if(!a){
response.failed('Missing argument "breakpoint"');
return;
}
if(!(b===(void 0))){
if(b){
Debug.enableBreakPoint(a);
}else{
Debug.disableBreakPoint(a);
}
}
if(!(c===(void 0))){
Debug.changeBreakPointCondition(a,c);
}
if(!(d===(void 0))){
Debug.changeBreakPointIgnoreCount(a,d);
}
};
DebugCommandProcessor.prototype.clearBreakPointGroupRequest_=function(
request,response){
if(!request.arguments){
response.failed('Missing arguments');
return;
}
var a=request.arguments.groupId;
if(!a){
response.failed('Missing argument "groupId"');
return;
}
var b=[];
var c=[];
for(var d=0;d<script_break_points.length;d++){
var e=script_break_points[d];
if(e.groupId()==a){
b.push(e.number());
e.clear();
}else{
c.push(e);
}
}
script_break_points=c;
response.body={breakpoints:b};
};
DebugCommandProcessor.prototype.clearBreakPointRequest_=function(
request,response){
if(!request.arguments){
response.failed('Missing arguments');
return;
}
var a=builtins.$toNumber(request.arguments.breakpoint);
if(!a){
response.failed('Missing argument "breakpoint"');
return;
}
Debug.clearBreakPoint(a);
response.body={breakpoint:a};
};
DebugCommandProcessor.prototype.listBreakpointsRequest_=function(
request,response){
var a=[];
for(var b=0;b<script_break_points.length;b++){
var c=script_break_points[b];
var d={
number:c.number(),
line:c.line(),
column:c.column(),
groupId:c.groupId(),
hit_count:c.hit_count(),
active:c.active(),
condition:c.condition(),
ignoreCount:c.ignoreCount(),
actual_locations:c.actual_locations()
};
if(c.type()==Debug.ScriptBreakPointType.ScriptId){
d.type='scriptId';
d.script_id=c.script_id();
}else if(c.type()==Debug.ScriptBreakPointType.ScriptName){
d.type='scriptName';
d.script_name=c.script_name();
}else if(c.type()==Debug.ScriptBreakPointType.ScriptRegExp){
d.type='scriptRegExp';
d.script_regexp=c.script_regexp_object().source;
}else{
throw new Error("Internal error: Unexpected breakpoint type: "+
c.type());
}
a.push(d);
}
response.body={
breakpoints:a,
breakOnExceptions:Debug.isBreakOnException(),
breakOnUncaughtExceptions:Debug.isBreakOnUncaughtException()
};
};
DebugCommandProcessor.prototype.disconnectRequest_=
function(a,b){
Debug.disableAllBreakPoints();
this.continueRequest_(a,b);
};
DebugCommandProcessor.prototype.setExceptionBreakRequest_=
function(a,b){
if(!a.arguments){
b.failed('Missing arguments');
return;
}
var c=a.arguments.type;
if(!c){
b.failed('Missing argument "type"');
return;
}
var d;
if(c=='all'){
d=!Debug.isBreakOnException();
}else if(c=='uncaught'){
d=!Debug.isBreakOnUncaughtException();
}
if(!(a.arguments.enabled===(void 0))){
d=a.arguments.enabled;
if((d!=true)&&(d!=false)){
b.failed('Illegal value for "enabled":"'+d+'"');
}
}
if(c=='all'){
%ChangeBreakOnException(Debug.ExceptionBreak.Caught,d);
}else if(c=='uncaught'){
%ChangeBreakOnException(Debug.ExceptionBreak.Uncaught,d);
}else{
b.failed('Unknown "type":"'+c+'"');
}
b.body={'type':c,'enabled':d};
};
DebugCommandProcessor.prototype.backtraceRequest_=function(
request,response){
var a=this.exec_state_.frameCount();
if(a==0){
response.body={
totalFrames:a
};
return;
}
var b=0;
var c=kDefaultBacktraceLength;
if(request.arguments){
if(request.arguments.fromFrame){
b=request.arguments.fromFrame;
}
if(request.arguments.toFrame){
c=request.arguments.toFrame;
}
if(request.arguments.bottom){
var d=a-b;
b=a-c;
c=d;
}
if(b<0||c<0){
return response.failed('Invalid frame number');
}
}
c=Math.min(a,c);
if(c<=b){
var e='Invalid frame range';
return response.failed(e);
}
var g=[];
for(var h=b;h<c;h++){
g.push(this.exec_state_.frame(h));
}
response.body={
fromFrame:b,
toFrame:c,
totalFrames:a,
frames:g
};
};
DebugCommandProcessor.prototype.frameRequest_=function(a,b){
if(this.exec_state_.frameCount()==0){
return b.failed('No frames');
}
if(a.arguments){
var c=a.arguments.number;
if(c<0||this.exec_state_.frameCount()<=c){
return b.failed('Invalid frame number');
}
this.exec_state_.setSelectedFrame(a.arguments.number);
}
b.body=this.exec_state_.frame();
};
DebugCommandProcessor.prototype.resolveFrameFromScopeDescription_=
function(a){
if(a&&!(a.frameNumber===(void 0))){
var b=a.frameNumber;
if(b<0||this.exec_state_.frameCount()<=b){
throw new Error('Invalid frame number');
}
return this.exec_state_.frame(b);
}else{
return this.exec_state_.frame();
}
};
DebugCommandProcessor.prototype.resolveScopeHolder_=
function(a){
if(a&&"functionHandle"in a){
if(!(typeof(a.functionHandle)==='number')){
throw new Error('Function handle must be a number');
}
var b=LookupMirror(a.functionHandle);
if(!b){
throw new Error('Failed to find function object by handle');
}
if(!b.isFunction()){
throw new Error('Value of non-function type is found by handle');
}
return b;
}else{
if(this.exec_state_.frameCount()==0){
throw new Error('No scopes');
}
var c=this.resolveFrameFromScopeDescription_(a);
return c;
}
}
DebugCommandProcessor.prototype.scopesRequest_=function(a,b){
var c=this.resolveScopeHolder_(a.arguments);
var d=c.scopeCount();
var e=[];
for(var g=0;g<d;g++){
e.push(c.scope(g));
}
b.body={
fromScope:0,
toScope:d,
totalScopes:d,
scopes:e
};
};
DebugCommandProcessor.prototype.scopeRequest_=function(a,b){
var c=this.resolveScopeHolder_(a.arguments);
var d=0;
if(a.arguments&&!(a.arguments.number===(void 0))){
d=builtins.$toNumber(a.arguments.number);
if(d<0||c.scopeCount()<=d){
return b.failed('Invalid scope number');
}
}
b.body=c.scope(d);
};
DebugCommandProcessor.resolveValue_=function(a){
if("handle"in a){
var b=LookupMirror(a.handle);
if(!b){
throw new Error("Failed to resolve value by handle, ' #"+
a.handle+"# not found");
}
return b.value();
}else if("stringDescription"in a){
if(a.type==BOOLEAN_TYPE){
return Boolean(a.stringDescription);
}else if(a.type==NUMBER_TYPE){
return Number(a.stringDescription);
}if(a.type==STRING_TYPE){
return String(a.stringDescription);
}else{
throw new Error("Unknown type");
}
}else if("value"in a){
return a.value;
}else if(a.type==UNDEFINED_TYPE){
return(void 0);
}else if(a.type==NULL_TYPE){
return null;
}else{
throw new Error("Failed to parse value description");
}
};
DebugCommandProcessor.prototype.setVariableValueRequest_=
function(a,b){
if(!a.arguments){
b.failed('Missing arguments');
return;
}
if((a.arguments.name===(void 0))){
b.failed('Missing variable name');
}
var c=a.arguments.name;
var d=a.arguments.scope;
var e=this.resolveScopeHolder_(d);
if((d.number===(void 0))){
b.failed('Missing scope number');
}
var g=builtins.$toNumber(d.number);
var h=e.scope(g);
var i=
DebugCommandProcessor.resolveValue_(a.arguments.newValue);
h.setVariableValue(c,i);
var j=MakeMirror(i);
b.body={
newValue:j
};
};
DebugCommandProcessor.prototype.evaluateRequest_=function(a,b){
if(!a.arguments){
return b.failed('Missing arguments');
}
var c=a.arguments.expression;
var d=a.arguments.frame;
var e=a.arguments.global;
var g=a.arguments.disable_break;
var h=a.arguments.additional_context;
try{
c=String(c);
}catch(e){
return b.failed('Failed to convert expression argument to string');
}
if(!(d===(void 0))&&e){
return b.failed('Arguments "frame" and "global" are exclusive');
}
var i;
if(h){
i={};
for(var j=0;j<h.length;j++){
var k=h[j];
if(!(typeof(k.name)==='string')){
return b.failed("Context element #"+j+
" doesn't contain name:string property");
}
var l=DebugCommandProcessor.resolveValue_(k);
i[k.name]=l;
}
}
if(e){
b.body=this.exec_state_.evaluateGlobal(
c,Boolean(g),i);
return;
}
if((g===(void 0))){
g=true;
}
if(this.exec_state_.frameCount()==0){
return b.failed('No frames');
}
if(!(d===(void 0))){
var m=builtins.$toNumber(d);
if(m<0||m>=this.exec_state_.frameCount()){
return b.failed('Invalid frame "'+d+'"');
}
b.body=this.exec_state_.frame(m).evaluate(
c,Boolean(g),i);
return;
}else{
b.body=this.exec_state_.frame().evaluate(
c,Boolean(g),i);
return;
}
};
DebugCommandProcessor.prototype.lookupRequest_=function(a,b){
if(!a.arguments){
return b.failed('Missing arguments');
}
var c=a.arguments.handles;
if((c===(void 0))){
return b.failed('Argument "handles" missing');
}
if(!(a.arguments.includeSource===(void 0))){
var d=builtins.$toBoolean(a.arguments.includeSource);
b.setOption('includeSource',d);
}
var e={};
for(var g=0;g<c.length;g++){
var h=c[g];
var i=LookupMirror(h);
if(!i){
return b.failed('Object #'+h+'# not found');
}
e[h]=i;
}
b.body=e;
};
DebugCommandProcessor.prototype.referencesRequest_=
function(a,b){
if(!a.arguments){
return b.failed('Missing arguments');
}
var c=a.arguments.type;
var d=a.arguments.handle;
if((c===(void 0))){
return b.failed('Argument "type" missing');
}
if((d===(void 0))){
return b.failed('Argument "handle" missing');
}
if(c!='referencedBy'&&c!='constructedBy'){
return b.failed('Invalid type "'+c+'"');
}
var e=LookupMirror(d);
if(e){
if(c=='referencedBy'){
b.body=e.referencedBy();
}else{
b.body=e.constructedBy();
}
}else{
return b.failed('Object #'+d+'# not found');
}
};
DebugCommandProcessor.prototype.sourceRequest_=function(a,b){
if(this.exec_state_.frameCount()==0){
return b.failed('No source');
}
var c;
var d;
var e=this.exec_state_.frame();
if(a.arguments){
c=a.arguments.fromLine;
d=a.arguments.toLine;
if(!(a.arguments.frame===(void 0))){
var g=builtins.$toNumber(a.arguments.frame);
if(g<0||g>=this.exec_state_.frameCount()){
return b.failed('Invalid frame "'+e+'"');
}
e=this.exec_state_.frame(g);
}
}
var h=e.func().script();
if(!h){
return b.failed('No source');
}
var i=h.sourceSlice(c,d);
if(!i){
return b.failed('Invalid line interval');
}
b.body={};
b.body.source=i.sourceText();
b.body.fromLine=i.from_line;
b.body.toLine=i.to_line;
b.body.fromPosition=i.from_position;
b.body.toPosition=i.to_position;
b.body.totalLines=h.lineCount();
};
DebugCommandProcessor.prototype.scriptsRequest_=function(a,b){
var c=ScriptTypeFlag(Debug.ScriptType.Normal);
var d=false;
var e=null;
if(a.arguments){
if(!(a.arguments.types===(void 0))){
c=builtins.$toNumber(a.arguments.types);
if(isNaN(c)||c<0){
return b.failed('Invalid types "'+
a.arguments.types+'"');
}
}
if(!(a.arguments.includeSource===(void 0))){
d=builtins.$toBoolean(a.arguments.includeSource);
b.setOption('includeSource',d);
}
if((%_IsArray(a.arguments.ids))){
e={};
var g=a.arguments.ids;
for(var h=0;h<g.length;h++){
e[g[h]]=true;
}
}
var i=null;
var j=null;
if(!(a.arguments.filter===(void 0))){
var k=builtins.$toNumber(a.arguments.filter);
if(!isNaN(k)){
j=k;
}
i=a.arguments.filter;
}
}
var l=%DebugGetLoadedScripts();
b.body=[];
for(var h=0;h<l.length;h++){
if(e&&!e[l[h].id]){
continue;
}
if(i||j){
var m=l[h];
var n=false;
if(j&&!n){
if(m.id&&m.id===j){
n=true;
}
}
if(i&&!n){
if(m.name&&m.name.indexOf(i)>=0){
n=true;
}
}
if(!n)continue;
}
if(c&ScriptTypeFlag(l[h].type)){
b.body.push(MakeMirror(l[h]));
}
}
};
DebugCommandProcessor.prototype.threadsRequest_=function(a,b){
var c=this.exec_state_.threadCount();
var d=[];
for(var e=0;e<c;e++){
var g=%GetThreadDetails(this.exec_state_.break_id,e);
var h={current:g[0],
id:g[1]
};
d.push(h);
}
b.body={
totalThreads:c,
threads:d
};
};
DebugCommandProcessor.prototype.suspendRequest_=function(a,b){
b.running=false;
};
DebugCommandProcessor.prototype.versionRequest_=function(a,b){
b.body={
V8Version:%GetV8Version()
};
};
DebugCommandProcessor.prototype.changeLiveRequest_=function(
request,response){
if(!request.arguments){
return response.failed('Missing arguments');
}
var a=request.arguments.script_id;
var b=!!request.arguments.preview_only;
var c=%DebugGetLoadedScripts();
var d=null;
for(var e=0;e<c.length;e++){
if(c[e].id==a){
d=c[e];
}
}
if(!d){
response.failed('Script not found');
return;
}
var g=new Array();
if(!(typeof(request.arguments.new_source)==='string')){
throw"new_source argument expected";
}
var h=request.arguments.new_source;
var i;
try{
i=Debug.LiveEdit.SetScriptSource(d,
h,b,g);
}catch(e){
if(e instanceof Debug.LiveEdit.Failure&&"details"in e){
response.failed(e.message,e.details);
return;
}
throw e;
}
response.body={change_log:g,result:i};
if(!b&&!this.running_&&i.stack_modified){
response.body.stepin_recommended=true;
}
};
DebugCommandProcessor.prototype.restartFrameRequest_=function(
request,response){
if(!request.arguments){
return response.failed('Missing arguments');
}
var a=request.arguments.frame;
if(this.exec_state_.frameCount()==0){
return response.failed('No frames');
}
var b;
if(!(a===(void 0))){
var c=builtins.$toNumber(a);
if(c<0||c>=this.exec_state_.frameCount()){
return response.failed('Invalid frame "'+a+'"');
}
b=this.exec_state_.frame(c);
}else{
b=this.exec_state_.frame();
}
var d=Debug.LiveEdit.RestartFrame(b);
response.body={result:d};
};
DebugCommandProcessor.prototype.debuggerFlagsRequest_=function(request,
response){
if(!request.arguments){
response.failed('Missing arguments');
return;
}
var a=request.arguments.flags;
response.body={flags:[]};
if(!(a===(void 0))){
for(var b=0;b<a.length;b++){
var c=a[b].name;
var d=debugger_flags[c];
if(!d){
continue;
}
if('value'in a[b]){
d.setValue(a[b].value);
}
response.body.flags.push({name:c,value:d.getValue()});
}
}else{
for(var c in debugger_flags){
var e=debugger_flags[c].getValue();
response.body.flags.push({name:c,value:e});
}
}
};
DebugCommandProcessor.prototype.v8FlagsRequest_=function(a,b){
var c=a.arguments.flags;
if(!c)c='';
%SetFlags(c);
};
DebugCommandProcessor.prototype.gcRequest_=function(a,b){
var c=a.arguments.type;
if(!c)c='all';
var d=%GetHeapUsage();
%CollectGarbage(c);
var e=%GetHeapUsage();
b.body={"before":d,"after":e};
};
DebugCommandProcessor.prototype.dispatch_=(function(){
var a=DebugCommandProcessor.prototype;
return{
"continue":a.continueRequest_,
"break":a.breakRequest_,
"setbreakpoint":a.setBreakPointRequest_,
"changebreakpoint":a.changeBreakPointRequest_,
"clearbreakpoint":a.clearBreakPointRequest_,
"clearbreakpointgroup":a.clearBreakPointGroupRequest_,
"disconnect":a.disconnectRequest_,
"setexceptionbreak":a.setExceptionBreakRequest_,
"listbreakpoints":a.listBreakpointsRequest_,
"backtrace":a.backtraceRequest_,
"frame":a.frameRequest_,
"scopes":a.scopesRequest_,
"scope":a.scopeRequest_,
"setvariablevalue":a.setVariableValueRequest_,
"evaluate":a.evaluateRequest_,
"lookup":a.lookupRequest_,
"references":a.referencesRequest_,
"source":a.sourceRequest_,
"scripts":a.scriptsRequest_,
"threads":a.threadsRequest_,
"suspend":a.suspendRequest_,
"version":a.versionRequest_,
"changelive":a.changeLiveRequest_,
"restartframe":a.restartFrameRequest_,
"flags":a.debuggerFlagsRequest_,
"v8flag":a.v8FlagsRequest_,
"gc":a.gcRequest_,
};
})();
DebugCommandProcessor.prototype.isRunning=function(){
return this.running_;
};
DebugCommandProcessor.prototype.systemBreak=function(a,b){
return %SystemBreak();
};
function ObjectToProtocolObject_(a,b){
var c={};
for(var d in a){
if(typeof d=='string'){
var e=ValueToProtocolValue_(a[d],
b);
if(!(e===(void 0))){
c[d]=e;
}
}
}
return c;
}
function ArrayToProtocolArray_(a,b){
var c=[];
for(var d=0;d<a.length;d++){
c.push(ValueToProtocolValue_(a[d],b));
}
return c;
}
function ValueToProtocolValue_(a,b){
var c;
switch(typeof a){
case'object':
if(a instanceof Mirror){
c=b.serializeValue(a);
}else if((%_IsArray(a))){
c=ArrayToProtocolArray_(a,b);
}else{
c=ObjectToProtocolObject_(a,b);
}
break;
case'boolean':
case'string':
case'number':
c=a;
break;
default:
c=null;
}
return c;
}
mirrorV<72>
"use strict";
var next_handle_=0;
var next_transient_handle_=-1;
var mirror_cache_=[];
var mirror_cache_enabled_=true;
function ToggleMirrorCache(a){
mirror_cache_enabled_=a;
next_handle_=0;
mirror_cache_=[];
}
function ObjectIsPromise(a){
try{
return(%_IsSpecObject(a))&&
!(%DebugGetProperty(a,builtins.$promiseStatus)===(void 0));
}catch(e){
return false;
}
}
function MakeMirror(a,b){
var c;
if(!b&&mirror_cache_enabled_){
for(var d in mirror_cache_){
c=mirror_cache_[d];
if(c.value()===a){
return c;
}
if(c.isNumber()&&isNaN(c.value())&&
typeof a=='number'&&isNaN(a)){
return c;
}
}
}
if((a===(void 0))){
c=new UndefinedMirror();
}else if((a===null)){
c=new NullMirror();
}else if((typeof(a)==='boolean')){
c=new BooleanMirror(a);
}else if((typeof(a)==='number')){
c=new NumberMirror(a);
}else if((typeof(a)==='string')){
c=new StringMirror(a);
}else if((typeof(a)==='symbol')){
c=new SymbolMirror(a);
}else if((%_IsArray(a))){
c=new ArrayMirror(a);
}else if((%_IsDate(a))){
c=new DateMirror(a);
}else if((%_IsFunction(a))){
c=new FunctionMirror(a);
}else if((%_IsRegExp(a))){
c=new RegExpMirror(a);
}else if((%_ClassOf(a)==='Error')){
c=new ErrorMirror(a);
}else if((%_ClassOf(a)==='Script')){
c=new ScriptMirror(a);
}else if((%_ClassOf(a)==='Map')||(%_ClassOf(a)==='WeakMap')){
c=new MapMirror(a);
}else if((%_ClassOf(a)==='Set')||(%_ClassOf(a)==='WeakSet')){
c=new SetMirror(a);
}else if((%_ClassOf(a)==='Map Iterator')||(%_ClassOf(a)==='Set Iterator')){
c=new IteratorMirror(a);
}else if(ObjectIsPromise(a)){
c=new PromiseMirror(a);
}else if((%_ClassOf(a)==='Generator')){
c=new GeneratorMirror(a);
}else{
c=new ObjectMirror(a,OBJECT_TYPE,b);
}
if(mirror_cache_enabled_)mirror_cache_[c.handle()]=c;
return c;
}
function LookupMirror(a){
if(!mirror_cache_enabled_)throw new Error("Mirror cache is disabled");
return mirror_cache_[a];
}
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 UNDEFINED_TYPE='undefined';
var NULL_TYPE='null';
var BOOLEAN_TYPE='boolean';
var NUMBER_TYPE='number';
var STRING_TYPE='string';
var SYMBOL_TYPE='symbol';
var OBJECT_TYPE='object';
var FUNCTION_TYPE='function';
var REGEXP_TYPE='regexp';
var ERROR_TYPE='error';
var PROPERTY_TYPE='property';
var INTERNAL_PROPERTY_TYPE='internalProperty';
var FRAME_TYPE='frame';
var SCRIPT_TYPE='script';
var CONTEXT_TYPE='context';
var SCOPE_TYPE='scope';
var PROMISE_TYPE='promise';
var MAP_TYPE='map';
var SET_TYPE='set';
var ITERATOR_TYPE='iterator';
var GENERATOR_TYPE='generator';
var kMaxProtocolStringLength=80;
var PropertyKind={};
PropertyKind.Named=1;
PropertyKind.Indexed=2;
var PropertyType={};
PropertyType.Data=0;
PropertyType.DataConstant=2;
PropertyType.AccessorConstant=3;
var PropertyAttribute={};
PropertyAttribute.None=0;
PropertyAttribute.ReadOnly=1;
PropertyAttribute.DontEnum=2;
PropertyAttribute.DontDelete=4;
var ScopeType={Global:0,
Local:1,
With:2,
Closure:3,
Catch:4,
Block:5,
Script:6};
function Mirror(a){
this.type_=a;
}
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(mirror_cache_enabled_)this.handle_=next_handle_++;
};
Mirror.prototype.allocateTransientHandle_=function(){
this.handle_=next_transient_handle_--;
};
Mirror.prototype.toText=function(){
return"#<"+this.constructor.name+">";
};
function ValueMirror(a,b,c){
%_CallFunction(this,a,Mirror);
this.value_=b;
if(!c){
this.allocateHandle_();
}else{
this.allocateTransientHandle_();
}
}
inherits(ValueMirror,Mirror);
Mirror.prototype.handle=function(){
return this.handle_;
};
ValueMirror.prototype.isPrimitive=function(){
var a=this.type();
return a==='undefined'||
a==='null'||
a==='boolean'||
a==='number'||
a==='string'||
a==='symbol';
};
ValueMirror.prototype.value=function(){
return this.value_;
};
function UndefinedMirror(){
%_CallFunction(this,UNDEFINED_TYPE,(void 0),ValueMirror);
}
inherits(UndefinedMirror,ValueMirror);
UndefinedMirror.prototype.toText=function(){
return'undefined';
};
function NullMirror(){
%_CallFunction(this,NULL_TYPE,null,ValueMirror);
}
inherits(NullMirror,ValueMirror);
NullMirror.prototype.toText=function(){
return'null';
};
function BooleanMirror(a){
%_CallFunction(this,BOOLEAN_TYPE,a,ValueMirror);
}
inherits(BooleanMirror,ValueMirror);
BooleanMirror.prototype.toText=function(){
return this.value_?'true':'false';
};
function NumberMirror(a){
%_CallFunction(this,NUMBER_TYPE,a,ValueMirror);
}
inherits(NumberMirror,ValueMirror);
NumberMirror.prototype.toText=function(){
return %_NumberToString(this.value_);
};
function StringMirror(a){
%_CallFunction(this,STRING_TYPE,a,ValueMirror);
}
inherits(StringMirror,ValueMirror);
StringMirror.prototype.length=function(){
return this.value_.length;
};
StringMirror.prototype.getTruncatedValue=function(a){
if(a!=-1&&this.length()>a){
return this.value_.substring(0,a)+
'... (length: '+this.length()+')';
}
return this.value_;
};
StringMirror.prototype.toText=function(){
return this.getTruncatedValue(kMaxProtocolStringLength);
};
function SymbolMirror(a){
%_CallFunction(this,SYMBOL_TYPE,a,ValueMirror);
}
inherits(SymbolMirror,ValueMirror);
SymbolMirror.prototype.description=function(){
return %SymbolDescription(%_ValueOf(this.value_));
}
SymbolMirror.prototype.toText=function(){
return %_CallFunction(this.value_,builtins.$symbolToString);
}
function ObjectMirror(a,b,c){
%_CallFunction(this,b||OBJECT_TYPE,a,c,ValueMirror);
}
inherits(ObjectMirror,ValueMirror);
ObjectMirror.prototype.className=function(){
return %_ClassOf(this.value_);
};
ObjectMirror.prototype.constructorFunction=function(){
return MakeMirror(%DebugGetProperty(this.value_,'constructor'));
};
ObjectMirror.prototype.prototypeObject=function(){
return MakeMirror(%DebugGetProperty(this.value_,'prototype'));
};
ObjectMirror.prototype.protoObject=function(){
return MakeMirror(%DebugGetPrototype(this.value_));
};
ObjectMirror.prototype.hasNamedInterceptor=function(){
var a=%GetInterceptorInfo(this.value_);
return(a&2)!=0;
};
ObjectMirror.prototype.hasIndexedInterceptor=function(){
var a=%GetInterceptorInfo(this.value_);
return(a&1)!=0;
};
function TryGetPropertyNames(a){
try{
return %GetOwnPropertyNames(a,32);
}catch(e){
return[];
}
}
ObjectMirror.prototype.propertyNames=function(a,b){
a=a||PropertyKind.Named|PropertyKind.Indexed;
var c;
var d;
var e=0;
if(a&PropertyKind.Named){
c=TryGetPropertyNames(this.value_);
e+=c.length;
if(this.hasNamedInterceptor()&&(a&PropertyKind.Named)){
var g=
%GetNamedInterceptorPropertyNames(this.value_);
if(g){
c=c.concat(g);
e+=g.length;
}
}
}
if(a&PropertyKind.Indexed){
d=%GetOwnElementNames(this.value_);
e+=d.length;
if(this.hasIndexedInterceptor()&&(a&PropertyKind.Indexed)){
var h=
%GetIndexedInterceptorElementNames(this.value_);
if(h){
d=d.concat(h);
e+=h.length;
}
}
}
b=Math.min(b||e,e);
var i=new Array(b);
var j=0;
if(a&PropertyKind.Named){
for(var k=0;j<b&&k<c.length;k++){
i[j++]=c[k];
}
}
if(a&PropertyKind.Indexed){
for(var k=0;j<b&&k<d.length;k++){
i[j++]=d[k];
}
}
return i;
};
ObjectMirror.prototype.properties=function(a,b){
var c=this.propertyNames(a,b);
var d=new Array(c.length);
for(var e=0;e<c.length;e++){
d[e]=this.property(c[e]);
}
return d;
};
ObjectMirror.prototype.internalProperties=function(){
return ObjectMirror.GetInternalProperties(this.value_);
}
ObjectMirror.prototype.property=function(a){
var b=%DebugGetPropertyDetails(this.value_,builtins.$toName(a));
if(b){
return new PropertyMirror(this,a,b);
}
return GetUndefinedMirror();
};
ObjectMirror.prototype.lookupProperty=function(a){
var b=this.properties();
for(var c=0;c<b.length;c++){
var d=b[c];
if(d.propertyType()!=PropertyType.AccessorConstant){
if(%_ObjectEquals(d.value_,a.value_)){
return d;
}
}
}
return GetUndefinedMirror();
};
ObjectMirror.prototype.referencedBy=function(a){
var b=%DebugReferencedBy(this.value_,
Mirror.prototype,a||0);
for(var c=0;c<b.length;c++){
b[c]=MakeMirror(b[c]);
}
return b;
};
ObjectMirror.prototype.toText=function(){
var a;
var b=this.constructorFunction();
if(!b.isFunction()){
a=this.className();
}else{
a=b.name();
if(!a){
a=this.className();
}
}
return'#<'+a+'>';
};
ObjectMirror.GetInternalProperties=function(a){
var b=%DebugGetInternalProperties(a);
var c=[];
for(var d=0;d<b.length;d+=2){
c.push(new InternalPropertyMirror(b[d],b[d+1]));
}
return c;
}
function FunctionMirror(a){
%_CallFunction(this,a,FUNCTION_TYPE,ObjectMirror);
this.resolved_=true;
}
inherits(FunctionMirror,ObjectMirror);
FunctionMirror.prototype.resolved=function(){
return this.resolved_;
};
FunctionMirror.prototype.name=function(){
return %FunctionGetName(this.value_);
};
FunctionMirror.prototype.inferredName=function(){
return %FunctionGetInferredName(this.value_);
};
FunctionMirror.prototype.source=function(){
if(this.resolved()){
return builtins.$functionSourceString(this.value_);
}
};
FunctionMirror.prototype.script=function(){
if(this.resolved()){
if(this.script_){
return this.script_;
}
var a=%FunctionGetScript(this.value_);
if(a){
return this.script_=MakeMirror(a);
}
}
};
FunctionMirror.prototype.sourcePosition_=function(){
if(this.resolved()){
return %FunctionGetScriptSourcePosition(this.value_);
}
};
FunctionMirror.prototype.sourceLocation=function(){
if(this.resolved()){
var a=this.script();
if(a){
return a.locationFromPosition(this.sourcePosition_(),true);
}
}
};
FunctionMirror.prototype.constructedBy=function(a){
if(this.resolved()){
var b=%DebugConstructedBy(this.value_,a||0);
for(var c=0;c<b.length;c++){
b[c]=MakeMirror(b[c]);
}
return b;
}else{
return[];
}
};
FunctionMirror.prototype.scopeCount=function(){
if(this.resolved()){
if((this.scopeCount_===(void 0))){
this.scopeCount_=%GetFunctionScopeCount(this.value());
}
return this.scopeCount_;
}else{
return 0;
}
};
FunctionMirror.prototype.scope=function(a){
if(this.resolved()){
return new ScopeMirror((void 0),this,a);
}
};
FunctionMirror.prototype.toText=function(){
return this.source();
};
function UnresolvedFunctionMirror(a){
%_CallFunction(this,FUNCTION_TYPE,a,ValueMirror);
this.propertyCount_=0;
this.elementCount_=0;
this.resolved_=false;
}
inherits(UnresolvedFunctionMirror,FunctionMirror);
UnresolvedFunctionMirror.prototype.className=function(){
return'Function';
};
UnresolvedFunctionMirror.prototype.constructorFunction=function(){
return GetUndefinedMirror();
};
UnresolvedFunctionMirror.prototype.prototypeObject=function(){
return GetUndefinedMirror();
};
UnresolvedFunctionMirror.prototype.protoObject=function(){
return GetUndefinedMirror();
};
UnresolvedFunctionMirror.prototype.name=function(){
return this.value_;
};
UnresolvedFunctionMirror.prototype.inferredName=function(){
return undefined;
};
UnresolvedFunctionMirror.prototype.propertyNames=function(a,b){
return[];
};
function ArrayMirror(a){
%_CallFunction(this,a,ObjectMirror);
}
inherits(ArrayMirror,ObjectMirror);
ArrayMirror.prototype.length=function(){
return this.value_.length;
};
ArrayMirror.prototype.indexedPropertiesFromRange=function(opt_from_index,
opt_to_index){
var a=opt_from_index||0;
var b=opt_to_index||this.length()-1;
if(a>b)return new Array();
var c=new Array(b-a+1);
for(var d=a;d<=b;d++){
var e=%DebugGetPropertyDetails(this.value_,builtins.$toString(d));
var g;
if(e){
g=new PropertyMirror(this,d,e);
}else{
g=GetUndefinedMirror();
}
c[d-a]=g;
}
return c;
};
function DateMirror(a){
%_CallFunction(this,a,ObjectMirror);
}
inherits(DateMirror,ObjectMirror);
DateMirror.prototype.toText=function(){
var a=JSON.stringify(this.value_);
return a.substring(1,a.length-1);
};
function RegExpMirror(a){
%_CallFunction(this,a,REGEXP_TYPE,ObjectMirror);
}
inherits(RegExpMirror,ObjectMirror);
RegExpMirror.prototype.source=function(){
return this.value_.source;
};
RegExpMirror.prototype.global=function(){
return this.value_.global;
};
RegExpMirror.prototype.ignoreCase=function(){
return this.value_.ignoreCase;
};
RegExpMirror.prototype.multiline=function(){
return this.value_.multiline;
};
RegExpMirror.prototype.sticky=function(){
return this.value_.sticky;
};
RegExpMirror.prototype.unicode=function(){
return this.value_.unicode;
};
RegExpMirror.prototype.toText=function(){
return"/"+this.source()+"/";
};
function ErrorMirror(a){
%_CallFunction(this,a,ERROR_TYPE,ObjectMirror);
}
inherits(ErrorMirror,ObjectMirror);
ErrorMirror.prototype.message=function(){
return this.value_.message;
};
ErrorMirror.prototype.toText=function(){
var a;
try{
a=%_CallFunction(this.value_,builtins.$errorToString);
}catch(e){
a='#<Error>';
}
return a;
};
function PromiseMirror(a){
%_CallFunction(this,a,PROMISE_TYPE,ObjectMirror);
}
inherits(PromiseMirror,ObjectMirror);
function PromiseGetStatus_(a){
var b=%DebugGetProperty(a,builtins.$promiseStatus);
if(b==0)return"pending";
if(b==1)return"resolved";
return"rejected";
}
function PromiseGetValue_(a){
return %DebugGetProperty(a,builtins.$promiseValue);
}
PromiseMirror.prototype.status=function(){
return PromiseGetStatus_(this.value_);
};
PromiseMirror.prototype.promiseValue=function(){
return MakeMirror(PromiseGetValue_(this.value_));
};
function MapMirror(a){
%_CallFunction(this,a,MAP_TYPE,ObjectMirror);
}
inherits(MapMirror,ObjectMirror);
MapMirror.prototype.entries=function(a){
var b=[];
if((%_ClassOf(this.value_)==='WeakMap')){
var c=%GetWeakMapEntries(this.value_,a||0);
for(var d=0;d<c.length;d+=2){
b.push({
key:c[d],
value:c[d+1]
});
}
return b;
}
var e=%_CallFunction(this.value_,builtins.$mapEntries);
var g;
while((!a||b.length<a)&&
!(g=e.next()).done){
b.push({
key:g.value[0],
value:g.value[1]
});
}
return b;
};
function SetMirror(a){
%_CallFunction(this,a,SET_TYPE,ObjectMirror);
}
inherits(SetMirror,ObjectMirror);
function IteratorGetValues_(a,b,c){
var d=[];
var e;
while((!c||d.length<c)&&
!(e=%_CallFunction(a,b)).done){
d.push(e.value);
}
return d;
}
SetMirror.prototype.values=function(a){
if((%_ClassOf(this.value_)==='WeakSet')){
return %GetWeakSetValues(this.value_,a||0);
}
var b=%_CallFunction(this.value_,builtins.$setValues);
return IteratorGetValues_(b,builtins.$setIteratorNext,a);
};
function IteratorMirror(a){
%_CallFunction(this,a,ITERATOR_TYPE,ObjectMirror);
}
inherits(IteratorMirror,ObjectMirror);
IteratorMirror.prototype.preview=function(a){
if((%_ClassOf(this.value_)==='Map Iterator')){
return IteratorGetValues_(%MapIteratorClone(this.value_),
builtins.$mapIteratorNext,
a);
}else if((%_ClassOf(this.value_)==='Set Iterator')){
return IteratorGetValues_(%SetIteratorClone(this.value_),
builtins.$setIteratorNext,
a);
}
};
function GeneratorMirror(a){
%_CallFunction(this,a,GENERATOR_TYPE,ObjectMirror);
}
inherits(GeneratorMirror,ObjectMirror);
function GeneratorGetStatus_(a){
var b=%GeneratorGetContinuation(a);
if(b<0)return"running";
if(b==0)return"closed";
return"suspended";
}
GeneratorMirror.prototype.status=function(){
return GeneratorGetStatus_(this.value_);
};
GeneratorMirror.prototype.sourcePosition_=function(){
return %GeneratorGetSourcePosition(this.value_);
};
GeneratorMirror.prototype.sourceLocation=function(){
var a=this.sourcePosition_();
if(!(a===(void 0))){
var b=this.func().script();
if(b){
return b.locationFromPosition(a,true);
}
}
};
GeneratorMirror.prototype.func=function(){
if(!this.func_){
this.func_=MakeMirror(%GeneratorGetFunction(this.value_));
}
return this.func_;
};
GeneratorMirror.prototype.context=function(){
if(!this.context_){
this.context_=new ContextMirror(%GeneratorGetContext(this.value_));
}
return this.context_;
};
GeneratorMirror.prototype.receiver=function(){
if(!this.receiver_){
this.receiver_=MakeMirror(%GeneratorGetReceiver(this.value_));
}
return this.receiver_;
};
function PropertyMirror(a,b,c){
%_CallFunction(this,PROPERTY_TYPE,Mirror);
this.mirror_=a;
this.name_=b;
this.value_=c[0];
this.details_=c[1];
this.is_interceptor_=c[2];
if(c.length>3){
this.exception_=c[3];
this.getter_=c[4];
this.setter_=c[5];
}
}
inherits(PropertyMirror,Mirror);
PropertyMirror.prototype.isReadOnly=function(){
return(this.attributes()&PropertyAttribute.ReadOnly)!=0;
};
PropertyMirror.prototype.isEnum=function(){
return(this.attributes()&PropertyAttribute.DontEnum)==0;
};
PropertyMirror.prototype.canDelete=function(){
return(this.attributes()&PropertyAttribute.DontDelete)==0;
};
PropertyMirror.prototype.name=function(){
return this.name_;
};
PropertyMirror.prototype.isIndexed=function(){
for(var a=0;a<this.name_.length;a++){
if(this.name_[a]<'0'||'9'<this.name_[a]){
return false;
}
}
return true;
};
PropertyMirror.prototype.value=function(){
return MakeMirror(this.value_,false);
};
PropertyMirror.prototype.isException=function(){
return this.exception_?true:false;
};
PropertyMirror.prototype.attributes=function(){
return %DebugPropertyAttributesFromDetails(this.details_);
};
PropertyMirror.prototype.propertyType=function(){
return %DebugPropertyTypeFromDetails(this.details_);
};
PropertyMirror.prototype.insertionIndex=function(){
return %DebugPropertyIndexFromDetails(this.details_);
};
PropertyMirror.prototype.hasGetter=function(){
return this.getter_?true:false;
};
PropertyMirror.prototype.hasSetter=function(){
return this.setter_?true:false;
};
PropertyMirror.prototype.getter=function(){
if(this.hasGetter()){
return MakeMirror(this.getter_);
}else{
return GetUndefinedMirror();
}
};
PropertyMirror.prototype.setter=function(){
if(this.hasSetter()){
return MakeMirror(this.setter_);
}else{
return GetUndefinedMirror();
}
};
PropertyMirror.prototype.isNative=function(){
return this.is_interceptor_||
((this.propertyType()==PropertyType.AccessorConstant)&&
!this.hasGetter()&&!this.hasSetter());
};
function InternalPropertyMirror(a,b){
%_CallFunction(this,INTERNAL_PROPERTY_TYPE,Mirror);
this.name_=a;
this.value_=b;
}
inherits(InternalPropertyMirror,Mirror);
InternalPropertyMirror.prototype.name=function(){
return this.name_;
};
InternalPropertyMirror.prototype.value=function(){
return MakeMirror(this.value_,false);
};
var kFrameDetailsFrameIdIndex=0;
var kFrameDetailsReceiverIndex=1;
var kFrameDetailsFunctionIndex=2;
var kFrameDetailsArgumentCountIndex=3;
var kFrameDetailsLocalCountIndex=4;
var kFrameDetailsSourcePositionIndex=5;
var kFrameDetailsConstructCallIndex=6;
var kFrameDetailsAtReturnIndex=7;
var kFrameDetailsFlagsIndex=8;
var kFrameDetailsFirstDynamicIndex=9;
var kFrameDetailsNameIndex=0;
var kFrameDetailsValueIndex=1;
var kFrameDetailsNameValueSize=2;
var kFrameDetailsFlagDebuggerFrameMask=1<<0;
var kFrameDetailsFlagOptimizedFrameMask=1<<1;
var kFrameDetailsFlagInlinedFrameIndexMask=7<<2;
function FrameDetails(a,b){
this.break_id_=a;
this.details_=%GetFrameDetails(a,b);
}
FrameDetails.prototype.frameId=function(){
%CheckExecutionState(this.break_id_);
return this.details_[kFrameDetailsFrameIdIndex];
};
FrameDetails.prototype.receiver=function(){
%CheckExecutionState(this.break_id_);
return this.details_[kFrameDetailsReceiverIndex];
};
FrameDetails.prototype.func=function(){
%CheckExecutionState(this.break_id_);
return this.details_[kFrameDetailsFunctionIndex];
};
FrameDetails.prototype.isConstructCall=function(){
%CheckExecutionState(this.break_id_);
return this.details_[kFrameDetailsConstructCallIndex];
};
FrameDetails.prototype.isAtReturn=function(){
%CheckExecutionState(this.break_id_);
return this.details_[kFrameDetailsAtReturnIndex];
};
FrameDetails.prototype.isDebuggerFrame=function(){
%CheckExecutionState(this.break_id_);
var a=kFrameDetailsFlagDebuggerFrameMask;
return(this.details_[kFrameDetailsFlagsIndex]&a)==a;
};
FrameDetails.prototype.isOptimizedFrame=function(){
%CheckExecutionState(this.break_id_);
var a=kFrameDetailsFlagOptimizedFrameMask;
return(this.details_[kFrameDetailsFlagsIndex]&a)==a;
};
FrameDetails.prototype.isInlinedFrame=function(){
return this.inlinedFrameIndex()>0;
};
FrameDetails.prototype.inlinedFrameIndex=function(){
%CheckExecutionState(this.break_id_);
var a=kFrameDetailsFlagInlinedFrameIndexMask;
return(this.details_[kFrameDetailsFlagsIndex]&a)>>2;
};
FrameDetails.prototype.argumentCount=function(){
%CheckExecutionState(this.break_id_);
return this.details_[kFrameDetailsArgumentCountIndex];
};
FrameDetails.prototype.argumentName=function(a){
%CheckExecutionState(this.break_id_);
if(a>=0&&a<this.argumentCount()){
return this.details_[kFrameDetailsFirstDynamicIndex+
a*kFrameDetailsNameValueSize+
kFrameDetailsNameIndex];
}
};
FrameDetails.prototype.argumentValue=function(a){
%CheckExecutionState(this.break_id_);
if(a>=0&&a<this.argumentCount()){
return this.details_[kFrameDetailsFirstDynamicIndex+
a*kFrameDetailsNameValueSize+
kFrameDetailsValueIndex];
}
};
FrameDetails.prototype.localCount=function(){
%CheckExecutionState(this.break_id_);
return this.details_[kFrameDetailsLocalCountIndex];
};
FrameDetails.prototype.sourcePosition=function(){
%CheckExecutionState(this.break_id_);
return this.details_[kFrameDetailsSourcePositionIndex];
};
FrameDetails.prototype.localName=function(a){
%CheckExecutionState(this.break_id_);
if(a>=0&&a<this.localCount()){
var b=kFrameDetailsFirstDynamicIndex+
this.argumentCount()*kFrameDetailsNameValueSize;
return this.details_[b+
a*kFrameDetailsNameValueSize+
kFrameDetailsNameIndex];
}
};
FrameDetails.prototype.localValue=function(a){
%CheckExecutionState(this.break_id_);
if(a>=0&&a<this.localCount()){
var b=kFrameDetailsFirstDynamicIndex+
this.argumentCount()*kFrameDetailsNameValueSize;
return this.details_[b+
a*kFrameDetailsNameValueSize+
kFrameDetailsValueIndex];
}
};
FrameDetails.prototype.returnValue=function(){
%CheckExecutionState(this.break_id_);
var a=
kFrameDetailsFirstDynamicIndex+
(this.argumentCount()+this.localCount())*kFrameDetailsNameValueSize;
if(this.details_[kFrameDetailsAtReturnIndex]){
return this.details_[a];
}
};
FrameDetails.prototype.scopeCount=function(){
if((this.scopeCount_===(void 0))){
this.scopeCount_=%GetScopeCount(this.break_id_,this.frameId());
}
return this.scopeCount_;
};
FrameDetails.prototype.stepInPositionsImpl=function(){
return %GetStepInPositions(this.break_id_,this.frameId());
};
function FrameMirror(a,b){
%_CallFunction(this,FRAME_TYPE,Mirror);
this.break_id_=a;
this.index_=b;
this.details_=new FrameDetails(a,b);
}
inherits(FrameMirror,Mirror);
FrameMirror.prototype.details=function(){
return this.details_;
};
FrameMirror.prototype.index=function(){
return this.index_;
};
FrameMirror.prototype.func=function(){
if(this.func_){
return this.func_;
}
var a=this.details_.func();
if((%_IsFunction(a))){
return this.func_=MakeMirror(a);
}else{
return new UnresolvedFunctionMirror(a);
}
};
FrameMirror.prototype.receiver=function(){
return MakeMirror(this.details_.receiver());
};
FrameMirror.prototype.isConstructCall=function(){
return this.details_.isConstructCall();
};
FrameMirror.prototype.isAtReturn=function(){
return this.details_.isAtReturn();
};
FrameMirror.prototype.isDebuggerFrame=function(){
return this.details_.isDebuggerFrame();
};
FrameMirror.prototype.isOptimizedFrame=function(){
return this.details_.isOptimizedFrame();
};
FrameMirror.prototype.isInlinedFrame=function(){
return this.details_.isInlinedFrame();
};
FrameMirror.prototype.inlinedFrameIndex=function(){
return this.details_.inlinedFrameIndex();
};
FrameMirror.prototype.argumentCount=function(){
return this.details_.argumentCount();
};
FrameMirror.prototype.argumentName=function(a){
return this.details_.argumentName(a);
};
FrameMirror.prototype.argumentValue=function(a){
return MakeMirror(this.details_.argumentValue(a));
};
FrameMirror.prototype.localCount=function(){
return this.details_.localCount();
};
FrameMirror.prototype.localName=function(a){
return this.details_.localName(a);
};
FrameMirror.prototype.localValue=function(a){
return MakeMirror(this.details_.localValue(a));
};
FrameMirror.prototype.returnValue=function(){
return MakeMirror(this.details_.returnValue());
};
FrameMirror.prototype.sourcePosition=function(){
return this.details_.sourcePosition();
};
FrameMirror.prototype.sourceLocation=function(){
var a=this.func();
if(a.resolved()){
var b=a.script();
if(b){
return b.locationFromPosition(this.sourcePosition(),true);
}
}
};
FrameMirror.prototype.sourceLine=function(){
var a=this.sourceLocation();
if(a){
return a.line;
}
};
FrameMirror.prototype.sourceColumn=function(){
var a=this.sourceLocation();
if(a){
return a.column;
}
};
FrameMirror.prototype.sourceLineText=function(){
var a=this.sourceLocation();
if(a){
return a.sourceText();
}
};
FrameMirror.prototype.scopeCount=function(){
return this.details_.scopeCount();
};
FrameMirror.prototype.scope=function(a){
return new ScopeMirror(this,(void 0),a);
};
FrameMirror.prototype.allScopes=function(a){
var b=%GetAllScopesDetails(this.break_id_,
this.details_.frameId(),
this.details_.inlinedFrameIndex(),
!!a);
var c=[];
for(var d=0;d<b.length;++d){
c.push(new ScopeMirror(this,(void 0),d,b[d]));
}
return c;
};
FrameMirror.prototype.stepInPositions=function(){
var a=this.func().script();
var b=this.func().sourcePosition_();
var c=this.details_.stepInPositionsImpl();
var d=[];
if(c){
for(var e=0;e<c.length;e++){
var g={};
var h=a.locationFromPosition(b+c[e],
true);
serializeLocationFields(h,g);
var i={
position:g
};
d.push(i);
}
}
return d;
};
FrameMirror.prototype.evaluate=function(source,disable_break,
opt_context_object){
return MakeMirror(%DebugEvaluate(this.break_id_,
this.details_.frameId(),
this.details_.inlinedFrameIndex(),
source,
Boolean(disable_break),
opt_context_object));
};
FrameMirror.prototype.invocationText=function(){
var a='';
var b=this.func();
var c=this.receiver();
if(this.isConstructCall()){
a+='new ';
a+=b.name()?b.name():'[anonymous]';
}else if(this.isDebuggerFrame()){
a+='[debugger]';
}else{
var d=
!c.className||(c.className()!='global');
if(d){
a+=c.toText();
}
var e=GetUndefinedMirror();
if(c.isObject()){
for(var g=c;
!g.isNull()&&e.isUndefined();
g=g.protoObject()){
e=g.lookupProperty(b);
}
}
if(!e.isUndefined()){
if(!e.isIndexed()){
if(d){
a+='.';
}
a+=e.name();
}else{
a+='[';
a+=e.name();
a+=']';
}
if(b.name()&&b.name()!=e.name()){
a+='(aka '+b.name()+')';
}
}else{
if(d){
a+='.';
}
a+=b.name()?b.name():'[anonymous]';
}
}
if(!this.isDebuggerFrame()){
a+='(';
for(var h=0;h<this.argumentCount();h++){
if(h!=0)a+=', ';
if(this.argumentName(h)){
a+=this.argumentName(h);
a+='=';
}
a+=this.argumentValue(h).toText();
}
a+=')';
}
if(this.isAtReturn()){
a+=' returning ';
a+=this.returnValue().toText();
}
return a;
};
FrameMirror.prototype.sourceAndPositionText=function(){
var a='';
var b=this.func();
if(b.resolved()){
var c=b.script();
if(c){
if(c.name()){
a+=c.name();
}else{
a+='[unnamed]';
}
if(!this.isDebuggerFrame()){
var d=this.sourceLocation();
a+=' line ';
a+=!(d===(void 0))?(d.line+1):'?';
a+=' column ';
a+=!(d===(void 0))?(d.column+1):'?';
if(!(this.sourcePosition()===(void 0))){
a+=' (position '+(this.sourcePosition()+1)+')';
}
}
}else{
a+='[no source]';
}
}else{
a+='[unresolved]';
}
return a;
};
FrameMirror.prototype.localsText=function(){
var a='';
var b=this.localCount();
if(b>0){
for(var c=0;c<b;++c){
a+=' var ';
a+=this.localName(c);
a+=' = ';
a+=this.localValue(c).toText();
if(c<b-1)a+='\n';
}
}
return a;
};
FrameMirror.prototype.restart=function(){
var a=%LiveEditRestartFrame(this.break_id_,this.index_);
if((a===(void 0))){
a="Failed to find requested frame";
}
return a;
};
FrameMirror.prototype.toText=function(a){
var b='';
b+='#'+(this.index()<=9?'0':'')+this.index();
b+=' ';
b+=this.invocationText();
b+=' ';
b+=this.sourceAndPositionText();
if(a){
b+='\n';
b+=this.localsText();
}
return b;
};
var kScopeDetailsTypeIndex=0;
var kScopeDetailsObjectIndex=1;
function ScopeDetails(a,b,c,d){
if(a){
this.break_id_=a.break_id_;
this.details_=d||
%GetScopeDetails(a.break_id_,
a.details_.frameId(),
a.details_.inlinedFrameIndex(),
c);
this.frame_id_=a.details_.frameId();
this.inlined_frame_id_=a.details_.inlinedFrameIndex();
}else{
this.details_=d||%GetFunctionScopeDetails(b.value(),c);
this.fun_value_=b.value();
this.break_id_=undefined;
}
this.index_=c;
}
ScopeDetails.prototype.type=function(){
if(!(this.break_id_===(void 0))){
%CheckExecutionState(this.break_id_);
}
return this.details_[kScopeDetailsTypeIndex];
};
ScopeDetails.prototype.object=function(){
if(!(this.break_id_===(void 0))){
%CheckExecutionState(this.break_id_);
}
return this.details_[kScopeDetailsObjectIndex];
};
ScopeDetails.prototype.setVariableValueImpl=function(a,b){
var c;
if(!(this.break_id_===(void 0))){
%CheckExecutionState(this.break_id_);
c=%SetScopeVariableValue(this.break_id_,this.frame_id_,
this.inlined_frame_id_,this.index_,a,b);
}else{
c=%SetScopeVariableValue(this.fun_value_,null,null,this.index_,
a,b);
}
if(!c){
throw new Error("Failed to set variable value");
}
};
function ScopeMirror(a,b,c,d){
%_CallFunction(this,SCOPE_TYPE,Mirror);
if(a){
this.frame_index_=a.index_;
}else{
this.frame_index_=undefined;
}
this.scope_index_=c;
this.details_=new ScopeDetails(a,b,c,d);
}
inherits(ScopeMirror,Mirror);
ScopeMirror.prototype.details=function(){
return this.details_;
};
ScopeMirror.prototype.frameIndex=function(){
return this.frame_index_;
};
ScopeMirror.prototype.scopeIndex=function(){
return this.scope_index_;
};
ScopeMirror.prototype.scopeType=function(){
return this.details_.type();
};
ScopeMirror.prototype.scopeObject=function(){
var a=this.scopeType()==ScopeType.Local||
this.scopeType()==ScopeType.Closure||
this.scopeType()==ScopeType.Script;
return MakeMirror(this.details_.object(),a);
};
ScopeMirror.prototype.setVariableValue=function(a,b){
this.details_.setVariableValueImpl(a,b);
};
function ScriptMirror(a){
%_CallFunction(this,SCRIPT_TYPE,Mirror);
this.script_=a;
this.context_=new ContextMirror(a.context_data);
this.allocateHandle_();
}
inherits(ScriptMirror,Mirror);
ScriptMirror.prototype.value=function(){
return this.script_;
};
ScriptMirror.prototype.name=function(){
return this.script_.name||this.script_.nameOrSourceURL();
};
ScriptMirror.prototype.id=function(){
return this.script_.id;
};
ScriptMirror.prototype.source=function(){
return this.script_.source;
};
ScriptMirror.prototype.setSource=function(a){
%DebugSetScriptSource(this.script_,a);
};
ScriptMirror.prototype.lineOffset=function(){
return this.script_.line_offset;
};
ScriptMirror.prototype.columnOffset=function(){
return this.script_.column_offset;
};
ScriptMirror.prototype.data=function(){
return this.script_.data;
};
ScriptMirror.prototype.scriptType=function(){
return this.script_.type;
};
ScriptMirror.prototype.compilationType=function(){
return this.script_.compilation_type;
};
ScriptMirror.prototype.lineCount=function(){
return this.script_.lineCount();
};
ScriptMirror.prototype.locationFromPosition=function(
position,include_resource_offset){
return this.script_.locationFromPosition(position,include_resource_offset);
};
ScriptMirror.prototype.sourceSlice=function(a,b){
return this.script_.sourceSlice(a,b);
};
ScriptMirror.prototype.context=function(){
return this.context_;
};
ScriptMirror.prototype.evalFromScript=function(){
return MakeMirror(this.script_.eval_from_script);
};
ScriptMirror.prototype.evalFromFunctionName=function(){
return MakeMirror(this.script_.eval_from_function_name);
};
ScriptMirror.prototype.evalFromLocation=function(){
var a=this.evalFromScript();
if(!a.isUndefined()){
var b=this.script_.eval_from_script_position;
return a.locationFromPosition(b,true);
}
};
ScriptMirror.prototype.toText=function(){
var a='';
a+=this.name();
a+=' (lines: ';
if(this.lineOffset()>0){
a+=this.lineOffset();
a+='-';
a+=this.lineOffset()+this.lineCount()-1;
}else{
a+=this.lineCount();
}
a+=')';
return a;
};
function ContextMirror(a){
%_CallFunction(this,CONTEXT_TYPE,Mirror);
this.data_=a;
this.allocateHandle_();
}
inherits(ContextMirror,Mirror);
ContextMirror.prototype.data=function(){
return this.data_;
};
function MakeMirrorSerializer(a,b){
return new JSONProtocolSerializer(a,b);
}
function JSONProtocolSerializer(a,b){
this.details_=a;
this.options_=b;
this.mirrors_=[];
}
JSONProtocolSerializer.prototype.serializeReference=function(a){
return this.serialize_(a,true,true);
};
JSONProtocolSerializer.prototype.serializeValue=function(a){
var b=this.serialize_(a,false,true);
return b;
};
JSONProtocolSerializer.prototype.serializeReferencedObjects=function(){
var a=[];
var b=this.mirrors_.length;
for(var c=0;c<b;c++){
a.push(this.serialize_(this.mirrors_[c],false,false));
}
return a;
};
JSONProtocolSerializer.prototype.includeSource_=function(){
return this.options_&&this.options_.includeSource;
};
JSONProtocolSerializer.prototype.inlineRefs_=function(){
return this.options_&&this.options_.inlineRefs;
};
JSONProtocolSerializer.prototype.maxStringLength_=function(){
if((this.options_===(void 0))||
(this.options_.maxStringLength===(void 0))){
return kMaxProtocolStringLength;
}
return this.options_.maxStringLength;
};
JSONProtocolSerializer.prototype.add_=function(a){
for(var b=0;b<this.mirrors_.length;b++){
if(this.mirrors_[b]===a){
return;
}
}
this.mirrors_.push(a);
};
JSONProtocolSerializer.prototype.serializeReferenceWithDisplayData_=
function(a){
var b={};
b.ref=a.handle();
b.type=a.type();
switch(a.type()){
case UNDEFINED_TYPE:
case NULL_TYPE:
case BOOLEAN_TYPE:
case NUMBER_TYPE:
b.value=a.value();
break;
case STRING_TYPE:
b.value=a.getTruncatedValue(this.maxStringLength_());
break;
case SYMBOL_TYPE:
b.description=a.description();
break;
case FUNCTION_TYPE:
b.name=a.name();
b.inferredName=a.inferredName();
if(a.script()){
b.scriptId=a.script().id();
}
break;
case ERROR_TYPE:
case REGEXP_TYPE:
b.value=a.toText();
break;
case OBJECT_TYPE:
b.className=a.className();
break;
}
return b;
};
JSONProtocolSerializer.prototype.serialize_=function(mirror,reference,
details){
if(reference&&
(mirror.isValue()||mirror.isScript()||mirror.isContext())){
if(this.inlineRefs_()&&mirror.isValue()){
return this.serializeReferenceWithDisplayData_(mirror);
}else{
this.add_(mirror);
return{'ref':mirror.handle()};
}
}
var a={};
if(mirror.isValue()||mirror.isScript()||mirror.isContext()){
a.handle=mirror.handle();
}
a.type=mirror.type();
switch(mirror.type()){
case UNDEFINED_TYPE:
case NULL_TYPE:
break;
case BOOLEAN_TYPE:
a.value=mirror.value();
break;
case NUMBER_TYPE:
a.value=NumberToJSON_(mirror.value());
break;
case STRING_TYPE:
if(this.maxStringLength_()!=-1&&
mirror.length()>this.maxStringLength_()){
var b=mirror.getTruncatedValue(this.maxStringLength_());
a.value=b;
a.fromIndex=0;
a.toIndex=this.maxStringLength_();
}else{
a.value=mirror.value();
}
a.length=mirror.length();
break;
case SYMBOL_TYPE:
a.description=mirror.description();
break;
case OBJECT_TYPE:
case FUNCTION_TYPE:
case ERROR_TYPE:
case REGEXP_TYPE:
case PROMISE_TYPE:
case GENERATOR_TYPE:
this.serializeObject_(mirror,a,details);
break;
case PROPERTY_TYPE:
case INTERNAL_PROPERTY_TYPE:
throw new Error('PropertyMirror cannot be serialized independently');
break;
case FRAME_TYPE:
this.serializeFrame_(mirror,a);
break;
case SCOPE_TYPE:
this.serializeScope_(mirror,a);
break;
case SCRIPT_TYPE:
if(mirror.name()){
a.name=mirror.name();
}
a.id=mirror.id();
a.lineOffset=mirror.lineOffset();
a.columnOffset=mirror.columnOffset();
a.lineCount=mirror.lineCount();
if(mirror.data()){
a.data=mirror.data();
}
if(this.includeSource_()){
a.source=mirror.source();
}else{
var c=mirror.source().substring(0,80);
a.sourceStart=c;
}
a.sourceLength=mirror.source().length;
a.scriptType=mirror.scriptType();
a.compilationType=mirror.compilationType();
if(mirror.compilationType()==1&&
mirror.evalFromScript()){
a.evalFromScript=
this.serializeReference(mirror.evalFromScript());
var d=mirror.evalFromLocation();
if(d){
a.evalFromLocation={line:d.line,
column:d.column};
}
if(mirror.evalFromFunctionName()){
a.evalFromFunctionName=mirror.evalFromFunctionName();
}
}
if(mirror.context()){
a.context=this.serializeReference(mirror.context());
}
break;
case CONTEXT_TYPE:
a.data=mirror.data();
break;
}
a.text=mirror.toText();
return a;
};
JSONProtocolSerializer.prototype.serializeObject_=function(mirror,content,
details){
content.className=mirror.className();
content.constructorFunction=
this.serializeReference(mirror.constructorFunction());
content.protoObject=this.serializeReference(mirror.protoObject());
content.prototypeObject=this.serializeReference(mirror.prototypeObject());
if(mirror.hasNamedInterceptor()){
content.namedInterceptor=true;
}
if(mirror.hasIndexedInterceptor()){
content.indexedInterceptor=true;
}
if(mirror.isFunction()){
content.name=mirror.name();
if(!(mirror.inferredName()===(void 0))){
content.inferredName=mirror.inferredName();
}
content.resolved=mirror.resolved();
if(mirror.resolved()){
content.source=mirror.source();
}
if(mirror.script()){
content.script=this.serializeReference(mirror.script());
content.scriptId=mirror.script().id();
serializeLocationFields(mirror.sourceLocation(),content);
}
content.scopes=[];
for(var a=0;a<mirror.scopeCount();a++){
var b=mirror.scope(a);
content.scopes.push({
type:b.scopeType(),
index:a
});
}
}
if(mirror.isGenerator()){
content.status=mirror.status();
content.func=this.serializeReference(mirror.func())
content.receiver=this.serializeReference(mirror.receiver())
serializeLocationFields(mirror.sourceLocation(),content);
}
if(mirror.isDate()){
content.value=mirror.value();
}
if(mirror.isPromise()){
content.status=mirror.status();
content.promiseValue=this.serializeReference(mirror.promiseValue());
}
var c=mirror.propertyNames(PropertyKind.Named);
var d=mirror.propertyNames(PropertyKind.Indexed);
var e=new Array(c.length+d.length);
for(var a=0;a<c.length;a++){
var g=mirror.property(c[a]);
e[a]=this.serializeProperty_(g);
if(details){
this.add_(g.value());
}
}
for(var a=0;a<d.length;a++){
var g=mirror.property(d[a]);
e[c.length+a]=this.serializeProperty_(g);
if(details){
this.add_(g.value());
}
}
content.properties=e;
var h=mirror.internalProperties();
if(h.length>0){
var i=[];
for(var a=0;a<h.length;a++){
i.push(this.serializeInternalProperty_(h[a]));
}
content.internalProperties=i;
}
};
function serializeLocationFields(a,b){
if(!a){
return;
}
b.position=a.position;
var c=a.line;
if(!(c===(void 0))){
b.line=c;
}
var d=a.column;
if(!(d===(void 0))){
b.column=d;
}
}
JSONProtocolSerializer.prototype.serializeProperty_=function(a){
var b={};
b.name=a.name();
var c=a.value();
if(this.inlineRefs_()&&c.isValue()){
b.value=this.serializeReferenceWithDisplayData_(c);
}else{
if(a.attributes()!=PropertyAttribute.None){
b.attributes=a.attributes();
}
b.propertyType=a.propertyType();
b.ref=c.handle();
}
return b;
};
JSONProtocolSerializer.prototype.serializeInternalProperty_=
function(a){
var b={};
b.name=a.name();
var c=a.value();
if(this.inlineRefs_()&&c.isValue()){
b.value=this.serializeReferenceWithDisplayData_(c);
}else{
b.ref=c.handle();
}
return b;
};
JSONProtocolSerializer.prototype.serializeFrame_=function(a,b){
b.index=a.index();
b.receiver=this.serializeReference(a.receiver());
var c=a.func();
b.func=this.serializeReference(c);
var d=c.script();
if(d){
b.script=this.serializeReference(d);
}
b.constructCall=a.isConstructCall();
b.atReturn=a.isAtReturn();
if(a.isAtReturn()){
b.returnValue=this.serializeReference(a.returnValue());
}
b.debuggerFrame=a.isDebuggerFrame();
var e=new Array(a.argumentCount());
for(var g=0;g<a.argumentCount();g++){
var h={};
var i=a.argumentName(g);
if(i){
h.name=i;
}
h.value=this.serializeReference(a.argumentValue(g));
e[g]=h;
}
b.arguments=e;
var e=new Array(a.localCount());
for(var g=0;g<a.localCount();g++){
var j={};
j.name=a.localName(g);
j.value=this.serializeReference(a.localValue(g));
e[g]=j;
}
b.locals=e;
serializeLocationFields(a.sourceLocation(),b);
var k=a.sourceLineText();
if(!(k===(void 0))){
b.sourceLineText=k;
}
b.scopes=[];
for(var g=0;g<a.scopeCount();g++){
var l=a.scope(g);
b.scopes.push({
type:l.scopeType(),
index:g
});
}
};
JSONProtocolSerializer.prototype.serializeScope_=function(a,b){
b.index=a.scopeIndex();
b.frameIndex=a.frameIndex();
b.type=a.scopeType();
b.object=this.inlineRefs_()?
this.serializeValue(a.scopeObject()):
this.serializeReference(a.scopeObject());
};
function NumberToJSON_(a){
if(isNaN(a)){
return'NaN';
}
if(!(%_IsSmi(%IS_VAR(a))||((a==a)&&(a!=1/0)&&(a!=-1/0)))){
if(a>0){
return'Infinity';
}else{
return'-Infinity';
}
}
return a;
}
liveedit<69><74>
"use strict";
Debug.LiveEdit=new function(){
var a;
var b="stack_update_needs_step_in";
function ApplyPatchMultiChunk(script,diff_array,new_source,preview_only,
change_log){
var c=script.source;
var d=GatherCompileInfo(c,script);
var e=BuildCodeInfoTree(d);
var g=new PosTranslator(diff_array);
MarkChangedFunctions(e,g.GetChunks());
FindLiveSharedInfos(e,script);
var h;
try{
h=GatherCompileInfo(new_source,script);
}catch(e){
var i=
new Failure("Failed to compile new version of script: "+e);
if(e instanceof SyntaxError){
var j={
type:"liveedit_compile_error",
syntaxErrorMessage:e.message
};
CopyErrorPositionToDetails(e,j);
i.details=j;
}
throw i;
}
var k=BuildCodeInfoTree(h);
FindCorrespondingFunctions(e,k);
var l=new Array();
var m=new Array();
var n=new Array();
var o=new Array();
function HarvestTodo(p){
function CollectDamaged(q){
m.push(q);
for(var r=0;r<q.children.length;r++){
CollectDamaged(q.children[r]);
}
}
function CollectNew(t){
for(var r=0;r<t.length;r++){
n.push(t[r]);
CollectNew(t[r].children);
}
}
if(p.status==a.DAMAGED){
CollectDamaged(p);
return;
}
if(p.status==a.UNCHANGED){
o.push(p);
}else if(p.status==a.SOURCE_CHANGED){
o.push(p);
}else if(p.status==a.CHANGED){
l.push(p);
CollectNew(p.unmatched_new_nodes);
}
for(var r=0;r<p.children.length;r++){
HarvestTodo(p.children[r]);
}
}
var u={
change_tree:DescribeChangeTree(e),
textual_diff:{
old_len:c.length,
new_len:new_source.length,
chunks:diff_array
},
updated:false
};
if(preview_only){
return u;
}
HarvestTodo(e);
var v=new Array();
for(var r=0;r<l.length;r++){
var w=
l[r].live_shared_function_infos;
if(w){
for(var x=0;x<w.length;x++){
v.push(w[x]);
}
}
}
var y=
CheckStackActivations(v,change_log);
u.stack_modified=y!=0;
u[b]=
u.stack_modified;
var z=TemporaryRemoveBreakPoints(script,change_log);
var A;
if(m.length==0){
%LiveEditReplaceScript(script,new_source,null);
A=(void 0);
}else{
var B=CreateNameForOldScript(script);
A=%LiveEditReplaceScript(script,new_source,
B);
var C=new Array();
change_log.push({linked_to_old_script:C});
for(var r=0;r<m.length;r++){
LinkToOldScript(m[r],A,
C);
}
u.created_script_name=B;
}
for(var r=0;r<n.length;r++){
%LiveEditFunctionSetScript(
n[r].info.shared_function_info,script);
}
for(var r=0;r<l.length;r++){
PatchFunctionCode(l[r],change_log);
}
var D=new Array();
change_log.push({position_patched:D});
for(var r=0;r<o.length;r++){
PatchPositions(o[r],diff_array,
D);
if(o[r].live_shared_function_infos){
o[r].live_shared_function_infos.
forEach(function(E){
%LiveEditFunctionSourceUpdated(E.raw_array);
});
}
}
z(g,A);
u.updated=true;
return u;
}
this.ApplyPatchMultiChunk=ApplyPatchMultiChunk;
function GatherCompileInfo(F,G){
var H=%LiveEditGatherCompileInfo(G,F);
var I=new Array();
var J=new Array();
for(var r=0;r<H.length;r++){
var E=new FunctionCompileInfo(H[r]);
%LiveEditFunctionSetScript(E.shared_function_info,(void 0));
I.push(E);
J.push(r);
}
for(var r=0;r<I.length;r++){
var K=r;
for(var x=r+1;x<I.length;x++){
if(I[K].start_position>I[x].start_position){
K=x;
}
}
if(K!=r){
var L=I[K];
var M=J[K];
I[K]=I[r];
J[K]=J[r];
I[r]=L;
J[r]=M;
}
}
var N=0;
function ResetIndexes(O,P){
var Q=-1;
while(N<I.length&&
I[N].outer_index==P){
var R=N;
I[R].outer_index=O;
if(Q!=-1){
I[Q].next_sibling_index=R;
}
Q=R;
N++;
ResetIndexes(R,J[R]);
}
if(Q!=-1){
I[Q].next_sibling_index=-1;
}
}
ResetIndexes(-1,-1);
Assert(N==I.length);
return I;
}
function PatchFunctionCode(p,S){
var T=p.corresponding_node.info;
if(p.live_shared_function_infos){
p.live_shared_function_infos.forEach(function(U){
%LiveEditReplaceFunctionCode(T.raw_array,
U.raw_array);
for(var r=0;r<p.children.length;r++){
if(p.children[r].corresponding_node){
var V=
p.children[r].corresponding_node.info.
shared_function_info;
if(p.children[r].live_shared_function_infos){
p.children[r].live_shared_function_infos.
forEach(function(W){
%LiveEditReplaceRefToNestedFunction(
U.info,
V,
W.info);
});
}
}
}
});
S.push({function_patched:T.function_name});
}else{
S.push({function_patched:T.function_name,
function_info_not_found:true});
}
}
function LinkToOldScript(X,A,Y){
if(X.live_shared_function_infos){
X.live_shared_function_infos.
forEach(function(E){
%LiveEditFunctionSetScript(E.info,A);
});
Y.push({name:X.info.function_name});
}else{
Y.push(
{name:X.info.function_name,not_found:true});
}
}
function TemporaryRemoveBreakPoints(Z,S){
var aa=GetScriptBreakPoints(Z);
var ab=[];
S.push({break_points_update:ab});
var ac=[];
for(var r=0;r<aa.length;r++){
var ad=aa[r];
ad.clear();
var ae=Debug.findScriptSourcePosition(Z,
ad.line(),ad.column());
var af={
position:ae,
line:ad.line(),
column:ad.column()
};
ac.push(af);
}
return function(g,ag){
for(var r=0;r<aa.length;r++){
var ad=aa[r];
if(ag){
var ah=ad.cloneForOtherScript(ag);
ah.set(ag);
ab.push({
type:"copied_to_old",
id:ad.number(),
new_id:ah.number(),
positions:ac[r]
});
}
var ai=g.Translate(
ac[r].position,
PosTranslator.ShiftWithTopInsideChunkHandler);
var aj=
Z.locationFromPosition(ai,false);
ad.update_positions(aj.line,aj.column);
var ak={
position:ai,
line:aj.line,
column:aj.column
};
ad.set(Z);
ab.push({type:"position_changed",
id:ad.number(),
old_positions:ac[r],
new_positions:ak
});
}
};
}
function Assert(al,am){
if(!al){
if(am){
throw"Assert "+am;
}else{
throw"Assert";
}
}
}
function DiffChunk(an,ao,ap,aq){
this.pos1=an;
this.pos2=ao;
this.len1=ap;
this.len2=aq;
}
function PosTranslator(ar){
var as=new Array();
var at=0;
for(var r=0;r<ar.length;r+=3){
var au=ar[r];
var av=au+at;
var aw=ar[r+1];
var ax=ar[r+2];
as.push(new DiffChunk(au,av,aw-au,
ax-av));
at=ax-aw;
}
this.chunks=as;
}
PosTranslator.prototype.GetChunks=function(){
return this.chunks;
};
PosTranslator.prototype.Translate=function(ay,az){
var aA=this.chunks;
if(aA.length==0||ay<aA[0].pos1){
return ay;
}
var aB=0;
var aC=aA.length-1;
while(aB<aC){
var aD=Math.floor((aB+aC)/2);
if(ay<aA[aD+1].pos1){
aC=aD;
}else{
aB=aD+1;
}
}
var aE=aA[aB];
if(ay>=aE.pos1+aE.len1){
return ay+aE.pos2+aE.len2-aE.pos1-aE.len1;
}
if(!az){
az=PosTranslator.DefaultInsideChunkHandler;
}
return az(ay,aE);
};
PosTranslator.DefaultInsideChunkHandler=function(ay,aF){
Assert(false,"Cannot translate position in changed area");
};
PosTranslator.ShiftWithTopInsideChunkHandler=
function(ay,aF){
return ay-aF.pos1+aF.pos2;
};
var a={
UNCHANGED:"unchanged",
SOURCE_CHANGED:"source changed",
CHANGED:"changed",
DAMAGED:"damaged"
};
function CodeInfoTreeNode(aG,aH,aI){
this.info=aG;
this.children=aH;
this.array_index=aI;
this.parent=(void 0);
this.status=a.UNCHANGED;
this.status_explanation=(void 0);
this.new_start_pos=(void 0);
this.new_end_pos=(void 0);
this.corresponding_node=(void 0);
this.unmatched_new_nodes=(void 0);
this.textual_corresponding_node=(void 0);
this.textually_unmatched_new_nodes=(void 0);
this.live_shared_function_infos=(void 0);
}
function BuildCodeInfoTree(aJ){
var aK=0;
function BuildNode(){
var aL=aK;
aK++;
var aM=new Array();
while(aK<aJ.length&&
aJ[aK].outer_index==aL){
aM.push(BuildNode());
}
var q=new CodeInfoTreeNode(aJ[aL],aM,
aL);
for(var r=0;r<aM.length;r++){
aM[r].parent=q;
}
return q;
}
var aN=BuildNode();
Assert(aK==aJ.length);
return aN;
}
function MarkChangedFunctions(aO,as){
var aP=new function(){
var aQ=0;
var aR=0;
this.current=function(){return as[aQ];};
this.next=function(){
var aE=as[aQ];
aR=aE.pos2+aE.len2-(aE.pos1+aE.len1);
aQ++;
};
this.done=function(){return aQ>=as.length;};
this.TranslatePos=function(ay){return ay+aR;};
};
function ProcessInternals(aS){
aS.new_start_pos=aP.TranslatePos(
aS.info.start_position);
var aT=0;
var aU=false;
var aV=false;
while(!aP.done()&&
aP.current().pos1<aS.info.end_position){
if(aT<aS.children.length){
var aW=aS.children[aT];
if(aW.info.end_position<=aP.current().pos1){
ProcessUnchangedChild(aW);
aT++;
continue;
}else if(aW.info.start_position>=
aP.current().pos1+aP.current().len1){
aU=true;
aP.next();
continue;
}else if(aW.info.start_position<=aP.current().pos1&&
aW.info.end_position>=aP.current().pos1+
aP.current().len1){
ProcessInternals(aW);
aV=aV||
(aW.status!=a.UNCHANGED);
aU=aU||
(aW.status==a.DAMAGED);
aT++;
continue;
}else{
aU=true;
aW.status=a.DAMAGED;
aW.status_explanation=
"Text diff overlaps with function boundary";
aT++;
continue;
}
}else{
if(aP.current().pos1+aP.current().len1<=
aS.info.end_position){
aS.status=a.CHANGED;
aP.next();
continue;
}else{
aS.status=a.DAMAGED;
aS.status_explanation=
"Text diff overlaps with function boundary";
return;
}
}
Assert("Unreachable",false);
}
while(aT<aS.children.length){
var aW=aS.children[aT];
ProcessUnchangedChild(aW);
aT++;
}
if(aU){
aS.status=a.CHANGED;
}else if(aV){
aS.status=a.SOURCE_CHANGED;
}
aS.new_end_pos=
aP.TranslatePos(aS.info.end_position);
}
function ProcessUnchangedChild(q){
q.new_start_pos=aP.TranslatePos(q.info.start_position);
q.new_end_pos=aP.TranslatePos(q.info.end_position);
}
ProcessInternals(aO);
}
function FindCorrespondingFunctions(aX,aY){
function ProcessNode(p,aZ){
var ba=
IsFunctionContextLocalsChanged(p.info,aZ.info);
if(ba){
p.status=a.CHANGED;
}
var bb=p.children;
var bc=aZ.children;
var bd=[];
var be=[];
var bf=0;
var bg=0;
while(bf<bb.length){
if(bb[bf].status==a.DAMAGED){
bf++;
}else if(bg<bc.length){
if(bc[bg].info.start_position<
bb[bf].new_start_pos){
bd.push(bc[bg]);
be.push(bc[bg]);
bg++;
}else if(bc[bg].info.start_position==
bb[bf].new_start_pos){
if(bc[bg].info.end_position==
bb[bf].new_end_pos){
bb[bf].corresponding_node=
bc[bg];
bb[bf].textual_corresponding_node=
bc[bg];
if(ba){
bb[bf].status=a.DAMAGED;
bb[bf].status_explanation=
"Enclosing function is now incompatible. "+
ba;
bb[bf].corresponding_node=(void 0);
}else if(bb[bf].status!=
a.UNCHANGED){
ProcessNode(bb[bf],
bc[bg]);
if(bb[bf].status==a.DAMAGED){
bd.push(
bb[bf].corresponding_node);
bb[bf].corresponding_node=(void 0);
p.status=a.CHANGED;
}
}
}else{
bb[bf].status=a.DAMAGED;
bb[bf].status_explanation=
"No corresponding function in new script found";
p.status=a.CHANGED;
bd.push(bc[bg]);
be.push(bc[bg]);
}
bg++;
bf++;
}else{
bb[bf].status=a.DAMAGED;
bb[bf].status_explanation=
"No corresponding function in new script found";
p.status=a.CHANGED;
bf++;
}
}else{
bb[bf].status=a.DAMAGED;
bb[bf].status_explanation=
"No corresponding function in new script found";
p.status=a.CHANGED;
bf++;
}
}
while(bg<bc.length){
bd.push(bc[bg]);
be.push(bc[bg]);
bg++;
}
if(p.status==a.CHANGED){
if(p.info.param_num!=aZ.info.param_num){
p.status=a.DAMAGED;
p.status_explanation="Changed parameter number: "+
p.info.param_num+" and "+aZ.info.param_num;
}
}
p.unmatched_new_nodes=bd;
p.textually_unmatched_new_nodes=
be;
}
ProcessNode(aX,aY);
aX.corresponding_node=aY;
aX.textual_corresponding_node=aY;
Assert(aX.status!=a.DAMAGED,
"Script became damaged");
}
function FindLiveSharedInfos(aX,G){
var bh=%LiveEditFindSharedFunctionInfosForScript(G);
var bi=new Array();
for(var r=0;r<bh.length;r++){
bi.push(new SharedInfoWrapper(bh[r]));
}
function FindFunctionInfos(I){
var bj=[];
for(var r=0;r<bi.length;r++){
var bk=bi[r];
if(bk.start_position==I.start_position&&
bk.end_position==I.end_position){
bj.push(bk);
}
}
if(bj.length>0){
return bj;
}
}
function TraverseTree(q){
q.live_shared_function_infos=FindFunctionInfos(q.info);
for(var r=0;r<q.children.length;r++){
TraverseTree(q.children[r]);
}
}
TraverseTree(aX);
}
function FunctionCompileInfo(bl){
this.function_name=bl[0];
this.start_position=bl[1];
this.end_position=bl[2];
this.param_num=bl[3];
this.code=bl[4];
this.code_scope_info=bl[5];
this.scope_info=bl[6];
this.outer_index=bl[7];
this.shared_function_info=bl[8];
this.next_sibling_index=null;
this.raw_array=bl;
}
function SharedInfoWrapper(bl){
this.function_name=bl[0];
this.start_position=bl[1];
this.end_position=bl[2];
this.info=bl[3];
this.raw_array=bl;
}
function PatchPositions(X,ar,Y){
if(X.live_shared_function_infos){
X.live_shared_function_infos.forEach(function(E){
%LiveEditPatchFunctionPositions(E.raw_array,
ar);
});
Y.push({name:X.info.function_name});
}else{
Y.push(
{name:X.info.function_name,info_not_found:true});
}
}
function CreateNameForOldScript(G){
return G.name+" (old)";
}
function IsFunctionContextLocalsChanged(bm,bn){
var bo=bm.scope_info;
var bp=bn.scope_info;
var bq;
var br;
if(bo){
bq=bo.toString();
}else{
bq="";
}
if(bp){
br=bp.toString();
}else{
br="";
}
if(bq!=br){
return"Variable map changed: ["+bq+
"] => ["+br+"]";
}
return;
}
var bs;
function CheckStackActivations(bt,S){
var bu=new Array();
for(var r=0;r<bt.length;r++){
bu[r]=bt[r].info;
}
var bv=%LiveEditCheckAndDropActivations(bu,true);
if(bv[bu.length]){
throw new Failure(bv[bu.length]);
}
var bw=new Array();
var bx=new Array();
for(var r=0;r<bu.length;r++){
var by=bt[r];
if(bv[r]==bs.REPLACED_ON_ACTIVE_STACK){
bx.push({name:by.function_name});
}else if(bv[r]!=bs.AVAILABLE_FOR_PATCH){
var bz={
name:by.function_name,
start_pos:by.start_position,
end_pos:by.end_position,
replace_problem:
bs.SymbolName(bv[r])
};
bw.push(bz);
}
}
if(bx.length>0){
S.push({dropped_from_stack:bx});
}
if(bw.length>0){
S.push({functions_on_stack:bw});
throw new Failure("Blocked by functions on stack");
}
return bx.length;
}
var bs={
AVAILABLE_FOR_PATCH:1,
BLOCKED_ON_ACTIVE_STACK:2,
BLOCKED_ON_OTHER_STACK:3,
BLOCKED_UNDER_NATIVE_CODE:4,
REPLACED_ON_ACTIVE_STACK:5,
BLOCKED_UNDER_GENERATOR:6,
BLOCKED_ACTIVE_GENERATOR:7
};
bs.SymbolName=function(bA){
var bB=bs;
for(var bC in bB){
if(bB[bC]==bA){
return bC;
}
}
};
function Failure(am){
this.message=am;
}
this.Failure=Failure;
Failure.prototype.toString=function(){
return"LiveEdit Failure: "+this.message;
};
function CopyErrorPositionToDetails(bD,j){
function createPositionStruct(G,bE){
if(bE==-1)return;
var bF=G.locationFromPosition(bE,true);
if(bF==null)return;
return{
line:bF.line+1,
column:bF.column+1,
position:bE
};
}
if(!("scriptObject"in bD)||!("startPosition"in bD)){
return;
}
var G=bD.scriptObject;
var bG={
start:createPositionStruct(G,bD.startPosition),
end:createPositionStruct(G,bD.endPosition)
};
j.position=bG;
}
function GetPcFromSourcePos(bH,bI){
return %GetFunctionCodePositionFromSource(bH,bI);
}
this.GetPcFromSourcePos=GetPcFromSourcePos;
function SetScriptSource(G,bJ,bK,S){
var c=G.source;
var bL=CompareStrings(c,bJ);
return ApplyPatchMultiChunk(G,bL,bJ,bK,
S);
}
this.SetScriptSource=SetScriptSource;
function CompareStrings(bM,bN){
return %LiveEditCompareStrings(bM,bN);
}
function ApplySingleChunkPatch(G,change_pos,change_len,new_str,
S){
var c=G.source;
var bJ=c.substring(0,change_pos)+
new_str+c.substring(change_pos+change_len);
return ApplyPatchMultiChunk(G,
[change_pos,change_pos+change_len,change_pos+new_str.length],
bJ,false,S);
}
function DescribeChangeTree(aX){
function ProcessOldNode(q){
var bO=[];
for(var r=0;r<q.children.length;r++){
var aW=q.children[r];
if(aW.status!=a.UNCHANGED){
bO.push(ProcessOldNode(aW));
}
}
var bP=[];
if(q.textually_unmatched_new_nodes){
for(var r=0;r<q.textually_unmatched_new_nodes.length;r++){
var aW=q.textually_unmatched_new_nodes[r];
bP.push(ProcessNewNode(aW));
}
}
var bQ={
name:q.info.function_name,
positions:DescribePositions(q),
status:q.status,
children:bO,
new_children:bP
};
if(q.status_explanation){
bQ.status_explanation=q.status_explanation;
}
if(q.textual_corresponding_node){
bQ.new_positions=DescribePositions(q.textual_corresponding_node);
}
return bQ;
}
function ProcessNewNode(q){
var bO=[];
if(false){
for(var r=0;r<q.children.length;r++){
bO.push(ProcessNewNode(q.children[r]));
}
}
var bQ={
name:q.info.function_name,
positions:DescribePositions(q),
children:bO,
};
return bQ;
}
function DescribePositions(q){
return{
start_position:q.info.start_position,
end_position:q.info.end_position
};
}
return ProcessOldNode(aX);
}
function RestartFrame(bR){
var bv=bR.restart();
if((typeof(bv)==='string')){
throw new Failure("Failed to restart frame: "+bv);
}
var bv={};
bv[b]=true;
return bv;
}
this.RestartFrame=RestartFrame;
this.TestApi={
PosTranslator:PosTranslator,
CompareStrings:CompareStrings,
ApplySingleChunkPatch:ApplySingleChunkPatch
};
};
pruntime<6D>
var EQUALS;
var STRICT_EQUALS;
var COMPARE;
var COMPARE_STRONG;
var ADD;
var ADD_STRONG;
var STRING_ADD_LEFT;
var STRING_ADD_LEFT_STRONG;
var STRING_ADD_RIGHT;
var STRING_ADD_RIGHT_STRONG;
var SUB;
var SUB_STRONG;
var MUL;
var MUL_STRONG;
var DIV;
var DIV_STRONG;
var MOD;
var MOD_STRONG;
var BIT_OR;
var BIT_OR_STRONG;
var BIT_AND;
var BIT_AND_STRONG;
var BIT_XOR;
var BIT_XOR_STRONG;
var SHL;
var SHL_STRONG;
var SAR;
var SAR_STRONG;
var SHR;
var SHR_STRONG;
var DELETE;
var IN;
var INSTANCE_OF;
var CALL_NON_FUNCTION;
var CALL_NON_FUNCTION_AS_CONSTRUCTOR;
var CALL_FUNCTION_PROXY;
var CALL_FUNCTION_PROXY_AS_CONSTRUCTOR;
var CONCAT_ITERABLE_TO_ARRAY;
var APPLY_PREPARE;
var REFLECT_APPLY_PREPARE;
var REFLECT_CONSTRUCT_PREPARE;
var STACK_OVERFLOW;
var TO_OBJECT;
var TO_NUMBER;
var TO_STRING;
var TO_NAME;
var StringLengthTFStub;
var StringAddTFStub;
var MathFloorStub;
var $defaultNumber;
var $defaultString;
var $NaN;
var $nonNumberToNumber;
var $nonStringToString;
var $sameValue;
var $sameValueZero;
var $toBoolean;
var $toInt32;
var $toInteger;
var $toLength;
var $toName;
var $toNumber;
var $toObject;
var $toPositiveInteger;
var $toPrimitive;
var $toString;
var $toUint32;
(function(a,b){
%CheckIsBootstrapping();
var c=a.Array;
var d=a.Boolean;
var e=a.String;
var g=a.Number;
EQUALS=function EQUALS(h){
if((typeof(this)==='string')&&(typeof(h)==='string'))return %StringEquals(this,h);
var i=this;
while(true){
if((typeof(i)==='number')){
while(true){
if((typeof(h)==='number'))return %NumberEquals(i,h);
if((h==null))return 1;
if((typeof(h)==='symbol'))return 1;
if(!(%_IsSpecObject(h))){
return %NumberEquals(i,%$toNumber(h));
}
h=%$toPrimitive(h,0);
}
}else if((typeof(i)==='string')){
while(true){
if((typeof(h)==='string'))return %StringEquals(i,h);
if((typeof(h)==='symbol'))return 1;
if((typeof(h)==='number'))return %NumberEquals(%$toNumber(i),h);
if((typeof(h)==='boolean'))return %NumberEquals(%$toNumber(i),%$toNumber(h));
if((h==null))return 1;
h=%$toPrimitive(h,0);
}
}else if((typeof(i)==='symbol')){
if((typeof(h)==='symbol'))return %_ObjectEquals(i,h)?0:1;
return 1;
}else if((typeof(i)==='boolean')){
if((typeof(h)==='boolean'))return %_ObjectEquals(i,h)?0:1;
if((h==null))return 1;
if((typeof(h)==='number'))return %NumberEquals(%$toNumber(i),h);
if((typeof(h)==='string'))return %NumberEquals(%$toNumber(i),%$toNumber(h));
if((typeof(h)==='symbol'))return 1;
i=%$toNumber(i);
h=%$toPrimitive(h,0);
}else if((i==null)){
return(h==null)?0:1;
}else{
if((%_IsSpecObject(h))){
return %_ObjectEquals(i,h)?0:1;
}
if((h==null))return 1;
if((typeof(h)==='symbol'))return 1;
if((typeof(h)==='boolean'))h=%$toNumber(h);
i=%$toPrimitive(i,0);
}
}
}
STRICT_EQUALS=function STRICT_EQUALS(i){
if((typeof(this)==='string')){
if(!(typeof(i)==='string'))return 1;
return %StringEquals(this,i);
}
if((typeof(this)==='number')){
if(!(typeof(i)==='number'))return 1;
return %NumberEquals(this,i);
}
return %_ObjectEquals(this,i)?0:1;
}
COMPARE=function COMPARE(i,j){
var k;
var l;
if((typeof(this)==='string')){
if((typeof(i)==='string'))return %_StringCompare(this,i);
if((i===(void 0)))return j;
k=this;
}else if((typeof(this)==='number')){
if((typeof(i)==='number'))return %NumberCompare(this,i,j);
if((i===(void 0)))return j;
k=this;
}else if((this===(void 0))){
if(!(i===(void 0))){
%$toPrimitive(i,1);
}
return j;
}else if((i===(void 0))){
%$toPrimitive(this,1);
return j;
}else{
k=%$toPrimitive(this,1);
}
l=%$toPrimitive(i,1);
if((typeof(k)==='string')&&(typeof(l)==='string')){
return %_StringCompare(k,l);
}else{
var m=%$toNumber(k);
var n=%$toNumber(l);
if((!%_IsSmi(%IS_VAR(m))&&!(m==m))||(!%_IsSmi(%IS_VAR(n))&&!(n==n)))return j;
return %NumberCompare(m,n,j);
}
}
COMPARE_STRONG=function COMPARE_STRONG(i,j){
if((typeof(this)==='string')&&(typeof(i)==='string'))return %_StringCompare(this,i);
if((typeof(this)==='number')&&(typeof(i)==='number'))return %NumberCompare(this,i,j);
throw %MakeTypeError(105);
}
ADD=function ADD(i){
if((typeof(this)==='number')&&(typeof(i)==='number'))return %NumberAdd(this,i);
if((typeof(this)==='string')&&(typeof(i)==='string'))return %_StringAdd(this,i);
var o=%$toPrimitive(this,0);
var p=%$toPrimitive(i,0);
if((typeof(o)==='string')){
return %_StringAdd(o,%$toString(p));
}else if((typeof(p)==='string')){
return %_StringAdd(%$nonStringToString(o),p);
}else{
return %NumberAdd(%$toNumber(o),%$toNumber(p));
}
}
ADD_STRONG=function ADD_STRONG(i){
if((typeof(this)==='number')&&(typeof(i)==='number'))return %NumberAdd(this,i);
if((typeof(this)==='string')&&(typeof(i)==='string'))return %_StringAdd(this,i);
throw %MakeTypeError(105);
}
STRING_ADD_LEFT=function STRING_ADD_LEFT(h){
if(!(typeof(h)==='string')){
if((%_ClassOf(h)==='String')&&%_IsStringWrapperSafeForDefaultValueOf(h)){
h=%_ValueOf(h);
}else{
h=(typeof(h)==='number')
?%_NumberToString(h)
:%$toString(%$toPrimitive(h,0));
}
}
return %_StringAdd(this,h);
}
STRING_ADD_LEFT_STRONG=function STRING_ADD_LEFT_STRONG(h){
if((typeof(h)==='string')){
return %_StringAdd(this,h);
}
throw %MakeTypeError(105);
}
STRING_ADD_RIGHT=function STRING_ADD_RIGHT(h){
var i=this;
if(!(typeof(i)==='string')){
if((%_ClassOf(i)==='String')&&%_IsStringWrapperSafeForDefaultValueOf(i)){
i=%_ValueOf(i);
}else{
i=(typeof(i)==='number')
?%_NumberToString(i)
:%$toString(%$toPrimitive(i,0));
}
}
return %_StringAdd(i,h);
}
STRING_ADD_RIGHT_STRONG=function STRING_ADD_RIGHT_STRONG(h){
if((typeof(this)==='string')){
return %_StringAdd(this,h);
}
throw %MakeTypeError(105);
}
SUB=function SUB(h){
var i=(typeof(this)==='number')?this:%$nonNumberToNumber(this);
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
return %NumberSub(i,h);
}
SUB_STRONG=function SUB_STRONG(h){
if((typeof(this)==='number')&&(typeof(h)==='number')){
return %NumberSub(this,h);
}
throw %MakeTypeError(105);
}
MUL=function MUL(h){
var i=(typeof(this)==='number')?this:%$nonNumberToNumber(this);
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
return %NumberMul(i,h);
}
MUL_STRONG=function MUL_STRONG(h){
if((typeof(this)==='number')&&(typeof(h)==='number')){
return %NumberMul(this,h);
}
throw %MakeTypeError(105);
}
DIV=function DIV(h){
var i=(typeof(this)==='number')?this:%$nonNumberToNumber(this);
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
return %NumberDiv(i,h);
}
DIV_STRONG=function DIV_STRONG(h){
if((typeof(this)==='number')&&(typeof(h)==='number')){
return %NumberDiv(this,h);
}
throw %MakeTypeError(105);
}
MOD=function MOD(h){
var i=(typeof(this)==='number')?this:%$nonNumberToNumber(this);
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
return %NumberMod(i,h);
}
MOD_STRONG=function MOD_STRONG(h){
if((typeof(this)==='number')&&(typeof(h)==='number')){
return %NumberMod(this,h);
}
throw %MakeTypeError(105);
}
BIT_OR=function BIT_OR(h){
var i=(typeof(this)==='number')?this:%$nonNumberToNumber(this);
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
return %NumberOr(i,h);
}
BIT_OR_STRONG=function BIT_OR_STRONG(h){
if((typeof(this)==='number')&&(typeof(h)==='number')){
return %NumberOr(this,h);
}
throw %MakeTypeError(105);
}
BIT_AND=function BIT_AND(h){
var i;
if((typeof(this)==='number')){
i=this;
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
}else{
i=%$nonNumberToNumber(this);
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
if((!%_IsSmi(%IS_VAR(i))&&!(i==i)))return 0;
}
return %NumberAnd(i,h);
}
BIT_AND_STRONG=function BIT_AND_STRONG(h){
if((typeof(this)==='number')&&(typeof(h)==='number')){
return %NumberAnd(this,h);
}
throw %MakeTypeError(105);
}
BIT_XOR=function BIT_XOR(h){
var i=(typeof(this)==='number')?this:%$nonNumberToNumber(this);
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
return %NumberXor(i,h);
}
BIT_XOR_STRONG=function BIT_XOR_STRONG(h){
if((typeof(this)==='number')&&(typeof(h)==='number')){
return %NumberXor(this,h);
}
throw %MakeTypeError(105);
}
SHL=function SHL(h){
var i=(typeof(this)==='number')?this:%$nonNumberToNumber(this);
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
return %NumberShl(i,h);
}
SHL_STRONG=function SHL_STRONG(h){
if((typeof(this)==='number')&&(typeof(h)==='number')){
return %NumberShl(this,h);
}
throw %MakeTypeError(105);
}
SAR=function SAR(h){
var i;
if((typeof(this)==='number')){
i=this;
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
}else{
i=%$nonNumberToNumber(this);
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
if((!%_IsSmi(%IS_VAR(i))&&!(i==i)))return 0;
}
return %NumberSar(i,h);
}
SAR_STRONG=function SAR_STRONG(h){
if((typeof(this)==='number')&&(typeof(h)==='number')){
return %NumberSar(this,h);
}
throw %MakeTypeError(105);
}
SHR=function SHR(h){
var i=(typeof(this)==='number')?this:%$nonNumberToNumber(this);
if(!(typeof(h)==='number'))h=%$nonNumberToNumber(h);
return %NumberShr(i,h);
}
SHR_STRONG=function SHR_STRONG(h){
if((typeof(this)==='number')&&(typeof(h)==='number')){
return %NumberShr(this,h);
}
throw %MakeTypeError(105);
}
DELETE=function DELETE(q,r){
return %DeleteProperty(%$toObject(this),q,r);
}
IN=function IN(i){
if(!(%_IsSpecObject(i))){
throw %MakeTypeError(37,this,i);
}
if(%_IsNonNegativeSmi(this)){
if((%_IsArray(i))&&%_HasFastPackedElements(i)){
return this<i.length;
}
return %HasElement(i,this);
}
return %HasProperty(i,%$toName(this));
}
INSTANCE_OF=function INSTANCE_OF(t){
var u=this;
if(!(%_ClassOf(t)==='Function')){
throw %MakeTypeError(34,t);
}
if(!(%_IsSpecObject(u))){
return 1;
}
var v=%BoundFunctionGetBindings(t);
if(v){
t=v[0];
}
var w=t.prototype;
if(!(%_IsSpecObject(w))){
throw %MakeTypeError(35,w);
}
return %IsInPrototypeChain(w,u)?0:1;
}
CALL_NON_FUNCTION=function CALL_NON_FUNCTION(){
var x=%GetFunctionDelegate(this);
if(!(%_IsFunction(x))){
var y=%RenderCallSite();
if(y=="")y=typeof this;
throw %MakeTypeError(12,y);
}
return %Apply(x,this,arguments,0,%_ArgumentsLength());
}
CALL_NON_FUNCTION_AS_CONSTRUCTOR=function CALL_NON_FUNCTION_AS_CONSTRUCTOR(){
var x=%GetConstructorDelegate(this);
if(!(%_IsFunction(x))){
var y=%RenderCallSite();
if(y=="")y=typeof this;
throw %MakeTypeError(12,y);
}
return %Apply(x,this,arguments,0,%_ArgumentsLength());
}
CALL_FUNCTION_PROXY=function CALL_FUNCTION_PROXY(){
var z=%_ArgumentsLength()-1;
var A=%_Arguments(z);
var B=%GetCallTrap(A);
return %Apply(B,this,arguments,0,z);
}
CALL_FUNCTION_PROXY_AS_CONSTRUCTOR=
function CALL_FUNCTION_PROXY_AS_CONSTRUCTOR(){
var A=this;
var B=%GetConstructTrap(A);
return %Apply(B,this,arguments,0,%_ArgumentsLength());
}
APPLY_PREPARE=function APPLY_PREPARE(C){
var D;
if((%_IsArray(C))){
D=C.length;
if(%_IsSmi(D)&&D>=0&&D<0x800000&&
(%_ClassOf(this)==='Function')){
return D;
}
}
D=(C==null)?0:%$toUint32(C.length);
if(D>0x800000)throw %MakeRangeError(144);
if(!(%_ClassOf(this)==='Function')){
throw %MakeTypeError(8,%$toString(this),typeof this);
}
if(C!=null&&!(%_IsSpecObject(C))){
throw %MakeTypeError(116,"Function.prototype.apply");
}
return D;
}
REFLECT_APPLY_PREPARE=function REFLECT_APPLY_PREPARE(C){
var D;
if((%_IsArray(C))){
D=C.length;
if(%_IsSmi(D)&&D>=0&&D<0x800000&&
(%_ClassOf(this)==='Function')){
return D;
}
}
if(!(%_ClassOf(this)==='Function')){
throw %MakeTypeError(12,%$toString(this));
}
if(!(%_IsSpecObject(C))){
throw %MakeTypeError(116,"Reflect.apply");
}
D=%$toLength(C.length);
if(D>0x800000)throw %MakeRangeError(144);
return D;
}
REFLECT_CONSTRUCT_PREPARE=function REFLECT_CONSTRUCT_PREPARE(
C,newTarget){
var D;
var E=(%_ClassOf(this)==='Function')&&%IsConstructor(this);
var F=(%_ClassOf(newTarget)==='Function')&&%IsConstructor(newTarget);
if((%_IsArray(C))){
D=C.length;
if(%_IsSmi(D)&&D>=0&&D<0x800000&&
E&&F){
return D;
}
}
if(!E){
if(!(%_ClassOf(this)==='Function')){
throw %MakeTypeError(12,%$toString(this));
}else{
throw %MakeTypeError(52,%$toString(this));
}
}
if(!F){
if(!(%_ClassOf(newTarget)==='Function')){
throw %MakeTypeError(12,%$toString(newTarget));
}else{
throw %MakeTypeError(52,%$toString(newTarget));
}
}
if(!(%_IsSpecObject(C))){
throw %MakeTypeError(116,"Reflect.construct");
}
D=%$toLength(C.length);
if(D>0x800000)throw %MakeRangeError(144);
return D;
}
CONCAT_ITERABLE_TO_ARRAY=function CONCAT_ITERABLE_TO_ARRAY(G){
return %$concatIterableToArray(this,G);
};
STACK_OVERFLOW=function STACK_OVERFLOW(D){
throw %MakeRangeError(144);
}
TO_OBJECT=function TO_OBJECT(){
return %$toObject(this);
}
TO_NUMBER=function TO_NUMBER(){
return %$toNumber(this);
}
TO_STRING=function TO_STRING(){
return %$toString(this);
}
TO_NAME=function TO_NAME(){
return %$toName(this);
}
StringLengthTFStub=function StringLengthTFStub(H,I){
var J=function(K,L,M,N){
return %_StringGetLength(%_JSValueGetValue(K));
}
return J;
}
StringAddTFStub=function StringAddTFStub(H,I){
var J=function(k,l){
return %StringAdd(k,l);
}
return J;
}
MathFloorStub=function MathFloorStub(H,I){
var J=function(O,M,N){
var P=%_MathFloor(+N);
if(%_IsMinusZero(P)){
%_FixedArraySet(%_GetTypeFeedbackVector(O),((M|0)+1)|0,1);
return-0;
}
var Q=P|0;
if(Q===P){
return Q;
}
return P;
}
return J;
}
function ToPrimitive(i,R){
if((typeof(i)==='string'))return i;
if(!(%_IsSpecObject(i)))return i;
if((%_ClassOf(i)==='Symbol'))throw MakeTypeError(109);
if(R==0)R=((%_IsDate(i)))?2:1;
return(R==1)?DefaultNumber(i):DefaultString(i);
}
function ToBoolean(i){
if((typeof(i)==='boolean'))return i;
if((typeof(i)==='string'))return i.length!=0;
if(i==null)return false;
if((typeof(i)==='number'))return!((i==0)||(!%_IsSmi(%IS_VAR(i))&&!(i==i)));
return true;
}
function ToNumber(i){
if((typeof(i)==='number'))return i;
if((typeof(i)==='string')){
return %_HasCachedArrayIndex(i)?%_GetCachedArrayIndex(i)
:%StringToNumber(i);
}
if((typeof(i)==='boolean'))return i?1:0;
if((i===(void 0)))return $NaN;
if((typeof(i)==='symbol'))throw MakeTypeError(110);
return((i===null))?0:ToNumber(DefaultNumber(i));
}
function NonNumberToNumber(i){
if((typeof(i)==='string')){
return %_HasCachedArrayIndex(i)?%_GetCachedArrayIndex(i)
:%StringToNumber(i);
}
if((typeof(i)==='boolean'))return i?1:0;
if((i===(void 0)))return $NaN;
if((typeof(i)==='symbol'))throw MakeTypeError(110);
return((i===null))?0:ToNumber(DefaultNumber(i));
}
function ToString(i){
if((typeof(i)==='string'))return i;
if((typeof(i)==='number'))return %_NumberToString(i);
if((typeof(i)==='boolean'))return i?'true':'false';
if((i===(void 0)))return'undefined';
if((typeof(i)==='symbol'))throw MakeTypeError(111);
return((i===null))?'null':ToString(DefaultString(i));
}
function NonStringToString(i){
if((typeof(i)==='number'))return %_NumberToString(i);
if((typeof(i)==='boolean'))return i?'true':'false';
if((i===(void 0)))return'undefined';
if((typeof(i)==='symbol'))throw MakeTypeError(111);
return((i===null))?'null':ToString(DefaultString(i));
}
function ToName(i){
return(typeof(i)==='symbol')?i:ToString(i);
}
function ToObject(i){
if((typeof(i)==='string'))return new e(i);
if((typeof(i)==='number'))return new g(i);
if((typeof(i)==='boolean'))return new d(i);
if((typeof(i)==='symbol'))return %NewSymbolWrapper(i);
if((i==null)&&!(%_IsUndetectableObject(i))){
throw MakeTypeError(112);
}
return i;
}
function ToInteger(i){
if(%_IsSmi(i))return i;
return %NumberToInteger(ToNumber(i));
}
function ToLength(S){
S=ToInteger(S);
if(S<0)return 0;
return S<g.MAX_SAFE_INTEGER?S
:g.MAX_SAFE_INTEGER;
}
function ToUint32(i){
if(%_IsSmi(i)&&i>=0)return i;
return %NumberToJSUint32(ToNumber(i));
}
function ToInt32(i){
if(%_IsSmi(i))return i;
return %NumberToJSInt32(ToNumber(i));
}
function SameValue(i,h){
if(typeof i!=typeof h)return false;
if((typeof(i)==='number')){
if((!%_IsSmi(%IS_VAR(i))&&!(i==i))&&(!%_IsSmi(%IS_VAR(h))&&!(h==h)))return true;
if(i===0&&h===0&&%_IsMinusZero(i)!=%_IsMinusZero(h)){
return false;
}
}
return i===h;
}
function SameValueZero(i,h){
if(typeof i!=typeof h)return false;
if((typeof(i)==='number')){
if((!%_IsSmi(%IS_VAR(i))&&!(i==i))&&(!%_IsSmi(%IS_VAR(h))&&!(h==h)))return true;
}
return i===h;
}
function ConcatIterableToArray(T,G){
var U=T.length;
for(var V of G){
%AddElement(T,U++,V);
}
return T;
}
function IsPrimitive(i){
return!(%_IsSpecObject(i));
}
function IsConcatSpreadable(w){
if(!(%_IsSpecObject(w)))return false;
var W=w[symbolIsConcatSpreadable];
if((W===(void 0)))return(%_IsArray(w));
return ToBoolean(W);
}
function DefaultNumber(i){
if(!(%_ClassOf(i)==='Symbol')){
var X=i.valueOf;
if((%_ClassOf(X)==='Function')){
var N=%_CallFunction(i,X);
if(IsPrimitive(N))return N;
}
var Y=i.toString;
if((%_ClassOf(Y)==='Function')){
var Z=%_CallFunction(i,Y);
if(IsPrimitive(Z))return Z;
}
}
throw MakeTypeError(15);
}
function DefaultString(i){
if(!(%_ClassOf(i)==='Symbol')){
var Y=i.toString;
if((%_ClassOf(Y)==='Function')){
var Z=%_CallFunction(i,Y);
if(IsPrimitive(Z))return Z;
}
var X=i.valueOf;
if((%_ClassOf(X)==='Function')){
var N=%_CallFunction(i,X);
if(IsPrimitive(N))return N;
}
}
throw MakeTypeError(15);
}
function ToPositiveInteger(i,aa){
var M=(%_IsSmi(%IS_VAR(i))?i:%NumberToIntegerMapMinusZero($toNumber(i)));
if(M<0)throw MakeRangeError(aa);
return M;
}
%FunctionSetPrototype(c,new c(0));
$concatIterableToArray=ConcatIterableToArray;
$defaultNumber=DefaultNumber;
$defaultString=DefaultString;
$NaN=%GetRootNaN();
$nonNumberToNumber=NonNumberToNumber;
$nonStringToString=NonStringToString;
$sameValue=SameValue;
$sameValueZero=SameValueZero;
$toBoolean=ToBoolean;
$toInt32=ToInt32;
$toInteger=ToInteger;
$toLength=ToLength;
$toName=ToName;
$toNumber=ToNumber;
$toObject=ToObject;
$toPositiveInteger=ToPositiveInteger;
$toPrimitive=ToPrimitive;
$toString=ToString;
$toUint32=ToUint32;
})
prologue<75>4
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=(void 0);
var d=(void 0);
var e=(void 0);
function Export(g){
g.next=d;
d=g;
};
function Import(g){
g.next=c;
c=g;
};
function ImportFromExperimental(g){
g.next=e;
e=g;
};
function SetFunctionName(g,h,i){
if((typeof(h)==='symbol')){
h="["+%SymbolDescription(h)+"]";
}
if((i===(void 0))){
%FunctionSetName(g,h);
}else{
%FunctionSetName(g,i+" "+h);
}
}
function InstallConstants(j,k){
%CheckIsBootstrapping();
%OptimizeObjectForAddingMultipleProperties(j,k.length>>1);
var l=2|4|1;
for(var m=0;m<k.length;m+=2){
var h=k[m];
var n=k[m+1];
%AddNamedProperty(j,h,n,l);
}
%ToFastProperties(j);
}
function InstallFunctions(j,l,o){
%CheckIsBootstrapping();
%OptimizeObjectForAddingMultipleProperties(j,o.length>>1);
for(var m=0;m<o.length;m+=2){
var p=o[m];
var g=o[m+1];
SetFunctionName(g,p);
%FunctionRemovePrototype(g);
%AddNamedProperty(j,p,g,l);
%SetNativeFlag(g);
}
%ToFastProperties(j);
}
function InstallGetter(j,h,q,l){
%CheckIsBootstrapping();
if(typeof l=="undefined"){
l=2;
}
SetFunctionName(q,h,"get");
%FunctionRemovePrototype(q);
%DefineAccessorPropertyUnchecked(j,h,q,null,l);
%SetNativeFlag(q);
}
function InstallGetterSetter(j,h,q,r){
%CheckIsBootstrapping();
SetFunctionName(q,h,"get");
SetFunctionName(r,h,"set");
%FunctionRemovePrototype(q);
%FunctionRemovePrototype(r);
%DefineAccessorPropertyUnchecked(j,h,q,r,2);
%SetNativeFlag(q);
%SetNativeFlag(r);
}
function SetUpLockedPrototype(
constructor,fields,methods){
%CheckIsBootstrapping();
var t=constructor.prototype;
var u=(methods.length>>1)+(fields?fields.length:0);
if(u>=4){
%OptimizeObjectForAddingMultipleProperties(t,u);
}
if(fields){
for(var m=0;m<fields.length;m++){
%AddNamedProperty(t,fields[m],
(void 0),2|4);
}
}
for(var m=0;m<methods.length;m+=2){
var p=methods[m];
var g=methods[m+1];
%AddNamedProperty(t,p,g,2|4|1);
%SetNativeFlag(g);
}
%InternalSetPrototype(t,null);
%ToFastProperties(t);
}
var v=(void 0);
function PostNatives(b){
%CheckIsBootstrapping();
var w={};
for(;!(d===(void 0));d=d.next)d(w);
for(;!(c===(void 0));c=c.next)c(w);
var x=[
"ArrayToString",
"GetIterator",
"GetMethod",
"InnerArrayEvery",
"InnerArrayFilter",
"InnerArrayForEach",
"InnerArrayIndexOf",
"InnerArrayJoin",
"InnerArrayLastIndexOf",
"InnerArrayMap",
"InnerArrayReduce",
"InnerArrayReduceRight",
"InnerArrayReverse",
"InnerArraySome",
"InnerArraySort",
"InnerArrayToLocaleString",
"IsNaN",
"MathMax",
"MathMin",
"ObjectIsFrozen",
"ObjectDefineProperty",
"OwnPropertyKeys",
"ToNameArray",
];
v={};
%OptimizeObjectForAddingMultipleProperties(
v,x.length);
for(var p of x){
v[p]=w[p];
}
%ToFastProperties(v);
w=(void 0);
b.PostNatives=(void 0);
b.ImportFromExperimental=(void 0);
};
function PostExperimentals(b){
%CheckIsBootstrapping();
for(;!(d===(void 0));d=d.next){
d(v);
}
for(;!(c===(void 0));c=c.next){
c(v);
}
for(;!(e===(void 0));
e=e.next){
e(v);
}
v=(void 0);
b.PostExperimentals=(void 0);
b.Import=(void 0);
b.Export=(void 0);
};
InstallFunctions(b,0,[
"Import",Import,
"Export",Export,
"ImportFromExperimental",ImportFromExperimental,
"SetFunctionName",SetFunctionName,
"InstallConstants",InstallConstants,
"InstallFunctions",InstallFunctions,
"InstallGetter",InstallGetter,
"InstallGetterSetter",InstallGetterSetter,
"SetUpLockedPrototype",SetUpLockedPrototype,
"PostNatives",PostNatives,
"PostExperimentals",PostExperimentals,
]);
})
$v8nativesz<73>
var $functionSourceString;
var $globalEval;
var $objectDefineOwnProperty;
var $objectGetOwnPropertyDescriptor;
var $toCompletePropertyDescriptor;
(function(a,b){
%CheckIsBootstrapping();
var c=a.Array;
var d=a.Boolean;
var e=a.Function;
var g=a.Number;
var h=a.Object;
var i=b.InternalArray;
var j=b.SetFunctionName;
var k;
var l;
var m;
var n;
var o;
b.Import(function(p){
k=p.MathAbs;
o=p.StringIndexOf;
});
b.ImportFromExperimental(function(p){
l=p.ProxyDelegateCallAndConstruct;
m=p.ProxyDerivedHasOwnTrap;
n=p.ProxyDerivedKeysTrap;
});
function GlobalIsNaN(q){
q=((typeof(%IS_VAR(q))==='number')?q:$nonNumberToNumber(q));
return(!%_IsSmi(%IS_VAR(q))&&!(q==q));
}
function GlobalIsFinite(q){
q=((typeof(%IS_VAR(q))==='number')?q:$nonNumberToNumber(q));
return(%_IsSmi(%IS_VAR(q))||((q==q)&&(q!=1/0)&&(q!=-1/0)));
}
function GlobalParseInt(r,t){
if((t===(void 0))||t===10||t===0){
if(%_IsSmi(r))return r;
if((typeof(r)==='number')&&
((0.01<r&&r<1e9)||
(-1e9<r&&r<-0.01))){
return r|0;
}
r=((typeof(%IS_VAR(r))==='string')?r:$nonStringToString(r));
t=t|0;
}else{
r=((typeof(%IS_VAR(r))==='string')?r:$nonStringToString(r));
t=(%_IsSmi(%IS_VAR(t))?t:(t>>0));
if(!(t==0||(2<=t&&t<=36))){
return $NaN;
}
}
if(%_HasCachedArrayIndex(r)&&
(t==0||t==10)){
return %_GetCachedArrayIndex(r);
}
return %StringParseInt(r,t);
}
function GlobalParseFloat(r){
r=((typeof(%IS_VAR(r))==='string')?r:$nonStringToString(r));
if(%_HasCachedArrayIndex(r))return %_GetCachedArrayIndex(r);
return %StringParseFloat(r);
}
function GlobalEval(u){
if(!(typeof(u)==='string'))return u;
var v=%GlobalProxy(GlobalEval);
var w=%CompileString(u,false);
if(!(%_IsFunction(w)))return w;
return %_CallFunction(v,w);
}
var x=2|4|1;
b.InstallConstants(a,[
"NaN",$NaN,
"Infinity",(1/0),
"undefined",(void 0),
]);
b.InstallFunctions(a,2,[
"isNaN",GlobalIsNaN,
"isFinite",GlobalIsFinite,
"parseInt",GlobalParseInt,
"parseFloat",GlobalParseFloat,
"eval",GlobalEval
]);
function ObjectToString(){
if((this===(void 0))&&!(%_IsUndetectableObject(this)))return"[object Undefined]";
if((this===null))return"[object Null]";
var y=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var z=%_ClassOf(y);
var A;
if(harmony_tostring){
A=y[symbolToStringTag];
if(!(typeof(A)==='string')){
A=z;
}
}else{
A=z;
}
return`[object ${A}]`;
}
function ObjectToLocaleString(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Object.prototype.toLocaleString");
return this.toString();
}
function ObjectValueOf(){
return((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
}
function ObjectHasOwnProperty(B){
var C=$toName(B);
var D=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
if(%_IsJSProxy(D)){
if((typeof(B)==='symbol'))return false;
var E=%GetHandler(D);
return CallTrap1(E,"hasOwn",m,C);
}
return %HasOwnProperty(D,C);
}
function ObjectIsPrototypeOf(F){
if(!(%_IsSpecObject(F)))return false;
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Object.prototype.isPrototypeOf");
return %IsInPrototypeChain(this,F);
}
function ObjectPropertyIsEnumerable(F){
var G=$toName(F);
if(%_IsJSProxy(this)){
if((typeof(F)==='symbol'))return false;
var H=GetOwnPropertyJS(this,G);
return(H===(void 0))?false:H.isEnumerable();
}
return %IsPropertyEnumerable(((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)),G);
}
function ObjectDefineGetter(C,I){
var J=this;
if(J==null&&!(%_IsUndetectableObject(J))){
J=%GlobalProxy(ObjectDefineGetter);
}
if(!(%_ClassOf(I)==='Function')){
throw MakeTypeError(60);
}
var H=new PropertyDescriptor();
H.setGet(I);
H.setEnumerable(true);
H.setConfigurable(true);
DefineOwnProperty(((%_IsSpecObject(%IS_VAR(J)))?J:$toObject(J)),$toName(C),H,false);
}
function ObjectLookupGetter(C){
var J=this;
if(J==null&&!(%_IsUndetectableObject(J))){
J=%GlobalProxy(ObjectLookupGetter);
}
return %LookupAccessor(((%_IsSpecObject(%IS_VAR(J)))?J:$toObject(J)),$toName(C),0);
}
function ObjectDefineSetter(C,I){
var J=this;
if(J==null&&!(%_IsUndetectableObject(J))){
J=%GlobalProxy(ObjectDefineSetter);
}
if(!(%_ClassOf(I)==='Function')){
throw MakeTypeError(63);
}
var H=new PropertyDescriptor();
H.setSet(I);
H.setEnumerable(true);
H.setConfigurable(true);
DefineOwnProperty(((%_IsSpecObject(%IS_VAR(J)))?J:$toObject(J)),$toName(C),H,false);
}
function ObjectLookupSetter(C){
var J=this;
if(J==null&&!(%_IsUndetectableObject(J))){
J=%GlobalProxy(ObjectLookupSetter);
}
return %LookupAccessor(((%_IsSpecObject(%IS_VAR(J)))?J:$toObject(J)),$toName(C),1);
}
function ObjectKeys(K){
K=((%_IsSpecObject(%IS_VAR(K)))?K:$toObject(K));
if(%_IsJSProxy(K)){
var E=%GetHandler(K);
var L=CallTrap0(E,"keys",n);
return ToNameArray(L,"keys",false);
}
return %OwnKeys(K);
}
function IsAccessorDescriptor(H){
if((H===(void 0)))return false;
return H.hasGetter()||H.hasSetter();
}
function IsDataDescriptor(H){
if((H===(void 0)))return false;
return H.hasValue()||H.hasWritable();
}
function IsGenericDescriptor(H){
if((H===(void 0)))return false;
return!(IsAccessorDescriptor(H)||IsDataDescriptor(H));
}
function IsInconsistentDescriptor(H){
return IsAccessorDescriptor(H)&&IsDataDescriptor(H);
}
function FromPropertyDescriptor(H){
if((H===(void 0)))return H;
if(IsDataDescriptor(H)){
return{value:H.getValue(),
writable:H.isWritable(),
enumerable:H.isEnumerable(),
configurable:H.isConfigurable()};
}
return{get:H.getGet(),
set:H.getSet(),
enumerable:H.isEnumerable(),
configurable:H.isConfigurable()};
}
function FromGenericPropertyDescriptor(H){
if((H===(void 0)))return H;
var K=new h();
if(H.hasValue()){
%AddNamedProperty(K,"value",H.getValue(),0);
}
if(H.hasWritable()){
%AddNamedProperty(K,"writable",H.isWritable(),0);
}
if(H.hasGetter()){
%AddNamedProperty(K,"get",H.getGet(),0);
}
if(H.hasSetter()){
%AddNamedProperty(K,"set",H.getSet(),0);
}
if(H.hasEnumerable()){
%AddNamedProperty(K,"enumerable",H.isEnumerable(),0);
}
if(H.hasConfigurable()){
%AddNamedProperty(K,"configurable",H.isConfigurable(),0);
}
return K;
}
function ToPropertyDescriptor(K){
if(!(%_IsSpecObject(K)))throw MakeTypeError(76,K);
var H=new PropertyDescriptor();
if("enumerable"in K){
H.setEnumerable($toBoolean(K.enumerable));
}
if("configurable"in K){
H.setConfigurable($toBoolean(K.configurable));
}
if("value"in K){
H.setValue(K.value);
}
if("writable"in K){
H.setWritable($toBoolean(K.writable));
}
if("get"in K){
var M=K.get;
if(!(M===(void 0))&&!(%_ClassOf(M)==='Function')){
throw MakeTypeError(61,M);
}
H.setGet(M);
}
if("set"in K){
var N=K.set;
if(!(N===(void 0))&&!(%_ClassOf(N)==='Function')){
throw MakeTypeError(64,N);
}
H.setSet(N);
}
if(IsInconsistentDescriptor(H)){
throw MakeTypeError(113,K);
}
return H;
}
function ToCompletePropertyDescriptor(K){
var H=ToPropertyDescriptor(K);
if(IsGenericDescriptor(H)||IsDataDescriptor(H)){
if(!H.hasValue())H.setValue((void 0));
if(!H.hasWritable())H.setWritable(false);
}else{
if(!H.hasGetter())H.setGet((void 0));
if(!H.hasSetter())H.setSet((void 0));
}
if(!H.hasEnumerable())H.setEnumerable(false);
if(!H.hasConfigurable())H.setConfigurable(false);
return H;
}
function PropertyDescriptor(){
this.value_=(void 0);
this.hasValue_=false;
this.writable_=false;
this.hasWritable_=false;
this.enumerable_=false;
this.hasEnumerable_=false;
this.configurable_=false;
this.hasConfigurable_=false;
this.get_=(void 0);
this.hasGetter_=false;
this.set_=(void 0);
this.hasSetter_=false;
}
b.SetUpLockedPrototype(PropertyDescriptor,[
"value_",
"hasValue_",
"writable_",
"hasWritable_",
"enumerable_",
"hasEnumerable_",
"configurable_",
"hasConfigurable_",
"get_",
"hasGetter_",
"set_",
"hasSetter_"
],[
"toString",function PropertyDescriptor_ToString(){
return"[object PropertyDescriptor]";
},
"setValue",function PropertyDescriptor_SetValue(B){
this.value_=B;
this.hasValue_=true;
},
"getValue",function PropertyDescriptor_GetValue(){
return this.value_;
},
"hasValue",function PropertyDescriptor_HasValue(){
return this.hasValue_;
},
"setEnumerable",function PropertyDescriptor_SetEnumerable(O){
this.enumerable_=O;
this.hasEnumerable_=true;
},
"isEnumerable",function PropertyDescriptor_IsEnumerable(){
return this.enumerable_;
},
"hasEnumerable",function PropertyDescriptor_HasEnumerable(){
return this.hasEnumerable_;
},
"setWritable",function PropertyDescriptor_SetWritable(P){
this.writable_=P;
this.hasWritable_=true;
},
"isWritable",function PropertyDescriptor_IsWritable(){
return this.writable_;
},
"hasWritable",function PropertyDescriptor_HasWritable(){
return this.hasWritable_;
},
"setConfigurable",
function PropertyDescriptor_SetConfigurable(Q){
this.configurable_=Q;
this.hasConfigurable_=true;
},
"hasConfigurable",function PropertyDescriptor_HasConfigurable(){
return this.hasConfigurable_;
},
"isConfigurable",function PropertyDescriptor_IsConfigurable(){
return this.configurable_;
},
"setGet",function PropertyDescriptor_SetGetter(M){
this.get_=M;
this.hasGetter_=true;
},
"getGet",function PropertyDescriptor_GetGetter(){
return this.get_;
},
"hasGetter",function PropertyDescriptor_HasGetter(){
return this.hasGetter_;
},
"setSet",function PropertyDescriptor_SetSetter(N){
this.set_=N;
this.hasSetter_=true;
},
"getSet",function PropertyDescriptor_GetSetter(){
return this.set_;
},
"hasSetter",function PropertyDescriptor_HasSetter(){
return this.hasSetter_;
}
]);
function ConvertDescriptorArrayToDescriptor(R){
if((R===(void 0))){
return(void 0);
}
var H=new PropertyDescriptor();
if(R[0]){
H.setGet(R[2]);
H.setSet(R[3]);
}else{
H.setValue(R[1]);
H.setWritable(R[4]);
}
H.setEnumerable(R[5]);
H.setConfigurable(R[6]);
return H;
}
function GetTrap(E,C,S){
var T=E[C];
if((T===(void 0))){
if((S===(void 0))){
throw MakeTypeError(83,E,C);
}
T=S;
}else if(!(%_ClassOf(T)==='Function')){
throw MakeTypeError(84,E,C);
}
return T;
}
function CallTrap0(E,C,S){
return %_CallFunction(E,GetTrap(E,C,S));
}
function CallTrap1(E,C,S,u){
return %_CallFunction(E,u,GetTrap(E,C,S));
}
function CallTrap2(E,C,S,u,U){
return %_CallFunction(E,u,U,GetTrap(E,C,S));
}
function GetOwnPropertyJS(K,V){
var W=$toName(V);
if(%_IsJSProxy(K)){
if((typeof(V)==='symbol'))return(void 0);
var E=%GetHandler(K);
var X=CallTrap1(
E,"getOwnPropertyDescriptor",(void 0),W);
if((X===(void 0)))return X;
var H=ToCompletePropertyDescriptor(X);
if(!H.isConfigurable()){
throw MakeTypeError(87,
E,W,"getOwnPropertyDescriptor");
}
return H;
}
var Y=%GetOwnProperty(((%_IsSpecObject(%IS_VAR(K)))?K:$toObject(K)),W);
return ConvertDescriptorArrayToDescriptor(Y);
}
function Delete(K,W,Z){
var H=GetOwnPropertyJS(K,W);
if((H===(void 0)))return true;
if(H.isConfigurable()){
%DeleteProperty(K,W,0);
return true;
}else if(Z){
throw MakeTypeError(24,W);
}else{
return;
}
}
function GetMethod(K,W){
var aa=K[W];
if((aa==null))return(void 0);
if((%_ClassOf(aa)==='Function'))return aa;
throw MakeTypeError(12,typeof aa);
}
function DefineProxyProperty(K,W,x,Z){
if((typeof(W)==='symbol'))return false;
var E=%GetHandler(K);
var ab=CallTrap2(E,"defineProperty",(void 0),W,x);
if(!$toBoolean(ab)){
if(Z){
throw MakeTypeError(82,
E,"false","defineProperty");
}else{
return false;
}
}
return true;
}
function DefineObjectProperty(K,W,H,Z){
var ac=%GetOwnProperty(K,$toName(W));
var ad=ConvertDescriptorArrayToDescriptor(ac);
var ae=%IsExtensible(K);
if((ad===(void 0))&&!ae){
if(Z){
throw MakeTypeError(24,W);
}else{
return false;
}
}
if(!(ad===(void 0))){
if((IsGenericDescriptor(H)||
IsDataDescriptor(H)==IsDataDescriptor(ad))&&
(!H.hasEnumerable()||
$sameValue(H.isEnumerable(),ad.isEnumerable()))&&
(!H.hasConfigurable()||
$sameValue(H.isConfigurable(),ad.isConfigurable()))&&
(!H.hasWritable()||
$sameValue(H.isWritable(),ad.isWritable()))&&
(!H.hasValue()||
$sameValue(H.getValue(),ad.getValue()))&&
(!H.hasGetter()||
$sameValue(H.getGet(),ad.getGet()))&&
(!H.hasSetter()||
$sameValue(H.getSet(),ad.getSet()))){
return true;
}
if(!ad.isConfigurable()){
if(H.isConfigurable()||
(H.hasEnumerable()&&
H.isEnumerable()!=ad.isEnumerable())){
if(Z){
throw MakeTypeError(90,W);
}else{
return false;
}
}
if(!IsGenericDescriptor(H)){
if(IsDataDescriptor(ad)!=IsDataDescriptor(H)){
if(Z){
throw MakeTypeError(90,W);
}else{
return false;
}
}
if(IsDataDescriptor(ad)&&IsDataDescriptor(H)){
var af=ad.isWritable();
if(af!=H.isWritable()){
if(!af||(%IsStrong(K))){
if(Z){
throw af
?MakeTypeError(106,K,W)
:MakeTypeError(90,W);
}else{
return false;
}
}
}
if(!af&&H.hasValue()&&
!$sameValue(H.getValue(),ad.getValue())){
if(Z){
throw MakeTypeError(90,W);
}else{
return false;
}
}
}
if(IsAccessorDescriptor(H)&&IsAccessorDescriptor(ad)){
if(H.hasSetter()&&
!$sameValue(H.getSet(),ad.getSet())){
if(Z){
throw MakeTypeError(90,W);
}else{
return false;
}
}
if(H.hasGetter()&&!$sameValue(H.getGet(),ad.getGet())){
if(Z){
throw MakeTypeError(90,W);
}else{
return false;
}
}
}
}
}
}
var ag=0;
if(H.hasEnumerable()){
ag|=H.isEnumerable()?0:2;
}else if(!(ad===(void 0))){
ag|=ad.isEnumerable()?0:2;
}else{
ag|=2;
}
if(H.hasConfigurable()){
ag|=H.isConfigurable()?0:4;
}else if(!(ad===(void 0))){
ag|=ad.isConfigurable()?0:4;
}else
ag|=4;
if(IsDataDescriptor(H)||
(IsGenericDescriptor(H)&&
((ad===(void 0))||IsDataDescriptor(ad)))){
if(H.hasWritable()){
ag|=H.isWritable()?0:1;
}else if(!(ad===(void 0))){
ag|=ad.isWritable()?0:1;
}else{
ag|=1;
}
var B=(void 0);
if(H.hasValue()){
B=H.getValue();
}else if(!(ad===(void 0))&&IsDataDescriptor(ad)){
B=ad.getValue();
}
%DefineDataPropertyUnchecked(K,W,B,ag);
}else{
var ah=null;
if(H.hasGetter()){
ah=H.getGet();
}else if(IsAccessorDescriptor(ad)&&ad.hasGetter()){
ah=ad.getGet();
}
var ai=null;
if(H.hasSetter()){
ai=H.getSet();
}else if(IsAccessorDescriptor(ad)&&ad.hasSetter()){
ai=ad.getSet();
}
%DefineAccessorPropertyUnchecked(K,W,ah,ai,ag);
}
return true;
}
function DefineArrayProperty(K,W,H,Z){
if(!(typeof(W)==='symbol')){
var aj=$toUint32(W);
var ak=false;
if($toString(aj)==W&&aj!=4294967295){
var al=K.length;
if(aj>=al&&%IsObserved(K)){
ak=true;
$observeBeginPerformSplice(K);
}
var am=GetOwnPropertyJS(K,"length");
if((aj>=al&&!am.isWritable())||
!DefineObjectProperty(K,W,H,true)){
if(ak)
$observeEndPerformSplice(K);
if(Z){
throw MakeTypeError(24,W);
}else{
return false;
}
}
if(aj>=al){
K.length=aj+1;
}
if(ak){
$observeEndPerformSplice(K);
$observeEnqueueSpliceRecord(K,al,[],aj+1-al);
}
return true;
}
}
return DefineObjectProperty(K,W,H,Z);
}
function DefineOwnProperty(K,W,H,Z){
if(%_IsJSProxy(K)){
if((typeof(W)==='symbol'))return false;
var x=FromGenericPropertyDescriptor(H);
return DefineProxyProperty(K,W,x,Z);
}else if((%_IsArray(K))){
return DefineArrayProperty(K,W,H,Z);
}else{
return DefineObjectProperty(K,W,H,Z);
}
}
function DefineOwnPropertyFromAPI(K,W,B,H){
return DefineOwnProperty(K,W,ToPropertyDescriptor({
value:B,
writable:H[0],
enumerable:H[1],
configurable:H[2]
}),
false);
}
function ObjectGetPrototypeOf(K){
return %_GetPrototype(((%_IsSpecObject(%IS_VAR(K)))?K:$toObject(K)));
}
function ObjectSetPrototypeOf(K,an){
if((K==null)&&!(%_IsUndetectableObject(K)))throw MakeTypeError(14,"Object.setPrototypeOf");
if(an!==null&&!(%_IsSpecObject(an))){
throw MakeTypeError(78,an);
}
if((%_IsSpecObject(K))){
%SetPrototype(K,an);
}
return K;
}
function ObjectGetOwnPropertyDescriptor(K,W){
var H=GetOwnPropertyJS(((%_IsSpecObject(%IS_VAR(K)))?K:$toObject(K)),W);
return FromPropertyDescriptor(H);
}
function ToNameArray(K,T,ao){
if(!(%_IsSpecObject(K))){
throw MakeTypeError(85,T,K);
}
var ap=$toUint32(K.length);
var aq=new c(ap);
var ar=0;
var L={__proto__:null};
for(var aj=0;aj<ap;aj++){
var as=$toName(K[aj]);
if((typeof(as)==='symbol')&&!ao)continue;
if(%HasOwnProperty(L,as)){
throw MakeTypeError(88,T,as);
}
aq[ar]=as;
++ar;
L[as]=0;
}
aq.length=ar;
return aq;
}
function ObjectGetOwnPropertyKeys(K,at){
var au=new i();
at|=32;
var av=%GetInterceptorInfo(K);
if((at&8)===0){
var aw=%GetOwnElementNames(K);
for(var ax=0;ax<aw.length;++ax){
aw[ax]=%_NumberToString(aw[ax]);
}
au.push(aw);
if((av&1)!=0){
var ay=%GetIndexedInterceptorElementNames(K);
if(!(ay===(void 0))){
au.push(ay);
}
}
}
au.push(%GetOwnPropertyNames(K,at));
if((av&2)!=0){
var az=
%GetNamedInterceptorPropertyNames(K);
if(!(az===(void 0))){
au.push(az);
}
}
var aA=
%Apply(i.prototype.concat,
au[0],au,1,au.length-1);
if(av!=0){
var aB={__proto__:null};
var aC=0;
for(var ax=0;ax<aA.length;++ax){
var C=aA[ax];
if((typeof(C)==='symbol')){
if((at&16)||(%SymbolIsPrivate(C))){
continue;
}
}else{
if(at&8)continue;
C=$toString(C);
}
if(aB[C])continue;
aB[C]=true;
aA[aC++]=C;
}
aA.length=aC;
}
return aA;
}
function OwnPropertyKeys(K){
if(%_IsJSProxy(K)){
var E=%GetHandler(K);
var L=CallTrap0(E,"ownKeys",(void 0));
return ToNameArray(L,"getOwnPropertyNames",false);
}
return ObjectGetOwnPropertyKeys(K,32);
}
function ObjectGetOwnPropertyNames(K){
K=((%_IsSpecObject(%IS_VAR(K)))?K:$toObject(K));
if(%_IsJSProxy(K)){
var E=%GetHandler(K);
var L=CallTrap0(E,"getOwnPropertyNames",(void 0));
return ToNameArray(L,"getOwnPropertyNames",false);
}
return ObjectGetOwnPropertyKeys(K,16);
}
function ObjectCreate(an,aD){
if(!(%_IsSpecObject(an))&&an!==null){
throw MakeTypeError(78,an);
}
var K={};
%InternalSetPrototype(K,an);
if(!(aD===(void 0)))ObjectDefineProperties(K,aD);
return K;
}
function ObjectDefineProperty(K,W,x){
if(!(%_IsSpecObject(K))){
throw MakeTypeError(13,"Object.defineProperty");
}
var C=$toName(W);
if(%_IsJSProxy(K)){
var aE={__proto__:null};
for(var aF in x){
aE[aF]=x[aF];
}
DefineProxyProperty(K,C,aE,true);
}else{
var H=ToPropertyDescriptor(x);
DefineOwnProperty(K,C,H,true);
}
return K;
}
function GetOwnEnumerablePropertyNames(D){
var L=new i();
for(var aG in D){
if(%HasOwnProperty(D,aG)){
L.push(aG);
}
}
var at=8|32;
var aH=%GetOwnPropertyNames(D,at);
for(var ax=0;ax<aH.length;++ax){
var aI=aH[ax];
if((typeof(aI)==='symbol')){
var H=ObjectGetOwnPropertyDescriptor(D,aI);
if(H.enumerable)L.push(aI);
}
}
return L;
}
function ObjectDefineProperties(K,aD){
if(!(%_IsSpecObject(K))){
throw MakeTypeError(13,"Object.defineProperties");
}
var Y=((%_IsSpecObject(%IS_VAR(aD)))?aD:$toObject(aD));
var L=GetOwnEnumerablePropertyNames(Y);
var aJ=new i();
for(var ax=0;ax<L.length;ax++){
aJ.push(ToPropertyDescriptor(Y[L[ax]]));
}
for(var ax=0;ax<L.length;ax++){
DefineOwnProperty(K,L[ax],aJ[ax],true);
}
return K;
}
function ProxyFix(K){
var E=%GetHandler(K);
var Y=CallTrap0(E,"fix",(void 0));
if((Y===(void 0))){
throw MakeTypeError(82,E,"undefined","fix");
}
if(%IsJSFunctionProxy(K)){
var aK=%GetCallTrap(K);
var aL=%GetConstructTrap(K);
var aM=l(aK,aL);
%Fix(K);
%SetCode(K,aM);
var aN=new h();
ObjectDefineProperty(aN,"constructor",
{value:K,writable:true,enumerable:false,configurable:true});
%FunctionSetPrototype(K,aN);
K.length=0;
}else{
%Fix(K);
}
ObjectDefineProperties(K,Y);
}
function ObjectSealJS(K){
if(!(%_IsSpecObject(K)))return K;
var aO=%_IsJSProxy(K);
if(aO||%HasSloppyArgumentsElements(K)||%IsObserved(K)){
if(aO){
ProxyFix(K);
}
var L=ObjectGetOwnPropertyNames(K);
for(var ax=0;ax<L.length;ax++){
var C=L[ax];
var H=GetOwnPropertyJS(K,C);
if(H.isConfigurable()){
H.setConfigurable(false);
DefineOwnProperty(K,C,H,true);
}
}
%PreventExtensions(K);
}else{
%ObjectSeal(K);
}
return K;
}
function ObjectFreezeJS(K){
if(!(%_IsSpecObject(K)))return K;
var aO=%_IsJSProxy(K);
if(aO||%HasSloppyArgumentsElements(K)||%IsObserved(K)||
(%IsStrong(K))){
if(aO){
ProxyFix(K);
}
var L=ObjectGetOwnPropertyNames(K);
for(var ax=0;ax<L.length;ax++){
var C=L[ax];
var H=GetOwnPropertyJS(K,C);
if(H.isWritable()||H.isConfigurable()){
if(IsDataDescriptor(H))H.setWritable(false);
H.setConfigurable(false);
DefineOwnProperty(K,C,H,true);
}
}
%PreventExtensions(K);
}else{
%ObjectFreeze(K);
}
return K;
}
function ObjectPreventExtension(K){
if(!(%_IsSpecObject(K)))return K;
if(%_IsJSProxy(K)){
ProxyFix(K);
}
%PreventExtensions(K);
return K;
}
function ObjectIsSealed(K){
if(!(%_IsSpecObject(K)))return true;
if(%_IsJSProxy(K)){
return false;
}
if(%IsExtensible(K)){
return false;
}
var L=ObjectGetOwnPropertyNames(K);
for(var ax=0;ax<L.length;ax++){
var C=L[ax];
var H=GetOwnPropertyJS(K,C);
if(H.isConfigurable()){
return false;
}
}
return true;
}
function ObjectIsFrozen(K){
if(!(%_IsSpecObject(K)))return true;
if(%_IsJSProxy(K)){
return false;
}
if(%IsExtensible(K)){
return false;
}
var L=ObjectGetOwnPropertyNames(K);
for(var ax=0;ax<L.length;ax++){
var C=L[ax];
var H=GetOwnPropertyJS(K,C);
if(IsDataDescriptor(H)&&H.isWritable())return false;
if(H.isConfigurable())return false;
}
return true;
}
function ObjectIsExtensible(K){
if(!(%_IsSpecObject(K)))return false;
if(%_IsJSProxy(K)){
return true;
}
return %IsExtensible(K);
}
function ObjectIs(aP,aQ){
return $sameValue(aP,aQ);
}
function ObjectGetProto(){
return %_GetPrototype(((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)));
}
function ObjectSetProto(an){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Object.prototype.__proto__");
if(((%_IsSpecObject(an))||(an===null))&&(%_IsSpecObject(this))){
%SetPrototype(this,an);
}
}
function ObjectConstructor(u){
if(%_IsConstructCall()){
if(u==null)return this;
return((%_IsSpecObject(%IS_VAR(u)))?u:$toObject(u));
}else{
if(u==null)return{};
return((%_IsSpecObject(%IS_VAR(u)))?u:$toObject(u));
}
}
%SetNativeFlag(h);
%SetCode(h,ObjectConstructor);
%AddNamedProperty(h.prototype,"constructor",h,
2);
b.InstallFunctions(h.prototype,2,[
"toString",ObjectToString,
"toLocaleString",ObjectToLocaleString,
"valueOf",ObjectValueOf,
"hasOwnProperty",ObjectHasOwnProperty,
"isPrototypeOf",ObjectIsPrototypeOf,
"propertyIsEnumerable",ObjectPropertyIsEnumerable,
"__defineGetter__",ObjectDefineGetter,
"__lookupGetter__",ObjectLookupGetter,
"__defineSetter__",ObjectDefineSetter,
"__lookupSetter__",ObjectLookupSetter
]);
b.InstallGetterSetter(h.prototype,"__proto__",ObjectGetProto,
ObjectSetProto);
b.InstallFunctions(h,2,[
"keys",ObjectKeys,
"create",ObjectCreate,
"defineProperty",ObjectDefineProperty,
"defineProperties",ObjectDefineProperties,
"freeze",ObjectFreezeJS,
"getPrototypeOf",ObjectGetPrototypeOf,
"setPrototypeOf",ObjectSetPrototypeOf,
"getOwnPropertyDescriptor",ObjectGetOwnPropertyDescriptor,
"getOwnPropertyNames",ObjectGetOwnPropertyNames,
"is",ObjectIs,
"isExtensible",ObjectIsExtensible,
"isFrozen",ObjectIsFrozen,
"isSealed",ObjectIsSealed,
"preventExtensions",ObjectPreventExtension,
"seal",ObjectSealJS
]);
function BooleanConstructor(u){
if(%_IsConstructCall()){
%_SetValueOf(this,$toBoolean(u));
}else{
return $toBoolean(u);
}
}
function BooleanToString(){
var aR=this;
if(!(typeof(aR)==='boolean')){
if(!(%_ClassOf(aR)==='Boolean')){
throw MakeTypeError(55,'Boolean.prototype.toString');
}
aR=%_ValueOf(aR);
}
return aR?'true':'false';
}
function BooleanValueOf(){
if(!(typeof(this)==='boolean')&&!(%_ClassOf(this)==='Boolean')){
throw MakeTypeError(55,'Boolean.prototype.valueOf');
}
return %_ValueOf(this);
}
%SetCode(d,BooleanConstructor);
%FunctionSetPrototype(d,new d(false));
%AddNamedProperty(d.prototype,"constructor",d,
2);
b.InstallFunctions(d.prototype,2,[
"toString",BooleanToString,
"valueOf",BooleanValueOf
]);
function NumberConstructor(u){
var B=%_ArgumentsLength()==0?0:$toNumber(u);
if(%_IsConstructCall()){
%_SetValueOf(this,B);
}else{
return B;
}
}
function NumberToStringJS(t){
var q=this;
if(!(typeof(this)==='number')){
if(!(%_ClassOf(this)==='Number')){
throw MakeTypeError(55,'Number.prototype.toString');
}
q=%_ValueOf(this);
}
if((t===(void 0))||t===10){
return %_NumberToString(q);
}
t=(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)));
if(t<2||t>36)throw MakeRangeError(146);
return %NumberToRadixString(q,t);
}
function NumberToLocaleString(){
return %_CallFunction(this,NumberToStringJS);
}
function NumberValueOf(){
if(!(typeof(this)==='number')&&!(%_ClassOf(this)==='Number')){
throw MakeTypeError(55,'Number.prototype.valueOf');
}
return %_ValueOf(this);
}
function NumberToFixedJS(aS){
var u=this;
if(!(typeof(this)==='number')){
if(!(%_ClassOf(this)==='Number')){
throw MakeTypeError(33,
"Number.prototype.toFixed",this);
}
u=%_ValueOf(this);
}
var w=(%_IsSmi(%IS_VAR(aS))?aS:%NumberToInteger($toNumber(aS)));
if(w<0||w>20){
throw MakeRangeError(142,"toFixed() digits");
}
if((!%_IsSmi(%IS_VAR(u))&&!(u==u)))return"NaN";
if(u==(1/0))return"Infinity";
if(u==-(1/0))return"-Infinity";
return %NumberToFixed(u,w);
}
function NumberToExponentialJS(aS){
var u=this;
if(!(typeof(this)==='number')){
if(!(%_ClassOf(this)==='Number')){
throw MakeTypeError(33,
"Number.prototype.toExponential",this);
}
u=%_ValueOf(this);
}
var w=(aS===(void 0))?(void 0):(%_IsSmi(%IS_VAR(aS))?aS:%NumberToInteger($toNumber(aS)));
if((!%_IsSmi(%IS_VAR(u))&&!(u==u)))return"NaN";
if(u==(1/0))return"Infinity";
if(u==-(1/0))return"-Infinity";
if((w===(void 0))){
w=-1;
}else if(w<0||w>20){
throw MakeRangeError(142,"toExponential()");
}
return %NumberToExponential(u,w);
}
function NumberToPrecisionJS(aT){
var u=this;
if(!(typeof(this)==='number')){
if(!(%_ClassOf(this)==='Number')){
throw MakeTypeError(33,
"Number.prototype.toPrecision",this);
}
u=%_ValueOf(this);
}
if((aT===(void 0)))return $toString(%_ValueOf(this));
var W=(%_IsSmi(%IS_VAR(aT))?aT:%NumberToInteger($toNumber(aT)));
if((!%_IsSmi(%IS_VAR(u))&&!(u==u)))return"NaN";
if(u==(1/0))return"Infinity";
if(u==-(1/0))return"-Infinity";
if(W<1||W>21){
throw MakeRangeError(145);
}
return %NumberToPrecision(u,W);
}
function NumberIsFinite(q){
return(typeof(q)==='number')&&(%_IsSmi(%IS_VAR(q))||((q==q)&&(q!=1/0)&&(q!=-1/0)));
}
function NumberIsInteger(q){
return NumberIsFinite(q)&&(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q)))==q;
}
function NumberIsNaN(q){
return(typeof(q)==='number')&&(!%_IsSmi(%IS_VAR(q))&&!(q==q));
}
function NumberIsSafeInteger(q){
if(NumberIsFinite(q)){
var aU=(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q)));
if(aU==q){
return k(aU)<=g.MAX_SAFE_INTEGER;
}
}
return false;
}
%SetCode(g,NumberConstructor);
%FunctionSetPrototype(g,new g(0));
%OptimizeObjectForAddingMultipleProperties(g.prototype,8);
%AddNamedProperty(g.prototype,"constructor",g,
2);
b.InstallConstants(g,[
"MAX_VALUE",1.7976931348623157e+308,
"MIN_VALUE",5e-324,
"NaN",$NaN,
"NEGATIVE_INFINITY",-(1/0),
"POSITIVE_INFINITY",(1/0),
"MAX_SAFE_INTEGER",%_MathPow(2,53)-1,
"MIN_SAFE_INTEGER",-%_MathPow(2,53)+1,
"EPSILON",%_MathPow(2,-52)
]);
b.InstallFunctions(g.prototype,2,[
"toString",NumberToStringJS,
"toLocaleString",NumberToLocaleString,
"valueOf",NumberValueOf,
"toFixed",NumberToFixedJS,
"toExponential",NumberToExponentialJS,
"toPrecision",NumberToPrecisionJS
]);
b.InstallFunctions(g,2,[
"isFinite",NumberIsFinite,
"isInteger",NumberIsInteger,
"isNaN",NumberIsNaN,
"isSafeInteger",NumberIsSafeInteger,
"parseInt",GlobalParseInt,
"parseFloat",GlobalParseFloat
]);
%SetForceInlineFlag(NumberIsNaN);
function NativeCodeFunctionSourceString(aa){
var C=%FunctionGetName(aa);
if(C){
return'function '+C+'() { [native code] }';
}
return'function () { [native code] }';
}
function FunctionSourceString(aa){
while(%IsJSFunctionProxy(aa)){
aa=%GetCallTrap(aa);
}
if(!(%_IsFunction(aa))){
throw MakeTypeError(55,'Function.prototype.toString');
}
if(%FunctionIsBuiltin(aa)){
return NativeCodeFunctionSourceString(aa);
}
var aV=%ClassGetSourceCode(aa);
if((typeof(aV)==='string')){
return aV;
}
var aW=%FunctionGetSourceCode(aa);
if(!(typeof(aW)==='string')){
return NativeCodeFunctionSourceString(aa);
}
if(%FunctionIsArrow(aa)){
return aW;
}
var C=%FunctionNameShouldPrintAsAnonymous(aa)
?'anonymous'
:%FunctionGetName(aa);
var aX=%FunctionIsGenerator(aa);
var aY=%FunctionIsConciseMethod(aa)
?(aX?'*':'')
:(aX?'function* ':'function ');
return aY+C+aW;
}
function FunctionToString(){
return FunctionSourceString(this);
}
function FunctionBind(aZ){
if(!(%_ClassOf(this)==='Function'))throw MakeTypeError(30);
var ba=function(){
"use strict";
if(%_IsConstructCall()){
return %NewObjectFromBound(ba);
}
var bb=%BoundFunctionGetBindings(ba);
var bc=%_ArgumentsLength();
if(bc==0){
return %Apply(bb[0],bb[1],bb,2,bb.length-2);
}
if(bb.length===2){
return %Apply(bb[0],bb[1],arguments,0,bc);
}
var bd=bb.length-2;
var be=new i(bd+bc);
for(var ax=0;ax<bd;ax++){
be[ax]=bb[ax+2];
}
for(var aC=0;aC<bc;aC++){
be[ax++]=%_Arguments(aC);
}
return %Apply(bb[0],bb[1],be,0,bd+bc);
};
var bf=0;
var bg=this.length;
if((typeof bg==="number")&&
((bg>>>0)===bg)){
var bc=%_ArgumentsLength();
if(bc>0)bc--;
bf=bg-bc;
if(bf<0)bf=0;
}
var ab=%FunctionBindArguments(ba,this,
aZ,bf);
var C=this.name;
var bh=(typeof(C)==='string')?C:"";
j(ab,bh,"bound");
return ab;
}
function NewFunctionString(bi,bj){
var ap=bi.length;
var W='';
if(ap>1){
W=$toString(bi[0]);
for(var ax=1;ax<ap-1;ax++){
W+=','+$toString(bi[ax]);
}
if(%_CallFunction(W,')',o)!=-1){
throw MakeSyntaxError(184);
}
W+='\n/'+'**/';
}
var bk=(ap>0)?$toString(bi[ap-1]):'';
return'('+bj+'('+W+') {\n'+bk+'\n})';
}
function FunctionConstructor(bl){
var aW=NewFunctionString(arguments,'function');
var v=%GlobalProxy(FunctionConstructor);
var w=%_CallFunction(v,%CompileString(aW,true));
%FunctionMarkNameShouldPrintAsAnonymous(w);
return w;
}
%SetCode(e,FunctionConstructor);
%AddNamedProperty(e.prototype,"constructor",e,
2);
b.InstallFunctions(e.prototype,2,[
"bind",FunctionBind,
"toString",FunctionToString
]);
function GetIterator(K,bm){
if((bm===(void 0))){
bm=K[symbolIterator];
}
if(!(%_ClassOf(bm)==='Function')){
throw MakeTypeError(56,K);
}
var bn=%_CallFunction(K,bm);
if(!(%_IsSpecObject(bn))){
throw MakeTypeError(50,bn);
}
return bn;
}
$functionSourceString=FunctionSourceString;
$globalEval=GlobalEval;
$objectDefineOwnProperty=DefineOwnPropertyFromAPI;
$objectGetOwnPropertyDescriptor=ObjectGetOwnPropertyDescriptor;
$toCompletePropertyDescriptor=ToCompletePropertyDescriptor;
b.ObjectDefineProperties=ObjectDefineProperties;
b.ObjectDefineProperty=ObjectDefineProperty;
b.Export(function(bo){
bo.Delete=Delete;
bo.GetIterator=GetIterator;
bo.GetMethod=GetMethod;
bo.IsFinite=GlobalIsFinite;
bo.IsNaN=GlobalIsNaN;
bo.NewFunctionString=NewFunctionString;
bo.NumberIsNaN=NumberIsNaN;
bo.ObjectDefineProperty=ObjectDefineProperty;
bo.ObjectFreeze=ObjectFreezeJS;
bo.ObjectGetOwnPropertyKeys=ObjectGetOwnPropertyKeys;
bo.ObjectHasOwnProperty=ObjectHasOwnProperty;
bo.ObjectIsFrozen=ObjectIsFrozen;
bo.ObjectIsSealed=ObjectIsSealed;
bo.ObjectToString=ObjectToString;
bo.OwnPropertyKeys=OwnPropertyKeys;
bo.ToNameArray=ToNameArray;
});
})
symbol%
var $symbolToString;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Object;
var d=a.Symbol;
var e;
b.Import(function(g){
e=g.ObjectGetOwnPropertyKeys;
});
function SymbolConstructor(h){
if(%_IsConstructCall())throw MakeTypeError(52,"Symbol");
return %CreateSymbol((h===(void 0))?h:$toString(h));
}
function SymbolToString(){
if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){
throw MakeTypeError(33,
"Symbol.prototype.toString",this);
}
var i=%SymbolDescription(%_ValueOf(this));
return"Symbol("+((i===(void 0))?"":i)+")";
}
function SymbolValueOf(){
if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){
throw MakeTypeError(33,
"Symbol.prototype.valueOf",this);
}
return %_ValueOf(this);
}
function SymbolFor(j){
j=((typeof(%IS_VAR(j))==='string')?j:$nonStringToString(j));
var k=%SymbolRegistry();
if((k.for[j]===(void 0))){
var l=%CreateSymbol(j);
k.for[j]=l;
k.keyFor[l]=j;
}
return k.for[j];
}
function SymbolKeyFor(l){
if(!(typeof(l)==='symbol'))throw MakeTypeError(108,l);
return %SymbolRegistry().keyFor[l];
}
function ObjectGetOwnPropertySymbols(m){
m=$toObject(m);
return e(m,8);
}
%SetCode(d,SymbolConstructor);
%FunctionSetPrototype(d,new c());
b.InstallConstants(d,[
"iterator",symbolIterator,
"unscopables",symbolUnscopables
]);
b.InstallFunctions(d,2,[
"for",SymbolFor,
"keyFor",SymbolKeyFor
]);
%AddNamedProperty(
d.prototype,"constructor",d,2);
%AddNamedProperty(
d.prototype,symbolToStringTag,"Symbol",2|1);
b.InstallFunctions(d.prototype,2,[
"toString",SymbolToString,
"valueOf",SymbolValueOf
]);
b.InstallFunctions(c,2,[
"getOwnPropertySymbols",ObjectGetOwnPropertySymbols
]);
$symbolToString=SymbolToString;
})
array<1E>
var $arrayConcat;
var $arrayPush;
var $arrayPop;
var $arrayShift;
var $arraySlice;
var $arraySplice;
var $arrayUnshift;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Array;
var d=b.InternalArray;
var e=b.InternalPackedArray;
var g;
var h;
var i;
var j;
var k;
var l;
b.Import(function(m){
g=m.Delete;
h=m.MathMin;
i=m.ObjectHasOwnProperty;
j=m.ObjectIsFrozen;
k=m.ObjectIsSealed;
l=m.ObjectToString;
});
var n=new d();
function GetSortedArrayKeys(o,p){
var q=new d();
if((typeof(p)==='number')){
var r=p;
for(var t=0;t<r;++t){
var u=o[t];
if(!(u===(void 0))||t in o){
q.push(t);
}
}
}else{
var v=p.length;
for(var w=0;w<v;++w){
var x=p[w];
if(!(x===(void 0))){
var u=o[x];
if(!(u===(void 0))||x in o){
q.push(x);
}
}
}
%_CallFunction(q,function(y,z){return y-z;},ArraySort);
}
return q;
}
function SparseJoinWithSeparatorJS(o,A,B,C){
var q=GetSortedArrayKeys(o,%GetArrayKeys(o,A));
var D=0;
var E=new d(q.length*2);
var F=-1;
for(var t=0;t<q.length;t++){
var x=q[t];
if(x!=F){
var u=o[x];
if(!(typeof(u)==='string'))u=B(u);
E[t*2]=x;
E[t*2+1]=u;
F=x;
}
}
return %SparseJoinWithSeparator(E,A,C);
}
function SparseJoin(o,A,B){
var q=GetSortedArrayKeys(o,%GetArrayKeys(o,A));
var G=-1;
var H=q.length;
var E=new d(H);
var I=0;
for(var t=0;t<H;t++){
var x=q[t];
if(x!=G){
var u=o[x];
if(!(typeof(u)==='string'))u=B(u);
E[I++]=u;
G=x;
}
}
return %StringBuilderConcat(E,I,'');
}
function UseSparseVariant(o,v,J,K){
if(!J||v<1000||%IsObserved(o)||
%HasComplexElements(o)){
return false;
}
if(!%_IsSmi(v)){
return true;
}
var L=v>>2;
var M=%EstimateNumberOfElements(o);
return(M<L)&&
(K>M*4);
}
function Join(o,v,C,B){
if(v==0)return'';
var J=(%_IsArray(o));
if(J){
if(!%PushIfAbsent(n,o))return'';
}
try{
if(UseSparseVariant(o,v,J,v)){
%NormalizeElements(o);
if(C.length==0){
return SparseJoin(o,v,B);
}else{
return SparseJoinWithSeparatorJS(o,v,B,C);
}
}
if(v==1){
var u=o[0];
if((typeof(u)==='string'))return u;
return B(u);
}
var E=new d(v);
if(C.length==0){
var I=0;
for(var t=0;t<v;t++){
var u=o[t];
if(!(typeof(u)==='string'))u=B(u);
E[I++]=u;
}
E.length=I;
var N=%_FastOneByteArrayJoin(E,'');
if(!(N===(void 0)))return N;
return %StringBuilderConcat(E,I,'');
}
if(!(typeof(o[0])==='number')){
for(var t=0;t<v;t++){
var u=o[t];
if(!(typeof(u)==='string'))u=B(u);
E[t]=u;
}
}else{
for(var t=0;t<v;t++){
var u=o[t];
if((typeof(u)==='number')){
u=%_NumberToString(u);
}else if(!(typeof(u)==='string')){
u=B(u);
}
E[t]=u;
}
}
var N=%_FastOneByteArrayJoin(E,C);
if(!(N===(void 0)))return N;
return %StringBuilderJoin(E,v,C);
}finally{
if(J)n.length=n.length-1;
}
}
function ConvertToString(O){
if((typeof(O)==='number'))return %_NumberToString(O);
if((typeof(O)==='boolean'))return O?'true':'false';
return((O==null))?'':$toString($defaultString(O));
}
function ConvertToLocaleString(u){
if((u==null)){
return'';
}else{
var P=$toObject(u);
return $toString(P.toLocaleString());
}
}
function SparseSlice(o,Q,R,A,S){
var p=%GetArrayKeys(o,Q+R);
if((typeof(p)==='number')){
var r=p;
for(var t=Q;t<r;++t){
var T=o[t];
if(!(T===(void 0))||t in o){
%AddElement(S,t-Q,T);
}
}
}else{
var v=p.length;
for(var w=0;w<v;++w){
var x=p[w];
if(!(x===(void 0))){
if(x>=Q){
var T=o[x];
if(!(T===(void 0))||x in o){
%AddElement(S,x-Q,T);
}
}
}
}
}
}
function SparseMove(o,Q,R,A,U){
if(U===R)return;
var V=new d(
h(A-R+U,0xffffffff));
var W;
var p=%GetArrayKeys(o,A);
if((typeof(p)==='number')){
var r=p;
for(var t=0;t<Q&&t<r;++t){
var T=o[t];
if(!(T===(void 0))||t in o){
V[t]=T;
}
}
for(var t=Q+R;t<r;++t){
var T=o[t];
if(!(T===(void 0))||t in o){
V[t-R+U]=T;
}
}
}else{
var v=p.length;
for(var w=0;w<v;++w){
var x=p[w];
if(!(x===(void 0))){
if(x<Q){
var T=o[x];
if(!(T===(void 0))||x in o){
V[x]=T;
}
}else if(x>=Q+R){
var T=o[x];
if(!(T===(void 0))||x in o){
var X=x-R+U;
V[X]=T;
if(X>0xfffffffe){
W=W||new d();
W.push(X);
}
}
}
}
}
}
%MoveArrayContents(V,o);
if(!(W===(void 0))){
var v=W.length;
for(var t=0;t<v;++t){
var x=W[t];
o[x]=V[x];
}
}
}
function SimpleSlice(o,Q,R,A,S){
var J=(%_IsArray(o));
for(var t=0;t<R;t++){
var Y=Q+t;
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(Y<o.length):(Y in o))){
var T=o[Y];
%AddElement(S,t,T);
}
}
}
function SimpleMove(o,Q,R,A,U){
var J=(%_IsArray(o));
if(U!==R){
if(U>R){
for(var t=A-R;t>Q;t--){
var Z=t+R-1;
var aa=t+U-1;
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(Z<o.length):(Z in o))){
o[aa]=o[Z];
}else{
delete o[aa];
}
}
}else{
for(var t=Q;t<A-R;t++){
var Z=t+R;
var aa=t+U;
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(Z<o.length):(Z in o))){
o[aa]=o[Z];
}else{
delete o[aa];
}
}
for(var t=A;t>A-R+U;t--){
delete o[t-1];
}
}
}
}
function ArrayToString(){
var o;
var ab;
if((%_IsArray(this))){
ab=this.join;
if(ab===ArrayJoin){
return Join(this,this.length,',',ConvertToString);
}
o=this;
}else{
o=$toObject(this);
ab=o.join;
}
if(!(%_ClassOf(ab)==='Function')){
return %_CallFunction(o,l);
}
return %_CallFunction(o,ab);
}
function InnerArrayToLocaleString(o,v){
var A=(v>>>0);
if(A===0)return"";
return Join(o,A,',',ConvertToLocaleString);
}
function ArrayToLocaleString(){
var o=$toObject(this);
var ac=o.length;
return InnerArrayToLocaleString(o,ac);
}
function InnerArrayJoin(C,o,v){
if((C===(void 0))){
C=',';
}else if(!(typeof(C)==='string')){
C=$nonStringToString(C);
}
var N=%_FastOneByteArrayJoin(o,C);
if(!(N===(void 0)))return N;
if(v===1){
var u=o[0];
if((typeof(u)==='string'))return u;
if((u==null))return'';
return $nonStringToString(u);
}
return Join(o,v,C,ConvertToString);
}
function ArrayJoin(C){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.join");
var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var v=(o.length>>>0);
return InnerArrayJoin(C,o,v);
}
function ObservedArrayPop(ad){
ad--;
var ae=this[ad];
try{
$observeBeginPerformSplice(this);
delete this[ad];
this.length=ad;
}finally{
$observeEndPerformSplice(this);
$observeEnqueueSpliceRecord(this,ad,[ae],0);
}
return ae;
}
function ArrayPop(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.pop");
var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var ad=(o.length>>>0);
if(ad==0){
o.length=ad;
return;
}
if(%IsObserved(o))
return ObservedArrayPop.call(o,ad);
ad--;
var ae=o[ad];
g(o,ad,true);
o.length=ad;
return ae;
}
function ObservedArrayPush(){
var ad=(this.length>>>0);
var af=%_ArgumentsLength();
try{
$observeBeginPerformSplice(this);
for(var t=0;t<af;t++){
this[t+ad]=%_Arguments(t);
}
var ag=ad+af;
this.length=ag;
}finally{
$observeEndPerformSplice(this);
$observeEnqueueSpliceRecord(this,ad,[],af);
}
return ag;
}
function ArrayPush(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.push");
if(%IsObserved(this))
return ObservedArrayPush.apply(this,arguments);
var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var ad=(o.length>>>0);
var af=%_ArgumentsLength();
for(var t=0;t<af;t++){
o[t+ad]=%_Arguments(t);
}
var ag=ad+af;
o.length=ag;
return ag;
}
function ArrayConcatJS(ah){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.concat");
var o=$toObject(this);
var ai=%_ArgumentsLength();
var aj=new d(1+ai);
aj[0]=o;
for(var t=0;t<ai;t++){
aj[t+1]=%_Arguments(t);
}
return %ArrayConcat(aj);
}
function SparseReverse(o,A){
var q=GetSortedArrayKeys(o,%GetArrayKeys(o,A));
var ak=q.length-1;
var al=0;
while(al<=ak){
var t=q[al];
var am=q[ak];
var an=A-am-1;
var ao,ap;
if(an<=t){
ap=am;
while(q[--ak]==am){}
ao=an;
}
if(an>=t){
ao=t;
while(q[++al]==t){}
ap=A-t-1;
}
var aq=o[ao];
if(!(aq===(void 0))||ao in o){
var ar=o[ap];
if(!(ar===(void 0))||ap in o){
o[ao]=ar;
o[ap]=aq;
}else{
o[ap]=aq;
delete o[ao];
}
}else{
var ar=o[ap];
if(!(ar===(void 0))||ap in o){
o[ao]=ar;
delete o[ap];
}
}
}
}
function InnerArrayReverse(o,A){
var am=A-1;
for(var t=0;t<am;t++,am--){
var aq=o[t];
if(!(aq===(void 0))||t in o){
var ar=o[am];
if(!(ar===(void 0))||am in o){
o[t]=ar;
o[am]=aq;
}else{
o[am]=aq;
delete o[t];
}
}else{
var ar=o[am];
if(!(ar===(void 0))||am in o){
o[t]=ar;
delete o[am];
}
}
}
return o;
}
function ArrayReverse(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.reverse");
var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var A=(o.length>>>0);
if(UseSparseVariant(o,A,(%_IsArray(o)),A)){
%NormalizeElements(o);
SparseReverse(o,A);
return o;
}
return InnerArrayReverse(o,A);
}
function ObservedArrayShift(A){
var as=this[0];
try{
$observeBeginPerformSplice(this);
SimpleMove(this,0,1,A,0);
this.length=A-1;
}finally{
$observeEndPerformSplice(this);
$observeEnqueueSpliceRecord(this,0,[as],0);
}
return as;
}
function ArrayShift(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.shift");
var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var A=(o.length>>>0);
if(A===0){
o.length=0;
return;
}
if(k(o))throw MakeTypeError(10);
if(%IsObserved(o))
return ObservedArrayShift.call(o,A);
var as=o[0];
if(UseSparseVariant(o,A,(%_IsArray(o)),A)){
SparseMove(o,0,1,A,0);
}else{
SimpleMove(o,0,1,A,0);
}
o.length=A-1;
return as;
}
function ObservedArrayUnshift(){
var A=(this.length>>>0);
var at=%_ArgumentsLength();
try{
$observeBeginPerformSplice(this);
SimpleMove(this,0,0,A,at);
for(var t=0;t<at;t++){
this[t]=%_Arguments(t);
}
var ag=A+at;
this.length=ag;
}finally{
$observeEndPerformSplice(this);
$observeEnqueueSpliceRecord(this,0,[],at);
}
return ag;
}
function ArrayUnshift(ah){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.unshift");
if(%IsObserved(this))
return ObservedArrayUnshift.apply(this,arguments);
var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var A=(o.length>>>0);
var at=%_ArgumentsLength();
if(A>0&&UseSparseVariant(o,A,(%_IsArray(o)),A)&&
!k(o)){
SparseMove(o,0,0,A,at);
}else{
SimpleMove(o,0,0,A,at);
}
for(var t=0;t<at;t++){
o[t]=%_Arguments(t);
}
var ag=A+at;
o.length=ag;
return ag;
}
function ArraySlice(au,av){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.slice");
var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var A=(o.length>>>0);
var Q=(%_IsSmi(%IS_VAR(au))?au:%NumberToInteger($toNumber(au)));
var aw=A;
if(!(av===(void 0)))aw=(%_IsSmi(%IS_VAR(av))?av:%NumberToInteger($toNumber(av)));
if(Q<0){
Q+=A;
if(Q<0)Q=0;
}else{
if(Q>A)Q=A;
}
if(aw<0){
aw+=A;
if(aw<0)aw=0;
}else{
if(aw>A)aw=A;
}
var N=[];
if(aw<Q)return N;
if(UseSparseVariant(o,A,(%_IsArray(o)),aw-Q)){
%NormalizeElements(o);
%NormalizeElements(N);
SparseSlice(o,Q,aw-Q,A,N);
}else{
SimpleSlice(o,Q,aw-Q,A,N);
}
N.length=aw-Q;
return N;
}
function ComputeSpliceStartIndex(Q,A){
if(Q<0){
Q+=A;
return Q<0?0:Q;
}
return Q>A?A:Q;
}
function ComputeSpliceDeleteCount(ax,at,A,Q){
var R=0;
if(at==1)
return A-Q;
R=(%_IsSmi(%IS_VAR(ax))?ax:%NumberToInteger($toNumber(ax)));
if(R<0)
return 0;
if(R>A-Q)
return A-Q;
return R;
}
function ObservedArraySplice(au,ax){
var at=%_ArgumentsLength();
var A=(this.length>>>0);
var Q=ComputeSpliceStartIndex((%_IsSmi(%IS_VAR(au))?au:%NumberToInteger($toNumber(au))),A);
var R=ComputeSpliceDeleteCount(ax,at,A,
Q);
var S=[];
S.length=R;
var ay=at>2?at-2:0;
try{
$observeBeginPerformSplice(this);
SimpleSlice(this,Q,R,A,S);
SimpleMove(this,Q,R,A,ay);
var t=Q;
var az=2;
var aA=%_ArgumentsLength();
while(az<aA){
this[t++]=%_Arguments(az++);
}
this.length=A-R+ay;
}finally{
$observeEndPerformSplice(this);
if(S.length||ay){
$observeEnqueueSpliceRecord(this,
Q,
S.slice(),
ay);
}
}
return S;
}
function ArraySplice(au,ax){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.splice");
if(%IsObserved(this))
return ObservedArraySplice.apply(this,arguments);
var at=%_ArgumentsLength();
var o=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var A=(o.length>>>0);
var Q=ComputeSpliceStartIndex((%_IsSmi(%IS_VAR(au))?au:%NumberToInteger($toNumber(au))),A);
var R=ComputeSpliceDeleteCount(ax,at,A,
Q);
var S=[];
S.length=R;
var ay=at>2?at-2:0;
if(R!=ay&&k(o)){
throw MakeTypeError(10);
}else if(R>0&&j(o)){
throw MakeTypeError(9);
}
var aB=R;
if(ay!=R){
aB+=A-Q-R;
}
if(UseSparseVariant(o,A,(%_IsArray(o)),aB)){
%NormalizeElements(o);
%NormalizeElements(S);
SparseSlice(o,Q,R,A,S);
SparseMove(o,Q,R,A,ay);
}else{
SimpleSlice(o,Q,R,A,S);
SimpleMove(o,Q,R,A,ay);
}
var t=Q;
var az=2;
var aA=%_ArgumentsLength();
while(az<aA){
o[t++]=%_Arguments(az++);
}
o.length=A-R+ay;
return S;
}
function InnerArraySort(v,aC){
if(!(%_ClassOf(aC)==='Function')){
aC=function(O,aD){
if(O===aD)return 0;
if(%_IsSmi(O)&&%_IsSmi(aD)){
return %SmiLexicographicCompare(O,aD);
}
O=$toString(O);
aD=$toString(aD);
if(O==aD)return 0;
else return O<aD?-1:1;
};
}
var aE=function InsertionSort(y,m,aF){
for(var t=m+1;t<aF;t++){
var aG=y[t];
for(var am=t-1;am>=m;am--){
var aH=y[am];
var aI=%_CallFunction((void 0),aH,aG,aC);
if(aI>0){
y[am+1]=aH;
}else{
break;
}
}
y[am+1]=aG;
}
};
var aJ=function(y,m,aF){
var aK=[];
var aL=200+((aF-m)&15);
for(var t=m+1,am=0;t<aF-1;t+=aL,am++){
aK[am]=[t,y[t]];
}
%_CallFunction(aK,function(y,z){
return %_CallFunction((void 0),y[1],z[1],aC);
},ArraySort);
var aM=aK[aK.length>>1][0];
return aM;
}
var aN=function QuickSort(y,m,aF){
var aM=0;
while(true){
if(aF-m<=10){
aE(y,m,aF);
return;
}
if(aF-m>1000){
aM=aJ(y,m,aF);
}else{
aM=m+((aF-m)>>1);
}
var aO=y[m];
var aP=y[aF-1];
var aQ=y[aM];
var aR=%_CallFunction((void 0),aO,aP,aC);
if(aR>0){
var aH=aO;
aO=aP;
aP=aH;
}
var aS=%_CallFunction((void 0),aO,aQ,aC);
if(aS>=0){
var aH=aO;
aO=aQ;
aQ=aP;
aP=aH;
}else{
var aT=%_CallFunction((void 0),aP,aQ,aC);
if(aT>0){
var aH=aP;
aP=aQ;
aQ=aH;
}
}
y[m]=aO;
y[aF-1]=aQ;
var aU=aP;
var aV=m+1;
var aW=aF-1;
y[aM]=y[aV];
y[aV]=aU;
partition:for(var t=aV+1;t<aW;t++){
var aG=y[t];
var aI=%_CallFunction((void 0),aG,aU,aC);
if(aI<0){
y[t]=y[aV];
y[aV]=aG;
aV++;
}else if(aI>0){
do{
aW--;
if(aW==t)break partition;
var aX=y[aW];
aI=%_CallFunction((void 0),aX,aU,aC);
}while(aI>0);
y[t]=y[aW];
y[aW]=aG;
if(aI<0){
aG=y[t];
y[t]=y[aV];
y[aV]=aG;
aV++;
}
}
}
if(aF-aW<aV-m){
aN(y,aW,aF);
aF=aV;
}else{
aN(y,m,aV);
m=aW;
}
}
};
var aY=function CopyFromPrototype(aZ,v){
var ba=0;
for(var bb=%_GetPrototype(aZ);bb;bb=%_GetPrototype(bb)){
var p=%GetArrayKeys(bb,v);
if((typeof(p)==='number')){
var bc=p;
for(var t=0;t<bc;t++){
if(!(%_CallFunction(aZ,t,i))&&(%_CallFunction(bb,t,i))){
aZ[t]=bb[t];
if(t>=ba){ba=t+1;}
}
}
}else{
for(var t=0;t<p.length;t++){
var Y=p[t];
if(!(Y===(void 0))&&!(%_CallFunction(aZ,Y,i))
&&(%_CallFunction(bb,Y,i))){
aZ[Y]=bb[Y];
if(Y>=ba){ba=Y+1;}
}
}
}
}
return ba;
};
var bd=function(aZ,m,aF){
for(var bb=%_GetPrototype(aZ);bb;bb=%_GetPrototype(bb)){
var p=%GetArrayKeys(bb,aF);
if((typeof(p)==='number')){
var bc=p;
for(var t=m;t<bc;t++){
if((%_CallFunction(bb,t,i))){
aZ[t]=(void 0);
}
}
}else{
for(var t=0;t<p.length;t++){
var Y=p[t];
if(!(Y===(void 0))&&m<=Y&&
(%_CallFunction(bb,Y,i))){
aZ[Y]=(void 0);
}
}
}
}
};
var be=function SafeRemoveArrayHoles(aZ){
var bf=0;
var bg=v-1;
var bh=0;
while(bf<bg){
while(bf<bg&&
!(aZ[bf]===(void 0))){
bf++;
}
if(!(%_CallFunction(aZ,bf,i))){
bh++;
}
while(bf<bg&&
(aZ[bg]===(void 0))){
if(!(%_CallFunction(aZ,bg,i))){
bh++;
}
bg--;
}
if(bf<bg){
aZ[bf]=aZ[bg];
aZ[bg]=(void 0);
}
}
if(!(aZ[bf]===(void 0)))bf++;
var t;
for(t=bf;t<v-bh;t++){
aZ[t]=(void 0);
}
for(t=v-bh;t<v;t++){
if(t in %_GetPrototype(aZ)){
aZ[t]=(void 0);
}else{
delete aZ[t];
}
}
return bf;
};
if(v<2)return this;
var J=(%_IsArray(this));
var bi;
if(!J){
bi=aY(this,v);
}
var bj=%RemoveArrayHoles(this,v);
if(bj==-1){
bj=be(this);
}
aN(this,0,bj);
if(!J&&(bj+1<bi)){
bd(this,bj,bi);
}
return this;
}
function ArraySort(aC){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.sort");
var o=$toObject(this);
var v=(o.length>>>0);
return %_CallFunction(o,v,aC,InnerArraySort);
}
function InnerArrayFilter(bk,bl,o,v){
if(!(%_ClassOf(bk)==='Function'))throw MakeTypeError(12,bk);
var bm=false;
if((bl===null)){
if(%IsSloppyModeFunction(bk))bl=(void 0);
}else if(!(bl===(void 0))){
bm=(!(%_IsSpecObject(bl))&&%IsSloppyModeFunction(bk));
}
var bn=new d();
var bo=0;
var J=(%_IsArray(o));
var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk);
for(var t=0;t<v;t++){
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t<o.length):(t in o))){
var aG=o[t];
if(bp)%DebugPrepareStepInIfStepping(bk);
var bq=bm?$toObject(bl):bl;
if(%_CallFunction(bq,aG,t,o,bk)){
bn[bo++]=aG;
}
}
}
return bn;
}
function ArrayFilter(bk,bl){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.filter");
var o=$toObject(this);
var v=$toUint32(o.length);
var bn=InnerArrayFilter(bk,bl,o,v);
var N=new c();
%MoveArrayContents(bn,N);
return N;
}
function InnerArrayForEach(bk,bl,o,v){
if(!(%_ClassOf(bk)==='Function'))throw MakeTypeError(12,bk);
var bm=false;
if((bl===null)){
if(%IsSloppyModeFunction(bk))bl=(void 0);
}else if(!(bl===(void 0))){
bm=(!(%_IsSpecObject(bl))&&%IsSloppyModeFunction(bk));
}
var J=(%_IsArray(o));
var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk);
for(var t=0;t<v;t++){
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t<o.length):(t in o))){
var aG=o[t];
if(bp)%DebugPrepareStepInIfStepping(bk);
var bq=bm?$toObject(bl):bl;
%_CallFunction(bq,aG,t,o,bk);
}
}
}
function ArrayForEach(bk,bl){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.forEach");
var o=$toObject(this);
var v=(o.length>>>0);
InnerArrayForEach(bk,bl,o,v);
}
function InnerArraySome(bk,bl,o,v){
if(!(%_ClassOf(bk)==='Function'))throw MakeTypeError(12,bk);
var bm=false;
if((bl===null)){
if(%IsSloppyModeFunction(bk))bl=(void 0);
}else if(!(bl===(void 0))){
bm=(!(%_IsSpecObject(bl))&&%IsSloppyModeFunction(bk));
}
var J=(%_IsArray(o));
var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk);
for(var t=0;t<v;t++){
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t<o.length):(t in o))){
var aG=o[t];
if(bp)%DebugPrepareStepInIfStepping(bk);
var bq=bm?$toObject(bl):bl;
if(%_CallFunction(bq,aG,t,o,bk))return true;
}
}
return false;
}
function ArraySome(bk,bl){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.some");
var o=$toObject(this);
var v=(o.length>>>0);
return InnerArraySome(bk,bl,o,v);
}
function InnerArrayEvery(bk,bl,o,v){
if(!(%_ClassOf(bk)==='Function'))throw MakeTypeError(12,bk);
var bm=false;
if((bl===null)){
if(%IsSloppyModeFunction(bk))bl=(void 0);
}else if(!(bl===(void 0))){
bm=(!(%_IsSpecObject(bl))&&%IsSloppyModeFunction(bk));
}
var J=(%_IsArray(o));
var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk);
for(var t=0;t<v;t++){
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t<o.length):(t in o))){
var aG=o[t];
if(bp)%DebugPrepareStepInIfStepping(bk);
var bq=bm?$toObject(bl):bl;
if(!%_CallFunction(bq,aG,t,o,bk))return false;
}
}
return true;
}
function ArrayEvery(bk,bl){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.every");
var o=$toObject(this);
var v=(o.length>>>0);
return InnerArrayEvery(bk,bl,o,v);
}
function InnerArrayMap(bk,bl,o,v){
if(!(%_ClassOf(bk)==='Function'))throw MakeTypeError(12,bk);
var bm=false;
if((bl===null)){
if(%IsSloppyModeFunction(bk))bl=(void 0);
}else if(!(bl===(void 0))){
bm=(!(%_IsSpecObject(bl))&&%IsSloppyModeFunction(bk));
}
var bn=new d(v);
var J=(%_IsArray(o));
var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bk);
for(var t=0;t<v;t++){
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t<o.length):(t in o))){
var aG=o[t];
if(bp)%DebugPrepareStepInIfStepping(bk);
var bq=bm?$toObject(bl):bl;
bn[t]=%_CallFunction(bq,aG,t,o,bk);
}
}
return bn;
}
function ArrayMap(bk,bl){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.map");
var o=$toObject(this);
var v=(o.length>>>0);
var bn=InnerArrayMap(bk,bl,o,v);
var N=new c();
%MoveArrayContents(bn,N);
return N;
}
function InnerArrayIndexOf(aG,Y,v){
if(v==0)return-1;
if((Y===(void 0))){
Y=0;
}else{
Y=(%_IsSmi(%IS_VAR(Y))?Y:%NumberToInteger($toNumber(Y)));
if(Y<0){
Y=v+Y;
if(Y<0)Y=0;
}
}
var br=Y;
var ba=v;
if(UseSparseVariant(this,v,(%_IsArray(this)),ba-br)){
%NormalizeElements(this);
var p=%GetArrayKeys(this,v);
if((typeof(p)==='number')){
ba=p;
}else{
if(p.length==0)return-1;
var bs=GetSortedArrayKeys(this,p);
var ad=bs.length;
var t=0;
while(t<ad&&bs[t]<Y)t++;
while(t<ad){
var x=bs[t];
if(!(x===(void 0))&&this[x]===aG)return x;
t++;
}
return-1;
}
}
if(!(aG===(void 0))){
for(var t=br;t<ba;t++){
if(this[t]===aG)return t;
}
return-1;
}
for(var t=br;t<ba;t++){
if((this[t]===(void 0))&&t in this){
return t;
}
}
return-1;
}
function ArrayIndexOf(aG,Y){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.indexOf");
var v=(this.length>>>0);
return %_CallFunction(this,aG,Y,v,InnerArrayIndexOf);
}
function InnerArrayLastIndexOf(aG,Y,v,bt){
if(v==0)return-1;
if(bt<2){
Y=v-1;
}else{
Y=(%_IsSmi(%IS_VAR(Y))?Y:%NumberToInteger($toNumber(Y)));
if(Y<0)Y+=v;
if(Y<0)return-1;
else if(Y>=v)Y=v-1;
}
var br=0;
var ba=Y;
if(UseSparseVariant(this,v,(%_IsArray(this)),Y)){
%NormalizeElements(this);
var p=%GetArrayKeys(this,Y+1);
if((typeof(p)==='number')){
ba=p;
}else{
if(p.length==0)return-1;
var bs=GetSortedArrayKeys(this,p);
var t=bs.length-1;
while(t>=0){
var x=bs[t];
if(!(x===(void 0))&&this[x]===aG)return x;
t--;
}
return-1;
}
}
if(!(aG===(void 0))){
for(var t=ba;t>=br;t--){
if(this[t]===aG)return t;
}
return-1;
}
for(var t=ba;t>=br;t--){
if((this[t]===(void 0))&&t in this){
return t;
}
}
return-1;
}
function ArrayLastIndexOf(aG,Y){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.lastIndexOf");
var v=(this.length>>>0);
return %_CallFunction(this,aG,Y,v,
%_ArgumentsLength(),InnerArrayLastIndexOf);
}
function InnerArrayReduce(bu,T,o,v,bt){
if(!(%_ClassOf(bu)==='Function')){
throw MakeTypeError(12,bu);
}
var J=(%_IsArray(o));
var t=0;
find_initial:if(bt<2){
for(;t<v;t++){
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t<o.length):(t in o))){
T=o[t++];
break find_initial;
}
}
throw MakeTypeError(92);
}
var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bu);
for(;t<v;t++){
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t<o.length):(t in o))){
var aG=o[t];
if(bp)%DebugPrepareStepInIfStepping(bu);
T=%_CallFunction((void 0),T,aG,t,o,bu);
}
}
return T;
}
function ArrayReduce(bu,T){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.reduce");
var o=$toObject(this);
var v=$toUint32(o.length);
return InnerArrayReduce(bu,T,o,v,
%_ArgumentsLength());
}
function InnerArrayReduceRight(bu,T,o,v,
bt){
if(!(%_ClassOf(bu)==='Function')){
throw MakeTypeError(12,bu);
}
var J=(%_IsArray(o));
var t=v-1;
find_initial:if(bt<2){
for(;t>=0;t--){
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t<o.length):(t in o))){
T=o[t--];
break find_initial;
}
}
throw MakeTypeError(92);
}
var bp=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bu);
for(;t>=0;t--){
if(((J&&%_HasFastPackedElements(%IS_VAR(o)))?(t<o.length):(t in o))){
var aG=o[t];
if(bp)%DebugPrepareStepInIfStepping(bu);
T=%_CallFunction((void 0),T,aG,t,o,bu);
}
}
return T;
}
function ArrayReduceRight(bu,T){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.reduceRight");
var o=$toObject(this);
var v=$toUint32(o.length);
return InnerArrayReduceRight(bu,T,o,v,
%_ArgumentsLength());
}
function ArrayIsArray(aZ){
return(%_IsArray(aZ));
}
%AddNamedProperty(c.prototype,"constructor",c,
2);
var bv={
__proto__:null,
copyWithin:true,
entries:true,
fill:true,
find:true,
findIndex:true,
keys:true,
};
%AddNamedProperty(c.prototype,symbolUnscopables,bv,
2|1);
b.InstallFunctions(c,2,[
"isArray",ArrayIsArray
]);
var bw=%SpecialArrayFunctions();
var bx=function(by,bz,A){
var bk=bz;
if(bw.hasOwnProperty(by)){
bk=bw[by];
}
if(!(A===(void 0))){
%FunctionSetLength(bk,A);
}
return bk;
};
b.InstallFunctions(c.prototype,2,[
"toString",bx("toString",ArrayToString),
"toLocaleString",bx("toLocaleString",ArrayToLocaleString),
"join",bx("join",ArrayJoin),
"pop",bx("pop",ArrayPop),
"push",bx("push",ArrayPush,1),
"concat",bx("concat",ArrayConcatJS,1),
"reverse",bx("reverse",ArrayReverse),
"shift",bx("shift",ArrayShift),
"unshift",bx("unshift",ArrayUnshift,1),
"slice",bx("slice",ArraySlice,2),
"splice",bx("splice",ArraySplice,2),
"sort",bx("sort",ArraySort),
"filter",bx("filter",ArrayFilter,1),
"forEach",bx("forEach",ArrayForEach,1),
"some",bx("some",ArraySome,1),
"every",bx("every",ArrayEvery,1),
"map",bx("map",ArrayMap,1),
"indexOf",bx("indexOf",ArrayIndexOf,1),
"lastIndexOf",bx("lastIndexOf",ArrayLastIndexOf,1),
"reduce",bx("reduce",ArrayReduce,1),
"reduceRight",bx("reduceRight",ArrayReduceRight,1)
]);
%FinishArrayPrototypeSetup(c.prototype);
b.SetUpLockedPrototype(d,c(),[
"concat",bx("concat",ArrayConcatJS),
"indexOf",bx("indexOf",ArrayIndexOf),
"join",bx("join",ArrayJoin),
"pop",bx("pop",ArrayPop),
"push",bx("push",ArrayPush),
"shift",bx("shift",ArrayShift),
"splice",bx("splice",ArraySplice)
]);
b.SetUpLockedPrototype(e,c(),[
"join",bx("join",ArrayJoin),
"pop",bx("pop",ArrayPop),
"push",bx("push",ArrayPush),
"shift",bx("shift",ArrayShift)
]);
b.Export(function(aF){
aF.ArrayIndexOf=ArrayIndexOf;
aF.ArrayJoin=ArrayJoin;
aF.ArrayToString=ArrayToString;
aF.InnerArrayEvery=InnerArrayEvery;
aF.InnerArrayFilter=InnerArrayFilter;
aF.InnerArrayForEach=InnerArrayForEach;
aF.InnerArrayIndexOf=InnerArrayIndexOf;
aF.InnerArrayJoin=InnerArrayJoin;
aF.InnerArrayLastIndexOf=InnerArrayLastIndexOf;
aF.InnerArrayMap=InnerArrayMap;
aF.InnerArrayReduce=InnerArrayReduce;
aF.InnerArrayReduceRight=InnerArrayReduceRight;
aF.InnerArrayReverse=InnerArrayReverse;
aF.InnerArraySome=InnerArraySome;
aF.InnerArraySort=InnerArraySort;
aF.InnerArrayToLocaleString=InnerArrayToLocaleString;
});
$arrayConcat=ArrayConcatJS;
$arrayPush=ArrayPush;
$arrayPop=ArrayPop;
$arrayShift=ArrayShift;
$arraySlice=ArraySlice;
$arraySplice=ArraySplice;
$arrayUnshift=ArrayUnshift;
});
string<6E>Q
(function(a,b){
%CheckIsBootstrapping();
var c=a.RegExp;
var d=a.String;
var e=b.InternalArray;
var g=b.InternalPackedArray;
var h;
var i;
var j;
var k;
var l;
var m;
var n;
b.Import(function(o){
h=o.ArrayIndexOf;
i=o.ArrayJoin;
j=o.MathMax;
k=o.MathMin;
l=o.RegExpExec;
m=o.RegExpExecNoTests;
n=o.RegExpLastMatchInfo;
});
function StringConstructor(p){
if(%_ArgumentsLength()==0)p='';
if(%_IsConstructCall()){
%_SetValueOf(this,((typeof(%IS_VAR(p))==='string')?p:$nonStringToString(p)));
}else{
return(typeof(p)==='symbol')?
%_CallFunction(p,$symbolToString):((typeof(%IS_VAR(p))==='string')?p:$nonStringToString(p));
}
}
function StringToString(){
if(!(typeof(this)==='string')&&!(%_ClassOf(this)==='String')){
throw MakeTypeError(55,'String.prototype.toString');
}
return %_ValueOf(this);
}
function StringValueOf(){
if(!(typeof(this)==='string')&&!(%_ClassOf(this)==='String')){
throw MakeTypeError(55,'String.prototype.valueOf');
}
return %_ValueOf(this);
}
function StringCharAtJS(q){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.charAt");
var r=%_StringCharAt(this,q);
if(%_IsSmi(r)){
r=%_StringCharAt(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)),(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q))));
}
return r;
}
function StringCharCodeAtJS(q){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.charCodeAt");
var r=%_StringCharCodeAt(this,q);
if(!%_IsSmi(r)){
r=%_StringCharCodeAt(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)),(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q))));
}
return r;
}
function StringConcat(t){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.concat");
var u=%_ArgumentsLength();
var v=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
if(u===1){
return v+((typeof(%IS_VAR(t))==='string')?t:$nonStringToString(t));
}
var w=new e(u+1);
w[0]=v;
for(var x=0;x<u;x++){
var y=%_Arguments(x);
w[x+1]=((typeof(%IS_VAR(y))==='string')?y:$nonStringToString(y));
}
return %StringBuilderConcat(w,u+1,"");
}
function StringIndexOfJS(z){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.indexOf");
var A=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
z=((typeof(%IS_VAR(z))==='string')?z:$nonStringToString(z));
var B=0;
if(%_ArgumentsLength()>1){
B=%_Arguments(1);
B=(%_IsSmi(%IS_VAR(B))?B:%NumberToInteger($toNumber(B)));
if(B<0)B=0;
if(B>A.length)B=A.length;
}
return %StringIndexOf(A,z,B);
}
function StringLastIndexOfJS(C){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.lastIndexOf");
var D=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
var E=D.length;
var C=((typeof(%IS_VAR(C))==='string')?C:$nonStringToString(C));
var F=C.length;
var B=E-F;
if(%_ArgumentsLength()>1){
var G=$toNumber(%_Arguments(1));
if(!(!%_IsSmi(%IS_VAR(G))&&!(G==G))){
G=(%_IsSmi(%IS_VAR(G))?G:%NumberToInteger($toNumber(G)));
if(G<0){
G=0;
}
if(G+F<E){
B=G;
}
}
}
if(B<0){
return-1;
}
return %StringLastIndexOf(D,C,B);
}
function StringLocaleCompareJS(t){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.localeCompare");
return %StringLocaleCompare(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)),
((typeof(%IS_VAR(t))==='string')?t:$nonStringToString(t)));
}
function StringMatchJS(H){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.match");
var A=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
if((%_IsRegExp(H))){
var I=H.lastIndex;
(%_IsSmi(%IS_VAR(I))?I:$toNumber(I));
if(!H.global)return m(H,A,0);
var r=%StringMatch(A,H,n);
if(r!==null)$regexpLastMatchInfoOverride=null;
H.lastIndex=0;
return r;
}
H=new c(H);
return m(H,A,0);
}
function StringNormalizeJS(J){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.normalize");
var J=J?((typeof(%IS_VAR(J))==='string')?J:$nonStringToString(J)):'NFC';
var K=['NFC','NFD','NFKC','NFKD'];
var L=
%_CallFunction(K,J,h);
if(L===-1){
throw MakeRangeError(141,
%_CallFunction(K,', ',i));
}
return %_ValueOf(this);
}
var M=[2,"","",-1,-1];
function StringReplace(N,O){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.replace");
var A=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
if((%_IsRegExp(N))){
var I=N.lastIndex;
(%_IsSmi(%IS_VAR(I))?I:$toNumber(I));
if(!(%_ClassOf(O)==='Function')){
O=((typeof(%IS_VAR(O))==='string')?O:$nonStringToString(O));
if(!N.global){
var P=l(N,A,0);
if(P==null){
N.lastIndex=0
return A;
}
if(O.length==0){
return %_SubString(A,0,P[3])+
%_SubString(A,P[4],A.length)
}
return ExpandReplacement(O,A,n,
%_SubString(A,0,P[3]))+
%_SubString(A,P[4],A.length);
}
N.lastIndex=0;
if($regexpLastMatchInfoOverride==null){
return %StringReplaceGlobalRegExpWithString(
A,N,O,n);
}else{
var Q=n[1];
n[1]=0;
var R=%StringReplaceGlobalRegExpWithString(
A,N,O,n);
if(%_IsSmi(n[1])){
n[1]=Q;
}else{
$regexpLastMatchInfoOverride=null;
}
return R;
}
}
if(N.global){
return StringReplaceGlobalRegExpWithFunction(A,N,O);
}
return StringReplaceNonGlobalRegExpWithFunction(A,N,O);
}
N=((typeof(%IS_VAR(N))==='string')?N:$nonStringToString(N));
if(N.length==1&&
A.length>0xFF&&
(typeof(O)==='string')&&
%StringIndexOf(O,'$',0)<0){
return %StringReplaceOneCharWithString(A,N,O);
}
var S=%StringIndexOf(A,N,0);
if(S<0)return A;
var T=S+N.length;
var r=%_SubString(A,0,S);
if((%_ClassOf(O)==='Function')){
var U=(void 0);
r+=%_CallFunction(U,N,S,A,O);
}else{
M[3]=S;
M[4]=T;
r=ExpandReplacement(((typeof(%IS_VAR(O))==='string')?O:$nonStringToString(O)),
A,
M,
r);
}
return r+%_SubString(A,T,A.length);
}
function ExpandReplacement(V,A,W,r){
var X=V.length;
var Y=%StringIndexOf(V,'$',0);
if(Y<0){
if(X>0)r+=V;
return r;
}
if(Y>0)r+=%_SubString(V,0,Y);
while(true){
var Z='$';
var G=Y+1;
if(G<X){
var aa=%_StringCharCodeAt(V,G);
if(aa==36){
++G;
r+='$';
}else if(aa==38){
++G;
r+=
%_SubString(A,W[3],W[4]);
}else if(aa==96){
++G;
r+=%_SubString(A,0,W[3]);
}else if(aa==39){
++G;
r+=%_SubString(A,W[4],A.length);
}else if(aa>=48&&aa<=57){
var ab=(aa-48)<<1;
var ac=1;
var ad=((W)[0]);
if(G+1<V.length){
var Y=%_StringCharCodeAt(V,G+1);
if(Y>=48&&Y<=57){
var ae=ab*10+((Y-48)<<1);
if(ae<ad){
ab=ae;
ac=2;
}
}
}
if(ab!=0&&ab<ad){
var S=W[(3+(ab))];
if(S>=0){
r+=
%_SubString(A,S,W[(3+(ab+1))]);
}
G+=ac;
}else{
r+='$';
}
}else{
r+='$';
}
}else{
r+='$';
}
Y=%StringIndexOf(V,'$',G);
if(Y<0){
if(G<X){
r+=%_SubString(V,G,X);
}
return r;
}
if(Y>G){
r+=%_SubString(V,G,Y);
}
}
return r;
}
function CaptureString(V,af,B){
var ag=B<<1;
var S=af[(3+(ag))];
if(S<0)return;
var T=af[(3+(ag+1))];
return %_SubString(V,S,T);
}
var ah=new e(4);
function StringReplaceGlobalRegExpWithFunction(A,H,O){
var ai=ah;
if(ai){
ah=null;
}else{
ai=new e(16);
}
var aj=%RegExpExecMultiple(H,
A,
n,
ai);
H.lastIndex=0;
if((aj===null)){
ah=ai;
return A;
}
var u=aj.length;
if(((n)[0])==2){
var ak=0;
var al=new g(null,0,A);
for(var x=0;x<u;x++){
var am=aj[x];
if(%_IsSmi(am)){
if(am>0){
ak=(am>>11)+(am&0x7ff);
}else{
ak=aj[++x]-am;
}
}else{
al[0]=am;
al[1]=ak;
$regexpLastMatchInfoOverride=al;
var an=
%_CallFunction((void 0),am,ak,A,O);
aj[x]=((typeof(%IS_VAR(an))==='string')?an:$nonStringToString(an));
ak+=am.length;
}
}
}else{
for(var x=0;x<u;x++){
var am=aj[x];
if(!%_IsSmi(am)){
$regexpLastMatchInfoOverride=am;
var an=%Apply(O,(void 0),am,0,am.length);
aj[x]=((typeof(%IS_VAR(an))==='string')?an:$nonStringToString(an));
}
}
}
var r=%StringBuilderConcat(aj,aj.length,A);
ai.length=0;
ah=ai;
return r;
}
function StringReplaceNonGlobalRegExpWithFunction(A,H,O){
var W=l(H,A,0);
if((W===null)){
H.lastIndex=0;
return A;
}
var B=W[3];
var r=%_SubString(A,0,B);
var ao=W[4];
var ap=((W)[0])>>1;
var aq;
if(ap==1){
var ar=%_SubString(A,B,ao);
aq=%_CallFunction((void 0),ar,B,A,O);
}else{
var as=new e(ap+2);
for(var at=0;at<ap;at++){
as[at]=CaptureString(A,W,at);
}
as[at]=B;
as[at+1]=A;
aq=%Apply(O,(void 0),as,0,at+2);
}
r+=aq;
return r+%_SubString(A,ao,A.length);
}
function StringSearch(au){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.search");
var H;
if((typeof(au)==='string')){
H=%_GetFromCache(0,au);
}else if((%_IsRegExp(au))){
H=au;
}else{
H=new c(au);
}
var P=l(H,((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)),0);
if(P){
return P[3];
}
return-1;
}
function StringSlice(S,T){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.slice");
var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
var av=ar.length;
var aw=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
var ax=av;
if(!(T===(void 0))){
ax=(%_IsSmi(%IS_VAR(T))?T:%NumberToInteger($toNumber(T)));
}
if(aw<0){
aw+=av;
if(aw<0){
aw=0;
}
}else{
if(aw>av){
return'';
}
}
if(ax<0){
ax+=av;
if(ax<0){
return'';
}
}else{
if(ax>av){
ax=av;
}
}
if(ax<=aw){
return'';
}
return %_SubString(ar,aw,ax);
}
function StringSplitJS(ay,az){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.split");
var A=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
az=((az===(void 0)))?0xffffffff:(az>>>0);
var X=A.length;
if(!(%_IsRegExp(ay))){
var aA=((typeof(%IS_VAR(ay))==='string')?ay:$nonStringToString(ay));
if(az===0)return[];
if((ay===(void 0)))return[A];
var aB=aA.length;
if(aB===0)return %StringToArray(A,az);
var r=%StringSplit(A,aA,az);
return r;
}
if(az===0)return[];
return StringSplitOnRegExp(A,ay,az,X);
}
function StringSplitOnRegExp(A,ay,az,X){
if(X===0){
if(l(ay,A,0,0)!=null){
return[];
}
return[A];
}
var aC=0;
var aD=0;
var aE=0;
var r=new e();
outer_loop:
while(true){
if(aD===X){
r[r.length]=%_SubString(A,aC,X);
break;
}
var W=l(ay,A,aD);
if(W==null||X===(aE=W[3])){
r[r.length]=%_SubString(A,aC,X);
break;
}
var aF=W[4];
if(aD===aF&&aF===aC){
aD++;
continue;
}
r[r.length]=%_SubString(A,aC,aE);
if(r.length===az)break;
var aG=((W)[0])+3;
for(var x=3+2;x<aG;){
var S=W[x++];
var T=W[x++];
if(T!=-1){
r[r.length]=%_SubString(A,S,T);
}else{
r[r.length]=(void 0);
}
if(r.length===az)break outer_loop;
}
aD=aC=aF;
}
var aH=[];
%MoveArrayContents(r,aH);
return aH;
}
function StringSubstring(S,T){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.subString");
var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
var av=ar.length;
var aw=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
if(aw<0){
aw=0;
}else if(aw>av){
aw=av;
}
var ax=av;
if(!(T===(void 0))){
ax=(%_IsSmi(%IS_VAR(T))?T:%NumberToInteger($toNumber(T)));
if(ax>av){
ax=av;
}else{
if(ax<0)ax=0;
if(aw>ax){
var aI=ax;
ax=aw;
aw=aI;
}
}
}
return %_SubString(ar,aw,ax);
}
function StringSubstr(S,aJ){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.substr");
var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
var u;
if((aJ===(void 0))){
u=ar.length;
}else{
u=(%_IsSmi(%IS_VAR(aJ))?aJ:%NumberToInteger($toNumber(aJ)));
if(u<=0)return'';
}
if((S===(void 0))){
S=0;
}else{
S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
if(S>=ar.length)return'';
if(S<0){
S+=ar.length;
if(S<0)S=0;
}
}
var T=S+u;
if(T>ar.length)T=ar.length;
return %_SubString(ar,S,T);
}
function StringToLowerCaseJS(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.toLowerCase");
return %StringToLowerCase(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)));
}
function StringToLocaleLowerCase(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.toLocaleLowerCase");
return %StringToLowerCase(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)));
}
function StringToUpperCaseJS(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.toUpperCase");
return %StringToUpperCase(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)));
}
function StringToLocaleUpperCase(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.toLocaleUpperCase");
return %StringToUpperCase(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)));
}
function StringTrimJS(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.trim");
return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)),true,true);
}
function StringTrimLeft(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.trimLeft");
return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)),true,false);
}
function StringTrimRight(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.trimRight");
return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this)),false,true);
}
function StringFromCharCode(aK){
var aJ=%_ArgumentsLength();
if(aJ==1){
if(!%_IsSmi(aK))aK=$toNumber(aK);
return %_StringCharFromCode(aK&0xffff);
}
var aL=%NewString(aJ,true);
var x;
for(x=0;x<aJ;x++){
var aK=%_Arguments(x);
if(!%_IsSmi(aK))aK=$toNumber(aK)&0xffff;
if(aK<0)aK=aK&0xffff;
if(aK>0xff)break;
%_OneByteSeqStringSetChar(x,aK,aL);
}
if(x==aJ)return aL;
aL=%TruncateString(aL,x);
var aM=%NewString(aJ-x,false);
for(var at=0;x<aJ;x++,at++){
var aK=%_Arguments(x);
if(!%_IsSmi(aK))aK=$toNumber(aK)&0xffff;
%_TwoByteSeqStringSetChar(at,aK,aM);
}
return aL+aM;
}
function HtmlEscape(aN){
return %_CallFunction(((typeof(%IS_VAR(aN))==='string')?aN:$nonStringToString(aN)),/"/g,"&quot;",StringReplace);
}
function StringAnchor(aO){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.anchor");
return"<a name=\""+HtmlEscape(aO)+"\">"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+
"</a>";
}
function StringBig(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.big");
return"<big>"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+"</big>";
}
function StringBlink(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.blink");
return"<blink>"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+"</blink>";
}
function StringBold(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.bold");
return"<b>"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+"</b>";
}
function StringFixed(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.fixed");
return"<tt>"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+"</tt>";
}
function StringFontcolor(aP){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.fontcolor");
return"<font color=\""+HtmlEscape(aP)+"\">"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+
"</font>";
}
function StringFontsize(aQ){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.fontsize");
return"<font size=\""+HtmlEscape(aQ)+"\">"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+
"</font>";
}
function StringItalics(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.italics");
return"<i>"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+"</i>";
}
function StringLink(ar){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.link");
return"<a href=\""+HtmlEscape(ar)+"\">"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+"</a>";
}
function StringSmall(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.small");
return"<small>"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+"</small>";
}
function StringStrike(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.strike");
return"<strike>"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+"</strike>";
}
function StringSub(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.sub");
return"<sub>"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+"</sub>";
}
function StringSup(){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.sup");
return"<sup>"+((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this))+"</sup>";
}
function StringRepeat(aR){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.repeat");
var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
var aJ=$toInteger(aR);
if(aJ<0||aJ>%_MaxSmi())throw MakeRangeError(127);
var aS="";
while(true){
if(aJ&1)aS+=ar;
aJ>>=1;
if(aJ===0)return aS;
ar+=ar;
}
}
function StringStartsWith(aT){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.startsWith");
var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
if((%_IsRegExp(aT))){
throw MakeTypeError(28,"String.prototype.startsWith");
}
var aU=((typeof(%IS_VAR(aT))==='string')?aT:$nonStringToString(aT));
var q=0;
if(%_ArgumentsLength()>1){
q=%_Arguments(1);
q=$toInteger(q);
}
var av=ar.length;
var S=k(j(q,0),av);
var aV=aU.length;
if(aV+S>av){
return false;
}
return %StringIndexOf(ar,aU,S)===S;
}
function StringEndsWith(aT){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.endsWith");
var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
if((%_IsRegExp(aT))){
throw MakeTypeError(28,"String.prototype.endsWith");
}
var aU=((typeof(%IS_VAR(aT))==='string')?aT:$nonStringToString(aT));
var av=ar.length;
var q=av;
if(%_ArgumentsLength()>1){
var aW=%_Arguments(1);
if(!(aW===(void 0))){
q=$toInteger(aW);
}
}
var T=k(j(q,0),av);
var aV=aU.length;
var S=T-aV;
if(S<0){
return false;
}
return %StringLastIndexOf(ar,aU,S)===S;
}
function StringIncludes(aT){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.includes");
var ar=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
if((%_IsRegExp(aT))){
throw MakeTypeError(28,"String.prototype.includes");
}
var aU=((typeof(%IS_VAR(aT))==='string')?aT:$nonStringToString(aT));
var q=0;
if(%_ArgumentsLength()>1){
q=%_Arguments(1);
q=$toInteger(q);
}
var av=ar.length;
var S=k(j(q,0),av);
var aV=aU.length;
if(aV+S>av){
return false;
}
return %StringIndexOf(ar,aU,S)!==-1;
}
function StringCodePointAt(q){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.codePointAt");
var V=((typeof(%IS_VAR(this))==='string')?this:$nonStringToString(this));
var aQ=V.length;
q=(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q)));
if(q<0||q>=aQ){
return(void 0);
}
var aX=%_StringCharCodeAt(V,q);
if(aX<0xD800||aX>0xDBFF||q+1==aQ){
return aX;
}
var aY=%_StringCharCodeAt(V,q+1);
if(aY<0xDC00||aY>0xDFFF){
return aX;
}
return(aX-0xD800)*0x400+aY+0x2400;
}
function StringFromCodePoint(aZ){
var aK;
var X=%_ArgumentsLength();
var B;
var r="";
for(B=0;B<X;B++){
aK=%_Arguments(B);
if(!%_IsSmi(aK)){
aK=$toNumber(aK);
}
if(aK<0||aK>0x10FFFF||aK!==(%_IsSmi(%IS_VAR(aK))?aK:%NumberToInteger($toNumber(aK)))){
throw MakeRangeError(126,aK);
}
if(aK<=0xFFFF){
r+=%_StringCharFromCode(aK);
}else{
aK-=0x10000;
r+=%_StringCharFromCode((aK>>>10)&0x3FF|0xD800);
r+=%_StringCharFromCode(aK&0x3FF|0xDC00);
}
}
return r;
}
function StringRaw(ba){
var bb=%_ArgumentsLength();
var bc=$toObject(ba);
var bd=$toObject(bc.raw);
var be=$toLength(bd.length);
if(be<=0)return"";
var r=$toString(bd[0]);
for(var x=1;x<be;++x){
if(x<bb){
r+=$toString(%_Arguments(x));
}
r+=$toString(bd[x]);
}
return r;
}
%SetCode(d,StringConstructor);
%FunctionSetPrototype(d,new d());
%AddNamedProperty(
d.prototype,"constructor",d,2);
b.InstallFunctions(d,2,[
"fromCharCode",StringFromCharCode,
"fromCodePoint",StringFromCodePoint,
"raw",StringRaw
]);
b.InstallFunctions(d.prototype,2,[
"valueOf",StringValueOf,
"toString",StringToString,
"charAt",StringCharAtJS,
"charCodeAt",StringCharCodeAtJS,
"codePointAt",StringCodePointAt,
"concat",StringConcat,
"endsWith",StringEndsWith,
"includes",StringIncludes,
"indexOf",StringIndexOfJS,
"lastIndexOf",StringLastIndexOfJS,
"localeCompare",StringLocaleCompareJS,
"match",StringMatchJS,
"normalize",StringNormalizeJS,
"repeat",StringRepeat,
"replace",StringReplace,
"search",StringSearch,
"slice",StringSlice,
"split",StringSplitJS,
"substring",StringSubstring,
"substr",StringSubstr,
"startsWith",StringStartsWith,
"toLowerCase",StringToLowerCaseJS,
"toLocaleLowerCase",StringToLocaleLowerCase,
"toUpperCase",StringToUpperCaseJS,
"toLocaleUpperCase",StringToLocaleUpperCase,
"trim",StringTrimJS,
"trimLeft",StringTrimLeft,
"trimRight",StringTrimRight,
"link",StringLink,
"anchor",StringAnchor,
"fontcolor",StringFontcolor,
"fontsize",StringFontsize,
"big",StringBig,
"blink",StringBlink,
"bold",StringBold,
"fixed",StringFixed,
"italics",StringItalics,
"small",StringSmall,
"strike",StringStrike,
"sub",StringSub,
"sup",StringSup
]);
b.Export(function(bf){
bf.StringCharAt=StringCharAtJS;
bf.StringIndexOf=StringIndexOfJS;
bf.StringLastIndexOf=StringLastIndexOfJS;
bf.StringMatch=StringMatchJS;
bf.StringReplace=StringReplace;
bf.StringSplit=StringSplitJS;
bf.StringSubstr=StringSubstr;
bf.StringSubstring=StringSubstring;
});
})
uri1[
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Object;
var d=a.Array;
var e=b.InternalArray;
function HexValueOf(g){
if(g>=48&&g<=57)return g-48;
if(g>=65&&g<=70)return g-55;
if(g>=97&&g<=102)return g-87;
return-1;
}
function isAlphaNumeric(h){
if(97<=h&&h<=122)return true;
if(65<=h&&h<=90)return true;
if(48<=h&&h<=57)return true;
return false;
}
var i=0;
function URIAddEncodedOctetToBuffer(j,k,l){
k[l++]=37;
k[l++]=i[j>>4];
k[l++]=i[j&0x0F];
return l;
}
function URIEncodeOctets(m,k,l){
if(i===0){
i=[48,49,50,51,52,53,54,55,56,57,
65,66,67,68,69,70];
}
l=URIAddEncodedOctetToBuffer(m[0],k,l);
if(m[1])l=URIAddEncodedOctetToBuffer(m[1],k,l);
if(m[2])l=URIAddEncodedOctetToBuffer(m[2],k,l);
if(m[3])l=URIAddEncodedOctetToBuffer(m[3],k,l);
return l;
}
function URIEncodeSingle(h,k,l){
var n=(h>>12)&0xF;
var o=(h>>6)&63;
var p=h&63;
var m=new d(3);
if(h<=0x007F){
m[0]=h;
}else if(h<=0x07FF){
m[0]=o+192;
m[1]=p+128;
}else{
m[0]=n+224;
m[1]=o+128;
m[2]=p+128;
}
return URIEncodeOctets(m,k,l);
}
function URIEncodePair(q,r,k,l){
var t=((q>>6)&0xF)+1;
var u=(q>>2)&0xF;
var n=q&3;
var o=(r>>6)&0xF;
var p=r&63;
var m=new d(4);
m[0]=(t>>2)+240;
m[1]=(((t&3)<<4)|u)+128;
m[2]=((n<<4)|o)+128;
m[3]=p+128;
return URIEncodeOctets(m,k,l);
}
function URIHexCharsToCharCode(v,w){
var x=HexValueOf(v);
var y=HexValueOf(w);
if(x==-1||y==-1)throw MakeURIError();
return(x<<4)|y;
}
function URIDecodeOctets(m,k,l){
var z;
var A=m[0];
if(A<0x80){
z=A;
}else if(A<0xc2){
throw MakeURIError();
}else{
var B=m[1];
if(A<0xe0){
var C=A&0x1f;
if((B<0x80)||(B>0xbf))throw MakeURIError();
var D=B&0x3f;
z=(C<<6)+D;
if(z<0x80||z>0x7ff)throw MakeURIError();
}else{
var E=m[2];
if(A<0xf0){
var C=A&0x0f;
if((B<0x80)||(B>0xbf))throw MakeURIError();
var D=B&0x3f;
if((E<0x80)||(E>0xbf))throw MakeURIError();
var F=E&0x3f;
z=(C<<12)+(D<<6)+F;
if((z<0x800)||(z>0xffff))throw MakeURIError();
}else{
var G=m[3];
if(A<0xf8){
var C=(A&0x07);
if((B<0x80)||(B>0xbf))throw MakeURIError();
var D=(B&0x3f);
if((E<0x80)||(E>0xbf)){
throw MakeURIError();
}
var F=(E&0x3f);
if((G<0x80)||(G>0xbf))throw MakeURIError();
var H=(G&0x3f);
z=(C<<18)+(D<<12)+(F<<6)+H;
if((z<0x10000)||(z>0x10ffff))throw MakeURIError();
}else{
throw MakeURIError();
}
}
}
}
if(0xD800<=z&&z<=0xDFFF)throw MakeURIError();
if(z<0x10000){
%_TwoByteSeqStringSetChar(l++,z,k);
}else{
%_TwoByteSeqStringSetChar(l++,(z>>10)+0xd7c0,k);
%_TwoByteSeqStringSetChar(l++,(z&0x3ff)+0xdc00,k);
}
return l;
}
function Encode(I,J){
I=((typeof(%IS_VAR(I))==='string')?I:$nonStringToString(I));
var K=I.length;
var L=new e(K);
var l=0;
for(var M=0;M<K;M++){
var q=%_StringCharCodeAt(I,M);
if(J(q)){
L[l++]=q;
}else{
if(q>=0xDC00&&q<=0xDFFF)throw MakeURIError();
if(q<0xD800||q>0xDBFF){
l=URIEncodeSingle(q,L,l);
}else{
M++;
if(M==K)throw MakeURIError();
var r=%_StringCharCodeAt(I,M);
if(r<0xDC00||r>0xDFFF)throw MakeURIError();
l=URIEncodePair(q,r,L,l);
}
}
}
var k=%NewString(L.length,true);
for(var N=0;N<L.length;N++){
%_OneByteSeqStringSetChar(N,L[N],k);
}
return k;
}
function Decode(I,O){
I=((typeof(%IS_VAR(I))==='string')?I:$nonStringToString(I));
var K=I.length;
var P=%NewString(K,true);
var l=0;
var M=0;
for(;M<K;M++){
var g=%_StringCharCodeAt(I,M);
if(g==37){
if(M+2>=K)throw MakeURIError();
var h=URIHexCharsToCharCode(%_StringCharCodeAt(I,M+1),
%_StringCharCodeAt(I,M+2));
if(h>>7)break;
if(O(h)){
%_OneByteSeqStringSetChar(l++,37,P);
%_OneByteSeqStringSetChar(l++,%_StringCharCodeAt(I,M+1),
P);
%_OneByteSeqStringSetChar(l++,%_StringCharCodeAt(I,M+2),
P);
}else{
%_OneByteSeqStringSetChar(l++,h,P);
}
M+=2;
}else{
if(g>0x7f)break;
%_OneByteSeqStringSetChar(l++,g,P);
}
}
P=%TruncateString(P,l);
if(M==K)return P;
var Q=%NewString(K-M,false);
l=0;
for(;M<K;M++){
var g=%_StringCharCodeAt(I,M);
if(g==37){
if(M+2>=K)throw MakeURIError();
var h=URIHexCharsToCharCode(%_StringCharCodeAt(I,++M),
%_StringCharCodeAt(I,++M));
if(h>>7){
var R=0;
while(((h<<++R)&0x80)!=0){}
if(R==1||R>4)throw MakeURIError();
var m=new d(R);
m[0]=h;
if(M+3*(R-1)>=K)throw MakeURIError();
for(var N=1;N<R;N++){
if(I[++M]!='%')throw MakeURIError();
m[N]=URIHexCharsToCharCode(%_StringCharCodeAt(I,++M),
%_StringCharCodeAt(I,++M));
}
l=URIDecodeOctets(m,Q,l);
}else if(O(h)){
%_TwoByteSeqStringSetChar(l++,37,Q);
%_TwoByteSeqStringSetChar(l++,%_StringCharCodeAt(I,M-1),
Q);
%_TwoByteSeqStringSetChar(l++,%_StringCharCodeAt(I,M),
Q);
}else{
%_TwoByteSeqStringSetChar(l++,h,Q);
}
}else{
%_TwoByteSeqStringSetChar(l++,g,Q);
}
}
Q=%TruncateString(Q,l);
return P+Q;
}
function URIEscapeJS(S){
var T=$toString(S);
return %URIEscape(T);
}
function URIUnescapeJS(S){
var T=$toString(S);
return %URIUnescape(T);
}
function URIDecode(I){
var U=function(h){
if(35<=h&&h<=36)return true;
if(h==38)return true;
if(43<=h&&h<=44)return true;
if(h==47)return true;
if(58<=h&&h<=59)return true;
if(h==61)return true;
if(63<=h&&h<=64)return true;
return false;
};
var V=$toString(I);
return Decode(V,U);
}
function URIDecodeComponent(W){
var U=function(h){return false;};
var V=$toString(W);
return Decode(V,U);
}
function URIEncode(I){
var X=function(h){
if(isAlphaNumeric(h))return true;
if(h==33)return true;
if(35<=h&&h<=36)return true;
if(38<=h&&h<=47)return true;
if(58<=h&&h<=59)return true;
if(h==61)return true;
if(63<=h&&h<=64)return true;
if(h==95)return true;
if(h==126)return true;
return false;
};
var V=$toString(I);
return Encode(V,X);
}
function URIEncodeComponent(W){
var X=function(h){
if(isAlphaNumeric(h))return true;
if(h==33)return true;
if(39<=h&&h<=42)return true;
if(45<=h&&h<=46)return true;
if(h==95)return true;
if(h==126)return true;
return false;
};
var V=$toString(W);
return Encode(V,X);
}
b.InstallFunctions(a,2,[
"escape",URIEscapeJS,
"unescape",URIUnescapeJS,
"decodeURI",URIDecode,
"decodeURIComponent",URIDecodeComponent,
"encodeURI",URIEncode,
"encodeURIComponent",URIEncodeComponent
]);
})
math<74>a
var rngstate;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Object;
var d=b.InternalArray;
function MathAbs(e){
e=+e;
return(e>0)?e:0-e;
}
function MathAcosJS(e){
return %_MathAcos(+e);
}
function MathAsinJS(e){
return %_MathAsin(+e);
}
function MathAtanJS(e){
return %_MathAtan(+e);
}
function MathAtan2JS(g,e){
g=+g;
e=+e;
return %_MathAtan2(g,e);
}
function MathCeil(e){
return-%_MathFloor(-e);
}
function MathExp(e){
return %MathExpRT(((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)));
}
function MathFloorJS(e){
return %_MathFloor(+e);
}
function MathLog(e){
return %_MathLogRT(((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)));
}
function MathMax(h,i){
var j=%_ArgumentsLength();
if(j==2){
h=((typeof(%IS_VAR(h))==='number')?h:$nonNumberToNumber(h));
i=((typeof(%IS_VAR(i))==='number')?i:$nonNumberToNumber(i));
if(i>h)return i;
if(h>i)return h;
if(h==i){
return(h===0&&%_IsMinusZero(h))?i:h;
}
return $NaN;
}
var k=-(1/0);
for(var l=0;l<j;l++){
var m=%_Arguments(l);
m=((typeof(%IS_VAR(m))==='number')?m:$nonNumberToNumber(m));
if((!%_IsSmi(%IS_VAR(m))&&!(m==m))||m>k||(k===0&&m===0&&%_IsMinusZero(k))){
k=m;
}
}
return k;
}
function MathMin(h,i){
var j=%_ArgumentsLength();
if(j==2){
h=((typeof(%IS_VAR(h))==='number')?h:$nonNumberToNumber(h));
i=((typeof(%IS_VAR(i))==='number')?i:$nonNumberToNumber(i));
if(i>h)return h;
if(h>i)return i;
if(h==i){
return(h===0&&%_IsMinusZero(h))?h:i;
}
return $NaN;
}
var k=(1/0);
for(var l=0;l<j;l++){
var m=%_Arguments(l);
m=((typeof(%IS_VAR(m))==='number')?m:$nonNumberToNumber(m));
if((!%_IsSmi(%IS_VAR(m))&&!(m==m))||m<k||(k===0&&m===0&&%_IsMinusZero(m))){
k=m;
}
}
return k;
}
function MathPowJS(e,g){
return %_MathPow(((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)),((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)));
}
function MathRandom(){
var n=(MathImul(18030,rngstate[0]&0xFFFF)+(rngstate[0]>>>16))|0;
rngstate[0]=n;
var o=(MathImul(36969,rngstate[1]&0xFFFF)+(rngstate[1]>>>16))|0;
rngstate[1]=o;
var e=((n<<16)+(o&0xFFFF))|0;
return(e<0?(e+0x100000000):e)*2.3283064365386962890625e-10;
}
function MathRandomRaw(){
var n=(MathImul(18030,rngstate[0]&0xFFFF)+(rngstate[0]>>>16))|0;
rngstate[0]=n;
var o=(MathImul(36969,rngstate[1]&0xFFFF)+(rngstate[1]>>>16))|0;
rngstate[1]=o;
var e=((n<<16)+(o&0xFFFF))|0;
return e&0x3fffffff;
}
function MathRound(e){
return %RoundNumber(((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)));
}
function MathSqrtJS(e){
return %_MathSqrt(+e);
}
function MathImul(e,g){
return %NumberImul(((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)),((typeof(%IS_VAR(g))==='number')?g:$nonNumberToNumber(g)));
}
function MathSign(e){
e=+e;
if(e>0)return 1;
if(e<0)return-1;
return e;
}
function MathTrunc(e){
e=+e;
if(e>0)return %_MathFloor(e);
if(e<0)return-%_MathFloor(-e);
return e;
}
function MathTanh(e){
e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e));
if(e===0)return e;
if(!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return MathSign(e);
var p=MathExp(e);
var q=MathExp(-e);
return(p-q)/(p+q);
}
function MathAsinh(e){
e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e));
if(e===0||!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return e;
if(e>0)return MathLog(e+%_MathSqrt(e*e+1));
return-MathLog(-e+%_MathSqrt(e*e+1));
}
function MathAcosh(e){
e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e));
if(e<1)return $NaN;
if(!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return e;
return MathLog(e+%_MathSqrt(e+1)*%_MathSqrt(e-1));
}
function MathAtanh(e){
e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e));
if(e===0)return e;
if(!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return $NaN;
return 0.5*MathLog((1+e)/(1-e));
}
function MathHypot(e,g){
var j=%_ArgumentsLength();
var r=new d(j);
var t=0;
for(var l=0;l<j;l++){
var m=%_Arguments(l);
m=((typeof(%IS_VAR(m))==='number')?m:$nonNumberToNumber(m));
if(m===(1/0)||m===-(1/0))return(1/0);
m=MathAbs(m);
if(m>t)t=m;
r[l]=m;
}
if(t===0)t=1;
var u=0;
var v=0;
for(var l=0;l<j;l++){
var m=r[l]/t;
var w=m*m-v;
var x=u+w;
v=(x-u)-w;
u=x;
}
return %_MathSqrt(u)*t;
}
function MathFroundJS(e){
return %MathFround(((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e)));
}
function MathClz32JS(e){
return %_MathClz32(e>>>0);
}
function MathCbrt(e){
e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e));
if(e==0||!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return e;
return e>=0?CubeRoot(e):-CubeRoot(-e);
}
function CubeRoot(e){
var y=MathFloorJS(%_DoubleHi(e)/3)+0x2A9F7893;
var z=%_ConstructDouble(y,0);
z=(1.0/3.0)*(e/(z*z)+2*z);
;
z=(1.0/3.0)*(e/(z*z)+2*z);
;
z=(1.0/3.0)*(e/(z*z)+2*z);
;
return(1.0/3.0)*(e/(z*z)+2*z);
;
}
function MathConstructor(){}
var A=new MathConstructor();
%InternalSetPrototype(A,c.prototype);
%AddNamedProperty(a,"Math",A,2);
%FunctionSetInstanceClassName(MathConstructor,'Math');
%AddNamedProperty(A,symbolToStringTag,"Math",1|2);
b.InstallConstants(A,[
"E",2.7182818284590452354,
"LN10",2.302585092994046,
"LN2",0.6931471805599453,
"LOG2E",1.4426950408889634,
"LOG10E",0.4342944819032518,
"PI",3.1415926535897932,
"SQRT1_2",0.7071067811865476,
"SQRT2",1.4142135623730951
]);
b.InstallFunctions(A,2,[
"random",MathRandom,
"abs",MathAbs,
"acos",MathAcosJS,
"asin",MathAsinJS,
"atan",MathAtanJS,
"ceil",MathCeil,
"exp",MathExp,
"floor",MathFloorJS,
"log",MathLog,
"round",MathRound,
"sqrt",MathSqrtJS,
"atan2",MathAtan2JS,
"pow",MathPowJS,
"max",MathMax,
"min",MathMin,
"imul",MathImul,
"sign",MathSign,
"trunc",MathTrunc,
"tanh",MathTanh,
"asinh",MathAsinh,
"acosh",MathAcosh,
"atanh",MathAtanh,
"hypot",MathHypot,
"fround",MathFroundJS,
"clz32",MathClz32JS,
"cbrt",MathCbrt
]);
%SetForceInlineFlag(MathAbs);
%SetForceInlineFlag(MathAcosJS);
%SetForceInlineFlag(MathAsinJS);
%SetForceInlineFlag(MathAtanJS);
%SetForceInlineFlag(MathAtan2JS);
%SetForceInlineFlag(MathCeil);
%SetForceInlineFlag(MathClz32JS);
%SetForceInlineFlag(MathFloorJS);
%SetForceInlineFlag(MathRandom);
%SetForceInlineFlag(MathSign);
%SetForceInlineFlag(MathSqrtJS);
%SetForceInlineFlag(MathTrunc);
b.Export(function(B){
B.MathAbs=MathAbs;
B.MathExp=MathExp;
B.MathFloor=MathFloorJS;
B.IntRandom=MathRandomRaw;
B.MathMax=MathMax;
B.MathMin=MathMin;
});
})
fdlibme<6D>
var kMath;
var rempio2result;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Math;
var d;
var e;
b.Import(function(g){
d=g.MathAbs;
e=g.MathExp;
});
function KernelTan(h,i,j){
var k;
var l;
var m=%_DoubleHi(h);
var n=m&0x7fffffff;
if(n<0x3e300000){
if(((n|%_DoubleLo(h))|(j+1))==0){
return 1/d(h);
}else{
if(j==1){
return h;
}else{
var l=h+i;
var k=%_ConstructDouble(%_DoubleHi(l),0);
var o=i-(k-h);
var p=-1/l;
var q=%_ConstructDouble(%_DoubleHi(p),0);
var r=1+q*k;
return q+p*(r+q*o);
}
}
}
if(n>=0x3fe59428){
if(h<0){
h=-h;
i=-i;
}
k=kMath[32]-h;
l=kMath[33]-i;
h=k+l;
i=0;
}
k=h*h;
l=k*k;
var t=kMath[19+1]
+l*(kMath[19+3]
+l*(kMath[19+5]
+
l*(kMath[19+7]
+l*(kMath[19+9]
+l*kMath[19+11]
))));
var o=k*(kMath[19+2]
+l*(kMath[19+4]
+l*(kMath[19+6]
+
l*(kMath[19+8]
+l*(kMath[19+10]
+l*kMath[19+12]
)))));
var r=k*h;
t=i+k*(r*(t+o)+i);
t=t+kMath[19+0]
*r;
l=h+t;
if(n>=0x3fe59428){
return(1-((m>>30)&2))*
(j-2.0*(h-(l*l/(l+j)-t)));
}
if(j==1){
return l;
}else{
k=%_ConstructDouble(%_DoubleHi(l),0);
o=t-(k-h);
var p=-1/l;
var q=%_ConstructDouble(%_DoubleHi(p),0);
r=1+q*k;
return q+p*(r+q*o);
}
}
function MathSinSlow(h){
var u,v,w;
var m=%_DoubleHi(h);
var n=m&0x7fffffff;
if(n<0x4002d97c){
if(m>0){
var k=h-kMath[1];
if(n!=0x3ff921fb){
v=k-kMath[2];
w=(k-v)-kMath[2];
}else{
k-=kMath[3];
v=k-kMath[4];
w=(k-v)-kMath[4];
}
u=1;
}else{
var k=h+kMath[1];
if(n!=0x3ff921fb){
v=k+kMath[2];
w=(k-v)+kMath[2];
}else{
k+=kMath[3];
v=k+kMath[4];
w=(k-v)+kMath[4];
}
u=-1;
}
}else if(n<=0x413921fb){
var q=d(h);
u=(q*kMath[0]+0.5)|0;
var t=q-u*kMath[1];
var l=u*kMath[2];
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x1000000){
q=t;
l=u*kMath[3];
t=q-l;
l=u*kMath[4]-((q-t)-l);
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x3100000){
q=t;
l=u*kMath[5];
t=q-l;
l=u*kMath[6]-((q-t)-l);
v=t-l;
}
}
w=(t-v)-l;
if(m<0){
u=-u;
v=-v;
w=-w;
}
}else{
u=%RemPiO2(h,rempio2result);
v=rempio2result[0];
w=rempio2result[1];
}
;
var x=1-(u&2);
if(u&1){
var n=%_DoubleHi(v)&0x7fffffff;
var k=v*v;
var t=k*(4.16666666666666019037e-02+k*(-1.38888888888741095749e-03+k*(2.48015872894767294178e-05+k*(-2.75573143513906633035e-07+k*(2.08757232129817482790e-09+k*-1.13596475577881948265e-11)))));
if(n<0x3fd33333){
return(1-(0.5*k-(k*t-v*w)))*x;
}else{
var y;
if(n>0x3fe90000){
y=0.28125;
}else{
y=%_ConstructDouble(%_DoubleHi(0.25*v),0);
}
var z=0.5*k-y;
return(1-y-(z-(k*t-v*w)))*x;
}
;
}else{
var k=v*v;
var o=k*v;
var t=8.33333333332248946124e-03+k*(-1.98412698298579493134e-04+k*(2.75573137070700676789e-06+k*(-2.50507602534068634195e-08+k*1.58969099521155010221e-10)));
return(v-((k*(0.5*w-o*t)-w)-o*-1.66666666666666324348e-01))*x;
;
}
}
function MathCosSlow(h){
var u,v,w;
var m=%_DoubleHi(h);
var n=m&0x7fffffff;
if(n<0x4002d97c){
if(m>0){
var k=h-kMath[1];
if(n!=0x3ff921fb){
v=k-kMath[2];
w=(k-v)-kMath[2];
}else{
k-=kMath[3];
v=k-kMath[4];
w=(k-v)-kMath[4];
}
u=1;
}else{
var k=h+kMath[1];
if(n!=0x3ff921fb){
v=k+kMath[2];
w=(k-v)+kMath[2];
}else{
k+=kMath[3];
v=k+kMath[4];
w=(k-v)+kMath[4];
}
u=-1;
}
}else if(n<=0x413921fb){
var q=d(h);
u=(q*kMath[0]+0.5)|0;
var t=q-u*kMath[1];
var l=u*kMath[2];
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x1000000){
q=t;
l=u*kMath[3];
t=q-l;
l=u*kMath[4]-((q-t)-l);
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x3100000){
q=t;
l=u*kMath[5];
t=q-l;
l=u*kMath[6]-((q-t)-l);
v=t-l;
}
}
w=(t-v)-l;
if(m<0){
u=-u;
v=-v;
w=-w;
}
}else{
u=%RemPiO2(h,rempio2result);
v=rempio2result[0];
w=rempio2result[1];
}
;
if(u&1){
var x=(u&2)-1;
var k=v*v;
var o=k*v;
var t=8.33333333332248946124e-03+k*(-1.98412698298579493134e-04+k*(2.75573137070700676789e-06+k*(-2.50507602534068634195e-08+k*1.58969099521155010221e-10)));
return(v-((k*(0.5*w-o*t)-w)-o*-1.66666666666666324348e-01))*x;
;
}else{
var x=1-(u&2);
var n=%_DoubleHi(v)&0x7fffffff;
var k=v*v;
var t=k*(4.16666666666666019037e-02+k*(-1.38888888888741095749e-03+k*(2.48015872894767294178e-05+k*(-2.75573143513906633035e-07+k*(2.08757232129817482790e-09+k*-1.13596475577881948265e-11)))));
if(n<0x3fd33333){
return(1-(0.5*k-(k*t-v*w)))*x;
}else{
var y;
if(n>0x3fe90000){
y=0.28125;
}else{
y=%_ConstructDouble(%_DoubleHi(0.25*v),0);
}
var z=0.5*k-y;
return(1-y-(z-(k*t-v*w)))*x;
}
;
}
}
function MathSin(h){
h=+h;
if((%_DoubleHi(h)&0x7fffffff)<=0x3fe921fb){
var k=h*h;
var o=k*h;
var t=8.33333333332248946124e-03+k*(-1.98412698298579493134e-04+k*(2.75573137070700676789e-06+k*(-2.50507602534068634195e-08+k*1.58969099521155010221e-10)));
return(h-((k*(0.5*0-o*t)-0)-o*-1.66666666666666324348e-01));
;
}
return+MathSinSlow(h);
}
function MathCos(h){
h=+h;
if((%_DoubleHi(h)&0x7fffffff)<=0x3fe921fb){
var n=%_DoubleHi(h)&0x7fffffff;
var k=h*h;
var t=k*(4.16666666666666019037e-02+k*(-1.38888888888741095749e-03+k*(2.48015872894767294178e-05+k*(-2.75573143513906633035e-07+k*(2.08757232129817482790e-09+k*-1.13596475577881948265e-11)))));
if(n<0x3fd33333){
return(1-(0.5*k-(k*t-h*0)));
}else{
var y;
if(n>0x3fe90000){
y=0.28125;
}else{
y=%_ConstructDouble(%_DoubleHi(0.25*h),0);
}
var z=0.5*k-y;
return(1-y-(z-(k*t-h*0)));
}
;
}
return+MathCosSlow(h);
}
function MathTan(h){
h=h*1;
if((%_DoubleHi(h)&0x7fffffff)<=0x3fe921fb){
return KernelTan(h,0,1);
}
var u,v,w;
var m=%_DoubleHi(h);
var n=m&0x7fffffff;
if(n<0x4002d97c){
if(m>0){
var k=h-kMath[1];
if(n!=0x3ff921fb){
v=k-kMath[2];
w=(k-v)-kMath[2];
}else{
k-=kMath[3];
v=k-kMath[4];
w=(k-v)-kMath[4];
}
u=1;
}else{
var k=h+kMath[1];
if(n!=0x3ff921fb){
v=k+kMath[2];
w=(k-v)+kMath[2];
}else{
k+=kMath[3];
v=k+kMath[4];
w=(k-v)+kMath[4];
}
u=-1;
}
}else if(n<=0x413921fb){
var q=d(h);
u=(q*kMath[0]+0.5)|0;
var t=q-u*kMath[1];
var l=u*kMath[2];
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x1000000){
q=t;
l=u*kMath[3];
t=q-l;
l=u*kMath[4]-((q-t)-l);
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x3100000){
q=t;
l=u*kMath[5];
t=q-l;
l=u*kMath[6]-((q-t)-l);
v=t-l;
}
}
w=(t-v)-l;
if(m<0){
u=-u;
v=-v;
w=-w;
}
}else{
u=%RemPiO2(h,rempio2result);
v=rempio2result[0];
w=rempio2result[1];
}
;
return KernelTan(v,w,(u&1)?-1:1);
}
function MathLog1p(h){
h=h*1;
var m=%_DoubleHi(h);
var A=m&0x7fffffff;
var B=1;
var C=h;
var D=1;
var E=0;
var F=h;
if(m<0x3fda827a){
if(A>=0x3ff00000){
if(h===-1){
return-(1/0);
}else{
return $NaN;
}
}else if(A<0x3c900000){
return h;
}else if(A<0x3e200000){
return h-h*h*0.5;
}
if((m>0)||(m<=-0x402D413D)){
B=0;
}
}
if(m>=0x7ff00000)return h;
if(B!==0){
if(m<0x43400000){
F=1+h;
D=%_DoubleHi(F);
B=(D>>20)-1023;
E=(B>0)?1-(F-h):h-(F-1);
E=E/F;
}else{
D=%_DoubleHi(F);
B=(D>>20)-1023;
}
D=D&0xfffff;
if(D<0x6a09e){
F=%_ConstructDouble(D|0x3ff00000,%_DoubleLo(F));
}else{
++B;
F=%_ConstructDouble(D|0x3fe00000,%_DoubleLo(F));
D=(0x00100000-D)>>2;
}
C=F-1;
}
var G=0.5*C*C;
if(D===0){
if(C===0){
if(B===0){
return 0.0;
}else{
return B*kMath[34]+(E+B*kMath[35]);
}
}
var H=G*(1-kMath[36]*C);
if(B===0){
return C-H;
}else{
return B*kMath[34]-((H-(B*kMath[35]+E))-C);
}
}
var r=C/(2+C);
var k=r*r;
var H=k*((kMath[37+0])
+k*((kMath[37+1])
+k*
((kMath[37+2])
+k*((kMath[37+3])
+k*
((kMath[37+4])
+k*((kMath[37+5])
+k*(kMath[37+6])
))))));
if(B===0){
return C-(G-r*(G+H));
}else{
return B*kMath[34]-((G-(r*(G+H)+(B*kMath[35]+E)))-C);
}
}
function MathExpm1(h){
h=h*1;
var i;
var I;
var J;
var B;
var q;
var E;
var m=%_DoubleHi(h);
var K=m&0x80000000;
var i=(K===0)?h:-h;
m&=0x7fffffff;
if(m>=0x4043687a){
if(m>=0x40862e42){
if(m>=0x7ff00000){
return(h===-(1/0))?-1:h;
}
if(h>kMath[44])return(1/0);
}
if(K!=0)return-1;
}
if(m>0x3fd62e42){
if(m<0x3ff0a2b2){
if(K===0){
I=h-kMath[34];
J=kMath[35];
B=1;
}else{
I=h+kMath[34];
J=-kMath[35];
B=-1;
}
}else{
B=(kMath[45]*h+((K===0)?0.5:-0.5))|0;
q=B;
I=h-q*kMath[34];
J=q*kMath[35];
}
h=I-J;
E=(I-h)-J;
}else if(m<0x3c900000){
return h;
}else{
B=0;
}
var L=0.5*h;
var M=h*L;
var N=1+M*((kMath[46+0])
+M*((kMath[46+1])
+M*
((kMath[46+2])
+M*((kMath[46+3])
+M*(kMath[46+4])
))));
q=3-N*L;
var O=M*((N-q)/(6-h*q));
if(B===0){
return h-(h*O-M);
}else{
O=(h*(O-E)-E);
O-=M;
if(B===-1)return 0.5*(h-O)-0.5;
if(B===1){
if(h<-0.25)return-2*(O-(h+0.5));
return 1+2*(h-O);
}
if(B<=-2||B>56){
i=1-(O-h);
i=%_ConstructDouble(%_DoubleHi(i)+(B<<20),%_DoubleLo(i));
return i-1;
}
if(B<20){
q=%_ConstructDouble(0x3ff00000-(0x200000>>B),0);
i=q-(O-h);
i=%_ConstructDouble(%_DoubleHi(i)+(B<<20),%_DoubleLo(i));
}else{
q=%_ConstructDouble((0x3ff-B)<<20,0);
i=h-(O+q);
i+=1;
i=%_ConstructDouble(%_DoubleHi(i)+(B<<20),%_DoubleLo(i));
}
}
return i;
}
function MathSinh(h){
h=h*1;
var P=(h<0)?-0.5:0.5;
var A=d(h);
if(A<22){
if(A<3.725290298461914e-9)return h;
var q=MathExpm1(A);
if(A<1)return P*(2*q-q*q/(q+1));
return P*(q+q/(q+1));
}
if(A<709.7822265625)return P*e(A);
if(A<=kMath[51]){
var l=e(0.5*A);
var q=P*l;
return q*l;
}
return h*(1/0);
}
function MathCosh(h){
h=h*1;
var n=%_DoubleHi(h)&0x7fffffff;
if(n<0x3fd62e43){
var q=MathExpm1(d(h));
var l=1+q;
if(n<0x3c800000)return l;
return 1+(q*q)/(l+l);
}
if(n<0x40360000){
var q=e(d(h));
return 0.5*q+0.5/q;
}
if(n<0x40862e42)return 0.5*e(d(h));
if(d(h)<=kMath[51]){
var l=e(0.5*d(h));
var q=0.5*l;
return q*l;
}
if((!%_IsSmi(%IS_VAR(h))&&!(h==h)))return h;
return(1/0);
}
function MathLog10(h){
h=h*1;
var m=%_DoubleHi(h);
var Q=%_DoubleLo(h);
var B=0;
if(m<0x00100000){
if(((m&0x7fffffff)|Q)===0)return-(1/0);
if(m<0)return $NaN;
B-=54;
h*=18014398509481984;
m=%_DoubleHi(h);
Q=%_DoubleLo(h);
}
if(m>=0x7ff00000)return h;
B+=(m>>20)-1023;
var R=(B&0x80000000)>>>31;
m=(m&0x000fffff)|((0x3ff-R)<<20);
var i=B+R;
h=%_ConstructDouble(m,Q);
var k=i*kMath[54]+kMath[52]*%_MathLogRT(h);
return k+i*kMath[53];
}
function MathLog2(h){
h=h*1;
var A=d(h);
var m=%_DoubleHi(h);
var Q=%_DoubleLo(h);
var n=m&0x7fffffff;
if((n|Q)==0)return-(1/0);
if(m<0)return $NaN;
if(n>=0x7ff00000)return h;
var u=0;
if(n<0x00100000){
A*=9007199254740992;
u-=53;
n=%_DoubleHi(A);
}
u+=(n>>20)-0x3ff;
var S=n&0x000fffff;
n=S|0x3ff00000;
var T=1;
var U=0;
var V=0;
if(S>0x3988e){
if(S<0xbb67a){
T=1.5;
U=kMath[64];
V=kMath[65];
}else{
u+=1;
n-=0x00100000;
}
}
A=%_ConstructDouble(n,%_DoubleLo(A));
var F=A-T;
var o=1/(A+T);
var W=F*o;
var X=%_ConstructDouble(%_DoubleHi(W),0);
var Y=%_ConstructDouble(%_DoubleHi(A+T),0)
var Z=A-(Y-T);
var aa=o*((F-X*Y)-X*Z);
var ab=W*W;
var t=ab*ab*((kMath[55+0])
+ab*((kMath[55+1])
+ab*((kMath[55+2])
+ab*(
(kMath[55+3])
+ab*((kMath[55+4])
+ab*(kMath[55+5])
)))));
t+=aa*(X+W);
ab=X*X;
Y=%_ConstructDouble(%_DoubleHi(3.0+ab+t),0);
Z=t-((Y-3.0)-ab);
F=X*Y;
o=aa*Y+Z*W;
p_h=%_ConstructDouble(%_DoubleHi(F+o),0);
p_l=o-(p_h-F);
z_h=kMath[62]*p_h;
z_l=kMath[63]*p_h+p_l*kMath[61]+V;
var q=u;
var ac=%_ConstructDouble(%_DoubleHi(((z_h+z_l)+U)+q),0);
var ad=z_l-(((ac-q)-U)-z_h);
return ac+ad;
}
b.InstallFunctions(c,2,[
"cos",MathCos,
"sin",MathSin,
"tan",MathTan,
"sinh",MathSinh,
"cosh",MathCosh,
"log10",MathLog10,
"log2",MathLog2,
"log1p",MathLog1p,
"expm1",MathExpm1
]);
%SetForceInlineFlag(MathSin);
%SetForceInlineFlag(MathCos);
})
date<74>
var $createDate;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Date;
var d=b.InternalArray;
var e;
var g;
var h;
b.Import(function(i){
e=i.IsFinite;
g=i.MathAbs;
h=i.MathFloor;
});
var j=$NaN;
var k;
function LocalTimezone(l){
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return"";
CheckDateCacheCurrent();
if(l==j){
return k;
}
var m=%DateLocalTimezone(l);
j=l;
k=m;
return m;
}
function UTC(n){
if((!%_IsSmi(%IS_VAR(n))&&!(n==n)))return n;
return %DateToUTC(n);
}
function MakeTime(o,p,q,r){
if(!e(o))return $NaN;
if(!e(p))return $NaN;
if(!e(q))return $NaN;
if(!e(r))return $NaN;
return(%_IsSmi(%IS_VAR(o))?o:%NumberToInteger($toNumber(o)))*3600000
+(%_IsSmi(%IS_VAR(p))?p:%NumberToInteger($toNumber(p)))*60000
+(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q)))*1000
+(%_IsSmi(%IS_VAR(r))?r:%NumberToInteger($toNumber(r)));
}
function TimeInYear(t){
return DaysInYear(t)*86400000;
}
function MakeDay(t,u,v){
if(!e(t)||!e(u)||!e(v))return $NaN;
t=(%_IsSmi(%IS_VAR(t))?t:%NumberToIntegerMapMinusZero($toNumber(t)));
u=(%_IsSmi(%IS_VAR(u))?u:%NumberToIntegerMapMinusZero($toNumber(u)));
v=(%_IsSmi(%IS_VAR(v))?v:%NumberToIntegerMapMinusZero($toNumber(v)));
if(t<-1000000||t>1000000||
u<-10000000||u>10000000){
return $NaN;
}
return %DateMakeDay(t|0,u|0)+v-1;
}
function MakeDate(w,n){
var n=w*86400000+n;
if(g(n)>8640002592000000)return $NaN;
return n;
}
function TimeClip(n){
if(!e(n))return $NaN;
if(g(n)>8640000000000000)return $NaN;
return(%_IsSmi(%IS_VAR(n))?n:%NumberToInteger($toNumber(n)));
}
var x={
time:0,
string:null
};
function DateConstructor(t,u,v,y,z,A,r){
if(!%_IsConstructCall()){
return %_CallFunction(new c(),DateToString);
}
var B=%_ArgumentsLength();
var C;
if(B==0){
C=%DateCurrentTime();
(%DateSetValue(this,C,1));
}else if(B==1){
if((typeof(t)==='number')){
C=t;
}else if((typeof(t)==='string')){
CheckDateCacheCurrent();
var D=x;
if(D.string===t){
C=D.time;
}else{
C=DateParse(t);
if(!(!%_IsSmi(%IS_VAR(C))&&!(C==C))){
D.time=C;
D.string=t;
}
}
}else{
var n=$toPrimitive(t,1);
C=(typeof(n)==='string')?DateParse(n):$toNumber(n);
}
(%DateSetValue(this,C,1));
}else{
t=$toNumber(t);
u=$toNumber(u);
v=B>2?$toNumber(v):1;
y=B>3?$toNumber(y):0;
z=B>4?$toNumber(z):0;
A=B>5?$toNumber(A):0;
r=B>6?$toNumber(r):0;
t=(!(!%_IsSmi(%IS_VAR(t))&&!(t==t))&&
0<=(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))&&
(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))<=99)?1900+(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t))):t;
var w=MakeDay(t,u,v);
var n=MakeTime(y,z,A,r);
C=MakeDate(w,n);
(%DateSetValue(this,C,0));
}
}
var E=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
var F=['Jan','Feb','Mar','Apr','May','Jun',
'Jul','Aug','Sep','Oct','Nov','Dec'];
function TwoDigitString(C){
return C<10?"0"+C:""+C;
}
function DateString(v){
if(!%_IsDate(v))%_ThrowNotDateError();
return E[(%_DateField(v,4))]+' '
+F[(%_DateField(v,2))]+' '
+TwoDigitString((%_DateField(v,3)))+' '
+(%_DateField(v,1));
}
var G=['Sunday','Monday','Tuesday','Wednesday',
'Thursday','Friday','Saturday'];
var H=['January','February','March','April','May','June',
'July','August','September','October','November','December'];
function LongDateString(v){
if(!%_IsDate(v))%_ThrowNotDateError();
return G[(%_DateField(v,4))]+', '
+H[(%_DateField(v,2))]+' '
+TwoDigitString((%_DateField(v,3)))+', '
+(%_DateField(v,1));
}
function TimeString(v){
if(!%_IsDate(v))%_ThrowNotDateError();
return TwoDigitString((%_DateField(v,5)))+':'
+TwoDigitString((%_DateField(v,6)))+':'
+TwoDigitString((%_DateField(v,7)));
}
function TimeStringUTC(v){
if(!%_IsDate(v))%_ThrowNotDateError();
return TwoDigitString((%_DateField(v,15)))+':'
+TwoDigitString((%_DateField(v,16)))+':'
+TwoDigitString((%_DateField(v,17)));
}
function LocalTimezoneString(v){
if(!%_IsDate(v))%_ThrowNotDateError();
var m=LocalTimezone((%_DateField(v,0)));
var I=-(%_DateField(v,21));
var J=(I>=0)?1:-1;
var y=h((J*I)/60);
var p=h((J*I)%60);
var K=' GMT'+((J==1)?'+':'-')+
TwoDigitString(y)+TwoDigitString(p);
return K+' ('+m+')';
}
function DatePrintString(v){
if(!%_IsDate(v))%_ThrowNotDateError();
return DateString(v)+' '+TimeString(v);
}
var L=new d(8);
function DateParse(M){
var N=%DateParseString($toString(M),L);
if((N===null))return $NaN;
var w=MakeDay(N[0],N[1],N[2]);
var n=MakeTime(N[3],N[4],N[5],N[6]);
var v=MakeDate(w,n);
if((N[7]===null)){
return TimeClip(UTC(v));
}else{
return TimeClip(v-N[7]*1000);
}
}
function DateUTC(t,u,v,y,z,A,r){
t=$toNumber(t);
u=$toNumber(u);
var B=%_ArgumentsLength();
v=B>2?$toNumber(v):1;
y=B>3?$toNumber(y):0;
z=B>4?$toNumber(z):0;
A=B>5?$toNumber(A):0;
r=B>6?$toNumber(r):0;
t=(!(!%_IsSmi(%IS_VAR(t))&&!(t==t))&&
0<=(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))&&
(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))<=99)?1900+(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t))):t;
var w=MakeDay(t,u,v);
var n=MakeTime(y,z,A,r);
return TimeClip(MakeDate(w,n));
}
function DateNow(){
return %DateCurrentTime();
}
function DateToString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0))
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
var O=LocalTimezoneString(this)
return DatePrintString(this)+O;
}
function DateToDateString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
return DateString(this);
}
function DateToTimeString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
var O=LocalTimezoneString(this);
return TimeString(this)+O;
}
function DateToLocaleString(){
if(!%_IsDate(this))%_ThrowNotDateError();
return %_CallFunction(this,DateToString);
}
function DateToLocaleDateString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
return LongDateString(this);
}
function DateToLocaleTimeString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
return TimeString(this);
}
function DateValueOf(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,0));
}
function DateGetTime(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,0));
}
function DateGetFullYear(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,1));
}
function DateGetUTCFullYear(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,11));
}
function DateGetMonth(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,2));
}
function DateGetUTCMonth(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,12));
}
function DateGetDate(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,3));
}
function DateGetUTCDate(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,13));
}
function DateGetDay(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,4));
}
function DateGetUTCDay(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,14));
}
function DateGetHours(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,5));
}
function DateGetUTCHours(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,15));
}
function DateGetMinutes(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,6));
}
function DateGetUTCMinutes(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,16));
}
function DateGetSeconds(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,7));
}
function DateGetUTCSeconds(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,17))
}
function DateGetMilliseconds(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,8));
}
function DateGetUTCMilliseconds(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,18));
}
function DateGetTimezoneOffset(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,21));
}
function DateSetTime(r){
if(!%_IsDate(this))%_ThrowNotDateError();
(%DateSetValue(this,$toNumber(r),1));
return(%_DateField(this,0));
}
function DateSetMilliseconds(r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
r=$toNumber(r);
var n=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),(%_DateField(this,7)),r);
return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0));
}
function DateSetUTCMilliseconds(r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
r=$toNumber(r);
var n=MakeTime((%_DateField(this,15)),
(%_DateField(this,16)),
(%_DateField(this,17)),
r);
return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1));
}
function DateSetSeconds(q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
q=$toNumber(q);
r=%_ArgumentsLength()<2?(%_DateField(this,8)):$toNumber(r);
var n=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0));
}
function DateSetUTCSeconds(q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
q=$toNumber(q);
r=%_ArgumentsLength()<2?(%_DateField(this,18)):$toNumber(r);
var n=MakeTime((%_DateField(this,15)),(%_DateField(this,16)),q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1));
}
function DateSetMinutes(p,q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
p=$toNumber(p);
var B=%_ArgumentsLength();
q=B<2?(%_DateField(this,7)):$toNumber(q);
r=B<3?(%_DateField(this,8)):$toNumber(r);
var n=MakeTime((%_DateField(this,5)),p,q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0));
}
function DateSetUTCMinutes(p,q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
p=$toNumber(p);
var B=%_ArgumentsLength();
q=B<2?(%_DateField(this,17)):$toNumber(q);
r=B<3?(%_DateField(this,18)):$toNumber(r);
var n=MakeTime((%_DateField(this,15)),p,q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1));
}
function DateSetHours(o,p,q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
o=$toNumber(o);
var B=%_ArgumentsLength();
p=B<2?(%_DateField(this,6)):$toNumber(p);
q=B<3?(%_DateField(this,7)):$toNumber(q);
r=B<4?(%_DateField(this,8)):$toNumber(r);
var n=MakeTime(o,p,q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0));
}
function DateSetUTCHours(o,p,q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
o=$toNumber(o);
var B=%_ArgumentsLength();
p=B<2?(%_DateField(this,16)):$toNumber(p);
q=B<3?(%_DateField(this,17)):$toNumber(q);
r=B<4?(%_DateField(this,18)):$toNumber(r);
var n=MakeTime(o,p,q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1));
}
function DateSetDate(v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
v=$toNumber(v);
var w=MakeDay((%_DateField(this,1)),(%_DateField(this,2)),v);
return(%DateSetValue(this,MakeDate(w,(%_DateField(this,10))),0));
}
function DateSetUTCDate(v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
v=$toNumber(v);
var w=MakeDay((%_DateField(this,11)),(%_DateField(this,12)),v);
return(%DateSetValue(this,MakeDate(w,(%_DateField(this,20))),1));
}
function DateSetMonth(u,v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
u=$toNumber(u);
v=%_ArgumentsLength()<2?(%_DateField(this,3)):$toNumber(v);
var w=MakeDay((%_DateField(this,1)),u,v);
return(%DateSetValue(this,MakeDate(w,(%_DateField(this,10))),0));
}
function DateSetUTCMonth(u,v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
u=$toNumber(u);
v=%_ArgumentsLength()<2?(%_DateField(this,13)):$toNumber(v);
var w=MakeDay((%_DateField(this,11)),u,v);
return(%DateSetValue(this,MakeDate(w,(%_DateField(this,20))),1));
}
function DateSetFullYear(t,u,v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
t=$toNumber(t);
var B=%_ArgumentsLength();
var n;
if((!%_IsSmi(%IS_VAR(l))&&!(l==l))){
u=B<2?0:$toNumber(u);
v=B<3?1:$toNumber(v);
n=0;
}else{
u=B<2?(%_DateField(this,2)):$toNumber(u);
v=B<3?(%_DateField(this,3)):$toNumber(v);
n=(%_DateField(this,10));
}
var w=MakeDay(t,u,v);
return(%DateSetValue(this,MakeDate(w,n),0));
}
function DateSetUTCFullYear(t,u,v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
t=$toNumber(t);
var B=%_ArgumentsLength();
var n;
if((!%_IsSmi(%IS_VAR(l))&&!(l==l))){
u=B<2?0:$toNumber(u);
v=B<3?1:$toNumber(v);
n=0;
}else{
u=B<2?(%_DateField(this,12)):$toNumber(u);
v=B<3?(%_DateField(this,13)):$toNumber(v);
n=(%_DateField(this,20));
}
var w=MakeDay(t,u,v);
return(%DateSetValue(this,MakeDate(w,n),1));
}
function DateToUTCString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
return E[(%_DateField(this,14))]+', '
+TwoDigitString((%_DateField(this,13)))+' '
+F[(%_DateField(this,12))]+' '
+(%_DateField(this,11))+' '
+TimeStringUTC(this)+' GMT';
}
function DateGetYear(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,1))-1900;
}
function DateSetYear(t){
if(!%_IsDate(this))%_ThrowNotDateError();
t=$toNumber(t);
if((!%_IsSmi(%IS_VAR(t))&&!(t==t)))return(%DateSetValue(this,$NaN,1));
t=(0<=(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))&&(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))<=99)
?1900+(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t))):t;
var l=(%_DateField(this,0)+%_DateField(this,21));
var u,v,n;
if((!%_IsSmi(%IS_VAR(l))&&!(l==l))){
u=0;
v=1;
n=0;
}else{
u=(%_DateField(this,2));
v=(%_DateField(this,3));
n=(%_DateField(this,10));
}
var w=MakeDay(t,u,v);
return(%DateSetValue(this,MakeDate(w,n),0));
}
function DateToGMTString(){
return %_CallFunction(this,DateToUTCString);
}
function PadInt(P,Q){
if(Q==1)return P;
return P<%_MathPow(10,Q-1)?'0'+PadInt(P,Q-1):P;
}
function DateToISOString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))throw MakeRangeError(136);
var t=(%_DateField(this,11));
var R;
if(t>=0&&t<=9999){
R=PadInt(t,4);
}else{
if(t<0){
R="-"+PadInt(-t,6);
}else{
R="+"+PadInt(t,6);
}
}
return R+
'-'+PadInt((%_DateField(this,12))+1,2)+
'-'+PadInt((%_DateField(this,13)),2)+
'T'+PadInt((%_DateField(this,15)),2)+
':'+PadInt((%_DateField(this,16)),2)+
':'+PadInt((%_DateField(this,17)),2)+
'.'+PadInt((%_DateField(this,18)),3)+
'Z';
}
function DateToJSON(S){
var T=$toObject(this);
var U=$defaultNumber(T);
if((typeof(U)==='number')&&!(%_IsSmi(%IS_VAR(U))||((U==U)&&(U!=1/0)&&(U!=-1/0)))){
return null;
}
return T.toISOString();
}
var V;
var W=$NaN;
function CheckDateCacheCurrent(){
if(!V){
V=%DateCacheVersion();
if(!V)return;
}
if(V[0]==W){
return;
}
W=V[0];
j=$NaN;
k=(void 0);
x.time=$NaN;
x.string=null;
}
function CreateDate(n){
var v=new c();
v.setTime(n);
return v;
}
%SetCode(c,DateConstructor);
%FunctionSetPrototype(c,new c($NaN));
b.InstallFunctions(c,2,[
"UTC",DateUTC,
"parse",DateParse,
"now",DateNow
]);
%AddNamedProperty(c.prototype,"constructor",c,2);
b.InstallFunctions(c.prototype,2,[
"toString",DateToString,
"toDateString",DateToDateString,
"toTimeString",DateToTimeString,
"toLocaleString",DateToLocaleString,
"toLocaleDateString",DateToLocaleDateString,
"toLocaleTimeString",DateToLocaleTimeString,
"valueOf",DateValueOf,
"getTime",DateGetTime,
"getFullYear",DateGetFullYear,
"getUTCFullYear",DateGetUTCFullYear,
"getMonth",DateGetMonth,
"getUTCMonth",DateGetUTCMonth,
"getDate",DateGetDate,
"getUTCDate",DateGetUTCDate,
"getDay",DateGetDay,
"getUTCDay",DateGetUTCDay,
"getHours",DateGetHours,
"getUTCHours",DateGetUTCHours,
"getMinutes",DateGetMinutes,
"getUTCMinutes",DateGetUTCMinutes,
"getSeconds",DateGetSeconds,
"getUTCSeconds",DateGetUTCSeconds,
"getMilliseconds",DateGetMilliseconds,
"getUTCMilliseconds",DateGetUTCMilliseconds,
"getTimezoneOffset",DateGetTimezoneOffset,
"setTime",DateSetTime,
"setMilliseconds",DateSetMilliseconds,
"setUTCMilliseconds",DateSetUTCMilliseconds,
"setSeconds",DateSetSeconds,
"setUTCSeconds",DateSetUTCSeconds,
"setMinutes",DateSetMinutes,
"setUTCMinutes",DateSetUTCMinutes,
"setHours",DateSetHours,
"setUTCHours",DateSetUTCHours,
"setDate",DateSetDate,
"setUTCDate",DateSetUTCDate,
"setMonth",DateSetMonth,
"setUTCMonth",DateSetUTCMonth,
"setFullYear",DateSetFullYear,
"setUTCFullYear",DateSetUTCFullYear,
"toGMTString",DateToGMTString,
"toUTCString",DateToUTCString,
"getYear",DateGetYear,
"setYear",DateSetYear,
"toISOString",DateToISOString,
"toJSON",DateToJSON
]);
$createDate=CreateDate;
})
regexp f
var $regexpLastMatchInfoOverride;
var harmony_regexps=false;
var harmony_unicode_regexps=false;
(function(a,b){
%CheckIsBootstrapping();
var c=a.RegExp;
var d=b.InternalPackedArray;
var e=new d(
2,
"",
(void 0),
0,
0
);
$regexpLastMatchInfoOverride=null;
function DoConstructRegExp(g,h,i){
if((%_IsRegExp(h))){
if(!(i===(void 0)))throw MakeTypeError(93);
i=(h.global?'g':'')
+(h.ignoreCase?'i':'')
+(h.multiline?'m':'');
if(harmony_unicode_regexps)
i+=(h.unicode?'u':'');
if(harmony_regexps)
i+=(h.sticky?'y':'');
h=h.source;
}
h=(h===(void 0))?'':$toString(h);
i=(i===(void 0))?'':$toString(i);
%RegExpInitializeAndCompile(g,h,i);
}
function RegExpConstructor(h,i){
if(%_IsConstructCall()){
DoConstructRegExp(this,h,i);
}else{
if((%_IsRegExp(h))&&(i===(void 0))){
return h;
}
return new c(h,i);
}
}
function RegExpCompileJS(h,i){
if(this==c.prototype){
throw MakeTypeError(33,
'RegExp.prototype.compile',this);
}
if((h===(void 0))&&%_ArgumentsLength()!=0){
DoConstructRegExp(this,'undefined',i);
}else{
DoConstructRegExp(this,h,i);
}
}
function DoRegExpExec(j,k,l){
var m=%_RegExpExec(j,k,l,e);
if(m!==null)$regexpLastMatchInfoOverride=null;
return m;
}
function RegExpExecNoTests(j,k,n){
var o=%_RegExpExec(j,k,n,e);
if(o!==null){
$regexpLastMatchInfoOverride=null;
var p=((o)[0])>>1;
var n=o[3];
var q=o[4];
var r=%_SubString(k,n,q);
var m=%_RegExpConstructResult(p,n,k);
m[0]=r;
if(p==1)return m;
var t=3+2;
for(var u=1;u<p;u++){
n=o[t++];
if(n!=-1){
q=o[t];
m[u]=%_SubString(k,n,q);
}
t++;
}
return m;
;
}
j.lastIndex=0;
return null;
}
function RegExpExecJS(k){
if(!(%_IsRegExp(this))){
throw MakeTypeError(33,
'RegExp.prototype.exec',this);
}
k=((typeof(%IS_VAR(k))==='string')?k:$nonStringToString(k));
var v=this.lastIndex;
var u=(%_IsSmi(%IS_VAR(v))?v:%NumberToInteger($toNumber(v)));
var w=this.global||(harmony_regexps&&this.sticky);
if(w){
if(u<0||u>k.length){
this.lastIndex=0;
return null;
}
}else{
u=0;
}
var x=%_RegExpExec(this,k,u,e);
if((x===null)){
this.lastIndex=0;
return null;
}
$regexpLastMatchInfoOverride=null;
if(w){
this.lastIndex=e[4];
}
var p=((x)[0])>>1;
var n=x[3];
var q=x[4];
var r=%_SubString(k,n,q);
var m=%_RegExpConstructResult(p,n,k);
m[0]=r;
if(p==1)return m;
var t=3+2;
for(var u=1;u<p;u++){
n=x[t++];
if(n!=-1){
q=x[t];
m[u]=%_SubString(k,n,q);
}
t++;
}
return m;
;
}
var y;
var z;
function RegExpTest(k){
if(!(%_IsRegExp(this))){
throw MakeTypeError(33,
'RegExp.prototype.test',this);
}
k=((typeof(%IS_VAR(k))==='string')?k:$nonStringToString(k));
var v=this.lastIndex;
var u=(%_IsSmi(%IS_VAR(v))?v:%NumberToInteger($toNumber(v)));
if(this.global||(harmony_regexps&&this.sticky)){
if(u<0||u>k.length){
this.lastIndex=0;
return false;
}
var x=%_RegExpExec(this,k,u,e);
if((x===null)){
this.lastIndex=0;
return false;
}
$regexpLastMatchInfoOverride=null;
this.lastIndex=e[4];
return true;
}else{
var j=this;
if(j.source.length>=3&&
%_StringCharCodeAt(j.source,0)==46&&
%_StringCharCodeAt(j.source,1)==42&&
%_StringCharCodeAt(j.source,2)!=63){
j=TrimRegExp(j);
}
var x=%_RegExpExec(j,k,0,e);
if((x===null)){
this.lastIndex=0;
return false;
}
$regexpLastMatchInfoOverride=null;
return true;
}
}
function TrimRegExp(j){
if(!%_ObjectEquals(y,j)){
y=j;
z=
new c(%_SubString(j.source,2,j.source.length),
(j.ignoreCase?j.multiline?"im":"i"
:j.multiline?"m":""));
}
return z;
}
function RegExpToString(){
if(!(%_IsRegExp(this))){
throw MakeTypeError(33,
'RegExp.prototype.toString',this);
}
var m='/'+this.source+'/';
if(this.global)m+='g';
if(this.ignoreCase)m+='i';
if(this.multiline)m+='m';
if(harmony_unicode_regexps&&this.unicode)m+='u';
if(harmony_regexps&&this.sticky)m+='y';
return m;
}
function RegExpGetLastMatch(){
if($regexpLastMatchInfoOverride!==null){
return(($regexpLastMatchInfoOverride)[0]);
}
var A=((e)[1]);
return %_SubString(A,
e[3],
e[4]);
}
function RegExpGetLastParen(){
if($regexpLastMatchInfoOverride){
var B=$regexpLastMatchInfoOverride;
if(B.length<=3)return'';
return B[B.length-3];
}
var C=((e)[0]);
if(C<=2)return'';
var A=((e)[1]);
var n=e[(3+(C-2))];
var q=e[(3+(C-1))];
if(n!=-1&&q!=-1){
return %_SubString(A,n,q);
}
return"";
}
function RegExpGetLeftContext(){
var D;
var E;
if(!$regexpLastMatchInfoOverride){
D=e[3];
E=((e)[1]);
}else{
var B=$regexpLastMatchInfoOverride;
D=((B)[(B).length-2]);
E=((B)[(B).length-1]);
}
return %_SubString(E,0,D);
}
function RegExpGetRightContext(){
var D;
var E;
if(!$regexpLastMatchInfoOverride){
D=e[4];
E=((e)[1]);
}else{
var B=$regexpLastMatchInfoOverride;
E=((B)[(B).length-1]);
var F=((B)[0]);
D=((B)[(B).length-2])+F.length;
}
return %_SubString(E,D,E.length);
}
function RegExpMakeCaptureGetter(G){
return function foo(){
if($regexpLastMatchInfoOverride){
if(G<$regexpLastMatchInfoOverride.length-2){
return(($regexpLastMatchInfoOverride)[(G)]);
}
return'';
}
var l=G*2;
if(l>=((e)[0]))return'';
var H=e[(3+(l))];
var I=e[(3+(l+1))];
if(H==-1||I==-1)return'';
return %_SubString(((e)[1]),H,I);
};
}
%FunctionSetInstanceClassName(c,'RegExp');
%AddNamedProperty(
c.prototype,'constructor',c,2);
%SetCode(c,RegExpConstructor);
b.InstallFunctions(c.prototype,2,[
"exec",RegExpExecJS,
"test",RegExpTest,
"toString",RegExpToString,
"compile",RegExpCompileJS
]);
%FunctionSetLength(c.prototype.compile,1);
var J=function(){
var K=((e)[2]);
return(K===(void 0))?"":K;
};
var L=function(k){
((e)[2])=$toString(k);
};
%OptimizeObjectForAddingMultipleProperties(c,22);
%DefineAccessorPropertyUnchecked(c,'input',J,
L,4);
%DefineAccessorPropertyUnchecked(c,'$_',J,
L,2|4);
var M=false;
var N=function(){return M;};
var O=function(P){M=P?true:false;};
%DefineAccessorPropertyUnchecked(c,'multiline',N,
O,4);
%DefineAccessorPropertyUnchecked(c,'$*',N,
O,
2|4);
var Q=function(R){};
%DefineAccessorPropertyUnchecked(c,'lastMatch',RegExpGetLastMatch,
Q,4);
%DefineAccessorPropertyUnchecked(c,'$&',RegExpGetLastMatch,
Q,2|4);
%DefineAccessorPropertyUnchecked(c,'lastParen',RegExpGetLastParen,
Q,4);
%DefineAccessorPropertyUnchecked(c,'$+',RegExpGetLastParen,
Q,2|4);
%DefineAccessorPropertyUnchecked(c,'leftContext',
RegExpGetLeftContext,Q,
4);
%DefineAccessorPropertyUnchecked(c,'$`',RegExpGetLeftContext,
Q,2|4);
%DefineAccessorPropertyUnchecked(c,'rightContext',
RegExpGetRightContext,Q,
4);
%DefineAccessorPropertyUnchecked(c,"$'",RegExpGetRightContext,
Q,2|4);
for(var u=1;u<10;++u){
%DefineAccessorPropertyUnchecked(c,'$'+u,
RegExpMakeCaptureGetter(u),Q,
4);
}
%ToFastProperties(c);
b.Export(function(S){
S.RegExpExec=DoRegExpExec;
S.RegExpExecNoTests=RegExpExecNoTests;
S.RegExpLastMatchInfo=e;
S.RegExpTest=RegExpTest;
});
})
,arraybufferi
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.ArrayBuffer;
var d=a.Object;
var e;
var g;
b.Import(function(h){
e=h.MathMax;
g=h.MathMin;
});
function ArrayBufferConstructor(i){
if(%_IsConstructCall()){
var j=$toPositiveInteger(i,124);
%ArrayBufferInitialize(this,j,false);
}else{
throw MakeTypeError(20,"ArrayBuffer");
}
}
function ArrayBufferGetByteLen(){
if(!(%_ClassOf(this)==='ArrayBuffer')){
throw MakeTypeError(33,
'ArrayBuffer.prototype.byteLength',this);
}
return %_ArrayBufferGetByteLength(this);
}
function ArrayBufferSlice(k,l){
if(!(%_ClassOf(this)==='ArrayBuffer')){
throw MakeTypeError(33,
'ArrayBuffer.prototype.slice',this);
}
var m=(%_IsSmi(%IS_VAR(k))?k:%NumberToInteger($toNumber(k)));
if(!(l===(void 0))){
l=(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger($toNumber(l)));
}
var n;
var o=%_ArrayBufferGetByteLength(this);
if(m<0){
n=e(o+m,0);
}else{
n=g(m,o);
}
var p=(l===(void 0))?o:l;
var q;
if(p<0){
q=e(o+p,0);
}else{
q=g(p,o);
}
if(q<n){
q=n;
}
var r=q-n;
var t=new c(r);
%ArrayBufferSliceImpl(this,t,n);
return t;
}
function ArrayBufferIsViewJS(u){
return %ArrayBufferIsView(u);
}
%SetCode(c,ArrayBufferConstructor);
%FunctionSetPrototype(c,new d());
%AddNamedProperty(
c.prototype,"constructor",c,2);
%AddNamedProperty(c.prototype,
symbolToStringTag,"ArrayBuffer",2|1);
b.InstallGetter(c.prototype,"byteLength",ArrayBufferGetByteLen);
b.InstallFunctions(c,2,[
"isView",ArrayBufferIsViewJS
]);
b.InstallFunctions(c.prototype,2,[
"slice",ArrayBufferSlice
]);
})
(typedarray<61><79>
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Array;
var d=a.ArrayBuffer;
var e=a.DataView;
var g=a.Object;
var h=a.Uint8Array;
var i=a.Int8Array;
var j=a.Uint16Array;
var k=a.Int16Array;
var l=a.Uint32Array;
var m=a.Int32Array;
var n=a.Float32Array;
var o=a.Float64Array;
var p=a.Uint8ClampedArray;
var q;
var r;
b.Import(function(t){
q=t.MathMax;
r=t.MathMin;
});
var u=b.InternalArray;
function Uint8ArrayConstructByArrayBuffer(v,w,x,y){
if(!(x===(void 0))){
x=
$toPositiveInteger(x,138);
}
if(!(y===(void 0))){
y=$toPositiveInteger(y,138);
}
var z=%_ArrayBufferGetByteLength(w);
var A;
if((x===(void 0))){
A=0;
}else{
A=x;
if(A % 1!==0){
throw MakeRangeError(137,
"start offset","Uint8Array",1);
}
if(A>z){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 1!==0){
throw MakeRangeError(137,
"byte length","Uint8Array",1);
}
B=z-A;
C=B/1;
}else{
var C=y;
B=C*1;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,1,w,A,B,true);
}
function Uint8ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*1;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,1,w,0,E,true);
}else{
%_TypedArrayInitialize(v,1,null,0,E,true);
}
}
function Uint8ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*1;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,1,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,1,F,D);
}
if(!G){
for(var H=0;H<D;H++){
v[H]=F[H];
}
}
}
function Uint8ArrayConstructByIterable(v,I,J){
var K=new u();
var L=%_CallFunction(I,J);
var M={
__proto__:null
};
M[symbolIterator]=function(){return L;}
for(var N of M){
K.push(N);
}
Uint8ArrayConstructByArrayLike(v,K);
}
function Uint8ArrayConstructor(O,P,Q){
if(%_IsConstructCall()){
if((%_ClassOf(O)==='ArrayBuffer')||(%_ClassOf(O)==='SharedArrayBuffer')){
Uint8ArrayConstructByArrayBuffer(this,O,P,Q);
}else if((typeof(O)==='number')||(typeof(O)==='string')||
(typeof(O)==='boolean')||(O===(void 0))){
Uint8ArrayConstructByLength(this,O);
}else{
var J=O[symbolIterator];
if((J===(void 0))||J===$arrayValues){
Uint8ArrayConstructByArrayLike(this,O);
}else{
Uint8ArrayConstructByIterable(this,O,J);
}
}
}else{
throw MakeTypeError(20,"Uint8Array")
}
}
function Uint8Array_GetBuffer(){
if(!(%_ClassOf(this)==='Uint8Array')){
throw MakeTypeError(33,"Uint8Array.buffer",this);
}
return %TypedArrayGetBuffer(this);
}
function Uint8Array_GetByteLength(){
if(!(%_ClassOf(this)==='Uint8Array')){
throw MakeTypeError(33,"Uint8Array.byteLength",this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function Uint8Array_GetByteOffset(){
if(!(%_ClassOf(this)==='Uint8Array')){
throw MakeTypeError(33,"Uint8Array.byteOffset",this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function Uint8Array_GetLength(){
if(!(%_ClassOf(this)==='Uint8Array')){
throw MakeTypeError(33,"Uint8Array.length",this);
}
return %_TypedArrayGetLength(this);
}
function Uint8ArraySubArray(R,S){
if(!(%_ClassOf(this)==='Uint8Array')){
throw MakeTypeError(33,"Uint8Array.subarray",this);
}
var T=(%_IsSmi(%IS_VAR(R))?R:%NumberToInteger($toNumber(R)));
if(!(S===(void 0))){
S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
}
var U=%_TypedArrayGetLength(this);
if(T<0){
T=q(0,U+T);
}else{
T=r(U,T);
}
var V=(S===(void 0))?U:S;
if(V<0){
V=q(0,U+V);
}else{
V=r(V,U);
}
if(V<T){
V=T;
}
var C=V-T;
var W=
%_ArrayBufferViewGetByteOffset(this)+T*1;
return new h(%TypedArrayGetBuffer(this),
W,C);
}
function Int8ArrayConstructByArrayBuffer(v,w,x,y){
if(!(x===(void 0))){
x=
$toPositiveInteger(x,138);
}
if(!(y===(void 0))){
y=$toPositiveInteger(y,138);
}
var z=%_ArrayBufferGetByteLength(w);
var A;
if((x===(void 0))){
A=0;
}else{
A=x;
if(A % 1!==0){
throw MakeRangeError(137,
"start offset","Int8Array",1);
}
if(A>z){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 1!==0){
throw MakeRangeError(137,
"byte length","Int8Array",1);
}
B=z-A;
C=B/1;
}else{
var C=y;
B=C*1;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,2,w,A,B,true);
}
function Int8ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*1;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,2,w,0,E,true);
}else{
%_TypedArrayInitialize(v,2,null,0,E,true);
}
}
function Int8ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*1;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,2,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,2,F,D);
}
if(!G){
for(var H=0;H<D;H++){
v[H]=F[H];
}
}
}
function Int8ArrayConstructByIterable(v,I,J){
var K=new u();
var L=%_CallFunction(I,J);
var M={
__proto__:null
};
M[symbolIterator]=function(){return L;}
for(var N of M){
K.push(N);
}
Int8ArrayConstructByArrayLike(v,K);
}
function Int8ArrayConstructor(O,P,Q){
if(%_IsConstructCall()){
if((%_ClassOf(O)==='ArrayBuffer')||(%_ClassOf(O)==='SharedArrayBuffer')){
Int8ArrayConstructByArrayBuffer(this,O,P,Q);
}else if((typeof(O)==='number')||(typeof(O)==='string')||
(typeof(O)==='boolean')||(O===(void 0))){
Int8ArrayConstructByLength(this,O);
}else{
var J=O[symbolIterator];
if((J===(void 0))||J===$arrayValues){
Int8ArrayConstructByArrayLike(this,O);
}else{
Int8ArrayConstructByIterable(this,O,J);
}
}
}else{
throw MakeTypeError(20,"Int8Array")
}
}
function Int8Array_GetBuffer(){
if(!(%_ClassOf(this)==='Int8Array')){
throw MakeTypeError(33,"Int8Array.buffer",this);
}
return %TypedArrayGetBuffer(this);
}
function Int8Array_GetByteLength(){
if(!(%_ClassOf(this)==='Int8Array')){
throw MakeTypeError(33,"Int8Array.byteLength",this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function Int8Array_GetByteOffset(){
if(!(%_ClassOf(this)==='Int8Array')){
throw MakeTypeError(33,"Int8Array.byteOffset",this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function Int8Array_GetLength(){
if(!(%_ClassOf(this)==='Int8Array')){
throw MakeTypeError(33,"Int8Array.length",this);
}
return %_TypedArrayGetLength(this);
}
function Int8ArraySubArray(R,S){
if(!(%_ClassOf(this)==='Int8Array')){
throw MakeTypeError(33,"Int8Array.subarray",this);
}
var T=(%_IsSmi(%IS_VAR(R))?R:%NumberToInteger($toNumber(R)));
if(!(S===(void 0))){
S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
}
var U=%_TypedArrayGetLength(this);
if(T<0){
T=q(0,U+T);
}else{
T=r(U,T);
}
var V=(S===(void 0))?U:S;
if(V<0){
V=q(0,U+V);
}else{
V=r(V,U);
}
if(V<T){
V=T;
}
var C=V-T;
var W=
%_ArrayBufferViewGetByteOffset(this)+T*1;
return new i(%TypedArrayGetBuffer(this),
W,C);
}
function Uint16ArrayConstructByArrayBuffer(v,w,x,y){
if(!(x===(void 0))){
x=
$toPositiveInteger(x,138);
}
if(!(y===(void 0))){
y=$toPositiveInteger(y,138);
}
var z=%_ArrayBufferGetByteLength(w);
var A;
if((x===(void 0))){
A=0;
}else{
A=x;
if(A % 2!==0){
throw MakeRangeError(137,
"start offset","Uint16Array",2);
}
if(A>z){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 2!==0){
throw MakeRangeError(137,
"byte length","Uint16Array",2);
}
B=z-A;
C=B/2;
}else{
var C=y;
B=C*2;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,3,w,A,B,true);
}
function Uint16ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*2;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,3,w,0,E,true);
}else{
%_TypedArrayInitialize(v,3,null,0,E,true);
}
}
function Uint16ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*2;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,3,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,3,F,D);
}
if(!G){
for(var H=0;H<D;H++){
v[H]=F[H];
}
}
}
function Uint16ArrayConstructByIterable(v,I,J){
var K=new u();
var L=%_CallFunction(I,J);
var M={
__proto__:null
};
M[symbolIterator]=function(){return L;}
for(var N of M){
K.push(N);
}
Uint16ArrayConstructByArrayLike(v,K);
}
function Uint16ArrayConstructor(O,P,Q){
if(%_IsConstructCall()){
if((%_ClassOf(O)==='ArrayBuffer')||(%_ClassOf(O)==='SharedArrayBuffer')){
Uint16ArrayConstructByArrayBuffer(this,O,P,Q);
}else if((typeof(O)==='number')||(typeof(O)==='string')||
(typeof(O)==='boolean')||(O===(void 0))){
Uint16ArrayConstructByLength(this,O);
}else{
var J=O[symbolIterator];
if((J===(void 0))||J===$arrayValues){
Uint16ArrayConstructByArrayLike(this,O);
}else{
Uint16ArrayConstructByIterable(this,O,J);
}
}
}else{
throw MakeTypeError(20,"Uint16Array")
}
}
function Uint16Array_GetBuffer(){
if(!(%_ClassOf(this)==='Uint16Array')){
throw MakeTypeError(33,"Uint16Array.buffer",this);
}
return %TypedArrayGetBuffer(this);
}
function Uint16Array_GetByteLength(){
if(!(%_ClassOf(this)==='Uint16Array')){
throw MakeTypeError(33,"Uint16Array.byteLength",this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function Uint16Array_GetByteOffset(){
if(!(%_ClassOf(this)==='Uint16Array')){
throw MakeTypeError(33,"Uint16Array.byteOffset",this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function Uint16Array_GetLength(){
if(!(%_ClassOf(this)==='Uint16Array')){
throw MakeTypeError(33,"Uint16Array.length",this);
}
return %_TypedArrayGetLength(this);
}
function Uint16ArraySubArray(R,S){
if(!(%_ClassOf(this)==='Uint16Array')){
throw MakeTypeError(33,"Uint16Array.subarray",this);
}
var T=(%_IsSmi(%IS_VAR(R))?R:%NumberToInteger($toNumber(R)));
if(!(S===(void 0))){
S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
}
var U=%_TypedArrayGetLength(this);
if(T<0){
T=q(0,U+T);
}else{
T=r(U,T);
}
var V=(S===(void 0))?U:S;
if(V<0){
V=q(0,U+V);
}else{
V=r(V,U);
}
if(V<T){
V=T;
}
var C=V-T;
var W=
%_ArrayBufferViewGetByteOffset(this)+T*2;
return new j(%TypedArrayGetBuffer(this),
W,C);
}
function Int16ArrayConstructByArrayBuffer(v,w,x,y){
if(!(x===(void 0))){
x=
$toPositiveInteger(x,138);
}
if(!(y===(void 0))){
y=$toPositiveInteger(y,138);
}
var z=%_ArrayBufferGetByteLength(w);
var A;
if((x===(void 0))){
A=0;
}else{
A=x;
if(A % 2!==0){
throw MakeRangeError(137,
"start offset","Int16Array",2);
}
if(A>z){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 2!==0){
throw MakeRangeError(137,
"byte length","Int16Array",2);
}
B=z-A;
C=B/2;
}else{
var C=y;
B=C*2;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,4,w,A,B,true);
}
function Int16ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*2;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,4,w,0,E,true);
}else{
%_TypedArrayInitialize(v,4,null,0,E,true);
}
}
function Int16ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*2;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,4,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,4,F,D);
}
if(!G){
for(var H=0;H<D;H++){
v[H]=F[H];
}
}
}
function Int16ArrayConstructByIterable(v,I,J){
var K=new u();
var L=%_CallFunction(I,J);
var M={
__proto__:null
};
M[symbolIterator]=function(){return L;}
for(var N of M){
K.push(N);
}
Int16ArrayConstructByArrayLike(v,K);
}
function Int16ArrayConstructor(O,P,Q){
if(%_IsConstructCall()){
if((%_ClassOf(O)==='ArrayBuffer')||(%_ClassOf(O)==='SharedArrayBuffer')){
Int16ArrayConstructByArrayBuffer(this,O,P,Q);
}else if((typeof(O)==='number')||(typeof(O)==='string')||
(typeof(O)==='boolean')||(O===(void 0))){
Int16ArrayConstructByLength(this,O);
}else{
var J=O[symbolIterator];
if((J===(void 0))||J===$arrayValues){
Int16ArrayConstructByArrayLike(this,O);
}else{
Int16ArrayConstructByIterable(this,O,J);
}
}
}else{
throw MakeTypeError(20,"Int16Array")
}
}
function Int16Array_GetBuffer(){
if(!(%_ClassOf(this)==='Int16Array')){
throw MakeTypeError(33,"Int16Array.buffer",this);
}
return %TypedArrayGetBuffer(this);
}
function Int16Array_GetByteLength(){
if(!(%_ClassOf(this)==='Int16Array')){
throw MakeTypeError(33,"Int16Array.byteLength",this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function Int16Array_GetByteOffset(){
if(!(%_ClassOf(this)==='Int16Array')){
throw MakeTypeError(33,"Int16Array.byteOffset",this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function Int16Array_GetLength(){
if(!(%_ClassOf(this)==='Int16Array')){
throw MakeTypeError(33,"Int16Array.length",this);
}
return %_TypedArrayGetLength(this);
}
function Int16ArraySubArray(R,S){
if(!(%_ClassOf(this)==='Int16Array')){
throw MakeTypeError(33,"Int16Array.subarray",this);
}
var T=(%_IsSmi(%IS_VAR(R))?R:%NumberToInteger($toNumber(R)));
if(!(S===(void 0))){
S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
}
var U=%_TypedArrayGetLength(this);
if(T<0){
T=q(0,U+T);
}else{
T=r(U,T);
}
var V=(S===(void 0))?U:S;
if(V<0){
V=q(0,U+V);
}else{
V=r(V,U);
}
if(V<T){
V=T;
}
var C=V-T;
var W=
%_ArrayBufferViewGetByteOffset(this)+T*2;
return new k(%TypedArrayGetBuffer(this),
W,C);
}
function Uint32ArrayConstructByArrayBuffer(v,w,x,y){
if(!(x===(void 0))){
x=
$toPositiveInteger(x,138);
}
if(!(y===(void 0))){
y=$toPositiveInteger(y,138);
}
var z=%_ArrayBufferGetByteLength(w);
var A;
if((x===(void 0))){
A=0;
}else{
A=x;
if(A % 4!==0){
throw MakeRangeError(137,
"start offset","Uint32Array",4);
}
if(A>z){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 4!==0){
throw MakeRangeError(137,
"byte length","Uint32Array",4);
}
B=z-A;
C=B/4;
}else{
var C=y;
B=C*4;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,5,w,A,B,true);
}
function Uint32ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*4;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,5,w,0,E,true);
}else{
%_TypedArrayInitialize(v,5,null,0,E,true);
}
}
function Uint32ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*4;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,5,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,5,F,D);
}
if(!G){
for(var H=0;H<D;H++){
v[H]=F[H];
}
}
}
function Uint32ArrayConstructByIterable(v,I,J){
var K=new u();
var L=%_CallFunction(I,J);
var M={
__proto__:null
};
M[symbolIterator]=function(){return L;}
for(var N of M){
K.push(N);
}
Uint32ArrayConstructByArrayLike(v,K);
}
function Uint32ArrayConstructor(O,P,Q){
if(%_IsConstructCall()){
if((%_ClassOf(O)==='ArrayBuffer')||(%_ClassOf(O)==='SharedArrayBuffer')){
Uint32ArrayConstructByArrayBuffer(this,O,P,Q);
}else if((typeof(O)==='number')||(typeof(O)==='string')||
(typeof(O)==='boolean')||(O===(void 0))){
Uint32ArrayConstructByLength(this,O);
}else{
var J=O[symbolIterator];
if((J===(void 0))||J===$arrayValues){
Uint32ArrayConstructByArrayLike(this,O);
}else{
Uint32ArrayConstructByIterable(this,O,J);
}
}
}else{
throw MakeTypeError(20,"Uint32Array")
}
}
function Uint32Array_GetBuffer(){
if(!(%_ClassOf(this)==='Uint32Array')){
throw MakeTypeError(33,"Uint32Array.buffer",this);
}
return %TypedArrayGetBuffer(this);
}
function Uint32Array_GetByteLength(){
if(!(%_ClassOf(this)==='Uint32Array')){
throw MakeTypeError(33,"Uint32Array.byteLength",this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function Uint32Array_GetByteOffset(){
if(!(%_ClassOf(this)==='Uint32Array')){
throw MakeTypeError(33,"Uint32Array.byteOffset",this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function Uint32Array_GetLength(){
if(!(%_ClassOf(this)==='Uint32Array')){
throw MakeTypeError(33,"Uint32Array.length",this);
}
return %_TypedArrayGetLength(this);
}
function Uint32ArraySubArray(R,S){
if(!(%_ClassOf(this)==='Uint32Array')){
throw MakeTypeError(33,"Uint32Array.subarray",this);
}
var T=(%_IsSmi(%IS_VAR(R))?R:%NumberToInteger($toNumber(R)));
if(!(S===(void 0))){
S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
}
var U=%_TypedArrayGetLength(this);
if(T<0){
T=q(0,U+T);
}else{
T=r(U,T);
}
var V=(S===(void 0))?U:S;
if(V<0){
V=q(0,U+V);
}else{
V=r(V,U);
}
if(V<T){
V=T;
}
var C=V-T;
var W=
%_ArrayBufferViewGetByteOffset(this)+T*4;
return new l(%TypedArrayGetBuffer(this),
W,C);
}
function Int32ArrayConstructByArrayBuffer(v,w,x,y){
if(!(x===(void 0))){
x=
$toPositiveInteger(x,138);
}
if(!(y===(void 0))){
y=$toPositiveInteger(y,138);
}
var z=%_ArrayBufferGetByteLength(w);
var A;
if((x===(void 0))){
A=0;
}else{
A=x;
if(A % 4!==0){
throw MakeRangeError(137,
"start offset","Int32Array",4);
}
if(A>z){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 4!==0){
throw MakeRangeError(137,
"byte length","Int32Array",4);
}
B=z-A;
C=B/4;
}else{
var C=y;
B=C*4;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,6,w,A,B,true);
}
function Int32ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*4;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,6,w,0,E,true);
}else{
%_TypedArrayInitialize(v,6,null,0,E,true);
}
}
function Int32ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*4;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,6,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,6,F,D);
}
if(!G){
for(var H=0;H<D;H++){
v[H]=F[H];
}
}
}
function Int32ArrayConstructByIterable(v,I,J){
var K=new u();
var L=%_CallFunction(I,J);
var M={
__proto__:null
};
M[symbolIterator]=function(){return L;}
for(var N of M){
K.push(N);
}
Int32ArrayConstructByArrayLike(v,K);
}
function Int32ArrayConstructor(O,P,Q){
if(%_IsConstructCall()){
if((%_ClassOf(O)==='ArrayBuffer')||(%_ClassOf(O)==='SharedArrayBuffer')){
Int32ArrayConstructByArrayBuffer(this,O,P,Q);
}else if((typeof(O)==='number')||(typeof(O)==='string')||
(typeof(O)==='boolean')||(O===(void 0))){
Int32ArrayConstructByLength(this,O);
}else{
var J=O[symbolIterator];
if((J===(void 0))||J===$arrayValues){
Int32ArrayConstructByArrayLike(this,O);
}else{
Int32ArrayConstructByIterable(this,O,J);
}
}
}else{
throw MakeTypeError(20,"Int32Array")
}
}
function Int32Array_GetBuffer(){
if(!(%_ClassOf(this)==='Int32Array')){
throw MakeTypeError(33,"Int32Array.buffer",this);
}
return %TypedArrayGetBuffer(this);
}
function Int32Array_GetByteLength(){
if(!(%_ClassOf(this)==='Int32Array')){
throw MakeTypeError(33,"Int32Array.byteLength",this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function Int32Array_GetByteOffset(){
if(!(%_ClassOf(this)==='Int32Array')){
throw MakeTypeError(33,"Int32Array.byteOffset",this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function Int32Array_GetLength(){
if(!(%_ClassOf(this)==='Int32Array')){
throw MakeTypeError(33,"Int32Array.length",this);
}
return %_TypedArrayGetLength(this);
}
function Int32ArraySubArray(R,S){
if(!(%_ClassOf(this)==='Int32Array')){
throw MakeTypeError(33,"Int32Array.subarray",this);
}
var T=(%_IsSmi(%IS_VAR(R))?R:%NumberToInteger($toNumber(R)));
if(!(S===(void 0))){
S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
}
var U=%_TypedArrayGetLength(this);
if(T<0){
T=q(0,U+T);
}else{
T=r(U,T);
}
var V=(S===(void 0))?U:S;
if(V<0){
V=q(0,U+V);
}else{
V=r(V,U);
}
if(V<T){
V=T;
}
var C=V-T;
var W=
%_ArrayBufferViewGetByteOffset(this)+T*4;
return new m(%TypedArrayGetBuffer(this),
W,C);
}
function Float32ArrayConstructByArrayBuffer(v,w,x,y){
if(!(x===(void 0))){
x=
$toPositiveInteger(x,138);
}
if(!(y===(void 0))){
y=$toPositiveInteger(y,138);
}
var z=%_ArrayBufferGetByteLength(w);
var A;
if((x===(void 0))){
A=0;
}else{
A=x;
if(A % 4!==0){
throw MakeRangeError(137,
"start offset","Float32Array",4);
}
if(A>z){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 4!==0){
throw MakeRangeError(137,
"byte length","Float32Array",4);
}
B=z-A;
C=B/4;
}else{
var C=y;
B=C*4;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,7,w,A,B,true);
}
function Float32ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*4;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,7,w,0,E,true);
}else{
%_TypedArrayInitialize(v,7,null,0,E,true);
}
}
function Float32ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*4;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,7,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,7,F,D);
}
if(!G){
for(var H=0;H<D;H++){
v[H]=F[H];
}
}
}
function Float32ArrayConstructByIterable(v,I,J){
var K=new u();
var L=%_CallFunction(I,J);
var M={
__proto__:null
};
M[symbolIterator]=function(){return L;}
for(var N of M){
K.push(N);
}
Float32ArrayConstructByArrayLike(v,K);
}
function Float32ArrayConstructor(O,P,Q){
if(%_IsConstructCall()){
if((%_ClassOf(O)==='ArrayBuffer')||(%_ClassOf(O)==='SharedArrayBuffer')){
Float32ArrayConstructByArrayBuffer(this,O,P,Q);
}else if((typeof(O)==='number')||(typeof(O)==='string')||
(typeof(O)==='boolean')||(O===(void 0))){
Float32ArrayConstructByLength(this,O);
}else{
var J=O[symbolIterator];
if((J===(void 0))||J===$arrayValues){
Float32ArrayConstructByArrayLike(this,O);
}else{
Float32ArrayConstructByIterable(this,O,J);
}
}
}else{
throw MakeTypeError(20,"Float32Array")
}
}
function Float32Array_GetBuffer(){
if(!(%_ClassOf(this)==='Float32Array')){
throw MakeTypeError(33,"Float32Array.buffer",this);
}
return %TypedArrayGetBuffer(this);
}
function Float32Array_GetByteLength(){
if(!(%_ClassOf(this)==='Float32Array')){
throw MakeTypeError(33,"Float32Array.byteLength",this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function Float32Array_GetByteOffset(){
if(!(%_ClassOf(this)==='Float32Array')){
throw MakeTypeError(33,"Float32Array.byteOffset",this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function Float32Array_GetLength(){
if(!(%_ClassOf(this)==='Float32Array')){
throw MakeTypeError(33,"Float32Array.length",this);
}
return %_TypedArrayGetLength(this);
}
function Float32ArraySubArray(R,S){
if(!(%_ClassOf(this)==='Float32Array')){
throw MakeTypeError(33,"Float32Array.subarray",this);
}
var T=(%_IsSmi(%IS_VAR(R))?R:%NumberToInteger($toNumber(R)));
if(!(S===(void 0))){
S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
}
var U=%_TypedArrayGetLength(this);
if(T<0){
T=q(0,U+T);
}else{
T=r(U,T);
}
var V=(S===(void 0))?U:S;
if(V<0){
V=q(0,U+V);
}else{
V=r(V,U);
}
if(V<T){
V=T;
}
var C=V-T;
var W=
%_ArrayBufferViewGetByteOffset(this)+T*4;
return new n(%TypedArrayGetBuffer(this),
W,C);
}
function Float64ArrayConstructByArrayBuffer(v,w,x,y){
if(!(x===(void 0))){
x=
$toPositiveInteger(x,138);
}
if(!(y===(void 0))){
y=$toPositiveInteger(y,138);
}
var z=%_ArrayBufferGetByteLength(w);
var A;
if((x===(void 0))){
A=0;
}else{
A=x;
if(A % 8!==0){
throw MakeRangeError(137,
"start offset","Float64Array",8);
}
if(A>z){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 8!==0){
throw MakeRangeError(137,
"byte length","Float64Array",8);
}
B=z-A;
C=B/8;
}else{
var C=y;
B=C*8;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,8,w,A,B,true);
}
function Float64ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*8;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,8,w,0,E,true);
}else{
%_TypedArrayInitialize(v,8,null,0,E,true);
}
}
function Float64ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*8;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,8,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,8,F,D);
}
if(!G){
for(var H=0;H<D;H++){
v[H]=F[H];
}
}
}
function Float64ArrayConstructByIterable(v,I,J){
var K=new u();
var L=%_CallFunction(I,J);
var M={
__proto__:null
};
M[symbolIterator]=function(){return L;}
for(var N of M){
K.push(N);
}
Float64ArrayConstructByArrayLike(v,K);
}
function Float64ArrayConstructor(O,P,Q){
if(%_IsConstructCall()){
if((%_ClassOf(O)==='ArrayBuffer')||(%_ClassOf(O)==='SharedArrayBuffer')){
Float64ArrayConstructByArrayBuffer(this,O,P,Q);
}else if((typeof(O)==='number')||(typeof(O)==='string')||
(typeof(O)==='boolean')||(O===(void 0))){
Float64ArrayConstructByLength(this,O);
}else{
var J=O[symbolIterator];
if((J===(void 0))||J===$arrayValues){
Float64ArrayConstructByArrayLike(this,O);
}else{
Float64ArrayConstructByIterable(this,O,J);
}
}
}else{
throw MakeTypeError(20,"Float64Array")
}
}
function Float64Array_GetBuffer(){
if(!(%_ClassOf(this)==='Float64Array')){
throw MakeTypeError(33,"Float64Array.buffer",this);
}
return %TypedArrayGetBuffer(this);
}
function Float64Array_GetByteLength(){
if(!(%_ClassOf(this)==='Float64Array')){
throw MakeTypeError(33,"Float64Array.byteLength",this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function Float64Array_GetByteOffset(){
if(!(%_ClassOf(this)==='Float64Array')){
throw MakeTypeError(33,"Float64Array.byteOffset",this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function Float64Array_GetLength(){
if(!(%_ClassOf(this)==='Float64Array')){
throw MakeTypeError(33,"Float64Array.length",this);
}
return %_TypedArrayGetLength(this);
}
function Float64ArraySubArray(R,S){
if(!(%_ClassOf(this)==='Float64Array')){
throw MakeTypeError(33,"Float64Array.subarray",this);
}
var T=(%_IsSmi(%IS_VAR(R))?R:%NumberToInteger($toNumber(R)));
if(!(S===(void 0))){
S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
}
var U=%_TypedArrayGetLength(this);
if(T<0){
T=q(0,U+T);
}else{
T=r(U,T);
}
var V=(S===(void 0))?U:S;
if(V<0){
V=q(0,U+V);
}else{
V=r(V,U);
}
if(V<T){
V=T;
}
var C=V-T;
var W=
%_ArrayBufferViewGetByteOffset(this)+T*8;
return new o(%TypedArrayGetBuffer(this),
W,C);
}
function Uint8ClampedArrayConstructByArrayBuffer(v,w,x,y){
if(!(x===(void 0))){
x=
$toPositiveInteger(x,138);
}
if(!(y===(void 0))){
y=$toPositiveInteger(y,138);
}
var z=%_ArrayBufferGetByteLength(w);
var A;
if((x===(void 0))){
A=0;
}else{
A=x;
if(A % 1!==0){
throw MakeRangeError(137,
"start offset","Uint8ClampedArray",1);
}
if(A>z){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 1!==0){
throw MakeRangeError(137,
"byte length","Uint8ClampedArray",1);
}
B=z-A;
C=B/1;
}else{
var C=y;
B=C*1;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,9,w,A,B,true);
}
function Uint8ClampedArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*1;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,9,w,0,E,true);
}else{
%_TypedArrayInitialize(v,9,null,0,E,true);
}
}
function Uint8ClampedArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*1;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,9,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,9,F,D);
}
if(!G){
for(var H=0;H<D;H++){
v[H]=F[H];
}
}
}
function Uint8ClampedArrayConstructByIterable(v,I,J){
var K=new u();
var L=%_CallFunction(I,J);
var M={
__proto__:null
};
M[symbolIterator]=function(){return L;}
for(var N of M){
K.push(N);
}
Uint8ClampedArrayConstructByArrayLike(v,K);
}
function Uint8ClampedArrayConstructor(O,P,Q){
if(%_IsConstructCall()){
if((%_ClassOf(O)==='ArrayBuffer')||(%_ClassOf(O)==='SharedArrayBuffer')){
Uint8ClampedArrayConstructByArrayBuffer(this,O,P,Q);
}else if((typeof(O)==='number')||(typeof(O)==='string')||
(typeof(O)==='boolean')||(O===(void 0))){
Uint8ClampedArrayConstructByLength(this,O);
}else{
var J=O[symbolIterator];
if((J===(void 0))||J===$arrayValues){
Uint8ClampedArrayConstructByArrayLike(this,O);
}else{
Uint8ClampedArrayConstructByIterable(this,O,J);
}
}
}else{
throw MakeTypeError(20,"Uint8ClampedArray")
}
}
function Uint8ClampedArray_GetBuffer(){
if(!(%_ClassOf(this)==='Uint8ClampedArray')){
throw MakeTypeError(33,"Uint8ClampedArray.buffer",this);
}
return %TypedArrayGetBuffer(this);
}
function Uint8ClampedArray_GetByteLength(){
if(!(%_ClassOf(this)==='Uint8ClampedArray')){
throw MakeTypeError(33,"Uint8ClampedArray.byteLength",this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function Uint8ClampedArray_GetByteOffset(){
if(!(%_ClassOf(this)==='Uint8ClampedArray')){
throw MakeTypeError(33,"Uint8ClampedArray.byteOffset",this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function Uint8ClampedArray_GetLength(){
if(!(%_ClassOf(this)==='Uint8ClampedArray')){
throw MakeTypeError(33,"Uint8ClampedArray.length",this);
}
return %_TypedArrayGetLength(this);
}
function Uint8ClampedArraySubArray(R,S){
if(!(%_ClassOf(this)==='Uint8ClampedArray')){
throw MakeTypeError(33,"Uint8ClampedArray.subarray",this);
}
var T=(%_IsSmi(%IS_VAR(R))?R:%NumberToInteger($toNumber(R)));
if(!(S===(void 0))){
S=(%_IsSmi(%IS_VAR(S))?S:%NumberToInteger($toNumber(S)));
}
var U=%_TypedArrayGetLength(this);
if(T<0){
T=q(0,U+T);
}else{
T=r(U,T);
}
var V=(S===(void 0))?U:S;
if(V<0){
V=q(0,U+V);
}else{
V=r(V,U);
}
if(V<T){
V=T;
}
var C=V-T;
var W=
%_ArrayBufferViewGetByteOffset(this)+T*1;
return new p(%TypedArrayGetBuffer(this),
W,C);
}
function TypedArraySetFromArrayLike(X,Y,Z,A){
if(A>0){
for(var H=0;H<Z;H++){
X[A+H]=Y[H];
}
}
else{
for(var H=0;H<Z;H++){
X[H]=Y[H];
}
}
}
function TypedArraySetFromOverlappingTypedArray(X,Y,A){
var aa=Y.BYTES_PER_ELEMENT;
var ab=X.BYTES_PER_ELEMENT;
var Z=Y.length;
function CopyLeftPart(){
var ac=X.byteOffset+(A+1)*ab;
var ad=Y.byteOffset;
for(var ae=0;
ae<Z&&ac<=ad;
ae++){
X[A+ae]=Y[ae];
ac+=ab;
ad+=aa;
}
return ae;
}
var ae=CopyLeftPart();
function CopyRightPart(){
var ac=
X.byteOffset+(A+Z-1)*ab;
var ad=
Y.byteOffset+Z*aa;
for(var af=Z-1;
af>=ae&&ac>=ad;
af--){
X[A+af]=Y[af];
ac-=ab;
ad-=aa;
}
return af;
}
var af=CopyRightPart();
var ag=new c(af+1-ae);
for(var H=ae;H<=af;H++){
ag[H-ae]=Y[H];
}
for(H=ae;H<=af;H++){
X[A+H]=ag[H-ae];
}
}
function TypedArraySet(v,A){
var ah=(A===(void 0))?0:(%_IsSmi(%IS_VAR(A))?A:%NumberToInteger($toNumber(A)));
if(ah<0)throw MakeTypeError(147);
if(ah>%_MaxSmi()){
throw MakeRangeError(148);
}
switch(%TypedArraySetFastCases(this,v,ah)){
case 0:
return;
case 1:
TypedArraySetFromOverlappingTypedArray(this,v,ah);
return;
case 2:
TypedArraySetFromArrayLike(this,v,v.length,ah);
return;
case 3:
var D=v.length;
if((D===(void 0))){
if((typeof(v)==='number')){
throw MakeTypeError(36);
}
return;
}
if(ah+D>this.length){
throw MakeRangeError(148);
}
TypedArraySetFromArrayLike(this,v,D,ah);
return;
}
}
function TypedArrayGetToStringTag(){
if(!%_IsTypedArray(this))return;
var ai=%_ClassOf(this);
if((ai===(void 0)))return;
return ai;
}
%SetCode(h,Uint8ArrayConstructor);
%FunctionSetPrototype(h,new g());
%AddNamedProperty(h,"BYTES_PER_ELEMENT",1,
1|2|4);
%AddNamedProperty(h.prototype,
"constructor",a.Uint8Array,2);
%AddNamedProperty(h.prototype,
"BYTES_PER_ELEMENT",1,
1|2|4);
b.InstallGetter(h.prototype,"buffer",Uint8Array_GetBuffer);
b.InstallGetter(h.prototype,"byteOffset",Uint8Array_GetByteOffset,
2|4);
b.InstallGetter(h.prototype,"byteLength",Uint8Array_GetByteLength,
2|4);
b.InstallGetter(h.prototype,"length",Uint8Array_GetLength,
2|4);
b.InstallGetter(h.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(h.prototype,2,[
"subarray",Uint8ArraySubArray,
"set",TypedArraySet
]);
%SetCode(i,Int8ArrayConstructor);
%FunctionSetPrototype(i,new g());
%AddNamedProperty(i,"BYTES_PER_ELEMENT",1,
1|2|4);
%AddNamedProperty(i.prototype,
"constructor",a.Int8Array,2);
%AddNamedProperty(i.prototype,
"BYTES_PER_ELEMENT",1,
1|2|4);
b.InstallGetter(i.prototype,"buffer",Int8Array_GetBuffer);
b.InstallGetter(i.prototype,"byteOffset",Int8Array_GetByteOffset,
2|4);
b.InstallGetter(i.prototype,"byteLength",Int8Array_GetByteLength,
2|4);
b.InstallGetter(i.prototype,"length",Int8Array_GetLength,
2|4);
b.InstallGetter(i.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(i.prototype,2,[
"subarray",Int8ArraySubArray,
"set",TypedArraySet
]);
%SetCode(j,Uint16ArrayConstructor);
%FunctionSetPrototype(j,new g());
%AddNamedProperty(j,"BYTES_PER_ELEMENT",2,
1|2|4);
%AddNamedProperty(j.prototype,
"constructor",a.Uint16Array,2);
%AddNamedProperty(j.prototype,
"BYTES_PER_ELEMENT",2,
1|2|4);
b.InstallGetter(j.prototype,"buffer",Uint16Array_GetBuffer);
b.InstallGetter(j.prototype,"byteOffset",Uint16Array_GetByteOffset,
2|4);
b.InstallGetter(j.prototype,"byteLength",Uint16Array_GetByteLength,
2|4);
b.InstallGetter(j.prototype,"length",Uint16Array_GetLength,
2|4);
b.InstallGetter(j.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(j.prototype,2,[
"subarray",Uint16ArraySubArray,
"set",TypedArraySet
]);
%SetCode(k,Int16ArrayConstructor);
%FunctionSetPrototype(k,new g());
%AddNamedProperty(k,"BYTES_PER_ELEMENT",2,
1|2|4);
%AddNamedProperty(k.prototype,
"constructor",a.Int16Array,2);
%AddNamedProperty(k.prototype,
"BYTES_PER_ELEMENT",2,
1|2|4);
b.InstallGetter(k.prototype,"buffer",Int16Array_GetBuffer);
b.InstallGetter(k.prototype,"byteOffset",Int16Array_GetByteOffset,
2|4);
b.InstallGetter(k.prototype,"byteLength",Int16Array_GetByteLength,
2|4);
b.InstallGetter(k.prototype,"length",Int16Array_GetLength,
2|4);
b.InstallGetter(k.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(k.prototype,2,[
"subarray",Int16ArraySubArray,
"set",TypedArraySet
]);
%SetCode(l,Uint32ArrayConstructor);
%FunctionSetPrototype(l,new g());
%AddNamedProperty(l,"BYTES_PER_ELEMENT",4,
1|2|4);
%AddNamedProperty(l.prototype,
"constructor",a.Uint32Array,2);
%AddNamedProperty(l.prototype,
"BYTES_PER_ELEMENT",4,
1|2|4);
b.InstallGetter(l.prototype,"buffer",Uint32Array_GetBuffer);
b.InstallGetter(l.prototype,"byteOffset",Uint32Array_GetByteOffset,
2|4);
b.InstallGetter(l.prototype,"byteLength",Uint32Array_GetByteLength,
2|4);
b.InstallGetter(l.prototype,"length",Uint32Array_GetLength,
2|4);
b.InstallGetter(l.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(l.prototype,2,[
"subarray",Uint32ArraySubArray,
"set",TypedArraySet
]);
%SetCode(m,Int32ArrayConstructor);
%FunctionSetPrototype(m,new g());
%AddNamedProperty(m,"BYTES_PER_ELEMENT",4,
1|2|4);
%AddNamedProperty(m.prototype,
"constructor",a.Int32Array,2);
%AddNamedProperty(m.prototype,
"BYTES_PER_ELEMENT",4,
1|2|4);
b.InstallGetter(m.prototype,"buffer",Int32Array_GetBuffer);
b.InstallGetter(m.prototype,"byteOffset",Int32Array_GetByteOffset,
2|4);
b.InstallGetter(m.prototype,"byteLength",Int32Array_GetByteLength,
2|4);
b.InstallGetter(m.prototype,"length",Int32Array_GetLength,
2|4);
b.InstallGetter(m.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(m.prototype,2,[
"subarray",Int32ArraySubArray,
"set",TypedArraySet
]);
%SetCode(n,Float32ArrayConstructor);
%FunctionSetPrototype(n,new g());
%AddNamedProperty(n,"BYTES_PER_ELEMENT",4,
1|2|4);
%AddNamedProperty(n.prototype,
"constructor",a.Float32Array,2);
%AddNamedProperty(n.prototype,
"BYTES_PER_ELEMENT",4,
1|2|4);
b.InstallGetter(n.prototype,"buffer",Float32Array_GetBuffer);
b.InstallGetter(n.prototype,"byteOffset",Float32Array_GetByteOffset,
2|4);
b.InstallGetter(n.prototype,"byteLength",Float32Array_GetByteLength,
2|4);
b.InstallGetter(n.prototype,"length",Float32Array_GetLength,
2|4);
b.InstallGetter(n.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(n.prototype,2,[
"subarray",Float32ArraySubArray,
"set",TypedArraySet
]);
%SetCode(o,Float64ArrayConstructor);
%FunctionSetPrototype(o,new g());
%AddNamedProperty(o,"BYTES_PER_ELEMENT",8,
1|2|4);
%AddNamedProperty(o.prototype,
"constructor",a.Float64Array,2);
%AddNamedProperty(o.prototype,
"BYTES_PER_ELEMENT",8,
1|2|4);
b.InstallGetter(o.prototype,"buffer",Float64Array_GetBuffer);
b.InstallGetter(o.prototype,"byteOffset",Float64Array_GetByteOffset,
2|4);
b.InstallGetter(o.prototype,"byteLength",Float64Array_GetByteLength,
2|4);
b.InstallGetter(o.prototype,"length",Float64Array_GetLength,
2|4);
b.InstallGetter(o.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(o.prototype,2,[
"subarray",Float64ArraySubArray,
"set",TypedArraySet
]);
%SetCode(p,Uint8ClampedArrayConstructor);
%FunctionSetPrototype(p,new g());
%AddNamedProperty(p,"BYTES_PER_ELEMENT",1,
1|2|4);
%AddNamedProperty(p.prototype,
"constructor",a.Uint8ClampedArray,2);
%AddNamedProperty(p.prototype,
"BYTES_PER_ELEMENT",1,
1|2|4);
b.InstallGetter(p.prototype,"buffer",Uint8ClampedArray_GetBuffer);
b.InstallGetter(p.prototype,"byteOffset",Uint8ClampedArray_GetByteOffset,
2|4);
b.InstallGetter(p.prototype,"byteLength",Uint8ClampedArray_GetByteLength,
2|4);
b.InstallGetter(p.prototype,"length",Uint8ClampedArray_GetLength,
2|4);
b.InstallGetter(p.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(p.prototype,2,[
"subarray",Uint8ClampedArraySubArray,
"set",TypedArraySet
]);
function DataViewConstructor(w,x,E){
if(%_IsConstructCall()){
if(!(%_ClassOf(w)==='ArrayBuffer'))throw MakeTypeError(22);
if(!(x===(void 0))){
x=$toPositiveInteger(x,131);
}
if(!(E===(void 0))){
E=(%_IsSmi(%IS_VAR(E))?E:%NumberToInteger($toNumber(E)));
}
var z=%_ArrayBufferGetByteLength(w);
var A=(x===(void 0))?0:x;
if(A>z)throw MakeRangeError(131);
var y=(E===(void 0))
?z-A
:E;
if(y<0||A+y>z){
throw new MakeRangeError(130);
}
%_DataViewInitialize(this,w,A,y);
}else{
throw MakeTypeError(20,"DataView");
}
}
function DataViewGetBufferJS(){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,'DataView.buffer',this);
}
return %DataViewGetBuffer(this);
}
function DataViewGetByteOffset(){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.byteOffset',this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function DataViewGetByteLength(){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.byteLength',this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function DataViewGetInt8JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getInt8',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetInt8(this,A,!!aj);
}
function DataViewSetInt8JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setInt8',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetInt8(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetUint8JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getUint8',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetUint8(this,A,!!aj);
}
function DataViewSetUint8JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setUint8',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetUint8(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetInt16JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getInt16',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetInt16(this,A,!!aj);
}
function DataViewSetInt16JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setInt16',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetInt16(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetUint16JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getUint16',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetUint16(this,A,!!aj);
}
function DataViewSetUint16JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setUint16',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetUint16(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetInt32JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getInt32',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetInt32(this,A,!!aj);
}
function DataViewSetInt32JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setInt32',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetInt32(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetUint32JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getUint32',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetUint32(this,A,!!aj);
}
function DataViewSetUint32JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setUint32',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetUint32(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetFloat32JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getFloat32',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetFloat32(this,A,!!aj);
}
function DataViewSetFloat32JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setFloat32',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetFloat32(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetFloat64JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getFloat64',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetFloat64(this,A,!!aj);
}
function DataViewSetFloat64JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setFloat64',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetFloat64(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
%SetCode(e,DataViewConstructor);
%FunctionSetPrototype(e,new g);
%AddNamedProperty(e.prototype,"constructor",e,
2);
%AddNamedProperty(e.prototype,symbolToStringTag,"DataView",
1|2);
b.InstallGetter(e.prototype,"buffer",DataViewGetBufferJS);
b.InstallGetter(e.prototype,"byteOffset",
DataViewGetByteOffset);
b.InstallGetter(e.prototype,"byteLength",
DataViewGetByteLength);
b.InstallFunctions(e.prototype,2,[
"getInt8",DataViewGetInt8JS,
"setInt8",DataViewSetInt8JS,
"getUint8",DataViewGetUint8JS,
"setUint8",DataViewSetUint8JS,
"getInt16",DataViewGetInt16JS,
"setInt16",DataViewSetInt16JS,
"getUint16",DataViewGetUint16JS,
"setUint16",DataViewSetUint16JS,
"getInt32",DataViewGetInt32JS,
"setInt32",DataViewSetInt32JS,
"getUint32",DataViewGetUint32JS,
"setUint32",DataViewSetUint32JS,
"getFloat32",DataViewGetFloat32JS,
"setFloat32",DataViewSetFloat32JS,
"getFloat64",DataViewGetFloat64JS,
"setFloat64",DataViewSetFloat64JS
]);
})
Hiterator-prototype<70>
var $iteratorPrototype;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Object;
function IteratorPrototypeIterator(){
return this;
}
b.SetFunctionName(IteratorPrototypeIterator,symbolIterator);
%AddNamedProperty($iteratorPrototype,symbolIterator,
IteratorPrototypeIterator,2);
})
$generator<6F>
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Function;
var d;
b.Import(function(e){
d=e.NewFunctionString;
});
function GeneratorObjectNext(g){
if(!(%_ClassOf(this)==='Generator')){
throw MakeTypeError(33,
'[Generator].prototype.next',this);
}
var h=%GeneratorGetContinuation(this);
if(h>0){
if((%_DebugIsActive()!=0))%DebugPrepareStepInIfStepping(this);
try{
return %_GeneratorNext(this,g);
}catch(e){
%GeneratorClose(this);
throw e;
}
}else if(h==0){
return{value:void 0,done:true};
}else{
throw MakeTypeError(31);
}
}
function GeneratorObjectThrow(i){
if(!(%_ClassOf(this)==='Generator')){
throw MakeTypeError(33,
'[Generator].prototype.throw',this);
}
var h=%GeneratorGetContinuation(this);
if(h>0){
try{
return %_GeneratorThrow(this,i);
}catch(e){
%GeneratorClose(this);
throw e;
}
}else if(h==0){
throw i;
}else{
throw MakeTypeError(31);
}
}
function GeneratorFunctionConstructor(j){
var k=d(arguments,'function*');
var l=%GlobalProxy(GeneratorFunctionConstructor);
var m=%_CallFunction(l,%CompileString(k,true));
%FunctionMarkNameShouldPrintAsAnonymous(m);
return m;
}
%NeverOptimizeFunction(GeneratorObjectNext);
%NeverOptimizeFunction(GeneratorObjectThrow);
var n=GeneratorFunctionPrototype.prototype;
b.InstallFunctions(n,
2,
["next",GeneratorObjectNext,
"throw",GeneratorObjectThrow]);
%AddNamedProperty(n,"constructor",
GeneratorFunctionPrototype,2|1);
%AddNamedProperty(n,
symbolToStringTag,"Generator",2|1);
%InternalSetPrototype(GeneratorFunctionPrototype,c.prototype);
%AddNamedProperty(GeneratorFunctionPrototype,
symbolToStringTag,"GeneratorFunction",2|1);
%AddNamedProperty(GeneratorFunctionPrototype,"constructor",
GeneratorFunction,2|1);
%InternalSetPrototype(GeneratorFunction,c);
%SetCode(GeneratorFunction,GeneratorFunctionConstructor);
})
8object-observei<65>
var $observeNotifyChange;
var $observeEnqueueSpliceRecord;
var $observeBeginPerformSplice;
var $observeEndPerformSplice;
var $observeNativeObjectObserve;
var $observeNativeObjectGetNotifier;
var $observeNativeObjectNotifierPerformChange;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Array;
var d=a.Object;
var e=b.InternalArray;
var g;
var h;
b.Import(function(i){
g=i.ObjectFreeze;
h=i.ObjectIsFrozen;
});
var j;
var k={};
function GetObservationStateJS(){
if((j===(void 0))){
j=%GetObservationState();
}
if((j.callbackInfoMap===(void 0))){
j.callbackInfoMap=%ObservationWeakMapCreate();
j.objectInfoMap=%ObservationWeakMapCreate();
j.notifierObjectInfoMap=%ObservationWeakMapCreate();
j.pendingObservers=null;
j.nextCallbackPriority=0;
j.lastMicrotaskId=0;
}
return j;
}
function GetPendingObservers(){
return GetObservationStateJS().pendingObservers;
}
function SetPendingObservers(l){
GetObservationStateJS().pendingObservers=l;
}
function GetNextCallbackPriority(){
return GetObservationStateJS().nextCallbackPriority++;
}
function nullProtoObject(){
return{__proto__:null};
}
function TypeMapCreate(){
return nullProtoObject();
}
function TypeMapAddType(m,n,o){
m[n]=o?1:(m[n]||0)+1;
}
function TypeMapRemoveType(m,n){
m[n]--;
}
function TypeMapCreateFromList(p,q){
var m=TypeMapCreate();
for(var r=0;r<q;r++){
TypeMapAddType(m,p[r],true);
}
return m;
}
function TypeMapHasType(m,n){
return!!m[n];
}
function TypeMapIsDisjointFrom(t,u){
if(!t||!u)
return true;
for(var n in t){
if(TypeMapHasType(t,n)&&TypeMapHasType(u,n))
return false;
}
return true;
}
var v=(function(){
var w=[
'add',
'update',
'delete',
'setPrototype',
'reconfigure',
'preventExtensions'
];
return TypeMapCreateFromList(w,w.length);
})();
function ObserverCreate(x,y){
if((y===(void 0)))
return x;
var z=nullProtoObject();
z.callback=x;
z.accept=y;
return z;
}
function ObserverGetCallback(z){
return(%_ClassOf(z)==='Function')?z:z.callback;
}
function ObserverGetAcceptTypes(z){
return(%_ClassOf(z)==='Function')?v:z.accept;
}
function ObserverIsActive(z,A){
return TypeMapIsDisjointFrom(ObjectInfoGetPerformingTypes(A),
ObserverGetAcceptTypes(z));
}
function ObjectInfoGetOrCreate(B){
var A=ObjectInfoGet(B);
if((A===(void 0))){
if(!%_IsJSProxy(B)){
%SetIsObserved(B);
}
A={
object:B,
changeObservers:null,
notifier:null,
performing:null,
performingCount:0,
};
%WeakCollectionSet(GetObservationStateJS().objectInfoMap,
B,A,$getHash(B));
}
return A;
}
function ObjectInfoGet(B){
return %WeakCollectionGet(GetObservationStateJS().objectInfoMap,B,
$getHash(B));
}
function ObjectInfoGetFromNotifier(C){
return %WeakCollectionGet(GetObservationStateJS().notifierObjectInfoMap,
C,$getHash(C));
}
function ObjectInfoGetNotifier(A){
if((A.notifier===null)){
var C={__proto__:k};
A.notifier=C;
%WeakCollectionSet(GetObservationStateJS().notifierObjectInfoMap,
C,A,$getHash(C));
}
return A.notifier;
}
function ChangeObserversIsOptimized(D){
return(%_ClassOf(D)==='Function')||
(%_ClassOf(D.callback)==='Function');
}
function ObjectInfoNormalizeChangeObservers(A){
if(ChangeObserversIsOptimized(A.changeObservers)){
var z=A.changeObservers;
var x=ObserverGetCallback(z);
var E=CallbackInfoGet(x);
var F=CallbackInfoGetPriority(E);
A.changeObservers=nullProtoObject();
A.changeObservers[F]=z;
}
}
function ObjectInfoAddObserver(A,x,y){
var E=CallbackInfoGetOrCreate(x);
var z=ObserverCreate(x,y);
if(!A.changeObservers){
A.changeObservers=z;
return;
}
ObjectInfoNormalizeChangeObservers(A);
var F=CallbackInfoGetPriority(E);
A.changeObservers[F]=z;
}
function ObjectInfoRemoveObserver(A,x){
if(!A.changeObservers)
return;
if(ChangeObserversIsOptimized(A.changeObservers)){
if(x===ObserverGetCallback(A.changeObservers))
A.changeObservers=null;
return;
}
var E=CallbackInfoGet(x);
var F=CallbackInfoGetPriority(E);
A.changeObservers[F]=null;
}
function ObjectInfoHasActiveObservers(A){
if((A===(void 0))||!A.changeObservers)
return false;
if(ChangeObserversIsOptimized(A.changeObservers))
return ObserverIsActive(A.changeObservers,A);
for(var F in A.changeObservers){
var z=A.changeObservers[F];
if(!(z===null)&&ObserverIsActive(z,A))
return true;
}
return false;
}
function ObjectInfoAddPerformingType(A,n){
A.performing=A.performing||TypeMapCreate();
TypeMapAddType(A.performing,n);
A.performingCount++;
}
function ObjectInfoRemovePerformingType(A,n){
A.performingCount--;
TypeMapRemoveType(A.performing,n);
}
function ObjectInfoGetPerformingTypes(A){
return A.performingCount>0?A.performing:null;
}
function ConvertAcceptListToTypeMap(G){
if((G===(void 0)))
return G;
if(!(%_IsSpecObject(G)))throw MakeTypeError(67);
var H=$toInteger(G.length);
if(H<0)H=0;
return TypeMapCreateFromList(G,H);
}
function CallbackInfoGet(x){
return %WeakCollectionGet(GetObservationStateJS().callbackInfoMap,x,
$getHash(x));
}
function CallbackInfoSet(x,E){
%WeakCollectionSet(GetObservationStateJS().callbackInfoMap,
x,E,$getHash(x));
}
function CallbackInfoGetOrCreate(x){
var E=CallbackInfoGet(x);
if(!(E===(void 0)))
return E;
var F=GetNextCallbackPriority();
CallbackInfoSet(x,F);
return F;
}
function CallbackInfoGetPriority(E){
if((typeof(E)==='number'))
return E;
else
return E.priority;
}
function CallbackInfoNormalize(x){
var E=CallbackInfoGet(x);
if((typeof(E)==='number')){
var F=E;
E=new e;
E.priority=F;
CallbackInfoSet(x,E);
}
return E;
}
function ObjectObserve(B,x,y){
if(!(%_IsSpecObject(B)))
throw MakeTypeError(69,"observe","observe");
if(%IsJSGlobalProxy(B))
throw MakeTypeError(66,"observe");
if(!(%_ClassOf(x)==='Function'))
throw MakeTypeError(68,"observe");
if(h(x))
throw MakeTypeError(65);
var I=%GetObjectContextObjectObserve(B);
return I(B,x,y);
}
function NativeObjectObserve(B,x,y){
var A=ObjectInfoGetOrCreate(B);
var p=ConvertAcceptListToTypeMap(y);
ObjectInfoAddObserver(A,x,p);
return B;
}
function ObjectUnobserve(B,x){
if(!(%_IsSpecObject(B)))
throw MakeTypeError(69,"unobserve","unobserve");
if(%IsJSGlobalProxy(B))
throw MakeTypeError(66,"unobserve");
if(!(%_ClassOf(x)==='Function'))
throw MakeTypeError(68,"unobserve");
var A=ObjectInfoGet(B);
if((A===(void 0)))
return B;
ObjectInfoRemoveObserver(A,x);
return B;
}
function ArrayObserve(B,x){
return ObjectObserve(B,x,['add',
'update',
'delete',
'splice']);
}
function ArrayUnobserve(B,x){
return ObjectUnobserve(B,x);
}
function ObserverEnqueueIfActive(z,A,J){
if(!ObserverIsActive(z,A)||
!TypeMapHasType(ObserverGetAcceptTypes(z),J.type)){
return;
}
var x=ObserverGetCallback(z);
if(!%ObserverObjectAndRecordHaveSameOrigin(x,J.object,
J)){
return;
}
var E=CallbackInfoNormalize(x);
if((GetPendingObservers()===null)){
SetPendingObservers(nullProtoObject());
if((%_DebugIsActive()!=0)){
var K=++GetObservationStateJS().lastMicrotaskId;
var L="Object.observe";
%EnqueueMicrotask(function(){
%DebugAsyncTaskEvent({type:"willHandle",id:K,name:L});
ObserveMicrotaskRunner();
%DebugAsyncTaskEvent({type:"didHandle",id:K,name:L});
});
%DebugAsyncTaskEvent({type:"enqueue",id:K,name:L});
}else{
%EnqueueMicrotask(ObserveMicrotaskRunner);
}
}
GetPendingObservers()[E.priority]=x;
E.push(J);
}
function ObjectInfoEnqueueExternalChangeRecord(A,J,n){
if(!ObjectInfoHasActiveObservers(A))
return;
var M=!(n===(void 0));
var N=M?
{object:A.object,type:n}:
{object:A.object};
for(var O in J){
if(O==='object'||(M&&O==='type'))continue;
%DefineDataPropertyUnchecked(
N,O,J[O],1+4);
}
g(N);
ObjectInfoEnqueueInternalChangeRecord(A,N);
}
function ObjectInfoEnqueueInternalChangeRecord(A,J){
if((typeof(J.name)==='symbol'))return;
if(ChangeObserversIsOptimized(A.changeObservers)){
var z=A.changeObservers;
ObserverEnqueueIfActive(z,A,J);
return;
}
for(var F in A.changeObservers){
var z=A.changeObservers[F];
if((z===null))
continue;
ObserverEnqueueIfActive(z,A,J);
}
}
function BeginPerformSplice(P){
var A=ObjectInfoGet(P);
if(!(A===(void 0)))
ObjectInfoAddPerformingType(A,'splice');
}
function EndPerformSplice(P){
var A=ObjectInfoGet(P);
if(!(A===(void 0)))
ObjectInfoRemovePerformingType(A,'splice');
}
function EnqueueSpliceRecord(P,Q,R,S){
var A=ObjectInfoGet(P);
if(!ObjectInfoHasActiveObservers(A))
return;
var J={
type:'splice',
object:P,
index:Q,
removed:R,
addedCount:S
};
g(J);
g(J.removed);
ObjectInfoEnqueueInternalChangeRecord(A,J);
}
function NotifyChange(n,B,L,T){
var A=ObjectInfoGet(B);
if(!ObjectInfoHasActiveObservers(A))
return;
var J;
if(arguments.length==2){
J={type:n,object:B};
}else if(arguments.length==3){
J={type:n,object:B,name:L};
}else{
J={
type:n,
object:B,
name:L,
oldValue:T
};
}
g(J);
ObjectInfoEnqueueInternalChangeRecord(A,J);
}
function ObjectNotifierNotify(J){
if(!(%_IsSpecObject(this)))
throw MakeTypeError(13,"notify");
var A=ObjectInfoGetFromNotifier(this);
if((A===(void 0)))
throw MakeTypeError(70);
if(!(typeof(J.type)==='string'))
throw MakeTypeError(73);
ObjectInfoEnqueueExternalChangeRecord(A,J);
}
function ObjectNotifierPerformChange(U,V){
if(!(%_IsSpecObject(this)))
throw MakeTypeError(13,"performChange");
var A=ObjectInfoGetFromNotifier(this);
if((A===(void 0)))
throw MakeTypeError(70);
if(!(typeof(U)==='string'))
throw MakeTypeError(72);
if(!(%_ClassOf(V)==='Function'))
throw MakeTypeError(71);
var W=%GetObjectContextNotifierPerformChange(A);
W(A,U,V);
}
function NativeObjectNotifierPerformChange(A,U,V){
ObjectInfoAddPerformingType(A,U);
var J;
try{
J=%_CallFunction((void 0),V);
}finally{
ObjectInfoRemovePerformingType(A,U);
}
if((%_IsSpecObject(J)))
ObjectInfoEnqueueExternalChangeRecord(A,J,U);
}
function ObjectGetNotifier(B){
if(!(%_IsSpecObject(B)))
throw MakeTypeError(69,"getNotifier","getNotifier");
if(%IsJSGlobalProxy(B))
throw MakeTypeError(66,"getNotifier");
if(h(B))return null;
if(!%ObjectWasCreatedInCurrentOrigin(B))return null;
var X=%GetObjectContextObjectGetNotifier(B);
return X(B);
}
function NativeObjectGetNotifier(B){
var A=ObjectInfoGetOrCreate(B);
return ObjectInfoGetNotifier(A);
}
function CallbackDeliverPending(x){
var E=CallbackInfoGet(x);
if((E===(void 0))||(typeof(E)==='number'))
return false;
var F=E.priority;
CallbackInfoSet(x,F);
var l=GetPendingObservers();
if(!(l===null))
delete l[F];
var Y=[];
%MoveArrayContents(E,Y);
%DeliverObservationChangeRecords(x,Y);
return true;
}
function ObjectDeliverChangeRecords(x){
if(!(%_ClassOf(x)==='Function'))
throw MakeTypeError(68,"deliverChangeRecords");
while(CallbackDeliverPending(x)){}
}
function ObserveMicrotaskRunner(){
var l=GetPendingObservers();
if(!(l===null)){
SetPendingObservers(null);
for(var r in l){
CallbackDeliverPending(l[r]);
}
}
}
b.InstallFunctions(d,2,[
"deliverChangeRecords",ObjectDeliverChangeRecords,
"getNotifier",ObjectGetNotifier,
"observe",ObjectObserve,
"unobserve",ObjectUnobserve
]);
b.InstallFunctions(c,2,[
"observe",ArrayObserve,
"unobserve",ArrayUnobserve
]);
b.InstallFunctions(k,2,[
"notify",ObjectNotifierNotify,
"performChange",ObjectNotifierPerformChange
]);
$observeNotifyChange=NotifyChange;
$observeEnqueueSpliceRecord=EnqueueSpliceRecord;
$observeBeginPerformSplice=BeginPerformSplice;
$observeEndPerformSplice=EndPerformSplice;
$observeNativeObjectObserve=NativeObjectObserve;
$observeNativeObjectGetNotifier=NativeObjectGetNotifier;
$observeNativeObjectNotifierPerformChange=NativeObjectNotifierPerformChange;
})
(collection<6F><6E>
var $getHash;
var $getExistingHash;
var $mapSet;
var $mapHas;
var $mapDelete;
var $setAdd;
var $setHas;
var $setDelete;
var $mapFromArray;
var $setFromArray;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Map;
var d=a.Object;
var e=a.Set;
var g;
b.Import(function(h){
g=h.IntRandom;
});
var i;
b.Import(function(h){
i=h.NumberIsNaN;
});
function HashToEntry(j,k,l){
var m=(k&((l)-1));
return((%_FixedArrayGet(j,(3+(m))|0)));
}
%SetForceInlineFlag(HashToEntry);
function SetFindEntry(j,l,n,k){
var o=HashToEntry(j,k,l);
if(o===-1)return o;
var p=((%_FixedArrayGet(j,((3+(l)+((o)<<1)))|0)));
if(n===p)return o;
var q=i(n);
while(true){
if(q&&i(p)){
return o;
}
o=((%_FixedArrayGet(j,((3+(l)+((o)<<1))+1)|0)));
if(o===-1)return o;
p=((%_FixedArrayGet(j,((3+(l)+((o)<<1)))|0)));
if(n===p)return o;
}
return-1;
}
%SetForceInlineFlag(SetFindEntry);
function MapFindEntry(j,l,n,k){
var o=HashToEntry(j,k,l);
if(o===-1)return o;
var p=((%_FixedArrayGet(j,((3+(l)+((o)*3)))|0)));
if(n===p)return o;
var q=i(n);
while(true){
if(q&&i(p)){
return o;
}
o=((%_FixedArrayGet(j,((3+(l)+((o)*3))+2)|0)));
if(o===-1)return o;
p=((%_FixedArrayGet(j,((3+(l)+((o)*3)))|0)));
if(n===p)return o;
}
return-1;
}
%SetForceInlineFlag(MapFindEntry);
function ComputeIntegerHash(n,r){
var k=n;
k=k^r;
k=~k+(k<<15);
k=k^(k>>>12);
k=k+(k<<2);
k=k^(k>>>4);
k=(k*2057)|0;
k=k^(k>>>16);
return k&0x3fffffff;
}
%SetForceInlineFlag(ComputeIntegerHash);
var t=(%CreateGlobalPrivateSymbol("hash_code_symbol"));
function GetExistingHash(n){
if(%_IsSmi(n)){
return ComputeIntegerHash(n,0);
}
if((typeof(n)==='string')){
var u=%_StringGetRawHashField(n);
if((u&1)===0){
return u>>>2;
}
}else if((%_IsSpecObject(n))&&!%_IsJSProxy(n)&&!(%_ClassOf(n)==='global')){
var k=(n[t]);
return k;
}
return %GenericHash(n);
}
%SetForceInlineFlag(GetExistingHash);
function GetHash(n){
var k=GetExistingHash(n);
if((k===(void 0))){
k=g()|0;
if(k===0)k=1;
(n[t]=k);
}
return k;
}
%SetForceInlineFlag(GetHash);
function SetConstructor(v){
if(!%_IsConstructCall()){
throw MakeTypeError(20,"Set");
}
%_SetInitialize(this);
if(!(v==null)){
var w=this.add;
if(!(%_ClassOf(w)==='Function')){
throw MakeTypeError(77,'add',this);
}
for(var x of v){
%_CallFunction(this,x,w);
}
}
}
function SetAdd(n){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,'Set.prototype.add',this);
}
if(n===0){
n=0;
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetHash(n);
if(SetFindEntry(j,l,n,k)!==-1)return this;
var y=((%_FixedArrayGet(j,(1)|0)));
var z=((%_FixedArrayGet(j,(2)|0)));
var A=l<<1;
if((y+z)>=A){
%SetGrow(this);
j=%_JSCollectionGetTable(this);
l=((%_FixedArrayGet(j,(0)|0)));
y=((%_FixedArrayGet(j,(1)|0)));
z=((%_FixedArrayGet(j,(2)|0)));
}
var o=y+z;
var B=(3+(l)+((o)<<1));
var m=(k&((l)-1));
var C=((%_FixedArrayGet(j,(3+(m))|0)));
((%_FixedArraySet(j,(3+(m))|0,o)));
(((%_FixedArraySet(j,(1)|0,(y+1)|0))));
(%_FixedArraySet(j,(B)|0,n));
((%_FixedArraySet(j,(B+1)|0,(C)|0)));
return this;
}
function SetHas(n){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,'Set.prototype.has',this);
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetExistingHash(n);
if((k===(void 0)))return false;
return SetFindEntry(j,l,n,k)!==-1;
}
function SetDelete(n){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,
'Set.prototype.delete',this);
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetExistingHash(n);
if((k===(void 0)))return false;
var o=SetFindEntry(j,l,n,k);
if(o===-1)return false;
var y=((%_FixedArrayGet(j,(1)|0)))-1;
var z=((%_FixedArrayGet(j,(2)|0)))+1;
var B=(3+(l)+((o)<<1));
(%_FixedArraySet(j,(B)|0,%_TheHole()));
(((%_FixedArraySet(j,(1)|0,(y)|0))));
(((%_FixedArraySet(j,(2)|0,(z)|0))));
if(y<(l>>>1))%SetShrink(this);
return true;
}
function SetGetSize(){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,
'Set.prototype.size',this);
}
var j=%_JSCollectionGetTable(this);
return((%_FixedArrayGet(j,(1)|0)));
}
function SetClearJS(){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,
'Set.prototype.clear',this);
}
%_SetClear(this);
}
function SetForEach(D,E){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,
'Set.prototype.forEach',this);
}
if(!(%_ClassOf(D)==='Function'))throw MakeTypeError(12,D);
var F=false;
if((E===null)){
if(%IsSloppyModeFunction(D))E=(void 0);
}else if(!(E===(void 0))){
F=(!(%_IsSpecObject(E))&&%IsSloppyModeFunction(D));
}
var G=new SetIterator(this,2);
var n;
var H=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(D);
var I=[(void 0)];
while(%SetIteratorNext(G,I)){
if(H)%DebugPrepareStepInIfStepping(D);
n=I[0];
var J=F?$toObject(E):E;
%_CallFunction(J,n,n,this,D);
}
}
%SetCode(e,SetConstructor);
%FunctionSetLength(e,0);
%FunctionSetPrototype(e,new d());
%AddNamedProperty(e.prototype,"constructor",e,2);
%AddNamedProperty(e.prototype,symbolToStringTag,"Set",
2|1);
%FunctionSetLength(SetForEach,1);
b.InstallGetter(e.prototype,"size",SetGetSize);
b.InstallFunctions(e.prototype,2,[
"add",SetAdd,
"has",SetHas,
"delete",SetDelete,
"clear",SetClearJS,
"forEach",SetForEach
]);
function MapConstructor(v){
if(!%_IsConstructCall()){
throw MakeTypeError(20,"Map");
}
%_MapInitialize(this);
if(!(v==null)){
var w=this.set;
if(!(%_ClassOf(w)==='Function')){
throw MakeTypeError(77,'set',this);
}
for(var K of v){
if(!(%_IsSpecObject(K))){
throw MakeTypeError(39,K);
}
%_CallFunction(this,K[0],K[1],w);
}
}
}
function MapGet(n){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.get',this);
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetExistingHash(n);
if((k===(void 0)))return(void 0);
var o=MapFindEntry(j,l,n,k);
if(o===-1)return(void 0);
return((%_FixedArrayGet(j,((3+(l)+((o)*3))+1)|0)));
}
function MapSet(n,x){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.set',this);
}
if(n===0){
n=0;
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetHash(n);
var o=MapFindEntry(j,l,n,k);
if(o!==-1){
var L=(3+(l)+((o)*3));
(%_FixedArraySet(j,(L+1)|0,x));
return this;
}
var y=((%_FixedArrayGet(j,(1)|0)));
var z=((%_FixedArrayGet(j,(2)|0)));
var A=l<<1;
if((y+z)>=A){
%MapGrow(this);
j=%_JSCollectionGetTable(this);
l=((%_FixedArrayGet(j,(0)|0)));
y=((%_FixedArrayGet(j,(1)|0)));
z=((%_FixedArrayGet(j,(2)|0)));
}
o=y+z;
var B=(3+(l)+((o)*3));
var m=(k&((l)-1));
var C=((%_FixedArrayGet(j,(3+(m))|0)));
((%_FixedArraySet(j,(3+(m))|0,o)));
(((%_FixedArraySet(j,(1)|0,(y+1)|0))));
(%_FixedArraySet(j,(B)|0,n));
(%_FixedArraySet(j,(B+1)|0,x));
(%_FixedArraySet(j,(B+2)|0,C));
return this;
}
function MapHas(n){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.has',this);
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetHash(n);
return MapFindEntry(j,l,n,k)!==-1;
}
function MapDelete(n){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.delete',this);
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetHash(n);
var o=MapFindEntry(j,l,n,k);
if(o===-1)return false;
var y=((%_FixedArrayGet(j,(1)|0)))-1;
var z=((%_FixedArrayGet(j,(2)|0)))+1;
var B=(3+(l)+((o)*3));
(%_FixedArraySet(j,(B)|0,%_TheHole()));
(%_FixedArraySet(j,(B+1)|0,%_TheHole()));
(((%_FixedArraySet(j,(1)|0,(y)|0))));
(((%_FixedArraySet(j,(2)|0,(z)|0))));
if(y<(l>>>1))%MapShrink(this);
return true;
}
function MapGetSize(){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.size',this);
}
var j=%_JSCollectionGetTable(this);
return((%_FixedArrayGet(j,(1)|0)));
}
function MapClearJS(){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.clear',this);
}
%_MapClear(this);
}
function MapForEach(D,E){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.forEach',this);
}
if(!(%_ClassOf(D)==='Function'))throw MakeTypeError(12,D);
var F=false;
if((E===null)){
if(%IsSloppyModeFunction(D))E=(void 0);
}else if(!(E===(void 0))){
F=(!(%_IsSpecObject(E))&&%IsSloppyModeFunction(D));
}
var G=new MapIterator(this,3);
var H=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(D);
var I=[(void 0),(void 0)];
while(%MapIteratorNext(G,I)){
if(H)%DebugPrepareStepInIfStepping(D);
var J=F?$toObject(E):E;
%_CallFunction(J,I[1],I[0],this,D);
}
}
%SetCode(c,MapConstructor);
%FunctionSetLength(c,0);
%FunctionSetPrototype(c,new d());
%AddNamedProperty(c.prototype,"constructor",c,2);
%AddNamedProperty(
c.prototype,symbolToStringTag,"Map",2|1);
%FunctionSetLength(MapForEach,1);
b.InstallGetter(c.prototype,"size",MapGetSize);
b.InstallFunctions(c.prototype,2,[
"get",MapGet,
"set",MapSet,
"has",MapHas,
"delete",MapDelete,
"clear",MapClearJS,
"forEach",MapForEach
]);
$getHash=GetHash;
$getExistingHash=GetExistingHash;
$mapGet=MapGet;
$mapSet=MapSet;
$mapHas=MapHas;
$mapDelete=MapDelete;
$setAdd=SetAdd;
$setHas=SetHas;
$setDelete=SetDelete;
$mapFromArray=function(M){
var N=new c;
var O=M.length;
for(var P=0;P<O;P+=2){
var n=M[P];
var x=M[P+1];
%_CallFunction(N,n,x,MapSet);
}
return N;
};
$setFromArray=function(M){
var Q=new e;
var O=M.length;
for(var P=0;P<O;++P){
%_CallFunction(Q,M[P],SetAdd);
}
return Q;
};
})
<weak-collectionM0
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Object;
var d=a.WeakMap;
var e=a.WeakSet;
function WeakMapConstructor(g){
if(!%_IsConstructCall()){
throw MakeTypeError(20,"WeakMap");
}
%WeakCollectionInitialize(this);
if(!(g==null)){
var h=this.set;
if(!(%_ClassOf(h)==='Function')){
throw MakeTypeError(77,'set',this);
}
for(var i of g){
if(!(%_IsSpecObject(i))){
throw MakeTypeError(39,i);
}
%_CallFunction(this,i[0],i[1],h);
}
}
}
function WeakMapGet(j){
if(!(%_ClassOf(this)==='WeakMap')){
throw MakeTypeError(33,
'WeakMap.prototype.get',this);
}
if(!(%_IsSpecObject(j)))return(void 0);
var k=$getExistingHash(j);
if((k===(void 0)))return(void 0);
return %WeakCollectionGet(this,j,k);
}
function WeakMapSet(j,l){
if(!(%_ClassOf(this)==='WeakMap')){
throw MakeTypeError(33,
'WeakMap.prototype.set',this);
}
if(!(%_IsSpecObject(j)))throw MakeTypeError(133);
return %WeakCollectionSet(this,j,l,$getHash(j));
}
function WeakMapHas(j){
if(!(%_ClassOf(this)==='WeakMap')){
throw MakeTypeError(33,
'WeakMap.prototype.has',this);
}
if(!(%_IsSpecObject(j)))return false;
var k=$getExistingHash(j);
if((k===(void 0)))return false;
return %WeakCollectionHas(this,j,k);
}
function WeakMapDelete(j){
if(!(%_ClassOf(this)==='WeakMap')){
throw MakeTypeError(33,
'WeakMap.prototype.delete',this);
}
if(!(%_IsSpecObject(j)))return false;
var k=$getExistingHash(j);
if((k===(void 0)))return false;
return %WeakCollectionDelete(this,j,k);
}
%SetCode(d,WeakMapConstructor);
%FunctionSetLength(d,0);
%FunctionSetPrototype(d,new c());
%AddNamedProperty(d.prototype,"constructor",d,
2);
%AddNamedProperty(d.prototype,symbolToStringTag,"WeakMap",
2|1);
b.InstallFunctions(d.prototype,2,[
"get",WeakMapGet,
"set",WeakMapSet,
"has",WeakMapHas,
"delete",WeakMapDelete
]);
function WeakSetConstructor(g){
if(!%_IsConstructCall()){
throw MakeTypeError(20,"WeakSet");
}
%WeakCollectionInitialize(this);
if(!(g==null)){
var h=this.add;
if(!(%_ClassOf(h)==='Function')){
throw MakeTypeError(77,'add',this);
}
for(var l of g){
%_CallFunction(this,l,h);
}
}
}
function WeakSetAdd(l){
if(!(%_ClassOf(this)==='WeakSet')){
throw MakeTypeError(33,
'WeakSet.prototype.add',this);
}
if(!(%_IsSpecObject(l)))throw MakeTypeError(134);
return %WeakCollectionSet(this,l,true,$getHash(l));
}
function WeakSetHas(l){
if(!(%_ClassOf(this)==='WeakSet')){
throw MakeTypeError(33,
'WeakSet.prototype.has',this);
}
if(!(%_IsSpecObject(l)))return false;
var k=$getExistingHash(l);
if((k===(void 0)))return false;
return %WeakCollectionHas(this,l,k);
}
function WeakSetDelete(l){
if(!(%_ClassOf(this)==='WeakSet')){
throw MakeTypeError(33,
'WeakSet.prototype.delete',this);
}
if(!(%_IsSpecObject(l)))return false;
var k=$getExistingHash(l);
if((k===(void 0)))return false;
return %WeakCollectionDelete(this,l,k);
}
%SetCode(e,WeakSetConstructor);
%FunctionSetLength(e,0);
%FunctionSetPrototype(e,new c());
%AddNamedProperty(e.prototype,"constructor",e,
2);
%AddNamedProperty(e.prototype,symbolToStringTag,"WeakSet",
2|1);
b.InstallFunctions(e.prototype,2,[
"add",WeakSetAdd,
"has",WeakSetHas,
"delete",WeakSetDelete
]);
})
Lcollection-iterator<6F>+
var $mapEntries;
var $mapIteratorNext;
var $setIteratorNext;
var $setValues;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Map;
var d=a.Set;
function SetIteratorConstructor(e,g){
%SetIteratorInitialize(this,e,g);
}
function SetIteratorNextJS(){
if(!(%_ClassOf(this)==='Set Iterator')){
throw MakeTypeError(33,
'Set Iterator.prototype.next',this);
}
var h=[(void 0),(void 0)];
var i={value:h,done:false};
switch(%SetIteratorNext(this,h)){
case 0:
i.value=(void 0);
i.done=true;
break;
case 2:
i.value=h[0];
break;
case 3:
h[1]=h[0];
break;
}
return i;
}
function SetEntries(){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,
'Set.prototype.entries',this);
}
return new SetIterator(this,3);
}
function SetValues(){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,
'Set.prototype.values',this);
}
return new SetIterator(this,2);
}
%SetCode(SetIterator,SetIteratorConstructor);
%FunctionSetPrototype(SetIterator,{__proto__:$iteratorPrototype});
%FunctionSetInstanceClassName(SetIterator,'Set Iterator');
b.InstallFunctions(SetIterator.prototype,2,[
'next',SetIteratorNextJS
]);
%AddNamedProperty(SetIterator.prototype,symbolToStringTag,
"Set Iterator",1|2);
b.InstallFunctions(d.prototype,2,[
'entries',SetEntries,
'keys',SetValues,
'values',SetValues
]);
%AddNamedProperty(d.prototype,symbolIterator,SetValues,2);
$setIteratorNext=SetIteratorNextJS;
$setValues=SetValues;
function MapIteratorConstructor(j,g){
%MapIteratorInitialize(this,j,g);
}
function MapIteratorNextJS(){
if(!(%_ClassOf(this)==='Map Iterator')){
throw MakeTypeError(33,
'Map Iterator.prototype.next',this);
}
var h=[(void 0),(void 0)];
var i={value:h,done:false};
switch(%MapIteratorNext(this,h)){
case 0:
i.value=(void 0);
i.done=true;
break;
case 1:
i.value=h[0];
break;
case 2:
i.value=h[1];
break;
}
return i;
}
function MapEntries(){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.entries',this);
}
return new MapIterator(this,3);
}
function MapKeys(){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.keys',this);
}
return new MapIterator(this,1);
}
function MapValues(){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.values',this);
}
return new MapIterator(this,2);
}
%SetCode(MapIterator,MapIteratorConstructor);
%FunctionSetPrototype(MapIterator,{__proto__:$iteratorPrototype});
%FunctionSetInstanceClassName(MapIterator,'Map Iterator');
b.InstallFunctions(MapIterator.prototype,2,[
'next',MapIteratorNextJS
]);
%AddNamedProperty(MapIterator.prototype,symbolToStringTag,
"Map Iterator",1|2);
b.InstallFunctions(c.prototype,2,[
'entries',MapEntries,
'keys',MapKeys,
'values',MapValues
]);
%AddNamedProperty(c.prototype,symbolIterator,MapEntries,2);
$mapEntries=MapEntries;
$mapIteratorNext=MapIteratorNextJS;
})
promise<73>e
var $promiseCreate;
var $promiseResolve;
var $promiseReject;
var $promiseChain;
var $promiseCatch;
var $promiseThen;
var $promiseHasUserDefinedRejectHandler;
var $promiseStatus;
var $promiseValue;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=b.InternalArray;
var d=(%CreateGlobalPrivateSymbol("Promise#status"));
var e=(%CreateGlobalPrivateSymbol("Promise#value"));
var g=(%CreateGlobalPrivateSymbol("Promise#onResolve"));
var h=(%CreateGlobalPrivateSymbol("Promise#onReject"));
var i=(%CreateGlobalPrivateSymbol("Promise#raw"));
var j=%PromiseHasHandlerSymbol();
var k=0;
var l=function Promise(m){
if(m===i)return;
if(!%_IsConstructCall())throw MakeTypeError(51,this);
if(!(%_ClassOf(m)==='Function'))
throw MakeTypeError(96,m);
var n=PromiseInit(this);
try{
%DebugPushPromise(n,Promise);
m(function(o){PromiseResolve(n,o)},
function(p){PromiseReject(n,p)});
}catch(e){
PromiseReject(n,e);
}finally{
%DebugPopPromise();
}
}
function PromiseSet(n,q,r,t,u){
(n[d]=q);
(n[e]=r);
(n[g]=t);
(n[h]=u);
if((%_DebugIsActive()!=0)){
%DebugPromiseEvent({promise:n,status:q,value:r});
}
return n;
}
function PromiseCreateAndSet(q,r){
var n=new l(i);
if((%_DebugIsActive()!=0))PromiseSet(n,0,(void 0));
return PromiseSet(n,q,r);
}
function PromiseInit(n){
return PromiseSet(
n,0,(void 0),new c,new c)
}
function PromiseDone(n,q,r,v){
if((n[d])===0){
var w=(n[v]);
if(w.length)PromiseEnqueue(r,w,q);
PromiseSet(n,q,r);
}
}
function PromiseCoerce(x,o){
if(!IsPromise(o)&&(%_IsSpecObject(o))){
var y;
try{
y=o.then;
}catch(p){
return %_CallFunction(x,p,PromiseRejected);
}
if((%_ClassOf(y)==='Function')){
var z=%_CallFunction(x,PromiseDeferred);
try{
%_CallFunction(o,z.resolve,z.reject,y);
}catch(p){
z.reject(p);
}
return z.promise;
}
}
return o;
}
function PromiseHandle(r,A,z){
try{
%DebugPushPromise(z.promise,PromiseHandle);
if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(A)))%DebugPrepareStepInIfStepping(A);
var B=A(r);
if(B===z.promise)
throw MakeTypeError(75,B);
else if(IsPromise(B))
%_CallFunction(B,z.resolve,z.reject,PromiseChain);
else
z.resolve(B);
}catch(exception){
try{z.reject(exception);}catch(e){}
}finally{
%DebugPopPromise();
}
}
function PromiseEnqueue(r,w,q){
var C,D,E=(%_DebugIsActive()!=0);
%EnqueueMicrotask(function(){
if(E){
%DebugAsyncTaskEvent({type:"willHandle",id:C,name:D});
}
for(var F=0;F<w.length;F+=2){
PromiseHandle(r,w[F],w[F+1])
}
if(E){
%DebugAsyncTaskEvent({type:"didHandle",id:C,name:D});
}
});
if(E){
C=++k;
D=q>0?"Promise.resolve":"Promise.reject";
%DebugAsyncTaskEvent({type:"enqueue",id:C,name:D});
}
}
function PromiseIdResolveHandler(o){return o}
function PromiseIdRejectHandler(p){throw p}
function PromiseNopResolver(){}
function IsPromise(o){
return(%_IsSpecObject(o))&&(!(o[d]===(void 0)));
}
function PromiseCreate(){
return new l(PromiseNopResolver)
}
function PromiseResolve(n,o){
PromiseDone(n,+1,o,g)
}
function PromiseReject(n,p){
if((n[d])==0){
var G=(%_DebugIsActive()!=0);
if(G||!(!(n[j]===(void 0)))){
%PromiseRejectEvent(n,p,G);
}
}
PromiseDone(n,-1,p,h)
}
function PromiseDeferred(){
if(this===l){
var n=PromiseInit(new l(i));
return{
promise:n,
resolve:function(o){PromiseResolve(n,o)},
reject:function(p){PromiseReject(n,p)}
};
}else{
var B={promise:(void 0),reject:(void 0),resolve:(void 0)};
B.promise=new this(function(H,I){
B.resolve=H;
B.reject=I;
});
return B;
}
}
function PromiseResolved(o){
if(this===l){
return PromiseCreateAndSet(+1,o);
}else{
return new this(function(H,I){H(o)});
}
}
function PromiseRejected(p){
var n;
if(this===l){
n=PromiseCreateAndSet(-1,p);
%PromiseRejectEvent(n,p,false);
}else{
n=new this(function(H,I){I(p)});
}
return n;
}
function PromiseChain(t,u){
t=(t===(void 0))?PromiseIdResolveHandler:t;
u=(u===(void 0))?PromiseIdRejectHandler:u;
var z=%_CallFunction(this.constructor,PromiseDeferred);
switch((this[d])){
case(void 0):
throw MakeTypeError(51,this);
case 0:
(this[g]).push(t,z);
(this[h]).push(u,z);
break;
case+1:
PromiseEnqueue((this[e]),
[t,z],
+1);
break;
case-1:
if(!(!(this[j]===(void 0)))){
%PromiseRevokeReject(this);
}
PromiseEnqueue((this[e]),
[u,z],
-1);
break;
}
(this[j]=true);
if((%_DebugIsActive()!=0)){
%DebugPromiseEvent({promise:z.promise,parentPromise:this});
}
return z.promise;
}
function PromiseCatch(u){
return this.then((void 0),u);
}
function PromiseThen(t,u){
t=(%_ClassOf(t)==='Function')?t
:PromiseIdResolveHandler;
u=(%_ClassOf(u)==='Function')?u
:PromiseIdRejectHandler;
var J=this;
var x=this.constructor;
return %_CallFunction(
this,
function(o){
o=PromiseCoerce(x,o);
if(o===J){
if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(u)))%DebugPrepareStepInIfStepping(u);
return u(MakeTypeError(75,o));
}else if(IsPromise(o)){
return o.then(t,u);
}else{
if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(t)))%DebugPrepareStepInIfStepping(t);
return t(o);
}
},
u,
PromiseChain
);
}
function PromiseCast(o){
return IsPromise(o)?o:new this(function(H){H(o)});
}
function PromiseAll(K){
var z=%_CallFunction(this,PromiseDeferred);
var L=[];
try{
var M=0;
var F=0;
for(var r of K){
this.resolve(r).then(
(function(F){
return function(o){
L[F]=o;
if(--M===0)z.resolve(L);
}
})(F),
function(p){z.reject(p);});
++F;
++M;
}
if(M===0){
z.resolve(L);
}
}catch(e){
z.reject(e)
}
return z.promise;
}
function PromiseRace(K){
var z=%_CallFunction(this,PromiseDeferred);
try{
for(var r of K){
this.resolve(r).then(
function(o){z.resolve(o)},
function(p){z.reject(p)});
}
}catch(e){
z.reject(e)
}
return z.promise;
}
function PromiseHasUserDefinedRejectHandlerRecursive(n){
var N=(n[h]);
if((N===(void 0)))return false;
for(var F=0;F<N.length;F+=2){
if(N[F]!=PromiseIdRejectHandler)return true;
if(PromiseHasUserDefinedRejectHandlerRecursive(N[F+1].promise)){
return true;
}
}
return false;
}
function PromiseHasUserDefinedRejectHandler(){
return PromiseHasUserDefinedRejectHandlerRecursive(this);
};
%AddNamedProperty(a,'Promise',l,2);
%AddNamedProperty(l.prototype,symbolToStringTag,"Promise",
2|1);
b.InstallFunctions(l,2,[
"defer",PromiseDeferred,
"accept",PromiseResolved,
"reject",PromiseRejected,
"all",PromiseAll,
"race",PromiseRace,
"resolve",PromiseCast
]);
b.InstallFunctions(l.prototype,2,[
"chain",PromiseChain,
"then",PromiseThen,
"catch",PromiseCatch
]);
$promiseCreate=PromiseCreate;
$promiseResolve=PromiseResolve;
$promiseReject=PromiseReject;
$promiseChain=PromiseChain;
$promiseCatch=PromiseCatch;
$promiseThen=PromiseThen;
$promiseHasUserDefinedRejectHandler=PromiseHasUserDefinedRejectHandler;
$promiseStatus=d;
$promiseValue=e;
})
messagese<73>
var $errorToString;
var $getStackTraceLine;
var $messageGetPositionInLine;
var $messageGetLineNumber;
var $messageGetSourceLine;
var $noSideEffectToString;
var $stackOverflowBoilerplate;
var $stackTraceSymbol;
var $toDetailString;
var $Error;
var $EvalError;
var $RangeError;
var $ReferenceError;
var $SyntaxError;
var $TypeError;
var $URIError;
var MakeError;
var MakeEvalError;
var MakeRangeError;
var MakeReferenceError;
var MakeSyntaxError;
var MakeTypeError;
var MakeURIError;
(function(a,b){
%CheckIsBootstrapping();
var c=a.Object;
var d=b.InternalArray;
var e=b.ObjectDefineProperty;
var g;
var h;
var i;
var j;
var k;
b.Import(function(l){
g=l.ArrayJoin;
h=l.ObjectToString;
i=l.StringCharAt;
j=l.StringIndexOf;
k=l.StringSubstring;
});
var m;
var n;
var o;
var p;
var q;
var r;
var t;
function NoSideEffectsObjectToString(){
if((this===(void 0))&&!(%_IsUndetectableObject(this)))return"[object Undefined]";
if((this===null))return"[object Null]";
return"[object "+%_ClassOf(((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this)))+"]";
}
function NoSideEffectToString(u){
if((typeof(u)==='string'))return u;
if((typeof(u)==='number'))return %_NumberToString(u);
if((typeof(u)==='boolean'))return u?'true':'false';
if((u===(void 0)))return'undefined';
if((u===null))return'null';
if((%_IsFunction(u))){
var v=%_CallFunction(u,u,$functionSourceString);
if(v.length>128){
v=%_SubString(v,0,111)+"...<omitted>..."+
%_SubString(v,v.length-2,v.length);
}
return v;
}
if((typeof(u)==='symbol'))return %_CallFunction(u,$symbolToString);
if((%_IsObject(u))
&&%GetDataProperty(u,"toString")===h){
var w=%GetDataProperty(u,"constructor");
if(typeof w=="function"){
var x=w.name;
if((typeof(x)==='string')&&x!==""){
return"#<"+x+">";
}
}
}
if(CanBeSafelyTreatedAsAnErrorObject(u)){
return %_CallFunction(u,ErrorToString);
}
return %_CallFunction(u,NoSideEffectsObjectToString);
}
function CanBeSafelyTreatedAsAnErrorObject(u){
switch(%_ClassOf(u)){
case'Error':
case'EvalError':
case'RangeError':
case'ReferenceError':
case'SyntaxError':
case'TypeError':
case'URIError':
return true;
}
var y=%GetDataProperty(u,"toString");
return u instanceof m&&y===ErrorToString;
}
function ToStringCheckErrorObject(u){
if(CanBeSafelyTreatedAsAnErrorObject(u)){
return %_CallFunction(u,ErrorToString);
}else{
return $toString(u);
}
}
function ToDetailString(u){
if(u!=null&&(%_IsObject(u))&&u.toString===h){
var w=u.constructor;
if(typeof w=="function"){
var x=w.name;
if((typeof(x)==='string')&&x!==""){
return"#<"+x+">";
}
}
}
return ToStringCheckErrorObject(u);
}
function MakeGenericError(w,z,A,B,C){
if((A===(void 0))&&(typeof(z)==='string'))A=[];
return new w(FormatMessage(z,A,B,C));
}
%FunctionSetInstanceClassName(Script,'Script');
%AddNamedProperty(Script.prototype,'constructor',Script,
2|4|1);
%SetCode(Script,function(D){
throw MakeError(5);
});
function FormatMessage(z,A,B,C){
var A=NoSideEffectToString(A);
var B=NoSideEffectToString(B);
var C=NoSideEffectToString(C);
try{
return %FormatMessageString(z,A,B,C);
}catch(e){
return"<error>";
}
}
function GetLineNumber(E){
var F=%MessageGetStartPosition(E);
if(F==-1)return 0;
var G=%MessageGetScript(E);
var H=G.locationFromPosition(F,true);
if(H==null)return 0;
return H.line+1;
}
function GetSourceLine(E){
var G=%MessageGetScript(E);
var F=%MessageGetStartPosition(E);
var H=G.locationFromPosition(F,true);
if(H==null)return"";
return H.sourceText();
}
function ScriptLineFromPosition(I){
var J=0;
var K=this.lineCount()-1;
var L=this.line_ends;
if(I>L[K]){
return-1;
}
if(I<=L[0]){
return 0;
}
while(K>=1){
var M=(J+K)>>1;
if(I>L[M]){
J=M+1;
}else if(I<=L[M-1]){
K=M-1;
}else{
return M;
}
}
return-1;
}
function ScriptLocationFromPosition(I,
include_resource_offset){
var N=this.lineFromPosition(I);
if(N==-1)return null;
var L=this.line_ends;
var O=N==0?0:L[N-1]+1;
var P=L[N];
if(P>0&&%_CallFunction(this.source,P-1,i)=='\r'){
P--;
}
var Q=I-O;
if(include_resource_offset){
N+=this.line_offset;
if(N==this.line_offset){
Q+=this.column_offset;
}
}
return new SourceLocation(this,I,N,Q,O,P);
}
function ScriptLocationFromLine(R,S,T){
var N=0;
if(!(R===(void 0))){
N=R-this.line_offset;
}
var Q=S||0;
if(N==0){
Q-=this.column_offset;
}
var U=T||0;
if(N<0||Q<0||U<0)return null;
if(N==0){
return this.locationFromPosition(U+Q,false);
}else{
var V=this.lineFromPosition(U);
if(V==-1||V+N>=this.lineCount()){
return null;
}
return this.locationFromPosition(
this.line_ends[V+N-1]+1+Q);
}
}
function ScriptSourceSlice(W,X){
var Y=(W===(void 0))?this.line_offset
:W;
var Z=(X===(void 0))?this.line_offset+this.lineCount()
:X;
Y-=this.line_offset;
Z-=this.line_offset;
if(Y<0)Y=0;
if(Z>this.lineCount())Z=this.lineCount();
if(Y>=this.lineCount()||
Z<0||
Y>Z){
return null;
}
var L=this.line_ends;
var aa=Y==0?0:L[Y-1]+1;
var ab=Z==0?0:L[Z-1]+1;
return new SourceSlice(this,
Y+this.line_offset,
Z+this.line_offset,
aa,ab);
}
function ScriptSourceLine(R){
var N=0;
if(!(R===(void 0))){
N=R-this.line_offset;
}
if(N<0||this.lineCount()<=N){
return null;
}
var L=this.line_ends;
var O=N==0?0:L[N-1]+1;
var P=L[N];
return %_CallFunction(this.source,O,P,k);
}
function ScriptLineCount(){
return this.line_ends.length;
}
function ScriptLineEnd(ac){
return this.line_ends[ac];
}
function ScriptNameOrSourceURL(){
if(this.source_url)return this.source_url;
return this.name;
}
b.SetUpLockedPrototype(Script,[
"source",
"name",
"source_url",
"source_mapping_url",
"line_ends",
"line_offset",
"column_offset"
],[
"lineFromPosition",ScriptLineFromPosition,
"locationFromPosition",ScriptLocationFromPosition,
"locationFromLine",ScriptLocationFromLine,
"sourceSlice",ScriptSourceSlice,
"sourceLine",ScriptSourceLine,
"lineCount",ScriptLineCount,
"nameOrSourceURL",ScriptNameOrSourceURL,
"lineEnd",ScriptLineEnd
]
);
function SourceLocation(G,I,N,Q,O,P){
this.script=G;
this.position=I;
this.line=N;
this.column=Q;
this.start=O;
this.end=P;
}
function SourceLocationSourceText(){
return %_CallFunction(this.script.source,
this.start,
this.end,
k);
}
b.SetUpLockedPrototype(SourceLocation,
["script","position","line","column","start","end"],
["sourceText",SourceLocationSourceText]
);
function SourceSlice(G,Y,Z,aa,ab){
this.script=G;
this.from_line=Y;
this.to_line=Z;
this.from_position=aa;
this.to_position=ab;
}
function SourceSliceSourceText(){
return %_CallFunction(this.script.source,
this.from_position,
this.to_position,
k);
}
b.SetUpLockedPrototype(SourceSlice,
["script","from_line","to_line","from_position","to_position"],
["sourceText",SourceSliceSourceText]
);
function GetPositionInLine(E){
var G=%MessageGetScript(E);
var F=%MessageGetStartPosition(E);
var H=G.locationFromPosition(F,false);
if(H==null)return-1;
return F-H.start;
}
function GetStackTraceLine(ad,ae,af,ag){
return new CallSite(ad,ae,af,false).toString();
}
var ah=(%CreatePrivateSymbol("CallSite#receiver"));
var ai=(%CreatePrivateSymbol("CallSite#function"));
var aj=(%CreatePrivateSymbol("CallSite#position"));
var ak=(%CreatePrivateSymbol("CallSite#strict_mode"));
function CallSite(al,ae,af,am){
(this[ah]=al);
(this[ai]=ae);
(this[aj]=af);
(this[ak]=am);
}
function CallSiteGetThis(){
return(this[ak])
?(void 0):(this[ah]);
}
function CallSiteGetFunction(){
return(this[ak])
?(void 0):(this[ai]);
}
function CallSiteGetPosition(){
return(this[aj]);
}
function CallSiteGetTypeName(){
return GetTypeName((this[ah]),false);
}
function CallSiteIsToplevel(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteIsToplevelRT(al,ae,af);
}
function CallSiteIsEval(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteIsEvalRT(al,ae,af);
}
function CallSiteGetEvalOrigin(){
var G=%FunctionGetScript((this[ai]));
return FormatEvalOrigin(G);
}
function CallSiteGetScriptNameOrSourceURL(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetScriptNameOrSourceUrlRT(al,ae,af);
}
function CallSiteGetFunctionName(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetFunctionNameRT(al,ae,af);
}
function CallSiteGetMethodName(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetMethodNameRT(al,ae,af);
}
function CallSiteGetFileName(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetFileNameRT(al,ae,af);
}
function CallSiteGetLineNumber(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetLineNumberRT(al,ae,af);
}
function CallSiteGetColumnNumber(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetColumnNumberRT(al,ae,af);
}
function CallSiteIsNative(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteIsNativeRT(al,ae,af);
}
function CallSiteIsConstructor(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteIsConstructorRT(al,ae,af);
}
function CallSiteToString(){
var an;
var ao="";
if(this.isNative()){
ao="native";
}else{
an=this.getScriptNameOrSourceURL();
if(!an&&this.isEval()){
ao=this.getEvalOrigin();
ao+=", ";
}
if(an){
ao+=an;
}else{
ao+="<anonymous>";
}
var ap=this.getLineNumber();
if(ap!=null){
ao+=":"+ap;
var aq=this.getColumnNumber();
if(aq){
ao+=":"+aq;
}
}
}
var N="";
var ar=this.getFunctionName();
var as=true;
var at=this.isConstructor();
var au=!(this.isToplevel()||at);
if(au){
var av=GetTypeName((this[ah]),true);
var aw=this.getMethodName();
if(ar){
if(av&&
%_CallFunction(ar,av,j)!=0){
N+=av+".";
}
N+=ar;
if(aw&&
(%_CallFunction(ar,"."+aw,j)!=
ar.length-aw.length-1)){
N+=" [as "+aw+"]";
}
}else{
N+=av+"."+(aw||"<anonymous>");
}
}else if(at){
N+="new "+(ar||"<anonymous>");
}else if(ar){
N+=ar;
}else{
N+=ao;
as=false;
}
if(as){
N+=" ("+ao+")";
}
return N;
}
b.SetUpLockedPrototype(CallSite,["receiver","fun","pos"],[
"getThis",CallSiteGetThis,
"getTypeName",CallSiteGetTypeName,
"isToplevel",CallSiteIsToplevel,
"isEval",CallSiteIsEval,
"getEvalOrigin",CallSiteGetEvalOrigin,
"getScriptNameOrSourceURL",CallSiteGetScriptNameOrSourceURL,
"getFunction",CallSiteGetFunction,
"getFunctionName",CallSiteGetFunctionName,
"getMethodName",CallSiteGetMethodName,
"getFileName",CallSiteGetFileName,
"getLineNumber",CallSiteGetLineNumber,
"getColumnNumber",CallSiteGetColumnNumber,
"isNative",CallSiteIsNative,
"getPosition",CallSiteGetPosition,
"isConstructor",CallSiteIsConstructor,
"toString",CallSiteToString
]);
function FormatEvalOrigin(G){
var ax=G.nameOrSourceURL();
if(ax){
return ax;
}
var ay="eval at ";
if(G.eval_from_function_name){
ay+=G.eval_from_function_name;
}else{
ay+="<anonymous>";
}
var az=G.eval_from_script;
if(az){
if(az.compilation_type==1){
ay+=" ("+FormatEvalOrigin(az)+")";
}else{
if(az.name){
ay+=" ("+az.name;
var H=az.locationFromPosition(
G.eval_from_script_position,true);
if(H){
ay+=":"+(H.line+1);
ay+=":"+(H.column+1);
}
ay+=")";
}else{
ay+=" (unknown source)";
}
}
}
return ay;
}
function FormatErrorString(aA){
try{
return %_CallFunction(aA,ErrorToString);
}catch(e){
try{
return"<error: "+e+">";
}catch(ee){
return"<error>";
}
}
}
function GetStackFrames(aB){
var aC=new d();
var aD=aB[0];
for(var M=1;M<aB.length;M+=4){
var ad=aB[M];
var ae=aB[M+1];
var aE=aB[M+2];
var aF=aB[M+3];
var af=%_IsSmi(aE)?aE:%FunctionGetPositionForOffset(aE,aF);
aD--;
aC.push(new CallSite(ad,ae,af,(aD<0)));
}
return aC;
}
var aG=false;
function FormatStackTrace(u,aB){
var aC=GetStackFrames(aB);
if((%_IsFunction(m.prepareStackTrace))&&
!aG){
var aH=[];
%MoveArrayContents(aC,aH);
aG=true;
var aI=(void 0);
try{
aI=m.prepareStackTrace(u,aH);
}catch(e){
throw e;
}finally{
aG=false;
}
return aI;
}
var aJ=new d();
aJ.push(FormatErrorString(u));
for(var M=0;M<aC.length;M++){
var aK=aC[M];
var N;
try{
N=aK.toString();
}catch(e){
try{
N="<error: "+e+">";
}catch(ee){
N="<error>";
}
}
aJ.push(" at "+N);
}
return %_CallFunction(aJ,"\n",g);
}
function GetTypeName(al,aL){
if((al==null))return null;
var w=al.constructor;
if(!w){
return aL?null:
%_CallFunction(al,NoSideEffectsObjectToString);
}
var x=w.name;
if(!x){
return aL?null:
%_CallFunction(al,NoSideEffectsObjectToString);
}
return x;
}
var aM=(%CreatePrivateSymbol("formatted stack trace"));
var aN=function(){
var aO=(void 0);
var aP=this;
while(aP){
var aO=
(aP[aM]);
if((aO===(void 0))){
var aI=(aP[$stackTraceSymbol]);
if((aI===(void 0))){
aP=%_GetPrototype(aP);
continue;
}
aO=FormatStackTrace(aP,aI);
(aP[$stackTraceSymbol]=(void 0));
(aP[aM]=aO);
}
return aO;
}
return(void 0);
};
var aQ=function(aR){
if((%HasOwnProperty(this,$stackTraceSymbol))){
(this[$stackTraceSymbol]=(void 0));
(this[aM]=aR);
}
};
var aS=function(){};
function DefineError(a,aT){
var aU=aT.name;
%AddNamedProperty(a,aU,aT,2);
if(aU=='Error'){
var aV=function(){};
%FunctionSetPrototype(aV,c.prototype);
%FunctionSetInstanceClassName(aV,'Error');
%FunctionSetPrototype(aT,new aV());
}else{
%FunctionSetPrototype(aT,new m());
%InternalSetPrototype(aT,m);
}
%FunctionSetInstanceClassName(aT,'Error');
%AddNamedProperty(aT.prototype,'constructor',aT,2);
%AddNamedProperty(aT.prototype,'name',aU,2);
%SetCode(aT,function(aW){
if(%_IsConstructCall()){
try{aS(this,aT);}catch(e){}
if(!(aW===(void 0))){
%AddNamedProperty(this,'message',$toString(aW),2);
}
}else{
return new aT(aW);
}
});
%SetNativeFlag(aT);
return aT;
};
m=DefineError(a,function Error(){});
t=DefineError(a,function EvalError(){});
o=DefineError(a,function RangeError(){});
r=DefineError(a,function ReferenceError(){});
q=DefineError(a,function SyntaxError(){});
n=DefineError(a,function TypeError(){});
p=DefineError(a,function URIError(){});
%AddNamedProperty(m.prototype,'message','',2);
var aX=new d();
var aY=new c();
function GetPropertyWithoutInvokingMonkeyGetters(aA,aU){
var aZ=aA;
while(aZ&&!%HasOwnProperty(aZ,aU)){
aZ=%_GetPrototype(aZ);
}
if((aZ===null))return(void 0);
if(!(%_IsObject(aZ)))return aA[aU];
var ba=%GetOwnProperty(aZ,aU);
if(ba&&ba[0]){
var bb=aU==="name";
if(aZ===r.prototype)
return bb?"ReferenceError":(void 0);
if(aZ===q.prototype)
return bb?"SyntaxError":(void 0);
if(aZ===n.prototype)
return bb?"TypeError":(void 0);
}
return aA[aU];
}
function ErrorToStringDetectCycle(aA){
if(!%PushIfAbsent(aX,aA))throw aY;
try{
var aU=GetPropertyWithoutInvokingMonkeyGetters(aA,"name");
aU=(aU===(void 0))?"Error":((typeof(%IS_VAR(aU))==='string')?aU:$nonStringToString(aU));
var E=GetPropertyWithoutInvokingMonkeyGetters(aA,"message");
E=(E===(void 0))?"":((typeof(%IS_VAR(E))==='string')?E:$nonStringToString(E));
if(aU==="")return E;
if(E==="")return aU;
return aU+": "+E;
}finally{
aX.length=aX.length-1;
}
}
function ErrorToString(){
if(!(%_IsSpecObject(this))){
throw MakeTypeError(13,"Error.prototype.toString");
}
try{
return ErrorToStringDetectCycle(this);
}catch(e){
if(e===aY){
return'';
}
throw e;
}
}
b.InstallFunctions(m.prototype,2,
['toString',ErrorToString]);
$errorToString=ErrorToString;
$getStackTraceLine=GetStackTraceLine;
$messageGetPositionInLine=GetPositionInLine;
$messageGetLineNumber=GetLineNumber;
$messageGetSourceLine=GetSourceLine;
$noSideEffectToString=NoSideEffectToString;
$toDetailString=ToDetailString;
$Error=m;
$EvalError=t;
$RangeError=o;
$ReferenceError=r;
$SyntaxError=q;
$TypeError=n;
$URIError=p;
MakeError=function(z,A,B,C){
return MakeGenericError(m,z,A,B,C);
}
MakeEvalError=function(z,A,B,C){
return MakeGenericError(t,z,A,B,C);
}
MakeRangeError=function(z,A,B,C){
return MakeGenericError(o,z,A,B,C);
}
MakeReferenceError=function(z,A,B,C){
return MakeGenericError(r,z,A,B,C);
}
MakeSyntaxError=function(z,A,B,C){
return MakeGenericError(q,z,A,B,C);
}
MakeTypeError=function(z,A,B,C){
return MakeGenericError(n,z,A,B,C);
}
MakeURIError=function(){
return MakeGenericError(p,232);
}
$stackOverflowBoilerplate=MakeRangeError(144);
%DefineAccessorPropertyUnchecked($stackOverflowBoilerplate,'stack',
aN,aQ,
2);
aS=function captureStackTrace(u,bc){
e(u,'stack',{get:aN,
set:aQ,
configurable:true});
%CollectStackTrace(u,bc?bc:aS);
};
m.captureStackTrace=aS;
});
json<6F>:
var $jsonSerializeAdapter;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.JSON;
var d=b.InternalArray;
var e;
var g;
var h;
b.Import(function(i){
e=i.MathMax;
g=i.MathMin;
h=i.ObjectHasOwnProperty;
});
function Revive(j,k,l){
var m=j[k];
if((%_IsObject(m))){
if((%_IsArray(m))){
var n=m.length;
for(var o=0;o<n;o++){
var p=Revive(m,%_NumberToString(o),l);
m[o]=p;
}
}else{
for(var q in m){
if((%_CallFunction(m,q,h))){
var p=Revive(m,q,l);
if((p===(void 0))){
delete m[q];
}else{
m[q]=p;
}
}
}
}
}
return %_CallFunction(j,k,m,l);
}
function JSONParse(r,l){
var t=%ParseJson(((typeof(%IS_VAR(r))==='string')?r:$nonStringToString(r)));
if((%_ClassOf(l)==='Function')){
return Revive({'':t},'',l);
}else{
return t;
}
}
function SerializeArray(u,v,w,x,y){
if(!%PushIfAbsent(w,u))throw MakeTypeError(17);
var z=x;
x+=y;
var A=new d();
var B=u.length;
for(var o=0;o<B;o++){
var C=JSONSerialize(%_NumberToString(o),u,v,w,
x,y);
if((C===(void 0))){
C="null";
}
A.push(C);
}
var D;
if(y==""){
D="["+A.join(",")+"]";
}else if(A.length>0){
var E=",\n"+x;
D="[\n"+x+A.join(E)+"\n"+
z+"]";
}else{
D="[]";
}
w.pop();
return D;
}
function SerializeObject(u,v,w,x,y){
if(!%PushIfAbsent(w,u))throw MakeTypeError(17);
var z=x;
x+=y;
var A=new d();
if((%_IsArray(v))){
var n=v.length;
for(var o=0;o<n;o++){
if((%_CallFunction(v,o,h))){
var q=v[o];
var C=JSONSerialize(q,u,v,w,x,y);
if(!(C===(void 0))){
var F=%QuoteJSONString(q)+":";
if(y!="")F+=" ";
F+=C;
A.push(F);
}
}
}
}else{
for(var q in u){
if((%_CallFunction(u,q,h))){
var C=JSONSerialize(q,u,v,w,x,y);
if(!(C===(void 0))){
var F=%QuoteJSONString(q)+":";
if(y!="")F+=" ";
F+=C;
A.push(F);
}
}
}
}
var D;
if(y==""){
D="{"+A.join(",")+"}";
}else if(A.length>0){
var E=",\n"+x;
D="{\n"+x+A.join(E)+"\n"+
z+"}";
}else{
D="{}";
}
w.pop();
return D;
}
function JSONSerialize(G,j,v,w,x,y){
var u=j[G];
if((%_IsSpecObject(u))){
var H=u.toJSON;
if((%_ClassOf(H)==='Function')){
u=%_CallFunction(u,G,H);
}
}
if((%_ClassOf(v)==='Function')){
u=%_CallFunction(j,G,u,v);
}
if((typeof(u)==='string')){
return %QuoteJSONString(u);
}else if((typeof(u)==='number')){
return((%_IsSmi(%IS_VAR(u))||u-u==0)?%_NumberToString(u):"null");
}else if((typeof(u)==='boolean')){
return u?"true":"false";
}else if((u===null)){
return"null";
}else if((%_IsSpecObject(u))&&!(typeof u=="function")){
if((%_IsArray(u))){
return SerializeArray(u,v,w,x,y);
}else if((%_ClassOf(u)==='Number')){
u=$toNumber(u);
return((%_IsSmi(%IS_VAR(u))||u-u==0)?%_NumberToString(u):"null");
}else if((%_ClassOf(u)==='String')){
return %QuoteJSONString($toString(u));
}else if((%_ClassOf(u)==='Boolean')){
return %_ValueOf(u)?"true":"false";
}else{
return SerializeObject(u,v,w,x,y);
}
}
return(void 0);
}
function JSONStringify(u,v,I){
if(%_ArgumentsLength()==1){
return %BasicJSONStringify(u);
}
if((%_IsArray(v))){
var J=new d();
var K={__proto__:null};
var n=v.length;
for(var o=0;o<n;o++){
var L=v[o];
var M;
if((typeof(L)==='string')){
M=L;
}else if((typeof(L)==='number')){
M=%_NumberToString(L);
}else if((%_ClassOf(L)==='String')||(%_ClassOf(L)==='Number')){
M=$toString(L);
}else{
continue;
}
if(!K[M]){
J.push(M);
K[M]=true;
}
}
v=J;
}
if((%_IsObject(I))){
if((%_ClassOf(I)==='Number')){
I=$toNumber(I);
}else if((%_ClassOf(I)==='String')){
I=$toString(I);
}
}
var y;
if((typeof(I)==='number')){
I=e(0,g($toInteger(I),10));
y=%_SubString(" ",0,I);
}else if((typeof(I)==='string')){
if(I.length>10){
y=%_SubString(I,0,10);
}else{
y=I;
}
}else{
y="";
}
return JSONSerialize('',{'':u},v,new d(),"",y);
}
%AddNamedProperty(c,symbolToStringTag,"JSON",1|2);
b.InstallFunctions(c,2,[
"parse",JSONParse,
"stringify",JSONStringify
]);
$jsonSerializeAdapter=function(G,N){
var j={};
j[G]=N;
return JSONSerialize(G,j,(void 0),new d(),"","");
}
})
8array-iteratoriA
var $arrayValues;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Array;
var d=a.Uint8Array;
var e=a.Int8Array;
var g=a.Uint16Array;
var h=a.Int16Array;
var i=a.Uint32Array;
var j=a.Int32Array;
var k=a.Float32Array;
var l=a.Float64Array;
var m=a.Uint8ClampedArray;
var n=(%CreateGlobalPrivateSymbol("ArrayIterator#object"));
var o=(%CreateGlobalPrivateSymbol("ArrayIterator#next"));
var p=(%CreateGlobalPrivateSymbol("ArrayIterator#kind"));
function ArrayIterator(){}
function CreateArrayIterator(q,r){
var t=$toObject(q);
var u=new ArrayIterator;
(u[n]=t);
(u[o]=0);
(u[p]=r);
return u;
}
function CreateIteratorResultObject(v,w){
return{value:v,done:w};
}
function ArrayIteratorIterator(){
return this;
}
function ArrayIteratorNext(){
var u=$toObject(this);
if(!(!(u[o]===(void 0)))){
throw MakeTypeError(33,
'Array Iterator.prototype.next',this);
}
var q=(u[n]);
if((q===(void 0))){
return CreateIteratorResultObject((void 0),true);
}
var x=(u[o]);
var y=(u[p]);
var z=(q.length>>>0);
if(x>=z){
(u[n]=(void 0));
return CreateIteratorResultObject((void 0),true);
}
(u[o]=x+1);
if(y==2){
return CreateIteratorResultObject(q[x],false);
}
if(y==3){
return CreateIteratorResultObject([x,q[x]],false);
}
return CreateIteratorResultObject(x,false);
}
function ArrayEntries(){
return CreateArrayIterator(this,3);
}
function ArrayValues(){
return CreateArrayIterator(this,2);
}
function ArrayKeys(){
return CreateArrayIterator(this,1);
}
%FunctionSetPrototype(ArrayIterator,{__proto__:$iteratorPrototype});
%FunctionSetInstanceClassName(ArrayIterator,'Array Iterator');
b.InstallFunctions(ArrayIterator.prototype,2,[
'next',ArrayIteratorNext
]);
b.SetFunctionName(ArrayIteratorIterator,symbolIterator);
%AddNamedProperty(ArrayIterator.prototype,symbolIterator,
ArrayIteratorIterator,2);
%AddNamedProperty(ArrayIterator.prototype,symbolToStringTag,
"Array Iterator",1|2);
b.InstallFunctions(c.prototype,2,[
'entries',ArrayEntries,
'keys',ArrayKeys
]);
%AddNamedProperty(c.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(d.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(d.prototype,'values',ArrayValues,2);
%AddNamedProperty(d.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(d.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(e.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(e.prototype,'values',ArrayValues,2);
%AddNamedProperty(e.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(e.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(g.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(g.prototype,'values',ArrayValues,2);
%AddNamedProperty(g.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(g.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(h.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(h.prototype,'values',ArrayValues,2);
%AddNamedProperty(h.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(h.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(i.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(i.prototype,'values',ArrayValues,2);
%AddNamedProperty(i.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(i.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(j.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(j.prototype,'values',ArrayValues,2);
%AddNamedProperty(j.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(j.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(k.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(k.prototype,'values',ArrayValues,2);
%AddNamedProperty(k.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(k.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(l.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(l.prototype,'values',ArrayValues,2);
%AddNamedProperty(l.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(l.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(m.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(m.prototype,'values',ArrayValues,2);
%AddNamedProperty(m.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(m.prototype,symbolIterator,ArrayValues,
2);
b.Export(function(A){
A.ArrayIteratorCreateResultObject=CreateIteratorResultObject;
});
$arrayValues=ArrayValues;
})
<string-iterator%
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.String;
var d;
b.Import(function(e){
d=e.ArrayIteratorCreateResultObject;
});
var g=
(%CreateGlobalPrivateSymbol("StringIterator#iteratedString"));
var h=(%CreateGlobalPrivateSymbol("StringIterator#next"));
function StringIterator(){}
function CreateStringIterator(i){
var j=((typeof(%IS_VAR(i))==='string')?i:$nonStringToString(i));
var k=new StringIterator;
(k[g]=j);
(k[h]=0);
return k;
}
function StringIteratorNext(){
var k=$toObject(this);
if(!(!(k[h]===(void 0)))){
throw MakeTypeError(33,
'String Iterator.prototype.next');
}
var j=(k[g]);
if((j===(void 0))){
return d((void 0),true);
}
var l=(k[h]);
var m=(j.length>>>0);
if(l>=m){
(k[g]=(void 0));
return d((void 0),true);
}
var n=%_StringCharCodeAt(j,l);
var o=%_StringCharFromCode(n);
l++;
if(n>=0xD800&&n<=0xDBFF&&l<m){
var p=%_StringCharCodeAt(j,l);
if(p>=0xDC00&&p<=0xDFFF){
o+=%_StringCharFromCode(p);
l++;
}
}
(k[h]=l);
return d(o,false);
}
function StringPrototypeIterator(){
return CreateStringIterator(this);
}
%FunctionSetPrototype(StringIterator,{__proto__:$iteratorPrototype});
%FunctionSetInstanceClassName(StringIterator,'String Iterator');
b.InstallFunctions(StringIterator.prototype,2,[
'next',StringIteratorNext
]);
%AddNamedProperty(StringIterator.prototype,symbolToStringTag,
"String Iterator",1|2);
b.SetFunctionName(StringPrototypeIterator,symbolIterator);
%AddNamedProperty(c.prototype,symbolIterator,
StringPrototypeIterator,2);
})
$templates<65>
var $getTemplateCallSite;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Map;
var d=b.InternalArray;
var e=new c;
var g=c.prototype.get;
var h=c.prototype.set;
function SameCallSiteElements(i,j){
var k=i.length;
var j=j.raw;
if(k!==j.length)return false;
for(var l=0;l<k;++l){
if(i[l]!==j[l])return false;
}
return true;
}
function GetCachedCallSite(m,n){
var o=%_CallFunction(e,n,g);
if((o===(void 0)))return;
var k=o.length;
for(var l=0;l<k;++l){
if(SameCallSiteElements(m,o[l]))return o[l];
}
}
function SetCachedCallSite(m,n){
var o=%_CallFunction(e,n,g);
var p;
if((o===(void 0))){
p=new d(1);
p[0]=m;
%_CallFunction(e,n,p,h);
}else{
o.push(m);
}
return m;
}
$getTemplateCallSite=function(m,i,n){
var q=GetCachedCallSite(i,n);
if(!(q===(void 0)))return q;
%AddNamedProperty(m,"raw",%ObjectFreeze(i),
1|2|4);
return SetCachedCallSite(%ObjectFreeze(m),n);
}
})
4harmony-array<61>F
(function(a,b){
'use strict';
%CheckIsBootstrapping();
var c=a.Array;
var d=a.Symbol;
var e;
var g;
var h;
var i;
var j;
var k;
b.Import(function(l){
e=l.GetIterator;
g=l.GetMethod;
h=l.MathMax;
i=l.MathMin;
j=l.ObjectIsFrozen;
k=l.ObjectDefineProperty;
});
function InnerArrayCopyWithin(m,n,o,p,q){
m=(%_IsSmi(%IS_VAR(m))?m:%NumberToInteger($toNumber(m)));
var r;
if(m<0){
r=h(q+m,0);
}else{
r=i(m,q);
}
n=(%_IsSmi(%IS_VAR(n))?n:%NumberToInteger($toNumber(n)));
var l;
if(n<0){
l=h(q+n,0);
}else{
l=i(n,q);
}
o=(o===(void 0))?q:(%_IsSmi(%IS_VAR(o))?o:%NumberToInteger($toNumber(o)));
var t;
if(o<0){
t=h(q+o,0);
}else{
t=i(o,q);
}
var u=i(t-l,q-r);
var v=1;
if(l<r&&r<(l+u)){
v=-1;
l=l+u-1;
r=r+u-1;
}
while(u>0){
if(l in p){
p[r]=p[l];
}else{
delete p[r];
}
l=l+v;
r=r+v;
u--;
}
return p;
}
function ArrayCopyWithin(m,n,o){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.copyWithin");
var p=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var q=$toLength(p.length);
return InnerArrayCopyWithin(m,n,o,p,q);
}
function InnerArrayFind(w,x,p,q){
if(!(%_ClassOf(w)==='Function')){
throw MakeTypeError(12,w);
}
var y=false;
if((x===null)){
if(%IsSloppyModeFunction(w))x=(void 0);
}else if(!(x===(void 0))){
y=(!(%_IsSpecObject(x))&&%IsSloppyModeFunction(w));
}
for(var z=0;z<q;z++){
var A=p[z];
var B=y?$toObject(x):x;
if(%_CallFunction(B,A,z,p,w)){
return A;
}
}
return;
}
function ArrayFind(w,x){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.find");
var p=$toObject(this);
var q=$toInteger(p.length);
return InnerArrayFind(w,x,p,q);
}
function InnerArrayFindIndex(w,x,p,q){
if(!(%_ClassOf(w)==='Function')){
throw MakeTypeError(12,w);
}
var y=false;
if((x===null)){
if(%IsSloppyModeFunction(w))x=(void 0);
}else if(!(x===(void 0))){
y=(!(%_IsSpecObject(x))&&%IsSloppyModeFunction(w));
}
for(var z=0;z<q;z++){
var A=p[z];
var B=y?$toObject(x):x;
if(%_CallFunction(B,A,z,p,w)){
return z;
}
}
return-1;
}
function ArrayFindIndex(w,x){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.findIndex");
var p=$toObject(this);
var q=$toInteger(p.length);
return InnerArrayFindIndex(w,x,p,q);
}
function InnerArrayFill(C,n,o,p,q){
var z=(n===(void 0))?0:(%_IsSmi(%IS_VAR(n))?n:%NumberToInteger($toNumber(n)));
var o=(o===(void 0))?q:(%_IsSmi(%IS_VAR(o))?o:%NumberToInteger($toNumber(o)));
if(z<0){
z+=q;
if(z<0)z=0;
}else{
if(z>q)z=q;
}
if(o<0){
o+=q;
if(o<0)o=0;
}else{
if(o>q)o=q;
}
if((o-z)>0&&j(p)){
throw MakeTypeError(9);
}
for(;z<o;z++)
p[z]=C;
return p;
}
function ArrayFill(C,n,o){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.fill");
var p=$toObject(this);
var q=(p.length>>>0);
return InnerArrayFill(C,n,o,p,q);
}
function AddArrayElement(D,p,z,C){
if(D===c){
%AddElement(p,z,C);
}else{
k(p,z,{
value:C,writable:true,configurable:true,enumerable:true
});
}
}
function ArrayFrom(E,F,G){
var H=$toObject(E);
var I=!(F===(void 0));
if(I){
if(!(%_ClassOf(F)==='Function')){
throw MakeTypeError(12,F);
}else if(%IsSloppyModeFunction(F)){
if((G===null)){
G=(void 0);
}else if(!(G===(void 0))){
G=((%_IsSpecObject(%IS_VAR(G)))?G:$toObject(G));
}
}
}
var J=g(H,symbolIterator);
var K;
var L;
var M;
var N;
if(!(J===(void 0))){
L=%IsConstructor(this)?new this():[];
var O=e(H,J);
K=0;
while(true){
var P=O.next();
if(!(%_IsObject(P))){
throw MakeTypeError(38,P);
}
if(P.done){
L.length=K;
return L;
}
N=P.value;
if(I){
M=%_CallFunction(G,N,K,F);
}else{
M=N;
}
AddArrayElement(this,L,K,M);
K++;
}
}else{
var Q=$toLength(H.length);
L=%IsConstructor(this)?new this(Q):new c(Q);
for(K=0;K<Q;++K){
N=H[K];
if(I){
M=%_CallFunction(G,N,K,F);
}else{
M=N;
}
AddArrayElement(this,L,K,M);
}
L.length=K;
return L;
}
}
function ArrayOf(){
var q=%_ArgumentsLength();
var D=this;
var p=%IsConstructor(D)?new D(q):[];
for(var z=0;z<q;z++){
AddArrayElement(D,p,z,%_Arguments(z));
}
p.length=q;
return p;
}
%FunctionSetLength(ArrayCopyWithin,2);
%FunctionSetLength(ArrayFrom,1);
%FunctionSetLength(ArrayFill,1);
%FunctionSetLength(ArrayFind,1);
%FunctionSetLength(ArrayFindIndex,1);
b.InstallFunctions(c,2,[
"from",ArrayFrom,
"of",ArrayOf
]);
b.InstallFunctions(c.prototype,2,[
"copyWithin",ArrayCopyWithin,
"find",ArrayFind,
"findIndex",ArrayFindIndex,
"fill",ArrayFill
]);
b.Export(function(r){
r.ArrayFrom=ArrayFrom;
r.InnerArrayCopyWithin=InnerArrayCopyWithin;
r.InnerArrayFill=InnerArrayFill;
r.InnerArrayFind=InnerArrayFind;
r.InnerArrayFindIndex=InnerArrayFindIndex;
});
})
Hharmony-typedarray5<79>
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Uint8Array;
var d=a.Int8Array;
var e=a.Uint16Array;
var g=a.Int16Array;
var h=a.Uint32Array;
var i=a.Int32Array;
var j=a.Float32Array;
var k=a.Float64Array;
var l=a.Uint8ClampedArray;
var m=a.Array;
var n;
var o;
var p;
var q;
var r;
var t;
var u;
var v;
var w;
var x;
var y;
var z;
var A;
var B;
var C;
var D;
var E;
var F;
var G;
var H;
b.Import(function(I){
n=I.ArrayFrom;
o=I.ArrayToString;
p=I.InnerArrayCopyWithin;
q=I.InnerArrayEvery;
r=I.InnerArrayFill;
t=I.InnerArrayFilter;
u=I.InnerArrayFind;
v=I.InnerArrayFindIndex;
w=I.InnerArrayForEach;
x=I.InnerArrayIndexOf;
y=I.InnerArrayJoin;
z=I.InnerArrayLastIndexOf;
A=I.InnerArrayMap;
InnerArrayReduce=I.InnerArrayReduce;
InnerArrayReduceRight=I.InnerArrayReduceRight;
B=I.InnerArrayReverse;
C=I.InnerArraySome;
D=I.InnerArraySort;
E=I.InnerArrayToLocaleString;
F=I.IsNaN;
G=I.MathMax;
H=I.MathMin;
});
function ConstructTypedArray(J,K){
if(!%IsConstructor(J)||(J.prototype===(void 0))||
!%HasOwnProperty(J.prototype,"BYTES_PER_ELEMENT")){
throw MakeTypeError(57);
}
return new J(K);
}
function ConstructTypedArrayLike(L,K){
return ConstructTypedArray(L.constructor,K);
}
function TypedArrayCopyWithin(M,N,O){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return p(M,N,O,this,P);
}
%FunctionSetLength(TypedArrayCopyWithin,2);
function TypedArrayEvery(Q,R){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return q(Q,R,this,P);
}
%FunctionSetLength(TypedArrayEvery,1);
function TypedArrayForEach(Q,R){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
w(Q,R,this,P);
}
%FunctionSetLength(TypedArrayForEach,1);
function TypedArrayFill(S,N,O){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return r(S,N,O,this,P);
}
%FunctionSetLength(TypedArrayFill,1);
function TypedArrayFilter(T,U){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
var V=t(T,U,this,P);
return ConstructTypedArrayLike(this,V);
}
%FunctionSetLength(TypedArrayFilter,1);
function TypedArrayFind(T,U){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return u(T,U,this,P);
}
%FunctionSetLength(TypedArrayFind,1);
function TypedArrayFindIndex(T,U){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return v(T,U,this,P);
}
%FunctionSetLength(TypedArrayFindIndex,1);
function TypedArrayReverse(){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return B(this,P);
}
function TypedArrayComparefn(W,X){
if(F(W)&&F(X)){
return F(X)?0:1;
}
if(F(W)){
return 1;
}
if(W===0&&W===X){
if(%_IsMinusZero(W)){
if(!%_IsMinusZero(X)){
return-1;
}
}else if(%_IsMinusZero(X)){
return 1;
}
}
return W-X;
}
function TypedArraySort(Y){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
if((Y===(void 0))){
Y=TypedArrayComparefn;
}
return %_CallFunction(this,P,Y,D);
}
function TypedArrayIndexOf(Z,aa){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return %_CallFunction(this,Z,aa,P,x);
}
%FunctionSetLength(TypedArrayIndexOf,1);
function TypedArrayLastIndexOf(Z,aa){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return %_CallFunction(this,Z,aa,P,
%_ArgumentsLength(),z);
}
%FunctionSetLength(TypedArrayLastIndexOf,1);
function TypedArrayMap(T,U){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
var V=A(T,U,this,P);
return ConstructTypedArrayLike(this,V);
}
%FunctionSetLength(TypedArrayMap,1);
function TypedArraySome(Q,R){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return C(Q,R,this,P);
}
%FunctionSetLength(TypedArraySome,1);
function TypedArrayToLocaleString(){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return E(this,P);
}
function TypedArrayToString(){
return %_CallFunction(this,o);
}
function TypedArrayJoin(ab){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return y(ab,this,P);
}
function TypedArrayReduce(ac,ad){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return InnerArrayReduce(ac,ad,this,P,
%_ArgumentsLength());
}
%FunctionSetLength(TypedArrayReduce,1);
function TypedArrayReduceRight(ac,ad){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var P=%_TypedArrayGetLength(this);
return InnerArrayReduceRight(ac,ad,this,P,
%_ArgumentsLength());
}
%FunctionSetLength(TypedArrayReduceRight,1);
function TypedArraySlice(N,O){
if(!%_IsTypedArray(this))throw MakeTypeError(57);
var ae=%_TypedArrayGetLength(this);
var af=(%_IsSmi(%IS_VAR(N))?N:%NumberToInteger($toNumber(N)));
var ag;
if(af<0){
ag=G(ae+af,0);
}else{
ag=H(af,ae);
}
var ah;
if((O===(void 0))){
ah=ae;
}else{
ah=(%_IsSmi(%IS_VAR(O))?O:%NumberToInteger($toNumber(O)));
}
var ai;
if(ah<0){
ai=G(ae+ah,0);
}else{
ai=H(ah,ae);
}
var aj=G(ai-ag,0);
var V=ConstructTypedArrayLike(this,aj);
var ak=0;
while(ag<ai){
var al=this[ag];
V[ak]=al;
ag++;
ak++;
}
return V;
}
function TypedArrayOf(){
var P=%_ArgumentsLength();
var V=new this(P);
for(var am=0;am<P;am++){
V[am]=%_Arguments(am);
}
return V;
}
function TypedArrayFrom(an,ao,U){
var V=%_CallFunction(m,an,ao,U,n);
return ConstructTypedArray(this,V);
}
%FunctionSetLength(TypedArrayFrom,1);
b.InstallFunctions(c,2|4|1,[
"from",TypedArrayFrom,
"of",TypedArrayOf
]);
b.InstallFunctions(c.prototype,2,[
"copyWithin",TypedArrayCopyWithin,
"every",TypedArrayEvery,
"fill",TypedArrayFill,
"filter",TypedArrayFilter,
"find",TypedArrayFind,
"findIndex",TypedArrayFindIndex,
"indexOf",TypedArrayIndexOf,
"join",TypedArrayJoin,
"lastIndexOf",TypedArrayLastIndexOf,
"forEach",TypedArrayForEach,
"map",TypedArrayMap,
"reduce",TypedArrayReduce,
"reduceRight",TypedArrayReduceRight,
"reverse",TypedArrayReverse,
"slice",TypedArraySlice,
"some",TypedArraySome,
"sort",TypedArraySort,
"toString",TypedArrayToString,
"toLocaleString",TypedArrayToLocaleString
]);
b.InstallFunctions(d,2|4|1,[
"from",TypedArrayFrom,
"of",TypedArrayOf
]);
b.InstallFunctions(d.prototype,2,[
"copyWithin",TypedArrayCopyWithin,
"every",TypedArrayEvery,
"fill",TypedArrayFill,
"filter",TypedArrayFilter,
"find",TypedArrayFind,
"findIndex",TypedArrayFindIndex,
"indexOf",TypedArrayIndexOf,
"join",TypedArrayJoin,
"lastIndexOf",TypedArrayLastIndexOf,
"forEach",TypedArrayForEach,
"map",TypedArrayMap,
"reduce",TypedArrayReduce,
"reduceRight",TypedArrayReduceRight,
"reverse",TypedArrayReverse,
"slice",TypedArraySlice,
"some",TypedArraySome,
"sort",TypedArraySort,
"toString",TypedArrayToString,
"toLocaleString",TypedArrayToLocaleString
]);
b.InstallFunctions(e,2|4|1,[
"from",TypedArrayFrom,
"of",TypedArrayOf
]);
b.InstallFunctions(e.prototype,2,[
"copyWithin",TypedArrayCopyWithin,
"every",TypedArrayEvery,
"fill",TypedArrayFill,
"filter",TypedArrayFilter,
"find",TypedArrayFind,
"findIndex",TypedArrayFindIndex,
"indexOf",TypedArrayIndexOf,
"join",TypedArrayJoin,
"lastIndexOf",TypedArrayLastIndexOf,
"forEach",TypedArrayForEach,
"map",TypedArrayMap,
"reduce",TypedArrayReduce,
"reduceRight",TypedArrayReduceRight,
"reverse",TypedArrayReverse,
"slice",TypedArraySlice,
"some",TypedArraySome,
"sort",TypedArraySort,
"toString",TypedArrayToString,
"toLocaleString",TypedArrayToLocaleString
]);
b.InstallFunctions(g,2|4|1,[
"from",TypedArrayFrom,
"of",TypedArrayOf
]);
b.InstallFunctions(g.prototype,2,[
"copyWithin",TypedArrayCopyWithin,
"every",TypedArrayEvery,
"fill",TypedArrayFill,
"filter",TypedArrayFilter,
"find",TypedArrayFind,
"findIndex",TypedArrayFindIndex,
"indexOf",TypedArrayIndexOf,
"join",TypedArrayJoin,
"lastIndexOf",TypedArrayLastIndexOf,
"forEach",TypedArrayForEach,
"map",TypedArrayMap,
"reduce",TypedArrayReduce,
"reduceRight",TypedArrayReduceRight,
"reverse",TypedArrayReverse,
"slice",TypedArraySlice,
"some",TypedArraySome,
"sort",TypedArraySort,
"toString",TypedArrayToString,
"toLocaleString",TypedArrayToLocaleString
]);
b.InstallFunctions(h,2|4|1,[
"from",TypedArrayFrom,
"of",TypedArrayOf
]);
b.InstallFunctions(h.prototype,2,[
"copyWithin",TypedArrayCopyWithin,
"every",TypedArrayEvery,
"fill",TypedArrayFill,
"filter",TypedArrayFilter,
"find",TypedArrayFind,
"findIndex",TypedArrayFindIndex,
"indexOf",TypedArrayIndexOf,
"join",TypedArrayJoin,
"lastIndexOf",TypedArrayLastIndexOf,
"forEach",TypedArrayForEach,
"map",TypedArrayMap,
"reduce",TypedArrayReduce,
"reduceRight",TypedArrayReduceRight,
"reverse",TypedArrayReverse,
"slice",TypedArraySlice,
"some",TypedArraySome,
"sort",TypedArraySort,
"toString",TypedArrayToString,
"toLocaleString",TypedArrayToLocaleString
]);
b.InstallFunctions(i,2|4|1,[
"from",TypedArrayFrom,
"of",TypedArrayOf
]);
b.InstallFunctions(i.prototype,2,[
"copyWithin",TypedArrayCopyWithin,
"every",TypedArrayEvery,
"fill",TypedArrayFill,
"filter",TypedArrayFilter,
"find",TypedArrayFind,
"findIndex",TypedArrayFindIndex,
"indexOf",TypedArrayIndexOf,
"join",TypedArrayJoin,
"lastIndexOf",TypedArrayLastIndexOf,
"forEach",TypedArrayForEach,
"map",TypedArrayMap,
"reduce",TypedArrayReduce,
"reduceRight",TypedArrayReduceRight,
"reverse",TypedArrayReverse,
"slice",TypedArraySlice,
"some",TypedArraySome,
"sort",TypedArraySort,
"toString",TypedArrayToString,
"toLocaleString",TypedArrayToLocaleString
]);
b.InstallFunctions(j,2|4|1,[
"from",TypedArrayFrom,
"of",TypedArrayOf
]);
b.InstallFunctions(j.prototype,2,[
"copyWithin",TypedArrayCopyWithin,
"every",TypedArrayEvery,
"fill",TypedArrayFill,
"filter",TypedArrayFilter,
"find",TypedArrayFind,
"findIndex",TypedArrayFindIndex,
"indexOf",TypedArrayIndexOf,
"join",TypedArrayJoin,
"lastIndexOf",TypedArrayLastIndexOf,
"forEach",TypedArrayForEach,
"map",TypedArrayMap,
"reduce",TypedArrayReduce,
"reduceRight",TypedArrayReduceRight,
"reverse",TypedArrayReverse,
"slice",TypedArraySlice,
"some",TypedArraySome,
"sort",TypedArraySort,
"toString",TypedArrayToString,
"toLocaleString",TypedArrayToLocaleString
]);
b.InstallFunctions(k,2|4|1,[
"from",TypedArrayFrom,
"of",TypedArrayOf
]);
b.InstallFunctions(k.prototype,2,[
"copyWithin",TypedArrayCopyWithin,
"every",TypedArrayEvery,
"fill",TypedArrayFill,
"filter",TypedArrayFilter,
"find",TypedArrayFind,
"findIndex",TypedArrayFindIndex,
"indexOf",TypedArrayIndexOf,
"join",TypedArrayJoin,
"lastIndexOf",TypedArrayLastIndexOf,
"forEach",TypedArrayForEach,
"map",TypedArrayMap,
"reduce",TypedArrayReduce,
"reduceRight",TypedArrayReduceRight,
"reverse",TypedArrayReverse,
"slice",TypedArraySlice,
"some",TypedArraySome,
"sort",TypedArraySort,
"toString",TypedArrayToString,
"toLocaleString",TypedArrayToLocaleString
]);
b.InstallFunctions(l,2|4|1,[
"from",TypedArrayFrom,
"of",TypedArrayOf
]);
b.InstallFunctions(l.prototype,2,[
"copyWithin",TypedArrayCopyWithin,
"every",TypedArrayEvery,
"fill",TypedArrayFill,
"filter",TypedArrayFilter,
"find",TypedArrayFind,
"findIndex",TypedArrayFindIndex,
"indexOf",TypedArrayIndexOf,
"join",TypedArrayJoin,
"lastIndexOf",TypedArrayLastIndexOf,
"forEach",TypedArrayForEach,
"map",TypedArrayMap,
"reduce",TypedArrayReduce,
"reduceRight",TypedArrayReduceRight,
"reverse",TypedArrayReverse,
"slice",TypedArraySlice,
"some",TypedArraySome,
"sort",TypedArraySort,
"toString",TypedArrayToString,
"toLocaleString",TypedArrayToLocaleString
]);
})
i18n:<3A>
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Boolean;
var d=a.Date;
var e=a.Number;
var g=a.RegExp;
var h=a.String;
var i=b.ObjectDefineProperties;
var j=b.ObjectDefineProperty;
var k=b.SetFunctionName;
var l;
var m;
var n;
var o;
var p;
var q;
var r;
var t;
var u;
var v;
var w;
var x;
var y;
b.Import(function(z){
l=z.ArrayIndexOf;
m=z.ArrayJoin;
n=z.IsFinite;
o=z.IsNaN;
p=z.MathFloor;
q=z.RegExpTest;
r=z.StringIndexOf;
t=z.StringLastIndexOf;
u=z.StringMatch;
v=z.StringReplace;
w=z.StringSplit;
x=z.StringSubstr;
y=z.StringSubstring;
});
var A={};
%AddNamedProperty(a,"Intl",A,2);
var B={
'collator':(void 0),
'numberformat':(void 0),
'dateformat':(void 0),
'breakiterator':(void 0)
};
var C=(void 0);
var D=(void 0);
function GetUnicodeExtensionRE(){
if(((void 0)===(void 0))){
D=new g('-u(-[a-z0-9]{2,8})+','g');
}
return D;
}
var E=(void 0);
function GetAnyExtensionRE(){
if((E===(void 0))){
E=new g('-[a-z0-9]{1}-.*','g');
}
return E;
}
var F=(void 0);
function GetQuotedStringRE(){
if((F===(void 0))){
F=new g("'[^']+'",'g');
}
return F;
}
var G=(void 0);
function GetServiceRE(){
if((G===(void 0))){
G=
new g('^(collator|numberformat|dateformat|breakiterator)$');
}
return G;
}
var H=(void 0);
function GetLanguageTagRE(){
if((H===(void 0))){
BuildLanguageTagREs();
}
return H;
}
var I=(void 0);
function GetLanguageVariantRE(){
if((I===(void 0))){
BuildLanguageTagREs();
}
return I;
}
var J=(void 0);
function GetLanguageSingletonRE(){
if((J===(void 0))){
BuildLanguageTagREs();
}
return J;
}
var K=(void 0);
function GetTimezoneNameCheckRE(){
if((K===(void 0))){
K=
new g('^([A-Za-z]+)/([A-Za-z]+)(?:_([A-Za-z]+))*$');
}
return K;
}
function addBoundMethod(L,M,N,O){
%CheckIsBootstrapping();
function getter(){
if(!%IsInitializedIntlObject(this)){
throw MakeTypeError(41,M);
}
var P='__bound'+M+'__';
if((this[P]===(void 0))){
var Q=this;
var R;
if((O===(void 0))||O===2){
R=function(S,T){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
return N(Q,S,T);
}
}else if(O===1){
R=function(S){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
return N(Q,S);
}
}else{
R=function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
if(%_ArgumentsLength()>0){
return N(Q,%_Arguments(0));
}else{
return N(Q);
}
}
}
k(R,P);
%FunctionRemovePrototype(R);
%SetNativeFlag(R);
this[P]=R;
}
return this[P];
}
k(getter,M);
%FunctionRemovePrototype(getter);
%SetNativeFlag(getter);
j(L.prototype,M,{
get:getter,
enumerable:false,
configurable:true
});
}
function supportedLocalesOf(U,V,W){
if((%_CallFunction(U,GetServiceRE(),u)===null)){
throw MakeError(6,U);
}
if((W===(void 0))){
W={};
}else{
W=$toObject(W);
}
var X=W.localeMatcher;
if(!(X===(void 0))){
X=h(X);
if(X!=='lookup'&&X!=='best fit'){
throw MakeRangeError(140,X);
}
}else{
X='best fit';
}
var Y=initializeLocaleList(V);
if((B[U]===(void 0))){
B[U]=getAvailableLocalesOf(U);
}
if(X==='best fit'){
return initializeLocaleList(bestFitSupportedLocalesOf(
Y,B[U]));
}
return initializeLocaleList(lookupSupportedLocalesOf(
Y,B[U]));
}
function lookupSupportedLocalesOf(Y,Z){
var aa=[];
for(var ab=0;ab<Y.length;++ab){
var ac=%_CallFunction(Y[ab],GetUnicodeExtensionRE(),
'',v);
do{
if(!(Z[ac]===(void 0))){
%_CallFunction(aa,Y[ab],$arrayPush);
break;
}
var ad=%_CallFunction(ac,'-',t);
if(ad===-1){
break;
}
ac=%_CallFunction(ac,0,ad,y);
}while(true);
}
return aa;
}
function bestFitSupportedLocalesOf(Y,Z){
return lookupSupportedLocalesOf(Y,Z);
}
function getGetOption(W,ae){
if((W===(void 0)))throw MakeError(3,ae);
var af=function getOption(ag,ah,ai,aj){
if(!(W[ag]===(void 0))){
var ak=W[ag];
switch(ah){
case'boolean':
ak=c(ak);
break;
case'string':
ak=h(ak);
break;
case'number':
ak=e(ak);
break;
default:
throw MakeError(7);
}
if(!(ai===(void 0))&&
%_CallFunction(ai,ak,l)===-1){
throw MakeRangeError(150,ak,ae,ag);
}
return ak;
}
return aj;
}
return af;
}
function resolveLocale(U,Y,W){
Y=initializeLocaleList(Y);
var af=getGetOption(W,U);
var X=af('localeMatcher','string',
['lookup','best fit'],'best fit');
var al;
if(X==='lookup'){
al=lookupMatcher(U,Y);
}else{
al=bestFitMatcher(U,Y);
}
return al;
}
function lookupMatcher(U,Y){
if((%_CallFunction(U,GetServiceRE(),u)===null)){
throw MakeError(6,U);
}
if((B[U]===(void 0))){
B[U]=getAvailableLocalesOf(U);
}
for(var ab=0;ab<Y.length;++ab){
var ac=%_CallFunction(Y[ab],GetAnyExtensionRE(),'',
v);
do{
if(!(B[U][ac]===(void 0))){
var am=
%_CallFunction(Y[ab],GetUnicodeExtensionRE(),
u);
var an=(am===null)?'':am[0];
return{'locale':ac,'extension':an,'position':ab};
}
var ad=%_CallFunction(ac,'-',t);
if(ad===-1){
break;
}
ac=%_CallFunction(ac,0,ad,y);
}while(true);
}
if((C===(void 0))){
C=%GetDefaultICULocale();
}
return{'locale':C,'extension':'','position':-1};
}
function bestFitMatcher(U,Y){
return lookupMatcher(U,Y);
}
function parseExtension(an){
var ao=%_CallFunction(an,'-',w);
if(ao.length<=2||
(ao[0]!==''&&ao[1]!=='u')){
return{};
}
var ap={};
var aq=(void 0);
for(var ab=2;ab<ao.length;++ab){
var O=ao[ab].length;
var ar=ao[ab];
if(O===2){
ap[ar]=(void 0);
aq=ar;
}else if(O>=3&&O<=8&&!(aq===(void 0))){
ap[aq]=ar;
aq=(void 0);
}else{
return{};
}
}
return ap;
}
function setOptions(as,ap,at,af,au){
var an='';
var av=function updateExtension(aw,ak){
return'-'+aw+'-'+h(ak);
}
var ax=function updateProperty(ag,ah,ak){
if(ah==='boolean'&&(typeof ak==='string')){
ak=(ak==='true')?true:false;
}
if(!(ag===(void 0))){
defineWEProperty(au,ag,ak);
}
}
for(var aw in at){
if(%HasOwnProperty(at,aw)){
var ak=(void 0);
var ay=at[aw];
if(!(ay.property===(void 0))){
ak=af(ay.property,ay.type,ay.values);
}
if(!(ak===(void 0))){
ax(ay.property,ay.type,ak);
an+=av(aw,ak);
continue;
}
if(%HasOwnProperty(ap,aw)){
ak=ap[aw];
if(!(ak===(void 0))){
ax(ay.property,ay.type,ak);
an+=av(aw,ak);
}else if(ay.type==='boolean'){
ax(ay.property,ay.type,true);
an+=av(aw,true);
}
}
}
}
return an===''?'':'-u'+an;
}
function freezeArray(az){
var aA=az.length;
for(var ab=0;ab<aA;ab++){
if(ab in az){
j(az,ab,{value:az[ab],
configurable:false,
writable:false,
enumerable:true});
}
}
j(az,'length',{value:aA,writable:false});
return az;
}
function getOptimalLanguageTag(aB,al){
if(aB===al){
return aB;
}
var V=%GetLanguageTagVariants([aB,al]);
if(V[0].maximized!==V[1].maximized){
return al;
}
var aC=new g('^'+V[1].base);
return %_CallFunction(al,aC,V[0].base,v);
}
function getAvailableLocalesOf(U){
var aD=%AvailableLocalesOf(U);
for(var ab in aD){
if(%HasOwnProperty(aD,ab)){
var aE=%_CallFunction(ab,/^([a-z]{2,3})-([A-Z][a-z]{3})-([A-Z]{2})$/,
u);
if(aE!==null){
aD[aE[1]+'-'+aE[3]]=null;
}
}
}
return aD;
}
function defineWEProperty(aF,ag,ak){
j(aF,ag,
{value:ak,writable:true,enumerable:true});
}
function addWEPropertyIfDefined(aF,ag,ak){
if(!(ak===(void 0))){
defineWEProperty(aF,ag,ak);
}
}
function defineWECProperty(aF,ag,ak){
j(aF,ag,{value:ak,
writable:true,
enumerable:true,
configurable:true});
}
function addWECPropertyIfDefined(aF,ag,ak){
if(!(ak===(void 0))){
defineWECProperty(aF,ag,ak);
}
}
function toTitleCaseWord(aG){
return %StringToUpperCase(%_CallFunction(aG,0,1,x))+
%StringToLowerCase(%_CallFunction(aG,1,x));
}
function canonicalizeLanguageTag(aH){
if(typeof aH!=='string'&&typeof aH!=='object'||
(aH===null)){
throw MakeTypeError(40);
}
var aI=h(aH);
if(isValidLanguageTag(aI)===false){
throw MakeRangeError(132,aI);
}
var aJ=%CanonicalizeLanguageTag(aI);
if(aJ==='invalid-tag'){
throw MakeRangeError(132,aI);
}
return aJ;
}
function initializeLocaleList(V){
var aK=[];
if((V===(void 0))){
aK=[];
}else{
if(typeof V==='string'){
%_CallFunction(aK,canonicalizeLanguageTag(V),$arrayPush);
return freezeArray(aK);
}
var aL=$toObject(V);
var aM=(aL.length>>>0);
for(var aN=0;aN<aM;aN++){
if(aN in aL){
var ak=aL[aN];
var aJ=canonicalizeLanguageTag(ak);
if(%_CallFunction(aK,aJ,l)===-1){
%_CallFunction(aK,aJ,$arrayPush);
}
}
}
}
return freezeArray(aK);
}
function isValidLanguageTag(ac){
if(!%_CallFunction(GetLanguageTagRE(),ac,q)){
return false;
}
if(%_CallFunction(ac,'x-',r)===0){
return true;
}
ac=%_CallFunction(ac,/-x-/,w)[0];
var aO=[];
var aP=[];
var aE=%_CallFunction(ac,/-/,w);
for(var ab=1;ab<aE.length;ab++){
var ak=aE[ab];
if(%_CallFunction(GetLanguageVariantRE(),ak,q)&&
aP.length===0){
if(%_CallFunction(aO,ak,l)===-1){
%_CallFunction(aO,ak,$arrayPush);
}else{
return false;
}
}
if(%_CallFunction(GetLanguageSingletonRE(),ak,q)){
if(%_CallFunction(aP,ak,l)===-1){
%_CallFunction(aP,ak,$arrayPush);
}else{
return false;
}
}
}
return true;
}
function BuildLanguageTagREs(){
var aQ='[a-zA-Z]';
var aR='[0-9]';
var aS='('+aQ+'|'+aR+')';
var aT='(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|'+
'zh-min|zh-min-nan|zh-xiang)';
var aU='(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|'+
'i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|'+
'i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)';
var aV='('+aU+'|'+aT+')';
var aW='(x(-'+aS+'{1,8})+)';
var aX='('+aR+'|[A-WY-Za-wy-z])';
J=new g('^'+aX+'$','i');
var an='('+aX+'(-'+aS+'{2,8})+)';
var aY='('+aS+'{5,8}|('+aR+aS+'{3}))';
I=new g('^'+aY+'$','i');
var aZ='('+aQ+'{2}|'+aR+'{3})';
var ba='('+aQ+'{4})';
var bb='('+aQ+'{3}(-'+aQ+'{3}){0,2})';
var bc='('+aQ+'{2,3}(-'+bb+')?|'+aQ+'{4}|'+
aQ+'{5,8})';
var bd=bc+'(-'+ba+')?(-'+aZ+')?(-'+
aY+')*(-'+an+')*(-'+aW+')?';
var be=
'^('+bd+'|'+aW+'|'+aV+')$';
H=new g(be,'i');
}
function initializeCollator(bf,V,W){
if(%IsInitializedIntlObject(bf)){
throw MakeTypeError(94,"Collator");
}
if((W===(void 0))){
W={};
}
var af=getGetOption(W,'collator');
var bg={};
defineWEProperty(bg,'usage',af(
'usage','string',['sort','search'],'sort'));
var bh=af('sensitivity','string',
['base','accent','case','variant']);
if((bh===(void 0))&&bg.usage==='sort'){
bh='variant';
}
defineWEProperty(bg,'sensitivity',bh);
defineWEProperty(bg,'ignorePunctuation',af(
'ignorePunctuation','boolean',(void 0),false));
var ac=resolveLocale('collator',V,W);
var ap=parseExtension(ac.extension);
var bi={
'kn':{'property':'numeric','type':'boolean'},
'kf':{'property':'caseFirst','type':'string',
'values':['false','lower','upper']}
};
setOptions(
W,ap,bi,af,bg);
var bj='default';
var an='';
if(%HasOwnProperty(ap,'co')&&bg.usage==='sort'){
var bk=[
'big5han','dict','direct','ducet','gb2312','phonebk','phonetic',
'pinyin','reformed','searchjl','stroke','trad','unihan','zhuyin'
];
if(%_CallFunction(bk,ap.co,l)!==
-1){
an='-u-co-'+ap.co;
bj=ap.co;
}
}else if(bg.usage==='search'){
an='-u-co-search';
}
defineWEProperty(bg,'collation',bj);
var bl=ac.locale+an;
var al=i({},{
caseFirst:{writable:true},
collation:{value:bg.collation,writable:true},
ignorePunctuation:{writable:true},
locale:{writable:true},
numeric:{writable:true},
requestedLocale:{value:bl,writable:true},
sensitivity:{writable:true},
strength:{writable:true},
usage:{value:bg.usage,writable:true}
});
var bm=%CreateCollator(bl,
bg,
al);
%MarkAsInitializedIntlObjectOfType(bf,'collator',bm);
j(bf,'resolved',{value:al});
return bf;
}
%AddNamedProperty(A,'Collator',function(){
var V=%_Arguments(0);
var W=%_Arguments(1);
if(!this||this===A){
return new A.Collator(V,W);
}
return initializeCollator($toObject(this),V,W);
},
2
);
%AddNamedProperty(A.Collator.prototype,'resolvedOptions',function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
if(!%IsInitializedIntlObjectOfType(this,'collator')){
throw MakeTypeError(95,"Collator");
}
var bn=this;
var ac=getOptimalLanguageTag(bn.resolved.requestedLocale,
bn.resolved.locale);
return{
locale:ac,
usage:bn.resolved.usage,
sensitivity:bn.resolved.sensitivity,
ignorePunctuation:bn.resolved.ignorePunctuation,
numeric:bn.resolved.numeric,
caseFirst:bn.resolved.caseFirst,
collation:bn.resolved.collation
};
},
2
);
k(A.Collator.prototype.resolvedOptions,'resolvedOptions');
%FunctionRemovePrototype(A.Collator.prototype.resolvedOptions);
%SetNativeFlag(A.Collator.prototype.resolvedOptions);
%AddNamedProperty(A.Collator,'supportedLocalesOf',function(V){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
return supportedLocalesOf('collator',V,%_Arguments(1));
},
2
);
k(A.Collator.supportedLocalesOf,'supportedLocalesOf');
%FunctionRemovePrototype(A.Collator.supportedLocalesOf);
%SetNativeFlag(A.Collator.supportedLocalesOf);
function compare(bf,S,T){
return %InternalCompare(%GetImplFromInitializedIntlObject(bf),
h(S),h(T));
};
addBoundMethod(A.Collator,'compare',compare,2);
function isWellFormedCurrencyCode(bo){
return typeof bo=="string"&&
bo.length==3&&
%_CallFunction(bo,/[^A-Za-z]/,u)==null;
}
function getNumberOption(W,ag,bp,bq,br){
var ak=W[ag];
if(!(ak===(void 0))){
ak=e(ak);
if(o(ak)||ak<bp||ak>bq){
throw MakeRangeError(143,ag);
}
return p(ak);
}
return br;
}
function initializeNumberFormat(bs,V,W){
if(%IsInitializedIntlObject(bs)){
throw MakeTypeError(94,"NumberFormat");
}
if((W===(void 0))){
W={};
}
var af=getGetOption(W,'numberformat');
var ac=resolveLocale('numberformat',V,W);
var bg={};
defineWEProperty(bg,'style',af(
'style','string',['decimal','percent','currency'],'decimal'));
var bo=af('currency','string');
if(!(bo===(void 0))&&!isWellFormedCurrencyCode(bo)){
throw MakeRangeError(128,bo);
}
if(bg.style==='currency'&&(bo===(void 0))){
throw MakeTypeError(21);
}
var bt=af(
'currencyDisplay','string',['code','symbol','name'],'symbol');
if(bg.style==='currency'){
defineWEProperty(bg,'currency',%StringToUpperCase(bo));
defineWEProperty(bg,'currencyDisplay',bt);
}
var bu=getNumberOption(W,'minimumIntegerDigits',1,21,1);
defineWEProperty(bg,'minimumIntegerDigits',bu);
var bv=getNumberOption(W,'minimumFractionDigits',0,20,0);
defineWEProperty(bg,'minimumFractionDigits',bv);
var bw=getNumberOption(W,'maximumFractionDigits',bv,20,3);
defineWEProperty(bg,'maximumFractionDigits',bw);
var bx=W['minimumSignificantDigits'];
var by=W['maximumSignificantDigits'];
if(!(bx===(void 0))||!(by===(void 0))){
bx=getNumberOption(W,'minimumSignificantDigits',1,21,0);
defineWEProperty(bg,'minimumSignificantDigits',bx);
by=getNumberOption(W,'maximumSignificantDigits',bx,21,21);
defineWEProperty(bg,'maximumSignificantDigits',by);
}
defineWEProperty(bg,'useGrouping',af(
'useGrouping','boolean',(void 0),true));
var ap=parseExtension(ac.extension);
var bz={
'nu':{'property':(void 0),'type':'string'}
};
var an=setOptions(W,ap,bz,
af,bg);
var bl=ac.locale+an;
var al=i({},{
currency:{writable:true},
currencyDisplay:{writable:true},
locale:{writable:true},
maximumFractionDigits:{writable:true},
minimumFractionDigits:{writable:true},
minimumIntegerDigits:{writable:true},
numberingSystem:{writable:true},
requestedLocale:{value:bl,writable:true},
style:{value:bg.style,writable:true},
useGrouping:{writable:true}
});
if(%HasOwnProperty(bg,'minimumSignificantDigits')){
defineWEProperty(al,'minimumSignificantDigits',(void 0));
}
if(%HasOwnProperty(bg,'maximumSignificantDigits')){
defineWEProperty(al,'maximumSignificantDigits',(void 0));
}
var bA=%CreateNumberFormat(bl,
bg,
al);
if(bg.style==='currency'){
j(al,'currencyDisplay',{value:bt,
writable:true});
}
%MarkAsInitializedIntlObjectOfType(bs,'numberformat',bA);
j(bs,'resolved',{value:al});
return bs;
}
%AddNamedProperty(A,'NumberFormat',function(){
var V=%_Arguments(0);
var W=%_Arguments(1);
if(!this||this===A){
return new A.NumberFormat(V,W);
}
return initializeNumberFormat($toObject(this),V,W);
},
2
);
%AddNamedProperty(A.NumberFormat.prototype,'resolvedOptions',function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
if(!%IsInitializedIntlObjectOfType(this,'numberformat')){
throw MakeTypeError(95,"NumberFormat");
}
var bB=this;
var ac=getOptimalLanguageTag(bB.resolved.requestedLocale,
bB.resolved.locale);
var bC={
locale:ac,
numberingSystem:bB.resolved.numberingSystem,
style:bB.resolved.style,
useGrouping:bB.resolved.useGrouping,
minimumIntegerDigits:bB.resolved.minimumIntegerDigits,
minimumFractionDigits:bB.resolved.minimumFractionDigits,
maximumFractionDigits:bB.resolved.maximumFractionDigits,
};
if(bC.style==='currency'){
defineWECProperty(bC,'currency',bB.resolved.currency);
defineWECProperty(bC,'currencyDisplay',
bB.resolved.currencyDisplay);
}
if(%HasOwnProperty(bB.resolved,'minimumSignificantDigits')){
defineWECProperty(bC,'minimumSignificantDigits',
bB.resolved.minimumSignificantDigits);
}
if(%HasOwnProperty(bB.resolved,'maximumSignificantDigits')){
defineWECProperty(bC,'maximumSignificantDigits',
bB.resolved.maximumSignificantDigits);
}
return bC;
},
2
);
k(A.NumberFormat.prototype.resolvedOptions,'resolvedOptions');
%FunctionRemovePrototype(A.NumberFormat.prototype.resolvedOptions);
%SetNativeFlag(A.NumberFormat.prototype.resolvedOptions);
%AddNamedProperty(A.NumberFormat,'supportedLocalesOf',function(V){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
return supportedLocalesOf('numberformat',V,%_Arguments(1));
},
2
);
k(A.NumberFormat.supportedLocalesOf,'supportedLocalesOf');
%FunctionRemovePrototype(A.NumberFormat.supportedLocalesOf);
%SetNativeFlag(A.NumberFormat.supportedLocalesOf);
function formatNumber(bA,ak){
var bD=$toNumber(ak)+0;
return %InternalNumberFormat(%GetImplFromInitializedIntlObject(bA),
bD);
}
function parseNumber(bA,ak){
return %InternalNumberParse(%GetImplFromInitializedIntlObject(bA),
h(ak));
}
addBoundMethod(A.NumberFormat,'format',formatNumber,1);
addBoundMethod(A.NumberFormat,'v8Parse',parseNumber,1);
function toLDMLString(W){
var af=getGetOption(W,'dateformat');
var bE='';
var bF=af('weekday','string',['narrow','short','long']);
bE+=appendToLDMLString(
bF,{narrow:'EEEEE',short:'EEE',long:'EEEE'});
bF=af('era','string',['narrow','short','long']);
bE+=appendToLDMLString(
bF,{narrow:'GGGGG',short:'GGG',long:'GGGG'});
bF=af('year','string',['2-digit','numeric']);
bE+=appendToLDMLString(bF,{'2-digit':'yy','numeric':'y'});
bF=af('month','string',
['2-digit','numeric','narrow','short','long']);
bE+=appendToLDMLString(bF,{'2-digit':'MM','numeric':'M',
'narrow':'MMMMM','short':'MMM','long':'MMMM'});
bF=af('day','string',['2-digit','numeric']);
bE+=appendToLDMLString(
bF,{'2-digit':'dd','numeric':'d'});
var bG=af('hour12','boolean');
bF=af('hour','string',['2-digit','numeric']);
if((bG===(void 0))){
bE+=appendToLDMLString(bF,{'2-digit':'jj','numeric':'j'});
}else if(bG===true){
bE+=appendToLDMLString(bF,{'2-digit':'hh','numeric':'h'});
}else{
bE+=appendToLDMLString(bF,{'2-digit':'HH','numeric':'H'});
}
bF=af('minute','string',['2-digit','numeric']);
bE+=appendToLDMLString(bF,{'2-digit':'mm','numeric':'m'});
bF=af('second','string',['2-digit','numeric']);
bE+=appendToLDMLString(bF,{'2-digit':'ss','numeric':'s'});
bF=af('timeZoneName','string',['short','long']);
bE+=appendToLDMLString(bF,{short:'z',long:'zzzz'});
return bE;
}
function appendToLDMLString(bF,bH){
if(!(bF===(void 0))){
return bH[bF];
}else{
return'';
}
}
function fromLDMLString(bE){
bE=%_CallFunction(bE,GetQuotedStringRE(),'',
v);
var W={};
var bI=%_CallFunction(bE,/E{3,5}/g,u);
W=appendToDateTimeObject(
W,'weekday',bI,{EEEEE:'narrow',EEE:'short',EEEE:'long'});
bI=%_CallFunction(bE,/G{3,5}/g,u);
W=appendToDateTimeObject(
W,'era',bI,{GGGGG:'narrow',GGG:'short',GGGG:'long'});
bI=%_CallFunction(bE,/y{1,2}/g,u);
W=appendToDateTimeObject(
W,'year',bI,{y:'numeric',yy:'2-digit'});
bI=%_CallFunction(bE,/M{1,5}/g,u);
W=appendToDateTimeObject(W,'month',bI,{MM:'2-digit',
M:'numeric',MMMMM:'narrow',MMM:'short',MMMM:'long'});
bI=%_CallFunction(bE,/L{1,5}/g,u);
W=appendToDateTimeObject(W,'month',bI,{LL:'2-digit',
L:'numeric',LLLLL:'narrow',LLL:'short',LLLL:'long'});
bI=%_CallFunction(bE,/d{1,2}/g,u);
W=appendToDateTimeObject(
W,'day',bI,{d:'numeric',dd:'2-digit'});
bI=%_CallFunction(bE,/h{1,2}/g,u);
if(bI!==null){
W['hour12']=true;
}
W=appendToDateTimeObject(
W,'hour',bI,{h:'numeric',hh:'2-digit'});
bI=%_CallFunction(bE,/H{1,2}/g,u);
if(bI!==null){
W['hour12']=false;
}
W=appendToDateTimeObject(
W,'hour',bI,{H:'numeric',HH:'2-digit'});
bI=%_CallFunction(bE,/m{1,2}/g,u);
W=appendToDateTimeObject(
W,'minute',bI,{m:'numeric',mm:'2-digit'});
bI=%_CallFunction(bE,/s{1,2}/g,u);
W=appendToDateTimeObject(
W,'second',bI,{s:'numeric',ss:'2-digit'});
bI=%_CallFunction(bE,/z|zzzz/g,u);
W=appendToDateTimeObject(
W,'timeZoneName',bI,{z:'short',zzzz:'long'});
return W;
}
function appendToDateTimeObject(W,bF,bI,bH){
if((bI===null)){
if(!%HasOwnProperty(W,bF)){
defineWEProperty(W,bF,(void 0));
}
return W;
}
var ag=bI[0];
defineWEProperty(W,bF,bH[ag]);
return W;
}
function toDateTimeOptions(W,bJ,bK){
if((W===(void 0))){
W={};
}else{
W=((%_IsSpecObject(%IS_VAR(W)))?W:$toObject(W));
}
var bL=true;
if((bJ==='date'||bJ==='any')&&
(!(W.weekday===(void 0))||!(W.year===(void 0))||
!(W.month===(void 0))||!(W.day===(void 0)))){
bL=false;
}
if((bJ==='time'||bJ==='any')&&
(!(W.hour===(void 0))||!(W.minute===(void 0))||
!(W.second===(void 0)))){
bL=false;
}
if(bL&&(bK==='date'||bK==='all')){
j(W,'year',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
j(W,'month',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
j(W,'day',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
}
if(bL&&(bK==='time'||bK==='all')){
j(W,'hour',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
j(W,'minute',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
j(W,'second',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
}
return W;
}
function initializeDateTimeFormat(bM,V,W){
if(%IsInitializedIntlObject(bM)){
throw MakeTypeError(94,"DateTimeFormat");
}
if((W===(void 0))){
W={};
}
var ac=resolveLocale('dateformat',V,W);
W=toDateTimeOptions(W,'any','date');
var af=getGetOption(W,'dateformat');
var X=af('formatMatcher','string',
['basic','best fit'],'best fit');
var bE=toLDMLString(W);
var bN=canonicalizeTimeZoneID(W.timeZone);
var bg={};
var ap=parseExtension(ac.extension);
var bO={
'ca':{'property':(void 0),'type':'string'},
'nu':{'property':(void 0),'type':'string'}
};
var an=setOptions(W,ap,bO,
af,bg);
var bl=ac.locale+an;
var al=i({},{
calendar:{writable:true},
day:{writable:true},
era:{writable:true},
hour12:{writable:true},
hour:{writable:true},
locale:{writable:true},
minute:{writable:true},
month:{writable:true},
numberingSystem:{writable:true},
pattern:{writable:true},
requestedLocale:{value:bl,writable:true},
second:{writable:true},
timeZone:{writable:true},
timeZoneName:{writable:true},
tz:{value:bN,writable:true},
weekday:{writable:true},
year:{writable:true}
});
var bA=%CreateDateTimeFormat(
bl,{skeleton:bE,timeZone:bN},al);
if(!(bN===(void 0))&&bN!==al.timeZone){
throw MakeRangeError(149,bN);
}
%MarkAsInitializedIntlObjectOfType(bM,'dateformat',bA);
j(bM,'resolved',{value:al});
return bM;
}
%AddNamedProperty(A,'DateTimeFormat',function(){
var V=%_Arguments(0);
var W=%_Arguments(1);
if(!this||this===A){
return new A.DateTimeFormat(V,W);
}
return initializeDateTimeFormat($toObject(this),V,W);
},
2
);
%AddNamedProperty(A.DateTimeFormat.prototype,'resolvedOptions',function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
if(!%IsInitializedIntlObjectOfType(this,'dateformat')){
throw MakeTypeError(95,"DateTimeFormat");
}
var bP={
'gregorian':'gregory',
'japanese':'japanese',
'buddhist':'buddhist',
'roc':'roc',
'persian':'persian',
'islamic-civil':'islamicc',
'islamic':'islamic',
'hebrew':'hebrew',
'chinese':'chinese',
'indian':'indian',
'coptic':'coptic',
'ethiopic':'ethiopic',
'ethiopic-amete-alem':'ethioaa'
};
var bB=this;
var bQ=fromLDMLString(bB.resolved.pattern);
var bR=bP[bB.resolved.calendar];
if((bR===(void 0))){
bR=bB.resolved.calendar;
}
var ac=getOptimalLanguageTag(bB.resolved.requestedLocale,
bB.resolved.locale);
var bC={
locale:ac,
numberingSystem:bB.resolved.numberingSystem,
calendar:bR,
timeZone:bB.resolved.timeZone
};
addWECPropertyIfDefined(bC,'timeZoneName',bQ.timeZoneName);
addWECPropertyIfDefined(bC,'era',bQ.era);
addWECPropertyIfDefined(bC,'year',bQ.year);
addWECPropertyIfDefined(bC,'month',bQ.month);
addWECPropertyIfDefined(bC,'day',bQ.day);
addWECPropertyIfDefined(bC,'weekday',bQ.weekday);
addWECPropertyIfDefined(bC,'hour12',bQ.hour12);
addWECPropertyIfDefined(bC,'hour',bQ.hour);
addWECPropertyIfDefined(bC,'minute',bQ.minute);
addWECPropertyIfDefined(bC,'second',bQ.second);
return bC;
},
2
);
k(A.DateTimeFormat.prototype.resolvedOptions,
'resolvedOptions');
%FunctionRemovePrototype(A.DateTimeFormat.prototype.resolvedOptions);
%SetNativeFlag(A.DateTimeFormat.prototype.resolvedOptions);
%AddNamedProperty(A.DateTimeFormat,'supportedLocalesOf',function(V){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
return supportedLocalesOf('dateformat',V,%_Arguments(1));
},
2
);
k(A.DateTimeFormat.supportedLocalesOf,'supportedLocalesOf');
%FunctionRemovePrototype(A.DateTimeFormat.supportedLocalesOf);
%SetNativeFlag(A.DateTimeFormat.supportedLocalesOf);
function formatDate(bA,bS){
var bT;
if((bS===(void 0))){
bT=%DateCurrentTime();
}else{
bT=$toNumber(bS);
}
if(!n(bT))throw MakeRangeError(122);
return %InternalDateFormat(%GetImplFromInitializedIntlObject(bA),
new d(bT));
}
function parseDate(bA,ak){
return %InternalDateParse(%GetImplFromInitializedIntlObject(bA),
h(ak));
}
addBoundMethod(A.DateTimeFormat,'format',formatDate,0);
addBoundMethod(A.DateTimeFormat,'v8Parse',parseDate,1);
function canonicalizeTimeZoneID(bU){
if((bU===(void 0))){
return bU;
}
var bV=%StringToUpperCase(bU);
if(bV==='UTC'||bV==='GMT'||
bV==='ETC/UTC'||bV==='ETC/GMT'){
return'UTC';
}
var bI=%_CallFunction(bU,GetTimezoneNameCheckRE(),u);
if((bI===null))throw MakeRangeError(123,bU);
var bC=toTitleCaseWord(bI[1])+'/'+toTitleCaseWord(bI[2]);
var ab=3;
while(!(bI[ab]===(void 0))&&ab<bI.length){
bC=bC+'_'+toTitleCaseWord(bI[ab]);
ab++;
}
return bC;
}
function initializeBreakIterator(bW,V,W){
if(%IsInitializedIntlObject(bW)){
throw MakeTypeError(94,"v8BreakIterator");
}
if((W===(void 0))){
W={};
}
var af=getGetOption(W,'breakiterator');
var bg={};
defineWEProperty(bg,'type',af(
'type','string',['character','word','sentence','line'],'word'));
var ac=resolveLocale('breakiterator',V,W);
var al=i({},{
requestedLocale:{value:ac.locale,writable:true},
type:{value:bg.type,writable:true},
locale:{writable:true}
});
var bX=%CreateBreakIterator(ac.locale,
bg,
al);
%MarkAsInitializedIntlObjectOfType(bW,'breakiterator',
bX);
j(bW,'resolved',{value:al});
return bW;
}
%AddNamedProperty(A,'v8BreakIterator',function(){
var V=%_Arguments(0);
var W=%_Arguments(1);
if(!this||this===A){
return new A.v8BreakIterator(V,W);
}
return initializeBreakIterator($toObject(this),V,W);
},
2
);
%AddNamedProperty(A.v8BreakIterator.prototype,'resolvedOptions',
function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
if(!%IsInitializedIntlObjectOfType(this,'breakiterator')){
throw MakeTypeError(95,"v8BreakIterator");
}
var bY=this;
var ac=getOptimalLanguageTag(bY.resolved.requestedLocale,
bY.resolved.locale);
return{
locale:ac,
type:bY.resolved.type
};
},
2
);
k(A.v8BreakIterator.prototype.resolvedOptions,
'resolvedOptions');
%FunctionRemovePrototype(A.v8BreakIterator.prototype.resolvedOptions);
%SetNativeFlag(A.v8BreakIterator.prototype.resolvedOptions);
%AddNamedProperty(A.v8BreakIterator,'supportedLocalesOf',
function(V){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
return supportedLocalesOf('breakiterator',V,%_Arguments(1));
},
2
);
k(A.v8BreakIterator.supportedLocalesOf,'supportedLocalesOf');
%FunctionRemovePrototype(A.v8BreakIterator.supportedLocalesOf);
%SetNativeFlag(A.v8BreakIterator.supportedLocalesOf);
function adoptText(bW,bZ){
%BreakIteratorAdoptText(%GetImplFromInitializedIntlObject(bW),
h(bZ));
}
function first(bW){
return %BreakIteratorFirst(%GetImplFromInitializedIntlObject(bW));
}
function next(bW){
return %BreakIteratorNext(%GetImplFromInitializedIntlObject(bW));
}
function current(bW){
return %BreakIteratorCurrent(%GetImplFromInitializedIntlObject(bW));
}
function breakType(bW){
return %BreakIteratorBreakType(%GetImplFromInitializedIntlObject(bW));
}
addBoundMethod(A.v8BreakIterator,'adoptText',adoptText,1);
addBoundMethod(A.v8BreakIterator,'first',first,0);
addBoundMethod(A.v8BreakIterator,'next',next,0);
addBoundMethod(A.v8BreakIterator,'current',current,0);
addBoundMethod(A.v8BreakIterator,'breakType',breakType,0);
var ca={
'collator':A.Collator,
'numberformat':A.NumberFormat,
'dateformatall':A.DateTimeFormat,
'dateformatdate':A.DateTimeFormat,
'dateformattime':A.DateTimeFormat
};
var cb={
'collator':(void 0),
'numberformat':(void 0),
'dateformatall':(void 0),
'dateformatdate':(void 0),
'dateformattime':(void 0),
};
function cachedOrNewService(U,V,W,bK){
var cc=((bK===(void 0)))?W:bK;
if((V===(void 0))&&(W===(void 0))){
if((cb[U]===(void 0))){
cb[U]=new ca[U](V,cc);
}
return cb[U];
}
return new ca[U](V,cc);
}
function OverrideFunction(aF,cd,ce){
%CheckIsBootstrapping();
j(aF,cd,{value:ce,
writeable:true,
configurable:true,
enumerable:false});
k(ce,cd);
%FunctionRemovePrototype(ce);
%SetNativeFlag(ce);
}
OverrideFunction(h.prototype,'localeCompare',function(Q){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
if((this==null)){
throw MakeTypeError(42);
}
var V=%_Arguments(1);
var W=%_Arguments(2);
var bf=cachedOrNewService('collator',V,W);
return compare(bf,this,Q);
}
);
OverrideFunction(h.prototype,'normalize',function(Q){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"String.prototype.normalize");
var cf=h(%_Arguments(0)||'NFC');
var cg=['NFC','NFD','NFKC','NFKD'];
var ch=
%_CallFunction(cg,cf,l);
if(ch===-1){
throw MakeRangeError(141,
%_CallFunction(cg,', ',m));
}
return %StringNormalize(this,ch);
}
);
OverrideFunction(e.prototype,'toLocaleString',function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
if(!(this instanceof e)&&typeof(this)!=='number'){
throw MakeTypeError(43,"Number");
}
var V=%_Arguments(0);
var W=%_Arguments(1);
var bs=cachedOrNewService('numberformat',V,W);
return formatNumber(bs,this);
}
);
function toLocaleDateTime(ci,V,W,bJ,bK,U){
if(!(ci instanceof d)){
throw MakeTypeError(43,"Date");
}
if(o(ci))return'Invalid Date';
var bg=toDateTimeOptions(W,bJ,bK);
var bM=
cachedOrNewService(U,V,W,bg);
return formatDate(bM,ci);
}
OverrideFunction(d.prototype,'toLocaleString',function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
var V=%_Arguments(0);
var W=%_Arguments(1);
return toLocaleDateTime(
this,V,W,'any','all','dateformatall');
}
);
OverrideFunction(d.prototype,'toLocaleDateString',function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
var V=%_Arguments(0);
var W=%_Arguments(1);
return toLocaleDateTime(
this,V,W,'date','date','dateformatdate');
}
);
OverrideFunction(d.prototype,'toLocaleTimeString',function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
var V=%_Arguments(0);
var W=%_Arguments(1);
return toLocaleDateTime(
this,V,W,'time','time','dateformattime');
}
);
})
,proxy)6
var $proxyDerivedGetTrap;
var $proxyDerivedHasTrap;
var $proxyDerivedSetTrap;
var $proxyEnumerate;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Function;
var d=a.Object;
var e;
b.Import(function(f){
e=f.ToNameArray;
});
function ProxyCreate(g,h){
if(!(%_IsSpecObject(g)))
throw MakeTypeError(81,"create")
if((h===(void 0)))
h=null
else if(!((%_IsSpecObject(h))||(h===null)))
throw MakeTypeError(86)
return %CreateJSProxy(g,h)
}
function ProxyCreateFunction(g,i,j){
if(!(%_IsSpecObject(g)))
throw MakeTypeError(81,"createFunction")
if(!(%_ClassOf(i)==='Function'))
throw MakeTypeError(89,"call")
if((j===(void 0))){
j=DerivedConstructTrap(i)
}else if((%_ClassOf(j)==='Function')){
var k=j
j=function(){
return %Apply(k,(void 0),arguments,0,%_ArgumentsLength());
}
}else{
throw MakeTypeError(89,"construct")
}
return %CreateJSFunctionProxy(
g,i,j,c.prototype)
}
function DerivedConstructTrap(i){
return function(){
var h=this.prototype
if(!(%_IsSpecObject(h)))h=d.prototype
var l={__proto__:h};
var m=%Apply(i,l,arguments,0,%_ArgumentsLength());
return(%_IsSpecObject(m))?m:l
}
}
function DelegateCallAndConstruct(i,j){
return function(){
return %Apply(%_IsConstructCall()?j:i,
this,arguments,0,%_ArgumentsLength())
}
}
function DerivedGetTrap(n,o){
var p=this.getPropertyDescriptor(o)
if((p===(void 0))){return p}
if('value'in p){
return p.value
}else{
if((p.get===(void 0))){return p.get}
return %_CallFunction(n,p.get)
}
}
function DerivedSetTrap(n,o,q){
var p=this.getOwnPropertyDescriptor(o)
if(p){
if('writable'in p){
if(p.writable){
p.value=q
this.defineProperty(o,p)
return true
}else{
return false
}
}else{
if(p.set){
%_CallFunction(n,q,p.set)
return true
}else{
return false
}
}
}
p=this.getPropertyDescriptor(o)
if(p){
if('writable'in p){
if(p.writable){
}else{
return false
}
}else{
if(p.set){
%_CallFunction(n,q,p.set)
return true
}else{
return false
}
}
}
this.defineProperty(o,{
value:q,
writable:true,
enumerable:true,
configurable:true});
return true;
}
function DerivedHasTrap(o){
return!!this.getPropertyDescriptor(o)
}
function DerivedHasOwnTrap(o){
return!!this.getOwnPropertyDescriptor(o)
}
function DerivedKeysTrap(){
var r=this.getOwnPropertyNames()
var s=[]
for(var t=0,count=0;t<r.length;++t){
var o=r[t]
if((typeof(o)==='symbol'))continue
var p=this.getOwnPropertyDescriptor(((typeof(%IS_VAR(o))==='string')?o:$nonStringToString(o)))
if(!(p===(void 0))&&p.enumerable){
s[count++]=r[t]
}
}
return s
}
function DerivedEnumerateTrap(){
var r=this.getPropertyNames()
var s=[]
for(var t=0,count=0;t<r.length;++t){
var o=r[t]
if((typeof(o)==='symbol'))continue
var p=this.getPropertyDescriptor(((typeof(%IS_VAR(o))==='string')?o:$nonStringToString(o)))
if(!(p===(void 0))){
if(!p.configurable){
throw MakeTypeError(87,
this,o,"getPropertyDescriptor")
}
if(p.enumerable)s[count++]=r[t]
}
}
return s
}
function ProxyEnumerate(u){
var g=%GetHandler(u)
if((g.enumerate===(void 0))){
return %Apply(DerivedEnumerateTrap,g,[],0,0)
}else{
return e(g.enumerate(),"enumerate",false)
}
}
var v=new d();
%AddNamedProperty(a,"Proxy",v,2);
b.InstallFunctions(v,2,[
"create",ProxyCreate,
"createFunction",ProxyCreateFunction
])
$proxyDerivedGetTrap=DerivedGetTrap;
$proxyDerivedHasTrap=DerivedHasTrap;
$proxyDerivedSetTrap=DerivedSetTrap;
$proxyEnumerate=ProxyEnumerate;
b.Export(function(w){
w.ProxyDelegateCallAndConstruct=DelegateCallAndConstruct;
w.ProxyDerivedHasOwnTrap=DerivedHasOwnTrap;
w.ProxyDerivedKeysTrap=DerivedKeysTrap;
});
})
$generator<6F>
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Function;
var d;
b.Import(function(e){
d=e.NewFunctionString;
});
function GeneratorObjectNext(f){
if(!(%_ClassOf(this)==='Generator')){
throw MakeTypeError(33,
'[Generator].prototype.next',this);
}
var g=%GeneratorGetContinuation(this);
if(g>0){
if((%_DebugIsActive()!=0))%DebugPrepareStepInIfStepping(this);
try{
return %_GeneratorNext(this,f);
}catch(e){
%GeneratorClose(this);
throw e;
}
}else if(g==0){
return{value:void 0,done:true};
}else{
throw MakeTypeError(31);
}
}
function GeneratorObjectThrow(h){
if(!(%_ClassOf(this)==='Generator')){
throw MakeTypeError(33,
'[Generator].prototype.throw',this);
}
var g=%GeneratorGetContinuation(this);
if(g>0){
try{
return %_GeneratorThrow(this,h);
}catch(e){
%GeneratorClose(this);
throw e;
}
}else if(g==0){
throw h;
}else{
throw MakeTypeError(31);
}
}
function GeneratorFunctionConstructor(i){
var j=d(arguments,'function*');
var k=%GlobalProxy(GeneratorFunctionConstructor);
var l=%_CallFunction(k,%CompileString(j,true));
%FunctionMarkNameShouldPrintAsAnonymous(l);
return l;
}
%NeverOptimizeFunction(GeneratorObjectNext);
%NeverOptimizeFunction(GeneratorObjectThrow);
var m=GeneratorFunctionPrototype.prototype;
b.InstallFunctions(m,
2,
["next",GeneratorObjectNext,
"throw",GeneratorObjectThrow]);
%AddNamedProperty(m,"constructor",
GeneratorFunctionPrototype,2|1);
%AddNamedProperty(m,
symbolToStringTag,"Generator",2|1);
%InternalSetPrototype(GeneratorFunctionPrototype,c.prototype);
%AddNamedProperty(GeneratorFunctionPrototype,
symbolToStringTag,"GeneratorFunction",2|1);
%AddNamedProperty(GeneratorFunctionPrototype,"constructor",
GeneratorFunction,2|1);
%InternalSetPrototype(GeneratorFunction,c);
%SetCode(GeneratorFunction,GeneratorFunctionConstructor);
})
<harmony-atomics%#
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Object;
function CheckSharedTypedArray(d){
if(!%_IsSharedTypedArray(d)){
throw MakeTypeError(58,d);
}
}
function CheckSharedIntegerTypedArray(e){
if(!%_IsSharedIntegerTypedArray(e)){
throw MakeTypeError(59,e);
}
}
function AtomicsCompareExchangeJS(d,f,g,h){
CheckSharedTypedArray(d);
f=$toInteger(f);
if(f<0||f>=d.length){
return(void 0);
}
return %_AtomicsCompareExchange(d,f,g,h);
}
function AtomicsLoadJS(d,f){
CheckSharedTypedArray(d);
f=$toInteger(f);
if(f<0||f>=d.length){
return(void 0);
}
return %_AtomicsLoad(d,f);
}
function AtomicsStoreJS(d,f,i){
CheckSharedTypedArray(d);
f=$toInteger(f);
if(f<0||f>=d.length){
return(void 0);
}
return %_AtomicsStore(d,f,i);
}
function AtomicsAddJS(e,f,i){
CheckSharedIntegerTypedArray(e);
f=$toInteger(f);
if(f<0||f>=e.length){
return(void 0);
}
return %_AtomicsAdd(e,f,i);
}
function AtomicsSubJS(e,f,i){
CheckSharedIntegerTypedArray(e);
f=$toInteger(f);
if(f<0||f>=e.length){
return(void 0);
}
return %_AtomicsSub(e,f,i);
}
function AtomicsAndJS(e,f,i){
CheckSharedIntegerTypedArray(e);
f=$toInteger(f);
if(f<0||f>=e.length){
return(void 0);
}
return %_AtomicsAnd(e,f,i);
}
function AtomicsOrJS(e,f,i){
CheckSharedIntegerTypedArray(e);
f=$toInteger(f);
if(f<0||f>=e.length){
return(void 0);
}
return %_AtomicsOr(e,f,i);
}
function AtomicsXorJS(e,f,i){
CheckSharedIntegerTypedArray(e);
f=$toInteger(f);
if(f<0||f>=e.length){
return(void 0);
}
return %_AtomicsXor(e,f,i);
}
function AtomicsExchangeJS(e,f,i){
CheckSharedIntegerTypedArray(e);
f=$toInteger(f);
if(f<0||f>=e.length){
return(void 0);
}
return %_AtomicsExchange(e,f,i);
}
function AtomicsIsLockFreeJS(j){
return %_AtomicsIsLockFree(j);
}
function AtomicsConstructor(){}
var k=new AtomicsConstructor();
%InternalSetPrototype(k,c.prototype);
%AddNamedProperty(a,"Atomics",k,2);
%FunctionSetInstanceClassName(AtomicsConstructor,'Atomics');
%AddNamedProperty(k,symbolToStringTag,"Atomics",1|2);
b.InstallFunctions(k,2,[
"compareExchange",AtomicsCompareExchangeJS,
"load",AtomicsLoadJS,
"store",AtomicsStoreJS,
"add",AtomicsAddJS,
"sub",AtomicsSubJS,
"and",AtomicsAndJS,
"or",AtomicsOrJS,
"xor",AtomicsXorJS,
"exchange",AtomicsExchangeJS,
"isLockFree",AtomicsIsLockFreeJS,
]);
})
Xharmony-array-includes<65>
(function(a,b){
'use strict';
%CheckIsBootstrapping();
var c=a.Array;
function ArrayIncludes(d,e){
var f=$toObject(this);
var g=$toLength(f.length);
if(g===0){
return false;
}
var h=$toInteger(e);
var i;
if(h>=0){
i=h;
}else{
i=g+h;
if(i<0){
i=0;
}
}
while(i<g){
var j=f[i];
if($sameValueZero(d,j)){
return true;
}
++i;
}
return false;
}
%FunctionSetLength(ArrayIncludes,1);
b.InstallFunctions(c.prototype,2,[
"includes",ArrayIncludes
]);
})
dharmony-concat-spreadable1
(function(a,b){
'use strict';
%CheckIsBootstrapping();
b.InstallConstants(a.Symbol,[
"isConcatSpreadable",symbolIsConcatSpreadable
]);
})
@harmony-tostring
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Symbol;
b.InstallConstants(c,[
"toStringTag",symbolToStringTag
]);
})
8harmony-regexp<78>
(function(a,b){
'use strict';
%CheckIsBootstrapping();
var c=a.RegExp;
function RegExpGetFlags(){
if(!(%_IsSpecObject(this))){
throw MakeTypeError(29,$toString(this));
}
var d='';
if(this.global)d+='g';
if(this.ignoreCase)d+='i';
if(this.multiline)d+='m';
if(this.unicode)d+='u';
if(this.sticky)d+='y';
return d;
}
%DefineAccessorPropertyUnchecked(c.prototype,'flags',
RegExpGetFlags,null,2);
%SetNativeFlag(RegExpGetFlags);
})
<harmony-reflect}
(function(a,b){
'use strict';
%CheckIsBootstrapping();
var c=a.Reflect;
b.InstallFunctions(c,2,[
"apply",$reflectApply,
"construct",$reflectConstruct
]);
})
8harmony-spready
var $spreadArguments;
var $spreadIterable;
(function(a,b){
'use strict';
var c=b.InternalArray;
function SpreadArguments(){
var d=%_ArgumentsLength();
var e=new c();
for(var f=0;f<d;++f){
var g=%_Arguments(f);
var h=g.length;
for(var i=0;i<h;++i){
e.push(g[i]);
}
}
return e;
}
function SpreadIterable(j){
if((j==null)){
throw MakeTypeError(56,j);
}
var e=new c();
for(var k of j){
e.push(k);
}
return e;
}
$spreadArguments=SpreadArguments;
$spreadIterable=SpreadIterable;
})
8harmony-object<63>
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Object;
var d;
b.Import(function(e){
d=e.OwnPropertyKeys;
});
function ObjectAssign(f,g){
var h=((%_IsSpecObject(%IS_VAR(f)))?f:$toObject(f));
var i=%_ArgumentsLength();
if(i<2)return h;
for(var j=1;j<i;++j){
var k=%_Arguments(j);
if((k==null)){
continue;
}
var e=((%_IsSpecObject(%IS_VAR(k)))?k:$toObject(k));
var l=d(e);
var m=l.length;
for(var n=0;n<m;++n){
var o=l[n];
if(%IsPropertyEnumerable(e,o)){
var p=e[o];
h[o]=p;
}
}
}
return h;
}
b.InstallFunctions(c,2,[
"assign",ObjectAssign
]);
})
dharmony-sharedarraybuffer1
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.SharedArrayBuffer;
var d=a.Object;
function SharedArrayBufferConstructor(e){
if(%_IsConstructCall()){
var f=$toPositiveInteger(e,124);
%ArrayBufferInitialize(this,f,true);
}else{
throw MakeTypeError(20,"SharedArrayBuffer");
}
}
function SharedArrayBufferGetByteLen(){
if(!(%_ClassOf(this)==='SharedArrayBuffer')){
throw MakeTypeError(33,
'SharedArrayBuffer.prototype.byteLength',this);
}
return %_ArrayBufferGetByteLength(this);
}
function SharedArrayBufferIsViewJS(g){
return %ArrayBufferIsView(g);
}
%SetCode(c,SharedArrayBufferConstructor);
%FunctionSetPrototype(c,new d());
%AddNamedProperty(c.prototype,"constructor",
c,2);
%AddNamedProperty(c.prototype,
symbolToStringTag,"SharedArrayBuffer",2|1);
b.InstallGetter(c.prototype,"byteLength",
SharedArrayBufferGetByteLen);
b.InstallFunctions(c,2,[
"isView",SharedArrayBufferIsViewJS
]);
})
dummy<(function() {})