>>0);
}
function MathCbrt(e){
e=((typeof(%IS_VAR(e))==='number')?e:$nonNumberToNumber(e));
if(e==0||!(%_IsSmi(%IS_VAR(e))||((e==e)&&(e!=1/0)&&(e!=-1/0))))return e;
return e>=0?CubeRoot(e):-CubeRoot(-e);
}
function CubeRoot(e){
var y=MathFloorJS(%_DoubleHi(e)/3)+0x2A9F7893;
var z=%_ConstructDouble(y,0);
z=(1.0/3.0)*(e/(z*z)+2*z);
;
z=(1.0/3.0)*(e/(z*z)+2*z);
;
z=(1.0/3.0)*(e/(z*z)+2*z);
;
return(1.0/3.0)*(e/(z*z)+2*z);
;
}
function MathConstructor(){}
var A=new MathConstructor();
%InternalSetPrototype(A,c.prototype);
%AddNamedProperty(a,"Math",A,2);
%FunctionSetInstanceClassName(MathConstructor,'Math');
%AddNamedProperty(A,symbolToStringTag,"Math",1|2);
b.InstallConstants(A,[
"E",2.7182818284590452354,
"LN10",2.302585092994046,
"LN2",0.6931471805599453,
"LOG2E",1.4426950408889634,
"LOG10E",0.4342944819032518,
"PI",3.1415926535897932,
"SQRT1_2",0.7071067811865476,
"SQRT2",1.4142135623730951
]);
b.InstallFunctions(A,2,[
"random",MathRandom,
"abs",MathAbs,
"acos",MathAcosJS,
"asin",MathAsinJS,
"atan",MathAtanJS,
"ceil",MathCeil,
"exp",MathExp,
"floor",MathFloorJS,
"log",MathLog,
"round",MathRound,
"sqrt",MathSqrtJS,
"atan2",MathAtan2JS,
"pow",MathPowJS,
"max",MathMax,
"min",MathMin,
"imul",MathImul,
"sign",MathSign,
"trunc",MathTrunc,
"tanh",MathTanh,
"asinh",MathAsinh,
"acosh",MathAcosh,
"atanh",MathAtanh,
"hypot",MathHypot,
"fround",MathFroundJS,
"clz32",MathClz32JS,
"cbrt",MathCbrt
]);
%SetForceInlineFlag(MathAbs);
%SetForceInlineFlag(MathAcosJS);
%SetForceInlineFlag(MathAsinJS);
%SetForceInlineFlag(MathAtanJS);
%SetForceInlineFlag(MathAtan2JS);
%SetForceInlineFlag(MathCeil);
%SetForceInlineFlag(MathClz32JS);
%SetForceInlineFlag(MathFloorJS);
%SetForceInlineFlag(MathRandom);
%SetForceInlineFlag(MathSign);
%SetForceInlineFlag(MathSqrtJS);
%SetForceInlineFlag(MathTrunc);
b.Export(function(B){
B.MathAbs=MathAbs;
B.MathExp=MathExp;
B.MathFloor=MathFloorJS;
B.IntRandom=MathRandomRaw;
B.MathMax=MathMax;
B.MathMin=MathMin;
});
})
fdlibme¨
var kMath;
var rempio2result;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Math;
var d;
var e;
b.Import(function(g){
d=g.MathAbs;
e=g.MathExp;
});
function KernelTan(h,i,j){
var k;
var l;
var m=%_DoubleHi(h);
var n=m&0x7fffffff;
if(n<0x3e300000){
if(((n|%_DoubleLo(h))|(j+1))==0){
return 1/d(h);
}else{
if(j==1){
return h;
}else{
var l=h+i;
var k=%_ConstructDouble(%_DoubleHi(l),0);
var o=i-(k-h);
var p=-1/l;
var q=%_ConstructDouble(%_DoubleHi(p),0);
var r=1+q*k;
return q+p*(r+q*o);
}
}
}
if(n>=0x3fe59428){
if(h<0){
h=-h;
i=-i;
}
k=kMath[32]-h;
l=kMath[33]-i;
h=k+l;
i=0;
}
k=h*h;
l=k*k;
var t=kMath[19+1]
+l*(kMath[19+3]
+l*(kMath[19+5]
+
l*(kMath[19+7]
+l*(kMath[19+9]
+l*kMath[19+11]
))));
var o=k*(kMath[19+2]
+l*(kMath[19+4]
+l*(kMath[19+6]
+
l*(kMath[19+8]
+l*(kMath[19+10]
+l*kMath[19+12]
)))));
var r=k*h;
t=i+k*(r*(t+o)+i);
t=t+kMath[19+0]
*r;
l=h+t;
if(n>=0x3fe59428){
return(1-((m>>30)&2))*
(j-2.0*(h-(l*l/(l+j)-t)));
}
if(j==1){
return l;
}else{
k=%_ConstructDouble(%_DoubleHi(l),0);
o=t-(k-h);
var p=-1/l;
var q=%_ConstructDouble(%_DoubleHi(p),0);
r=1+q*k;
return q+p*(r+q*o);
}
}
function MathSinSlow(h){
var u,v,w;
var m=%_DoubleHi(h);
var n=m&0x7fffffff;
if(n<0x4002d97c){
if(m>0){
var k=h-kMath[1];
if(n!=0x3ff921fb){
v=k-kMath[2];
w=(k-v)-kMath[2];
}else{
k-=kMath[3];
v=k-kMath[4];
w=(k-v)-kMath[4];
}
u=1;
}else{
var k=h+kMath[1];
if(n!=0x3ff921fb){
v=k+kMath[2];
w=(k-v)+kMath[2];
}else{
k+=kMath[3];
v=k+kMath[4];
w=(k-v)+kMath[4];
}
u=-1;
}
}else if(n<=0x413921fb){
var q=d(h);
u=(q*kMath[0]+0.5)|0;
var t=q-u*kMath[1];
var l=u*kMath[2];
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x1000000){
q=t;
l=u*kMath[3];
t=q-l;
l=u*kMath[4]-((q-t)-l);
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x3100000){
q=t;
l=u*kMath[5];
t=q-l;
l=u*kMath[6]-((q-t)-l);
v=t-l;
}
}
w=(t-v)-l;
if(m<0){
u=-u;
v=-v;
w=-w;
}
}else{
u=%RemPiO2(h,rempio2result);
v=rempio2result[0];
w=rempio2result[1];
}
;
var x=1-(u&2);
if(u&1){
var n=%_DoubleHi(v)&0x7fffffff;
var k=v*v;
var t=k*(4.16666666666666019037e-02+k*(-1.38888888888741095749e-03+k*(2.48015872894767294178e-05+k*(-2.75573143513906633035e-07+k*(2.08757232129817482790e-09+k*-1.13596475577881948265e-11)))));
if(n<0x3fd33333){
return(1-(0.5*k-(k*t-v*w)))*x;
}else{
var y;
if(n>0x3fe90000){
y=0.28125;
}else{
y=%_ConstructDouble(%_DoubleHi(0.25*v),0);
}
var z=0.5*k-y;
return(1-y-(z-(k*t-v*w)))*x;
}
;
}else{
var k=v*v;
var o=k*v;
var t=8.33333333332248946124e-03+k*(-1.98412698298579493134e-04+k*(2.75573137070700676789e-06+k*(-2.50507602534068634195e-08+k*1.58969099521155010221e-10)));
return(v-((k*(0.5*w-o*t)-w)-o*-1.66666666666666324348e-01))*x;
;
}
}
function MathCosSlow(h){
var u,v,w;
var m=%_DoubleHi(h);
var n=m&0x7fffffff;
if(n<0x4002d97c){
if(m>0){
var k=h-kMath[1];
if(n!=0x3ff921fb){
v=k-kMath[2];
w=(k-v)-kMath[2];
}else{
k-=kMath[3];
v=k-kMath[4];
w=(k-v)-kMath[4];
}
u=1;
}else{
var k=h+kMath[1];
if(n!=0x3ff921fb){
v=k+kMath[2];
w=(k-v)+kMath[2];
}else{
k+=kMath[3];
v=k+kMath[4];
w=(k-v)+kMath[4];
}
u=-1;
}
}else if(n<=0x413921fb){
var q=d(h);
u=(q*kMath[0]+0.5)|0;
var t=q-u*kMath[1];
var l=u*kMath[2];
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x1000000){
q=t;
l=u*kMath[3];
t=q-l;
l=u*kMath[4]-((q-t)-l);
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x3100000){
q=t;
l=u*kMath[5];
t=q-l;
l=u*kMath[6]-((q-t)-l);
v=t-l;
}
}
w=(t-v)-l;
if(m<0){
u=-u;
v=-v;
w=-w;
}
}else{
u=%RemPiO2(h,rempio2result);
v=rempio2result[0];
w=rempio2result[1];
}
;
if(u&1){
var x=(u&2)-1;
var k=v*v;
var o=k*v;
var t=8.33333333332248946124e-03+k*(-1.98412698298579493134e-04+k*(2.75573137070700676789e-06+k*(-2.50507602534068634195e-08+k*1.58969099521155010221e-10)));
return(v-((k*(0.5*w-o*t)-w)-o*-1.66666666666666324348e-01))*x;
;
}else{
var x=1-(u&2);
var n=%_DoubleHi(v)&0x7fffffff;
var k=v*v;
var t=k*(4.16666666666666019037e-02+k*(-1.38888888888741095749e-03+k*(2.48015872894767294178e-05+k*(-2.75573143513906633035e-07+k*(2.08757232129817482790e-09+k*-1.13596475577881948265e-11)))));
if(n<0x3fd33333){
return(1-(0.5*k-(k*t-v*w)))*x;
}else{
var y;
if(n>0x3fe90000){
y=0.28125;
}else{
y=%_ConstructDouble(%_DoubleHi(0.25*v),0);
}
var z=0.5*k-y;
return(1-y-(z-(k*t-v*w)))*x;
}
;
}
}
function MathSin(h){
h=+h;
if((%_DoubleHi(h)&0x7fffffff)<=0x3fe921fb){
var k=h*h;
var o=k*h;
var t=8.33333333332248946124e-03+k*(-1.98412698298579493134e-04+k*(2.75573137070700676789e-06+k*(-2.50507602534068634195e-08+k*1.58969099521155010221e-10)));
return(h-((k*(0.5*0-o*t)-0)-o*-1.66666666666666324348e-01));
;
}
return+MathSinSlow(h);
}
function MathCos(h){
h=+h;
if((%_DoubleHi(h)&0x7fffffff)<=0x3fe921fb){
var n=%_DoubleHi(h)&0x7fffffff;
var k=h*h;
var t=k*(4.16666666666666019037e-02+k*(-1.38888888888741095749e-03+k*(2.48015872894767294178e-05+k*(-2.75573143513906633035e-07+k*(2.08757232129817482790e-09+k*-1.13596475577881948265e-11)))));
if(n<0x3fd33333){
return(1-(0.5*k-(k*t-h*0)));
}else{
var y;
if(n>0x3fe90000){
y=0.28125;
}else{
y=%_ConstructDouble(%_DoubleHi(0.25*h),0);
}
var z=0.5*k-y;
return(1-y-(z-(k*t-h*0)));
}
;
}
return+MathCosSlow(h);
}
function MathTan(h){
h=h*1;
if((%_DoubleHi(h)&0x7fffffff)<=0x3fe921fb){
return KernelTan(h,0,1);
}
var u,v,w;
var m=%_DoubleHi(h);
var n=m&0x7fffffff;
if(n<0x4002d97c){
if(m>0){
var k=h-kMath[1];
if(n!=0x3ff921fb){
v=k-kMath[2];
w=(k-v)-kMath[2];
}else{
k-=kMath[3];
v=k-kMath[4];
w=(k-v)-kMath[4];
}
u=1;
}else{
var k=h+kMath[1];
if(n!=0x3ff921fb){
v=k+kMath[2];
w=(k-v)+kMath[2];
}else{
k+=kMath[3];
v=k+kMath[4];
w=(k-v)+kMath[4];
}
u=-1;
}
}else if(n<=0x413921fb){
var q=d(h);
u=(q*kMath[0]+0.5)|0;
var t=q-u*kMath[1];
var l=u*kMath[2];
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x1000000){
q=t;
l=u*kMath[3];
t=q-l;
l=u*kMath[4]-((q-t)-l);
v=t-l;
if(n-(%_DoubleHi(v)&0x7ff00000)>0x3100000){
q=t;
l=u*kMath[5];
t=q-l;
l=u*kMath[6]-((q-t)-l);
v=t-l;
}
}
w=(t-v)-l;
if(m<0){
u=-u;
v=-v;
w=-w;
}
}else{
u=%RemPiO2(h,rempio2result);
v=rempio2result[0];
w=rempio2result[1];
}
;
return KernelTan(v,w,(u&1)?-1:1);
}
function MathLog1p(h){
h=h*1;
var m=%_DoubleHi(h);
var A=m&0x7fffffff;
var B=1;
var C=h;
var D=1;
var E=0;
var F=h;
if(m<0x3fda827a){
if(A>=0x3ff00000){
if(h===-1){
return-(1/0);
}else{
return $NaN;
}
}else if(A<0x3c900000){
return h;
}else if(A<0x3e200000){
return h-h*h*0.5;
}
if((m>0)||(m<=-0x402D413D)){
B=0;
}
}
if(m>=0x7ff00000)return h;
if(B!==0){
if(m<0x43400000){
F=1+h;
D=%_DoubleHi(F);
B=(D>>20)-1023;
E=(B>0)?1-(F-h):h-(F-1);
E=E/F;
}else{
D=%_DoubleHi(F);
B=(D>>20)-1023;
}
D=D&0xfffff;
if(D<0x6a09e){
F=%_ConstructDouble(D|0x3ff00000,%_DoubleLo(F));
}else{
++B;
F=%_ConstructDouble(D|0x3fe00000,%_DoubleLo(F));
D=(0x00100000-D)>>2;
}
C=F-1;
}
var G=0.5*C*C;
if(D===0){
if(C===0){
if(B===0){
return 0.0;
}else{
return B*kMath[34]+(E+B*kMath[35]);
}
}
var H=G*(1-kMath[36]*C);
if(B===0){
return C-H;
}else{
return B*kMath[34]-((H-(B*kMath[35]+E))-C);
}
}
var r=C/(2+C);
var k=r*r;
var H=k*((kMath[37+0])
+k*((kMath[37+1])
+k*
((kMath[37+2])
+k*((kMath[37+3])
+k*
((kMath[37+4])
+k*((kMath[37+5])
+k*(kMath[37+6])
))))));
if(B===0){
return C-(G-r*(G+H));
}else{
return B*kMath[34]-((G-(r*(G+H)+(B*kMath[35]+E)))-C);
}
}
function MathExpm1(h){
h=h*1;
var i;
var I;
var J;
var B;
var q;
var E;
var m=%_DoubleHi(h);
var K=m&0x80000000;
var i=(K===0)?h:-h;
m&=0x7fffffff;
if(m>=0x4043687a){
if(m>=0x40862e42){
if(m>=0x7ff00000){
return(h===-(1/0))?-1:h;
}
if(h>kMath[44])return(1/0);
}
if(K!=0)return-1;
}
if(m>0x3fd62e42){
if(m<0x3ff0a2b2){
if(K===0){
I=h-kMath[34];
J=kMath[35];
B=1;
}else{
I=h+kMath[34];
J=-kMath[35];
B=-1;
}
}else{
B=(kMath[45]*h+((K===0)?0.5:-0.5))|0;
q=B;
I=h-q*kMath[34];
J=q*kMath[35];
}
h=I-J;
E=(I-h)-J;
}else if(m<0x3c900000){
return h;
}else{
B=0;
}
var L=0.5*h;
var M=h*L;
var N=1+M*((kMath[46+0])
+M*((kMath[46+1])
+M*
((kMath[46+2])
+M*((kMath[46+3])
+M*(kMath[46+4])
))));
q=3-N*L;
var O=M*((N-q)/(6-h*q));
if(B===0){
return h-(h*O-M);
}else{
O=(h*(O-E)-E);
O-=M;
if(B===-1)return 0.5*(h-O)-0.5;
if(B===1){
if(h<-0.25)return-2*(O-(h+0.5));
return 1+2*(h-O);
}
if(B<=-2||B>56){
i=1-(O-h);
i=%_ConstructDouble(%_DoubleHi(i)+(B<<20),%_DoubleLo(i));
return i-1;
}
if(B<20){
q=%_ConstructDouble(0x3ff00000-(0x200000>>B),0);
i=q-(O-h);
i=%_ConstructDouble(%_DoubleHi(i)+(B<<20),%_DoubleLo(i));
}else{
q=%_ConstructDouble((0x3ff-B)<<20,0);
i=h-(O+q);
i+=1;
i=%_ConstructDouble(%_DoubleHi(i)+(B<<20),%_DoubleLo(i));
}
}
return i;
}
function MathSinh(h){
h=h*1;
var P=(h<0)?-0.5:0.5;
var A=d(h);
if(A<22){
if(A<3.725290298461914e-9)return h;
var q=MathExpm1(A);
if(A<1)return P*(2*q-q*q/(q+1));
return P*(q+q/(q+1));
}
if(A<709.7822265625)return P*e(A);
if(A<=kMath[51]){
var l=e(0.5*A);
var q=P*l;
return q*l;
}
return h*(1/0);
}
function MathCosh(h){
h=h*1;
var n=%_DoubleHi(h)&0x7fffffff;
if(n<0x3fd62e43){
var q=MathExpm1(d(h));
var l=1+q;
if(n<0x3c800000)return l;
return 1+(q*q)/(l+l);
}
if(n<0x40360000){
var q=e(d(h));
return 0.5*q+0.5/q;
}
if(n<0x40862e42)return 0.5*e(d(h));
if(d(h)<=kMath[51]){
var l=e(0.5*d(h));
var q=0.5*l;
return q*l;
}
if((!%_IsSmi(%IS_VAR(h))&&!(h==h)))return h;
return(1/0);
}
function MathLog10(h){
h=h*1;
var m=%_DoubleHi(h);
var Q=%_DoubleLo(h);
var B=0;
if(m<0x00100000){
if(((m&0x7fffffff)|Q)===0)return-(1/0);
if(m<0)return $NaN;
B-=54;
h*=18014398509481984;
m=%_DoubleHi(h);
Q=%_DoubleLo(h);
}
if(m>=0x7ff00000)return h;
B+=(m>>20)-1023;
var R=(B&0x80000000)>>>31;
m=(m&0x000fffff)|((0x3ff-R)<<20);
var i=B+R;
h=%_ConstructDouble(m,Q);
var k=i*kMath[54]+kMath[52]*%_MathLogRT(h);
return k+i*kMath[53];
}
function MathLog2(h){
h=h*1;
var A=d(h);
var m=%_DoubleHi(h);
var Q=%_DoubleLo(h);
var n=m&0x7fffffff;
if((n|Q)==0)return-(1/0);
if(m<0)return $NaN;
if(n>=0x7ff00000)return h;
var u=0;
if(n<0x00100000){
A*=9007199254740992;
u-=53;
n=%_DoubleHi(A);
}
u+=(n>>20)-0x3ff;
var S=n&0x000fffff;
n=S|0x3ff00000;
var T=1;
var U=0;
var V=0;
if(S>0x3988e){
if(S<0xbb67a){
T=1.5;
U=kMath[64];
V=kMath[65];
}else{
u+=1;
n-=0x00100000;
}
}
A=%_ConstructDouble(n,%_DoubleLo(A));
var F=A-T;
var o=1/(A+T);
var W=F*o;
var X=%_ConstructDouble(%_DoubleHi(W),0);
var Y=%_ConstructDouble(%_DoubleHi(A+T),0)
var Z=A-(Y-T);
var aa=o*((F-X*Y)-X*Z);
var ab=W*W;
var t=ab*ab*((kMath[55+0])
+ab*((kMath[55+1])
+ab*((kMath[55+2])
+ab*(
(kMath[55+3])
+ab*((kMath[55+4])
+ab*(kMath[55+5])
)))));
t+=aa*(X+W);
ab=X*X;
Y=%_ConstructDouble(%_DoubleHi(3.0+ab+t),0);
Z=t-((Y-3.0)-ab);
F=X*Y;
o=aa*Y+Z*W;
p_h=%_ConstructDouble(%_DoubleHi(F+o),0);
p_l=o-(p_h-F);
z_h=kMath[62]*p_h;
z_l=kMath[63]*p_h+p_l*kMath[61]+V;
var q=u;
var ac=%_ConstructDouble(%_DoubleHi(((z_h+z_l)+U)+q),0);
var ad=z_l-(((ac-q)-U)-z_h);
return ac+ad;
}
b.InstallFunctions(c,2,[
"cos",MathCos,
"sin",MathSin,
"tan",MathTan,
"sinh",MathSinh,
"cosh",MathCosh,
"log10",MathLog10,
"log2",MathLog2,
"log1p",MathLog1p,
"expm1",MathExpm1
]);
%SetForceInlineFlag(MathSin);
%SetForceInlineFlag(MathCos);
})
dateŠ
var $createDate;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Date;
var d=b.InternalArray;
var e;
var g;
var h;
b.Import(function(i){
e=i.IsFinite;
g=i.MathAbs;
h=i.MathFloor;
});
var j=$NaN;
var k;
function LocalTimezone(l){
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return"";
CheckDateCacheCurrent();
if(l==j){
return k;
}
var m=%DateLocalTimezone(l);
j=l;
k=m;
return m;
}
function UTC(n){
if((!%_IsSmi(%IS_VAR(n))&&!(n==n)))return n;
return %DateToUTC(n);
}
function MakeTime(o,p,q,r){
if(!e(o))return $NaN;
if(!e(p))return $NaN;
if(!e(q))return $NaN;
if(!e(r))return $NaN;
return(%_IsSmi(%IS_VAR(o))?o:%NumberToInteger($toNumber(o)))*3600000
+(%_IsSmi(%IS_VAR(p))?p:%NumberToInteger($toNumber(p)))*60000
+(%_IsSmi(%IS_VAR(q))?q:%NumberToInteger($toNumber(q)))*1000
+(%_IsSmi(%IS_VAR(r))?r:%NumberToInteger($toNumber(r)));
}
function TimeInYear(t){
return DaysInYear(t)*86400000;
}
function MakeDay(t,u,v){
if(!e(t)||!e(u)||!e(v))return $NaN;
t=(%_IsSmi(%IS_VAR(t))?t:%NumberToIntegerMapMinusZero($toNumber(t)));
u=(%_IsSmi(%IS_VAR(u))?u:%NumberToIntegerMapMinusZero($toNumber(u)));
v=(%_IsSmi(%IS_VAR(v))?v:%NumberToIntegerMapMinusZero($toNumber(v)));
if(t<-1000000||t>1000000||
u<-10000000||u>10000000){
return $NaN;
}
return %DateMakeDay(t|0,u|0)+v-1;
}
function MakeDate(w,n){
var n=w*86400000+n;
if(g(n)>8640002592000000)return $NaN;
return n;
}
function TimeClip(n){
if(!e(n))return $NaN;
if(g(n)>8640000000000000)return $NaN;
return(%_IsSmi(%IS_VAR(n))?n:%NumberToInteger($toNumber(n)));
}
var x={
time:0,
string:null
};
function DateConstructor(t,u,v,y,z,A,r){
if(!%_IsConstructCall()){
return %_CallFunction(new c(),DateToString);
}
var B=%_ArgumentsLength();
var C;
if(B==0){
C=%DateCurrentTime();
(%DateSetValue(this,C,1));
}else if(B==1){
if((typeof(t)==='number')){
C=t;
}else if((typeof(t)==='string')){
CheckDateCacheCurrent();
var D=x;
if(D.string===t){
C=D.time;
}else{
C=DateParse(t);
if(!(!%_IsSmi(%IS_VAR(C))&&!(C==C))){
D.time=C;
D.string=t;
}
}
}else{
var n=$toPrimitive(t,1);
C=(typeof(n)==='string')?DateParse(n):$toNumber(n);
}
(%DateSetValue(this,C,1));
}else{
t=$toNumber(t);
u=$toNumber(u);
v=B>2?$toNumber(v):1;
y=B>3?$toNumber(y):0;
z=B>4?$toNumber(z):0;
A=B>5?$toNumber(A):0;
r=B>6?$toNumber(r):0;
t=(!(!%_IsSmi(%IS_VAR(t))&&!(t==t))&&
0<=(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))&&
(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))<=99)?1900+(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t))):t;
var w=MakeDay(t,u,v);
var n=MakeTime(y,z,A,r);
C=MakeDate(w,n);
(%DateSetValue(this,C,0));
}
}
var E=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
var F=['Jan','Feb','Mar','Apr','May','Jun',
'Jul','Aug','Sep','Oct','Nov','Dec'];
function TwoDigitString(C){
return C<10?"0"+C:""+C;
}
function DateString(v){
if(!%_IsDate(v))%_ThrowNotDateError();
return E[(%_DateField(v,4))]+' '
+F[(%_DateField(v,2))]+' '
+TwoDigitString((%_DateField(v,3)))+' '
+(%_DateField(v,1));
}
var G=['Sunday','Monday','Tuesday','Wednesday',
'Thursday','Friday','Saturday'];
var H=['January','February','March','April','May','June',
'July','August','September','October','November','December'];
function LongDateString(v){
if(!%_IsDate(v))%_ThrowNotDateError();
return G[(%_DateField(v,4))]+', '
+H[(%_DateField(v,2))]+' '
+TwoDigitString((%_DateField(v,3)))+', '
+(%_DateField(v,1));
}
function TimeString(v){
if(!%_IsDate(v))%_ThrowNotDateError();
return TwoDigitString((%_DateField(v,5)))+':'
+TwoDigitString((%_DateField(v,6)))+':'
+TwoDigitString((%_DateField(v,7)));
}
function TimeStringUTC(v){
if(!%_IsDate(v))%_ThrowNotDateError();
return TwoDigitString((%_DateField(v,15)))+':'
+TwoDigitString((%_DateField(v,16)))+':'
+TwoDigitString((%_DateField(v,17)));
}
function LocalTimezoneString(v){
if(!%_IsDate(v))%_ThrowNotDateError();
var m=LocalTimezone((%_DateField(v,0)));
var I=-(%_DateField(v,21));
var J=(I>=0)?1:-1;
var y=h((J*I)/60);
var p=h((J*I)%60);
var K=' GMT'+((J==1)?'+':'-')+
TwoDigitString(y)+TwoDigitString(p);
return K+' ('+m+')';
}
function DatePrintString(v){
if(!%_IsDate(v))%_ThrowNotDateError();
return DateString(v)+' '+TimeString(v);
}
var L=new d(8);
function DateParse(M){
var N=%DateParseString($toString(M),L);
if((N===null))return $NaN;
var w=MakeDay(N[0],N[1],N[2]);
var n=MakeTime(N[3],N[4],N[5],N[6]);
var v=MakeDate(w,n);
if((N[7]===null)){
return TimeClip(UTC(v));
}else{
return TimeClip(v-N[7]*1000);
}
}
function DateUTC(t,u,v,y,z,A,r){
t=$toNumber(t);
u=$toNumber(u);
var B=%_ArgumentsLength();
v=B>2?$toNumber(v):1;
y=B>3?$toNumber(y):0;
z=B>4?$toNumber(z):0;
A=B>5?$toNumber(A):0;
r=B>6?$toNumber(r):0;
t=(!(!%_IsSmi(%IS_VAR(t))&&!(t==t))&&
0<=(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))&&
(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))<=99)?1900+(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t))):t;
var w=MakeDay(t,u,v);
var n=MakeTime(y,z,A,r);
return TimeClip(MakeDate(w,n));
}
function DateNow(){
return %DateCurrentTime();
}
function DateToString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0))
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
var O=LocalTimezoneString(this)
return DatePrintString(this)+O;
}
function DateToDateString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
return DateString(this);
}
function DateToTimeString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
var O=LocalTimezoneString(this);
return TimeString(this)+O;
}
function DateToLocaleString(){
if(!%_IsDate(this))%_ThrowNotDateError();
return %_CallFunction(this,DateToString);
}
function DateToLocaleDateString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
return LongDateString(this);
}
function DateToLocaleTimeString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
return TimeString(this);
}
function DateValueOf(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,0));
}
function DateGetTime(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,0));
}
function DateGetFullYear(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,1));
}
function DateGetUTCFullYear(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,11));
}
function DateGetMonth(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,2));
}
function DateGetUTCMonth(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,12));
}
function DateGetDate(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,3));
}
function DateGetUTCDate(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,13));
}
function DateGetDay(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,4));
}
function DateGetUTCDay(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,14));
}
function DateGetHours(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,5));
}
function DateGetUTCHours(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,15));
}
function DateGetMinutes(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,6));
}
function DateGetUTCMinutes(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,16));
}
function DateGetSeconds(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,7));
}
function DateGetUTCSeconds(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,17))
}
function DateGetMilliseconds(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,8));
}
function DateGetUTCMilliseconds(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,18));
}
function DateGetTimezoneOffset(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,21));
}
function DateSetTime(r){
if(!%_IsDate(this))%_ThrowNotDateError();
(%DateSetValue(this,$toNumber(r),1));
return(%_DateField(this,0));
}
function DateSetMilliseconds(r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
r=$toNumber(r);
var n=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),(%_DateField(this,7)),r);
return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0));
}
function DateSetUTCMilliseconds(r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
r=$toNumber(r);
var n=MakeTime((%_DateField(this,15)),
(%_DateField(this,16)),
(%_DateField(this,17)),
r);
return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1));
}
function DateSetSeconds(q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
q=$toNumber(q);
r=%_ArgumentsLength()<2?(%_DateField(this,8)):$toNumber(r);
var n=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0));
}
function DateSetUTCSeconds(q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
q=$toNumber(q);
r=%_ArgumentsLength()<2?(%_DateField(this,18)):$toNumber(r);
var n=MakeTime((%_DateField(this,15)),(%_DateField(this,16)),q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1));
}
function DateSetMinutes(p,q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
p=$toNumber(p);
var B=%_ArgumentsLength();
q=B<2?(%_DateField(this,7)):$toNumber(q);
r=B<3?(%_DateField(this,8)):$toNumber(r);
var n=MakeTime((%_DateField(this,5)),p,q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0));
}
function DateSetUTCMinutes(p,q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
p=$toNumber(p);
var B=%_ArgumentsLength();
q=B<2?(%_DateField(this,17)):$toNumber(q);
r=B<3?(%_DateField(this,18)):$toNumber(r);
var n=MakeTime((%_DateField(this,15)),p,q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1));
}
function DateSetHours(o,p,q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
o=$toNumber(o);
var B=%_ArgumentsLength();
p=B<2?(%_DateField(this,6)):$toNumber(p);
q=B<3?(%_DateField(this,7)):$toNumber(q);
r=B<4?(%_DateField(this,8)):$toNumber(r);
var n=MakeTime(o,p,q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,9)),n),0));
}
function DateSetUTCHours(o,p,q,r){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
o=$toNumber(o);
var B=%_ArgumentsLength();
p=B<2?(%_DateField(this,16)):$toNumber(p);
q=B<3?(%_DateField(this,17)):$toNumber(q);
r=B<4?(%_DateField(this,18)):$toNumber(r);
var n=MakeTime(o,p,q,r);
return(%DateSetValue(this,MakeDate((%_DateField(this,19)),n),1));
}
function DateSetDate(v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
v=$toNumber(v);
var w=MakeDay((%_DateField(this,1)),(%_DateField(this,2)),v);
return(%DateSetValue(this,MakeDate(w,(%_DateField(this,10))),0));
}
function DateSetUTCDate(v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
v=$toNumber(v);
var w=MakeDay((%_DateField(this,11)),(%_DateField(this,12)),v);
return(%DateSetValue(this,MakeDate(w,(%_DateField(this,20))),1));
}
function DateSetMonth(u,v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
u=$toNumber(u);
v=%_ArgumentsLength()<2?(%_DateField(this,3)):$toNumber(v);
var w=MakeDay((%_DateField(this,1)),u,v);
return(%DateSetValue(this,MakeDate(w,(%_DateField(this,10))),0));
}
function DateSetUTCMonth(u,v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
u=$toNumber(u);
v=%_ArgumentsLength()<2?(%_DateField(this,13)):$toNumber(v);
var w=MakeDay((%_DateField(this,11)),u,v);
return(%DateSetValue(this,MakeDate(w,(%_DateField(this,20))),1));
}
function DateSetFullYear(t,u,v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0)+%_DateField(this,21));
t=$toNumber(t);
var B=%_ArgumentsLength();
var n;
if((!%_IsSmi(%IS_VAR(l))&&!(l==l))){
u=B<2?0:$toNumber(u);
v=B<3?1:$toNumber(v);
n=0;
}else{
u=B<2?(%_DateField(this,2)):$toNumber(u);
v=B<3?(%_DateField(this,3)):$toNumber(v);
n=(%_DateField(this,10));
}
var w=MakeDay(t,u,v);
return(%DateSetValue(this,MakeDate(w,n),0));
}
function DateSetUTCFullYear(t,u,v){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
t=$toNumber(t);
var B=%_ArgumentsLength();
var n;
if((!%_IsSmi(%IS_VAR(l))&&!(l==l))){
u=B<2?0:$toNumber(u);
v=B<3?1:$toNumber(v);
n=0;
}else{
u=B<2?(%_DateField(this,12)):$toNumber(u);
v=B<3?(%_DateField(this,13)):$toNumber(v);
n=(%_DateField(this,20));
}
var w=MakeDay(t,u,v);
return(%DateSetValue(this,MakeDate(w,n),1));
}
function DateToUTCString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return'Invalid Date';
return E[(%_DateField(this,14))]+', '
+TwoDigitString((%_DateField(this,13)))+' '
+F[(%_DateField(this,12))]+' '
+(%_DateField(this,11))+' '
+TimeStringUTC(this)+' GMT';
}
function DateGetYear(){
if(!%_IsDate(this))%_ThrowNotDateError();
return(%_DateField(this,1))-1900;
}
function DateSetYear(t){
if(!%_IsDate(this))%_ThrowNotDateError();
t=$toNumber(t);
if((!%_IsSmi(%IS_VAR(t))&&!(t==t)))return(%DateSetValue(this,$NaN,1));
t=(0<=(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))&&(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t)))<=99)
?1900+(%_IsSmi(%IS_VAR(t))?t:%NumberToInteger($toNumber(t))):t;
var l=(%_DateField(this,0)+%_DateField(this,21));
var u,v,n;
if((!%_IsSmi(%IS_VAR(l))&&!(l==l))){
u=0;
v=1;
n=0;
}else{
u=(%_DateField(this,2));
v=(%_DateField(this,3));
n=(%_DateField(this,10));
}
var w=MakeDay(t,u,v);
return(%DateSetValue(this,MakeDate(w,n),0));
}
function DateToGMTString(){
return %_CallFunction(this,DateToUTCString);
}
function PadInt(P,Q){
if(Q==1)return P;
return P<%_MathPow(10,Q-1)?'0'+PadInt(P,Q-1):P;
}
function DateToISOString(){
if(!%_IsDate(this))%_ThrowNotDateError();
var l=(%_DateField(this,0));
if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))throw MakeRangeError(136);
var t=(%_DateField(this,11));
var R;
if(t>=0&&t<=9999){
R=PadInt(t,4);
}else{
if(t<0){
R="-"+PadInt(-t,6);
}else{
R="+"+PadInt(t,6);
}
}
return R+
'-'+PadInt((%_DateField(this,12))+1,2)+
'-'+PadInt((%_DateField(this,13)),2)+
'T'+PadInt((%_DateField(this,15)),2)+
':'+PadInt((%_DateField(this,16)),2)+
':'+PadInt((%_DateField(this,17)),2)+
'.'+PadInt((%_DateField(this,18)),3)+
'Z';
}
function DateToJSON(S){
var T=$toObject(this);
var U=$defaultNumber(T);
if((typeof(U)==='number')&&!(%_IsSmi(%IS_VAR(U))||((U==U)&&(U!=1/0)&&(U!=-1/0)))){
return null;
}
return T.toISOString();
}
var V;
var W=$NaN;
function CheckDateCacheCurrent(){
if(!V){
V=%DateCacheVersion();
if(!V)return;
}
if(V[0]==W){
return;
}
W=V[0];
j=$NaN;
k=(void 0);
x.time=$NaN;
x.string=null;
}
function CreateDate(n){
var v=new c();
v.setTime(n);
return v;
}
%SetCode(c,DateConstructor);
%FunctionSetPrototype(c,new c($NaN));
b.InstallFunctions(c,2,[
"UTC",DateUTC,
"parse",DateParse,
"now",DateNow
]);
%AddNamedProperty(c.prototype,"constructor",c,2);
b.InstallFunctions(c.prototype,2,[
"toString",DateToString,
"toDateString",DateToDateString,
"toTimeString",DateToTimeString,
"toLocaleString",DateToLocaleString,
"toLocaleDateString",DateToLocaleDateString,
"toLocaleTimeString",DateToLocaleTimeString,
"valueOf",DateValueOf,
"getTime",DateGetTime,
"getFullYear",DateGetFullYear,
"getUTCFullYear",DateGetUTCFullYear,
"getMonth",DateGetMonth,
"getUTCMonth",DateGetUTCMonth,
"getDate",DateGetDate,
"getUTCDate",DateGetUTCDate,
"getDay",DateGetDay,
"getUTCDay",DateGetUTCDay,
"getHours",DateGetHours,
"getUTCHours",DateGetUTCHours,
"getMinutes",DateGetMinutes,
"getUTCMinutes",DateGetUTCMinutes,
"getSeconds",DateGetSeconds,
"getUTCSeconds",DateGetUTCSeconds,
"getMilliseconds",DateGetMilliseconds,
"getUTCMilliseconds",DateGetUTCMilliseconds,
"getTimezoneOffset",DateGetTimezoneOffset,
"setTime",DateSetTime,
"setMilliseconds",DateSetMilliseconds,
"setUTCMilliseconds",DateSetUTCMilliseconds,
"setSeconds",DateSetSeconds,
"setUTCSeconds",DateSetUTCSeconds,
"setMinutes",DateSetMinutes,
"setUTCMinutes",DateSetUTCMinutes,
"setHours",DateSetHours,
"setUTCHours",DateSetUTCHours,
"setDate",DateSetDate,
"setUTCDate",DateSetUTCDate,
"setMonth",DateSetMonth,
"setUTCMonth",DateSetUTCMonth,
"setFullYear",DateSetFullYear,
"setUTCFullYear",DateSetUTCFullYear,
"toGMTString",DateToGMTString,
"toUTCString",DateToUTCString,
"getYear",DateGetYear,
"setYear",DateSetYear,
"toISOString",DateToISOString,
"toJSON",DateToJSON
]);
$createDate=CreateDate;
})
regexp f
var $regexpLastMatchInfoOverride;
var harmony_regexps=false;
var harmony_unicode_regexps=false;
(function(a,b){
%CheckIsBootstrapping();
var c=a.RegExp;
var d=b.InternalPackedArray;
var e=new d(
2,
"",
(void 0),
0,
0
);
$regexpLastMatchInfoOverride=null;
function DoConstructRegExp(g,h,i){
if((%_IsRegExp(h))){
if(!(i===(void 0)))throw MakeTypeError(93);
i=(h.global?'g':'')
+(h.ignoreCase?'i':'')
+(h.multiline?'m':'');
if(harmony_unicode_regexps)
i+=(h.unicode?'u':'');
if(harmony_regexps)
i+=(h.sticky?'y':'');
h=h.source;
}
h=(h===(void 0))?'':$toString(h);
i=(i===(void 0))?'':$toString(i);
%RegExpInitializeAndCompile(g,h,i);
}
function RegExpConstructor(h,i){
if(%_IsConstructCall()){
DoConstructRegExp(this,h,i);
}else{
if((%_IsRegExp(h))&&(i===(void 0))){
return h;
}
return new c(h,i);
}
}
function RegExpCompileJS(h,i){
if(this==c.prototype){
throw MakeTypeError(33,
'RegExp.prototype.compile',this);
}
if((h===(void 0))&&%_ArgumentsLength()!=0){
DoConstructRegExp(this,'undefined',i);
}else{
DoConstructRegExp(this,h,i);
}
}
function DoRegExpExec(j,k,l){
var m=%_RegExpExec(j,k,l,e);
if(m!==null)$regexpLastMatchInfoOverride=null;
return m;
}
function RegExpExecNoTests(j,k,n){
var o=%_RegExpExec(j,k,n,e);
if(o!==null){
$regexpLastMatchInfoOverride=null;
var p=((o)[0])>>1;
var n=o[3];
var q=o[4];
var r=%_SubString(k,n,q);
var m=%_RegExpConstructResult(p,n,k);
m[0]=r;
if(p==1)return m;
var t=3+2;
for(var u=1;uk.length){
this.lastIndex=0;
return null;
}
}else{
u=0;
}
var x=%_RegExpExec(this,k,u,e);
if((x===null)){
this.lastIndex=0;
return null;
}
$regexpLastMatchInfoOverride=null;
if(w){
this.lastIndex=e[4];
}
var p=((x)[0])>>1;
var n=x[3];
var q=x[4];
var r=%_SubString(k,n,q);
var m=%_RegExpConstructResult(p,n,k);
m[0]=r;
if(p==1)return m;
var t=3+2;
for(var u=1;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(qz){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 1!==0){
throw MakeRangeError(137,
"byte length","Uint8Array",1);
}
B=z-A;
C=B/1;
}else{
var C=y;
B=C*1;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,1,w,A,B,true);
}
function Uint8ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*1;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,1,w,0,E,true);
}else{
%_TypedArrayInitialize(v,1,null,0,E,true);
}
}
function Uint8ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*1;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,1,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,1,F,D);
}
if(!G){
for(var H=0;Hz){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 1!==0){
throw MakeRangeError(137,
"byte length","Int8Array",1);
}
B=z-A;
C=B/1;
}else{
var C=y;
B=C*1;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,2,w,A,B,true);
}
function Int8ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*1;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,2,w,0,E,true);
}else{
%_TypedArrayInitialize(v,2,null,0,E,true);
}
}
function Int8ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*1;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,2,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,2,F,D);
}
if(!G){
for(var H=0;Hz){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 2!==0){
throw MakeRangeError(137,
"byte length","Uint16Array",2);
}
B=z-A;
C=B/2;
}else{
var C=y;
B=C*2;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,3,w,A,B,true);
}
function Uint16ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*2;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,3,w,0,E,true);
}else{
%_TypedArrayInitialize(v,3,null,0,E,true);
}
}
function Uint16ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*2;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,3,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,3,F,D);
}
if(!G){
for(var H=0;Hz){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 2!==0){
throw MakeRangeError(137,
"byte length","Int16Array",2);
}
B=z-A;
C=B/2;
}else{
var C=y;
B=C*2;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,4,w,A,B,true);
}
function Int16ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*2;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,4,w,0,E,true);
}else{
%_TypedArrayInitialize(v,4,null,0,E,true);
}
}
function Int16ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*2;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,4,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,4,F,D);
}
if(!G){
for(var H=0;Hz){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 4!==0){
throw MakeRangeError(137,
"byte length","Uint32Array",4);
}
B=z-A;
C=B/4;
}else{
var C=y;
B=C*4;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,5,w,A,B,true);
}
function Uint32ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*4;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,5,w,0,E,true);
}else{
%_TypedArrayInitialize(v,5,null,0,E,true);
}
}
function Uint32ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*4;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,5,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,5,F,D);
}
if(!G){
for(var H=0;Hz){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 4!==0){
throw MakeRangeError(137,
"byte length","Int32Array",4);
}
B=z-A;
C=B/4;
}else{
var C=y;
B=C*4;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,6,w,A,B,true);
}
function Int32ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*4;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,6,w,0,E,true);
}else{
%_TypedArrayInitialize(v,6,null,0,E,true);
}
}
function Int32ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*4;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,6,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,6,F,D);
}
if(!G){
for(var H=0;Hz){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 4!==0){
throw MakeRangeError(137,
"byte length","Float32Array",4);
}
B=z-A;
C=B/4;
}else{
var C=y;
B=C*4;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,7,w,A,B,true);
}
function Float32ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*4;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,7,w,0,E,true);
}else{
%_TypedArrayInitialize(v,7,null,0,E,true);
}
}
function Float32ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*4;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,7,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,7,F,D);
}
if(!G){
for(var H=0;Hz){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 8!==0){
throw MakeRangeError(137,
"byte length","Float64Array",8);
}
B=z-A;
C=B/8;
}else{
var C=y;
B=C*8;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,8,w,A,B,true);
}
function Float64ArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*8;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,8,w,0,E,true);
}else{
%_TypedArrayInitialize(v,8,null,0,E,true);
}
}
function Float64ArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*8;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,8,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,8,F,D);
}
if(!G){
for(var H=0;Hz){
throw MakeRangeError(139);
}
}
var B;
var C;
if((y===(void 0))){
if(z % 1!==0){
throw MakeRangeError(137,
"byte length","Uint8ClampedArray",1);
}
B=z-A;
C=B/1;
}else{
var C=y;
B=C*1;
}
if((A+B>z)
||(C>%_MaxSmi())){
throw MakeRangeError(138);
}
%_TypedArrayInitialize(v,9,w,A,B,true);
}
function Uint8ClampedArrayConstructByLength(v,y){
var D=(y===(void 0))?
0:$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var E=D*1;
if(E>%_TypedArrayMaxSizeInHeap()){
var w=new d(E);
%_TypedArrayInitialize(v,9,w,0,E,true);
}else{
%_TypedArrayInitialize(v,9,null,0,E,true);
}
}
function Uint8ClampedArrayConstructByArrayLike(v,F){
var y=F.length;
var D=$toPositiveInteger(y,138);
if(D>%_MaxSmi()){
throw MakeRangeError(138);
}
var G=false;
var E=D*1;
if(E<=%_TypedArrayMaxSizeInHeap()){
%_TypedArrayInitialize(v,9,null,0,E,false);
}else{
G=
%TypedArrayInitializeFromArrayLike(v,9,F,D);
}
if(!G){
for(var H=0;H0){
for(var H=0;H=ae&&ac>=ad;
af--){
X[A+af]=Y[af];
ac-=ab;
ad-=aa;
}
return af;
}
var af=CopyRightPart();
var ag=new c(af+1-ae);
for(var H=ae;H<=af;H++){
ag[H-ae]=Y[H];
}
for(H=ae;H<=af;H++){
X[A+H]=ag[H-ae];
}
}
function TypedArraySet(v,A){
var ah=(A===(void 0))?0:(%_IsSmi(%IS_VAR(A))?A:%NumberToInteger($toNumber(A)));
if(ah<0)throw MakeTypeError(147);
if(ah>%_MaxSmi()){
throw MakeRangeError(148);
}
switch(%TypedArraySetFastCases(this,v,ah)){
case 0:
return;
case 1:
TypedArraySetFromOverlappingTypedArray(this,v,ah);
return;
case 2:
TypedArraySetFromArrayLike(this,v,v.length,ah);
return;
case 3:
var D=v.length;
if((D===(void 0))){
if((typeof(v)==='number')){
throw MakeTypeError(36);
}
return;
}
if(ah+D>this.length){
throw MakeRangeError(148);
}
TypedArraySetFromArrayLike(this,v,D,ah);
return;
}
}
function TypedArrayGetToStringTag(){
if(!%_IsTypedArray(this))return;
var ai=%_ClassOf(this);
if((ai===(void 0)))return;
return ai;
}
%SetCode(h,Uint8ArrayConstructor);
%FunctionSetPrototype(h,new g());
%AddNamedProperty(h,"BYTES_PER_ELEMENT",1,
1|2|4);
%AddNamedProperty(h.prototype,
"constructor",a.Uint8Array,2);
%AddNamedProperty(h.prototype,
"BYTES_PER_ELEMENT",1,
1|2|4);
b.InstallGetter(h.prototype,"buffer",Uint8Array_GetBuffer);
b.InstallGetter(h.prototype,"byteOffset",Uint8Array_GetByteOffset,
2|4);
b.InstallGetter(h.prototype,"byteLength",Uint8Array_GetByteLength,
2|4);
b.InstallGetter(h.prototype,"length",Uint8Array_GetLength,
2|4);
b.InstallGetter(h.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(h.prototype,2,[
"subarray",Uint8ArraySubArray,
"set",TypedArraySet
]);
%SetCode(i,Int8ArrayConstructor);
%FunctionSetPrototype(i,new g());
%AddNamedProperty(i,"BYTES_PER_ELEMENT",1,
1|2|4);
%AddNamedProperty(i.prototype,
"constructor",a.Int8Array,2);
%AddNamedProperty(i.prototype,
"BYTES_PER_ELEMENT",1,
1|2|4);
b.InstallGetter(i.prototype,"buffer",Int8Array_GetBuffer);
b.InstallGetter(i.prototype,"byteOffset",Int8Array_GetByteOffset,
2|4);
b.InstallGetter(i.prototype,"byteLength",Int8Array_GetByteLength,
2|4);
b.InstallGetter(i.prototype,"length",Int8Array_GetLength,
2|4);
b.InstallGetter(i.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(i.prototype,2,[
"subarray",Int8ArraySubArray,
"set",TypedArraySet
]);
%SetCode(j,Uint16ArrayConstructor);
%FunctionSetPrototype(j,new g());
%AddNamedProperty(j,"BYTES_PER_ELEMENT",2,
1|2|4);
%AddNamedProperty(j.prototype,
"constructor",a.Uint16Array,2);
%AddNamedProperty(j.prototype,
"BYTES_PER_ELEMENT",2,
1|2|4);
b.InstallGetter(j.prototype,"buffer",Uint16Array_GetBuffer);
b.InstallGetter(j.prototype,"byteOffset",Uint16Array_GetByteOffset,
2|4);
b.InstallGetter(j.prototype,"byteLength",Uint16Array_GetByteLength,
2|4);
b.InstallGetter(j.prototype,"length",Uint16Array_GetLength,
2|4);
b.InstallGetter(j.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(j.prototype,2,[
"subarray",Uint16ArraySubArray,
"set",TypedArraySet
]);
%SetCode(k,Int16ArrayConstructor);
%FunctionSetPrototype(k,new g());
%AddNamedProperty(k,"BYTES_PER_ELEMENT",2,
1|2|4);
%AddNamedProperty(k.prototype,
"constructor",a.Int16Array,2);
%AddNamedProperty(k.prototype,
"BYTES_PER_ELEMENT",2,
1|2|4);
b.InstallGetter(k.prototype,"buffer",Int16Array_GetBuffer);
b.InstallGetter(k.prototype,"byteOffset",Int16Array_GetByteOffset,
2|4);
b.InstallGetter(k.prototype,"byteLength",Int16Array_GetByteLength,
2|4);
b.InstallGetter(k.prototype,"length",Int16Array_GetLength,
2|4);
b.InstallGetter(k.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(k.prototype,2,[
"subarray",Int16ArraySubArray,
"set",TypedArraySet
]);
%SetCode(l,Uint32ArrayConstructor);
%FunctionSetPrototype(l,new g());
%AddNamedProperty(l,"BYTES_PER_ELEMENT",4,
1|2|4);
%AddNamedProperty(l.prototype,
"constructor",a.Uint32Array,2);
%AddNamedProperty(l.prototype,
"BYTES_PER_ELEMENT",4,
1|2|4);
b.InstallGetter(l.prototype,"buffer",Uint32Array_GetBuffer);
b.InstallGetter(l.prototype,"byteOffset",Uint32Array_GetByteOffset,
2|4);
b.InstallGetter(l.prototype,"byteLength",Uint32Array_GetByteLength,
2|4);
b.InstallGetter(l.prototype,"length",Uint32Array_GetLength,
2|4);
b.InstallGetter(l.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(l.prototype,2,[
"subarray",Uint32ArraySubArray,
"set",TypedArraySet
]);
%SetCode(m,Int32ArrayConstructor);
%FunctionSetPrototype(m,new g());
%AddNamedProperty(m,"BYTES_PER_ELEMENT",4,
1|2|4);
%AddNamedProperty(m.prototype,
"constructor",a.Int32Array,2);
%AddNamedProperty(m.prototype,
"BYTES_PER_ELEMENT",4,
1|2|4);
b.InstallGetter(m.prototype,"buffer",Int32Array_GetBuffer);
b.InstallGetter(m.prototype,"byteOffset",Int32Array_GetByteOffset,
2|4);
b.InstallGetter(m.prototype,"byteLength",Int32Array_GetByteLength,
2|4);
b.InstallGetter(m.prototype,"length",Int32Array_GetLength,
2|4);
b.InstallGetter(m.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(m.prototype,2,[
"subarray",Int32ArraySubArray,
"set",TypedArraySet
]);
%SetCode(n,Float32ArrayConstructor);
%FunctionSetPrototype(n,new g());
%AddNamedProperty(n,"BYTES_PER_ELEMENT",4,
1|2|4);
%AddNamedProperty(n.prototype,
"constructor",a.Float32Array,2);
%AddNamedProperty(n.prototype,
"BYTES_PER_ELEMENT",4,
1|2|4);
b.InstallGetter(n.prototype,"buffer",Float32Array_GetBuffer);
b.InstallGetter(n.prototype,"byteOffset",Float32Array_GetByteOffset,
2|4);
b.InstallGetter(n.prototype,"byteLength",Float32Array_GetByteLength,
2|4);
b.InstallGetter(n.prototype,"length",Float32Array_GetLength,
2|4);
b.InstallGetter(n.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(n.prototype,2,[
"subarray",Float32ArraySubArray,
"set",TypedArraySet
]);
%SetCode(o,Float64ArrayConstructor);
%FunctionSetPrototype(o,new g());
%AddNamedProperty(o,"BYTES_PER_ELEMENT",8,
1|2|4);
%AddNamedProperty(o.prototype,
"constructor",a.Float64Array,2);
%AddNamedProperty(o.prototype,
"BYTES_PER_ELEMENT",8,
1|2|4);
b.InstallGetter(o.prototype,"buffer",Float64Array_GetBuffer);
b.InstallGetter(o.prototype,"byteOffset",Float64Array_GetByteOffset,
2|4);
b.InstallGetter(o.prototype,"byteLength",Float64Array_GetByteLength,
2|4);
b.InstallGetter(o.prototype,"length",Float64Array_GetLength,
2|4);
b.InstallGetter(o.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(o.prototype,2,[
"subarray",Float64ArraySubArray,
"set",TypedArraySet
]);
%SetCode(p,Uint8ClampedArrayConstructor);
%FunctionSetPrototype(p,new g());
%AddNamedProperty(p,"BYTES_PER_ELEMENT",1,
1|2|4);
%AddNamedProperty(p.prototype,
"constructor",a.Uint8ClampedArray,2);
%AddNamedProperty(p.prototype,
"BYTES_PER_ELEMENT",1,
1|2|4);
b.InstallGetter(p.prototype,"buffer",Uint8ClampedArray_GetBuffer);
b.InstallGetter(p.prototype,"byteOffset",Uint8ClampedArray_GetByteOffset,
2|4);
b.InstallGetter(p.prototype,"byteLength",Uint8ClampedArray_GetByteLength,
2|4);
b.InstallGetter(p.prototype,"length",Uint8ClampedArray_GetLength,
2|4);
b.InstallGetter(p.prototype,symbolToStringTag,
TypedArrayGetToStringTag);
b.InstallFunctions(p.prototype,2,[
"subarray",Uint8ClampedArraySubArray,
"set",TypedArraySet
]);
function DataViewConstructor(w,x,E){
if(%_IsConstructCall()){
if(!(%_ClassOf(w)==='ArrayBuffer'))throw MakeTypeError(22);
if(!(x===(void 0))){
x=$toPositiveInteger(x,131);
}
if(!(E===(void 0))){
E=(%_IsSmi(%IS_VAR(E))?E:%NumberToInteger($toNumber(E)));
}
var z=%_ArrayBufferGetByteLength(w);
var A=(x===(void 0))?0:x;
if(A>z)throw MakeRangeError(131);
var y=(E===(void 0))
?z-A
:E;
if(y<0||A+y>z){
throw new MakeRangeError(130);
}
%_DataViewInitialize(this,w,A,y);
}else{
throw MakeTypeError(20,"DataView");
}
}
function DataViewGetBufferJS(){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,'DataView.buffer',this);
}
return %DataViewGetBuffer(this);
}
function DataViewGetByteOffset(){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.byteOffset',this);
}
return %_ArrayBufferViewGetByteOffset(this);
}
function DataViewGetByteLength(){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.byteLength',this);
}
return %_ArrayBufferViewGetByteLength(this);
}
function DataViewGetInt8JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getInt8',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetInt8(this,A,!!aj);
}
function DataViewSetInt8JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setInt8',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetInt8(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetUint8JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getUint8',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetUint8(this,A,!!aj);
}
function DataViewSetUint8JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setUint8',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetUint8(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetInt16JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getInt16',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetInt16(this,A,!!aj);
}
function DataViewSetInt16JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setInt16',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetInt16(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetUint16JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getUint16',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetUint16(this,A,!!aj);
}
function DataViewSetUint16JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setUint16',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetUint16(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetInt32JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getInt32',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetInt32(this,A,!!aj);
}
function DataViewSetInt32JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setInt32',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetInt32(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetUint32JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getUint32',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetUint32(this,A,!!aj);
}
function DataViewSetUint32JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setUint32',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetUint32(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetFloat32JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getFloat32',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetFloat32(this,A,!!aj);
}
function DataViewSetFloat32JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setFloat32',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetFloat32(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
function DataViewGetFloat64JS(A,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.getFloat64',this);
}
if(%_ArgumentsLength()<1)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
return %DataViewGetFloat64(this,A,!!aj);
}
function DataViewSetFloat64JS(A,N,aj){
if(!(%_ClassOf(this)==='DataView')){
throw MakeTypeError(33,
'DataView.setFloat64',this);
}
if(%_ArgumentsLength()<2)throw MakeTypeError(36);
A=$toPositiveInteger(A,129);
%DataViewSetFloat64(this,A,((typeof(%IS_VAR(N))==='number')?N:$nonNumberToNumber(N)),!!aj);
}
%SetCode(e,DataViewConstructor);
%FunctionSetPrototype(e,new g);
%AddNamedProperty(e.prototype,"constructor",e,
2);
%AddNamedProperty(e.prototype,symbolToStringTag,"DataView",
1|2);
b.InstallGetter(e.prototype,"buffer",DataViewGetBufferJS);
b.InstallGetter(e.prototype,"byteOffset",
DataViewGetByteOffset);
b.InstallGetter(e.prototype,"byteLength",
DataViewGetByteLength);
b.InstallFunctions(e.prototype,2,[
"getInt8",DataViewGetInt8JS,
"setInt8",DataViewSetInt8JS,
"getUint8",DataViewGetUint8JS,
"setUint8",DataViewSetUint8JS,
"getInt16",DataViewGetInt16JS,
"setInt16",DataViewSetInt16JS,
"getUint16",DataViewGetUint16JS,
"setUint16",DataViewSetUint16JS,
"getInt32",DataViewGetInt32JS,
"setInt32",DataViewSetInt32JS,
"getUint32",DataViewGetUint32JS,
"setUint32",DataViewSetUint32JS,
"getFloat32",DataViewGetFloat32JS,
"setFloat32",DataViewSetFloat32JS,
"getFloat64",DataViewGetFloat64JS,
"setFloat64",DataViewSetFloat64JS
]);
})
Hiterator-prototype¥
var $iteratorPrototype;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Object;
function IteratorPrototypeIterator(){
return this;
}
b.SetFunctionName(IteratorPrototypeIterator,symbolIterator);
%AddNamedProperty($iteratorPrototype,symbolIterator,
IteratorPrototypeIterator,2);
})
$generatorá
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Function;
var d;
b.Import(function(e){
d=e.NewFunctionString;
});
function GeneratorObjectNext(g){
if(!(%_ClassOf(this)==='Generator')){
throw MakeTypeError(33,
'[Generator].prototype.next',this);
}
var h=%GeneratorGetContinuation(this);
if(h>0){
if((%_DebugIsActive()!=0))%DebugPrepareStepInIfStepping(this);
try{
return %_GeneratorNext(this,g);
}catch(e){
%GeneratorClose(this);
throw e;
}
}else if(h==0){
return{value:void 0,done:true};
}else{
throw MakeTypeError(31);
}
}
function GeneratorObjectThrow(i){
if(!(%_ClassOf(this)==='Generator')){
throw MakeTypeError(33,
'[Generator].prototype.throw',this);
}
var h=%GeneratorGetContinuation(this);
if(h>0){
try{
return %_GeneratorThrow(this,i);
}catch(e){
%GeneratorClose(this);
throw e;
}
}else if(h==0){
throw i;
}else{
throw MakeTypeError(31);
}
}
function GeneratorFunctionConstructor(j){
var k=d(arguments,'function*');
var l=%GlobalProxy(GeneratorFunctionConstructor);
var m=%_CallFunction(l,%CompileString(k,true));
%FunctionMarkNameShouldPrintAsAnonymous(m);
return m;
}
%NeverOptimizeFunction(GeneratorObjectNext);
%NeverOptimizeFunction(GeneratorObjectThrow);
var n=GeneratorFunctionPrototype.prototype;
b.InstallFunctions(n,
2,
["next",GeneratorObjectNext,
"throw",GeneratorObjectThrow]);
%AddNamedProperty(n,"constructor",
GeneratorFunctionPrototype,2|1);
%AddNamedProperty(n,
symbolToStringTag,"Generator",2|1);
%InternalSetPrototype(GeneratorFunctionPrototype,c.prototype);
%AddNamedProperty(GeneratorFunctionPrototype,
symbolToStringTag,"GeneratorFunction",2|1);
%AddNamedProperty(GeneratorFunctionPrototype,"constructor",
GeneratorFunction,2|1);
%InternalSetPrototype(GeneratorFunction,c);
%SetCode(GeneratorFunction,GeneratorFunctionConstructor);
})
8object-observei®
var $observeNotifyChange;
var $observeEnqueueSpliceRecord;
var $observeBeginPerformSplice;
var $observeEndPerformSplice;
var $observeNativeObjectObserve;
var $observeNativeObjectGetNotifier;
var $observeNativeObjectNotifierPerformChange;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Array;
var d=a.Object;
var e=b.InternalArray;
var g;
var h;
b.Import(function(i){
g=i.ObjectFreeze;
h=i.ObjectIsFrozen;
});
var j;
var k={};
function GetObservationStateJS(){
if((j===(void 0))){
j=%GetObservationState();
}
if((j.callbackInfoMap===(void 0))){
j.callbackInfoMap=%ObservationWeakMapCreate();
j.objectInfoMap=%ObservationWeakMapCreate();
j.notifierObjectInfoMap=%ObservationWeakMapCreate();
j.pendingObservers=null;
j.nextCallbackPriority=0;
j.lastMicrotaskId=0;
}
return j;
}
function GetPendingObservers(){
return GetObservationStateJS().pendingObservers;
}
function SetPendingObservers(l){
GetObservationStateJS().pendingObservers=l;
}
function GetNextCallbackPriority(){
return GetObservationStateJS().nextCallbackPriority++;
}
function nullProtoObject(){
return{__proto__:null};
}
function TypeMapCreate(){
return nullProtoObject();
}
function TypeMapAddType(m,n,o){
m[n]=o?1:(m[n]||0)+1;
}
function TypeMapRemoveType(m,n){
m[n]--;
}
function TypeMapCreateFromList(p,q){
var m=TypeMapCreate();
for(var r=0;r0?A.performing:null;
}
function ConvertAcceptListToTypeMap(G){
if((G===(void 0)))
return G;
if(!(%_IsSpecObject(G)))throw MakeTypeError(67);
var H=$toInteger(G.length);
if(H<0)H=0;
return TypeMapCreateFromList(G,H);
}
function CallbackInfoGet(x){
return %WeakCollectionGet(GetObservationStateJS().callbackInfoMap,x,
$getHash(x));
}
function CallbackInfoSet(x,E){
%WeakCollectionSet(GetObservationStateJS().callbackInfoMap,
x,E,$getHash(x));
}
function CallbackInfoGetOrCreate(x){
var E=CallbackInfoGet(x);
if(!(E===(void 0)))
return E;
var F=GetNextCallbackPriority();
CallbackInfoSet(x,F);
return F;
}
function CallbackInfoGetPriority(E){
if((typeof(E)==='number'))
return E;
else
return E.priority;
}
function CallbackInfoNormalize(x){
var E=CallbackInfoGet(x);
if((typeof(E)==='number')){
var F=E;
E=new e;
E.priority=F;
CallbackInfoSet(x,E);
}
return E;
}
function ObjectObserve(B,x,y){
if(!(%_IsSpecObject(B)))
throw MakeTypeError(69,"observe","observe");
if(%IsJSGlobalProxy(B))
throw MakeTypeError(66,"observe");
if(!(%_ClassOf(x)==='Function'))
throw MakeTypeError(68,"observe");
if(h(x))
throw MakeTypeError(65);
var I=%GetObjectContextObjectObserve(B);
return I(B,x,y);
}
function NativeObjectObserve(B,x,y){
var A=ObjectInfoGetOrCreate(B);
var p=ConvertAcceptListToTypeMap(y);
ObjectInfoAddObserver(A,x,p);
return B;
}
function ObjectUnobserve(B,x){
if(!(%_IsSpecObject(B)))
throw MakeTypeError(69,"unobserve","unobserve");
if(%IsJSGlobalProxy(B))
throw MakeTypeError(66,"unobserve");
if(!(%_ClassOf(x)==='Function'))
throw MakeTypeError(68,"unobserve");
var A=ObjectInfoGet(B);
if((A===(void 0)))
return B;
ObjectInfoRemoveObserver(A,x);
return B;
}
function ArrayObserve(B,x){
return ObjectObserve(B,x,['add',
'update',
'delete',
'splice']);
}
function ArrayUnobserve(B,x){
return ObjectUnobserve(B,x);
}
function ObserverEnqueueIfActive(z,A,J){
if(!ObserverIsActive(z,A)||
!TypeMapHasType(ObserverGetAcceptTypes(z),J.type)){
return;
}
var x=ObserverGetCallback(z);
if(!%ObserverObjectAndRecordHaveSameOrigin(x,J.object,
J)){
return;
}
var E=CallbackInfoNormalize(x);
if((GetPendingObservers()===null)){
SetPendingObservers(nullProtoObject());
if((%_DebugIsActive()!=0)){
var K=++GetObservationStateJS().lastMicrotaskId;
var L="Object.observe";
%EnqueueMicrotask(function(){
%DebugAsyncTaskEvent({type:"willHandle",id:K,name:L});
ObserveMicrotaskRunner();
%DebugAsyncTaskEvent({type:"didHandle",id:K,name:L});
});
%DebugAsyncTaskEvent({type:"enqueue",id:K,name:L});
}else{
%EnqueueMicrotask(ObserveMicrotaskRunner);
}
}
GetPendingObservers()[E.priority]=x;
E.push(J);
}
function ObjectInfoEnqueueExternalChangeRecord(A,J,n){
if(!ObjectInfoHasActiveObservers(A))
return;
var M=!(n===(void 0));
var N=M?
{object:A.object,type:n}:
{object:A.object};
for(var O in J){
if(O==='object'||(M&&O==='type'))continue;
%DefineDataPropertyUnchecked(
N,O,J[O],1+4);
}
g(N);
ObjectInfoEnqueueInternalChangeRecord(A,N);
}
function ObjectInfoEnqueueInternalChangeRecord(A,J){
if((typeof(J.name)==='symbol'))return;
if(ChangeObserversIsOptimized(A.changeObservers)){
var z=A.changeObservers;
ObserverEnqueueIfActive(z,A,J);
return;
}
for(var F in A.changeObservers){
var z=A.changeObservers[F];
if((z===null))
continue;
ObserverEnqueueIfActive(z,A,J);
}
}
function BeginPerformSplice(P){
var A=ObjectInfoGet(P);
if(!(A===(void 0)))
ObjectInfoAddPerformingType(A,'splice');
}
function EndPerformSplice(P){
var A=ObjectInfoGet(P);
if(!(A===(void 0)))
ObjectInfoRemovePerformingType(A,'splice');
}
function EnqueueSpliceRecord(P,Q,R,S){
var A=ObjectInfoGet(P);
if(!ObjectInfoHasActiveObservers(A))
return;
var J={
type:'splice',
object:P,
index:Q,
removed:R,
addedCount:S
};
g(J);
g(J.removed);
ObjectInfoEnqueueInternalChangeRecord(A,J);
}
function NotifyChange(n,B,L,T){
var A=ObjectInfoGet(B);
if(!ObjectInfoHasActiveObservers(A))
return;
var J;
if(arguments.length==2){
J={type:n,object:B};
}else if(arguments.length==3){
J={type:n,object:B,name:L};
}else{
J={
type:n,
object:B,
name:L,
oldValue:T
};
}
g(J);
ObjectInfoEnqueueInternalChangeRecord(A,J);
}
function ObjectNotifierNotify(J){
if(!(%_IsSpecObject(this)))
throw MakeTypeError(13,"notify");
var A=ObjectInfoGetFromNotifier(this);
if((A===(void 0)))
throw MakeTypeError(70);
if(!(typeof(J.type)==='string'))
throw MakeTypeError(73);
ObjectInfoEnqueueExternalChangeRecord(A,J);
}
function ObjectNotifierPerformChange(U,V){
if(!(%_IsSpecObject(this)))
throw MakeTypeError(13,"performChange");
var A=ObjectInfoGetFromNotifier(this);
if((A===(void 0)))
throw MakeTypeError(70);
if(!(typeof(U)==='string'))
throw MakeTypeError(72);
if(!(%_ClassOf(V)==='Function'))
throw MakeTypeError(71);
var W=%GetObjectContextNotifierPerformChange(A);
W(A,U,V);
}
function NativeObjectNotifierPerformChange(A,U,V){
ObjectInfoAddPerformingType(A,U);
var J;
try{
J=%_CallFunction((void 0),V);
}finally{
ObjectInfoRemovePerformingType(A,U);
}
if((%_IsSpecObject(J)))
ObjectInfoEnqueueExternalChangeRecord(A,J,U);
}
function ObjectGetNotifier(B){
if(!(%_IsSpecObject(B)))
throw MakeTypeError(69,"getNotifier","getNotifier");
if(%IsJSGlobalProxy(B))
throw MakeTypeError(66,"getNotifier");
if(h(B))return null;
if(!%ObjectWasCreatedInCurrentOrigin(B))return null;
var X=%GetObjectContextObjectGetNotifier(B);
return X(B);
}
function NativeObjectGetNotifier(B){
var A=ObjectInfoGetOrCreate(B);
return ObjectInfoGetNotifier(A);
}
function CallbackDeliverPending(x){
var E=CallbackInfoGet(x);
if((E===(void 0))||(typeof(E)==='number'))
return false;
var F=E.priority;
CallbackInfoSet(x,F);
var l=GetPendingObservers();
if(!(l===null))
delete l[F];
var Y=[];
%MoveArrayContents(E,Y);
%DeliverObservationChangeRecords(x,Y);
return true;
}
function ObjectDeliverChangeRecords(x){
if(!(%_ClassOf(x)==='Function'))
throw MakeTypeError(68,"deliverChangeRecords");
while(CallbackDeliverPending(x)){}
}
function ObserveMicrotaskRunner(){
var l=GetPendingObservers();
if(!(l===null)){
SetPendingObservers(null);
for(var r in l){
CallbackDeliverPending(l[r]);
}
}
}
b.InstallFunctions(d,2,[
"deliverChangeRecords",ObjectDeliverChangeRecords,
"getNotifier",ObjectGetNotifier,
"observe",ObjectObserve,
"unobserve",ObjectUnobserve
]);
b.InstallFunctions(c,2,[
"observe",ArrayObserve,
"unobserve",ArrayUnobserve
]);
b.InstallFunctions(k,2,[
"notify",ObjectNotifierNotify,
"performChange",ObjectNotifierPerformChange
]);
$observeNotifyChange=NotifyChange;
$observeEnqueueSpliceRecord=EnqueueSpliceRecord;
$observeBeginPerformSplice=BeginPerformSplice;
$observeEndPerformSplice=EndPerformSplice;
$observeNativeObjectObserve=NativeObjectObserve;
$observeNativeObjectGetNotifier=NativeObjectGetNotifier;
$observeNativeObjectNotifierPerformChange=NativeObjectNotifierPerformChange;
})
(collection•
var $getHash;
var $getExistingHash;
var $mapSet;
var $mapHas;
var $mapDelete;
var $setAdd;
var $setHas;
var $setDelete;
var $mapFromArray;
var $setFromArray;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Map;
var d=a.Object;
var e=a.Set;
var g;
b.Import(function(h){
g=h.IntRandom;
});
var i;
b.Import(function(h){
i=h.NumberIsNaN;
});
function HashToEntry(j,k,l){
var m=(k&((l)-1));
return((%_FixedArrayGet(j,(3+(m))|0)));
}
%SetForceInlineFlag(HashToEntry);
function SetFindEntry(j,l,n,k){
var o=HashToEntry(j,k,l);
if(o===-1)return o;
var p=((%_FixedArrayGet(j,((3+(l)+((o)<<1)))|0)));
if(n===p)return o;
var q=i(n);
while(true){
if(q&&i(p)){
return o;
}
o=((%_FixedArrayGet(j,((3+(l)+((o)<<1))+1)|0)));
if(o===-1)return o;
p=((%_FixedArrayGet(j,((3+(l)+((o)<<1)))|0)));
if(n===p)return o;
}
return-1;
}
%SetForceInlineFlag(SetFindEntry);
function MapFindEntry(j,l,n,k){
var o=HashToEntry(j,k,l);
if(o===-1)return o;
var p=((%_FixedArrayGet(j,((3+(l)+((o)*3)))|0)));
if(n===p)return o;
var q=i(n);
while(true){
if(q&&i(p)){
return o;
}
o=((%_FixedArrayGet(j,((3+(l)+((o)*3))+2)|0)));
if(o===-1)return o;
p=((%_FixedArrayGet(j,((3+(l)+((o)*3)))|0)));
if(n===p)return o;
}
return-1;
}
%SetForceInlineFlag(MapFindEntry);
function ComputeIntegerHash(n,r){
var k=n;
k=k^r;
k=~k+(k<<15);
k=k^(k>>>12);
k=k+(k<<2);
k=k^(k>>>4);
k=(k*2057)|0;
k=k^(k>>>16);
return k&0x3fffffff;
}
%SetForceInlineFlag(ComputeIntegerHash);
var t=(%CreateGlobalPrivateSymbol("hash_code_symbol"));
function GetExistingHash(n){
if(%_IsSmi(n)){
return ComputeIntegerHash(n,0);
}
if((typeof(n)==='string')){
var u=%_StringGetRawHashField(n);
if((u&1)===0){
return u>>>2;
}
}else if((%_IsSpecObject(n))&&!%_IsJSProxy(n)&&!(%_ClassOf(n)==='global')){
var k=(n[t]);
return k;
}
return %GenericHash(n);
}
%SetForceInlineFlag(GetExistingHash);
function GetHash(n){
var k=GetExistingHash(n);
if((k===(void 0))){
k=g()|0;
if(k===0)k=1;
(n[t]=k);
}
return k;
}
%SetForceInlineFlag(GetHash);
function SetConstructor(v){
if(!%_IsConstructCall()){
throw MakeTypeError(20,"Set");
}
%_SetInitialize(this);
if(!(v==null)){
var w=this.add;
if(!(%_ClassOf(w)==='Function')){
throw MakeTypeError(77,'add',this);
}
for(var x of v){
%_CallFunction(this,x,w);
}
}
}
function SetAdd(n){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,'Set.prototype.add',this);
}
if(n===0){
n=0;
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetHash(n);
if(SetFindEntry(j,l,n,k)!==-1)return this;
var y=((%_FixedArrayGet(j,(1)|0)));
var z=((%_FixedArrayGet(j,(2)|0)));
var A=l<<1;
if((y+z)>=A){
%SetGrow(this);
j=%_JSCollectionGetTable(this);
l=((%_FixedArrayGet(j,(0)|0)));
y=((%_FixedArrayGet(j,(1)|0)));
z=((%_FixedArrayGet(j,(2)|0)));
}
var o=y+z;
var B=(3+(l)+((o)<<1));
var m=(k&((l)-1));
var C=((%_FixedArrayGet(j,(3+(m))|0)));
((%_FixedArraySet(j,(3+(m))|0,o)));
(((%_FixedArraySet(j,(1)|0,(y+1)|0))));
(%_FixedArraySet(j,(B)|0,n));
((%_FixedArraySet(j,(B+1)|0,(C)|0)));
return this;
}
function SetHas(n){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,'Set.prototype.has',this);
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetExistingHash(n);
if((k===(void 0)))return false;
return SetFindEntry(j,l,n,k)!==-1;
}
function SetDelete(n){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,
'Set.prototype.delete',this);
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetExistingHash(n);
if((k===(void 0)))return false;
var o=SetFindEntry(j,l,n,k);
if(o===-1)return false;
var y=((%_FixedArrayGet(j,(1)|0)))-1;
var z=((%_FixedArrayGet(j,(2)|0)))+1;
var B=(3+(l)+((o)<<1));
(%_FixedArraySet(j,(B)|0,%_TheHole()));
(((%_FixedArraySet(j,(1)|0,(y)|0))));
(((%_FixedArraySet(j,(2)|0,(z)|0))));
if(y<(l>>>1))%SetShrink(this);
return true;
}
function SetGetSize(){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,
'Set.prototype.size',this);
}
var j=%_JSCollectionGetTable(this);
return((%_FixedArrayGet(j,(1)|0)));
}
function SetClearJS(){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,
'Set.prototype.clear',this);
}
%_SetClear(this);
}
function SetForEach(D,E){
if(!(%_ClassOf(this)==='Set')){
throw MakeTypeError(33,
'Set.prototype.forEach',this);
}
if(!(%_ClassOf(D)==='Function'))throw MakeTypeError(12,D);
var F=false;
if((E===null)){
if(%IsSloppyModeFunction(D))E=(void 0);
}else if(!(E===(void 0))){
F=(!(%_IsSpecObject(E))&&%IsSloppyModeFunction(D));
}
var G=new SetIterator(this,2);
var n;
var H=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(D);
var I=[(void 0)];
while(%SetIteratorNext(G,I)){
if(H)%DebugPrepareStepInIfStepping(D);
n=I[0];
var J=F?$toObject(E):E;
%_CallFunction(J,n,n,this,D);
}
}
%SetCode(e,SetConstructor);
%FunctionSetLength(e,0);
%FunctionSetPrototype(e,new d());
%AddNamedProperty(e.prototype,"constructor",e,2);
%AddNamedProperty(e.prototype,symbolToStringTag,"Set",
2|1);
%FunctionSetLength(SetForEach,1);
b.InstallGetter(e.prototype,"size",SetGetSize);
b.InstallFunctions(e.prototype,2,[
"add",SetAdd,
"has",SetHas,
"delete",SetDelete,
"clear",SetClearJS,
"forEach",SetForEach
]);
function MapConstructor(v){
if(!%_IsConstructCall()){
throw MakeTypeError(20,"Map");
}
%_MapInitialize(this);
if(!(v==null)){
var w=this.set;
if(!(%_ClassOf(w)==='Function')){
throw MakeTypeError(77,'set',this);
}
for(var K of v){
if(!(%_IsSpecObject(K))){
throw MakeTypeError(39,K);
}
%_CallFunction(this,K[0],K[1],w);
}
}
}
function MapGet(n){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.get',this);
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetExistingHash(n);
if((k===(void 0)))return(void 0);
var o=MapFindEntry(j,l,n,k);
if(o===-1)return(void 0);
return((%_FixedArrayGet(j,((3+(l)+((o)*3))+1)|0)));
}
function MapSet(n,x){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.set',this);
}
if(n===0){
n=0;
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetHash(n);
var o=MapFindEntry(j,l,n,k);
if(o!==-1){
var L=(3+(l)+((o)*3));
(%_FixedArraySet(j,(L+1)|0,x));
return this;
}
var y=((%_FixedArrayGet(j,(1)|0)));
var z=((%_FixedArrayGet(j,(2)|0)));
var A=l<<1;
if((y+z)>=A){
%MapGrow(this);
j=%_JSCollectionGetTable(this);
l=((%_FixedArrayGet(j,(0)|0)));
y=((%_FixedArrayGet(j,(1)|0)));
z=((%_FixedArrayGet(j,(2)|0)));
}
o=y+z;
var B=(3+(l)+((o)*3));
var m=(k&((l)-1));
var C=((%_FixedArrayGet(j,(3+(m))|0)));
((%_FixedArraySet(j,(3+(m))|0,o)));
(((%_FixedArraySet(j,(1)|0,(y+1)|0))));
(%_FixedArraySet(j,(B)|0,n));
(%_FixedArraySet(j,(B+1)|0,x));
(%_FixedArraySet(j,(B+2)|0,C));
return this;
}
function MapHas(n){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.has',this);
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetHash(n);
return MapFindEntry(j,l,n,k)!==-1;
}
function MapDelete(n){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.delete',this);
}
var j=%_JSCollectionGetTable(this);
var l=((%_FixedArrayGet(j,(0)|0)));
var k=GetHash(n);
var o=MapFindEntry(j,l,n,k);
if(o===-1)return false;
var y=((%_FixedArrayGet(j,(1)|0)))-1;
var z=((%_FixedArrayGet(j,(2)|0)))+1;
var B=(3+(l)+((o)*3));
(%_FixedArraySet(j,(B)|0,%_TheHole()));
(%_FixedArraySet(j,(B+1)|0,%_TheHole()));
(((%_FixedArraySet(j,(1)|0,(y)|0))));
(((%_FixedArraySet(j,(2)|0,(z)|0))));
if(y<(l>>>1))%MapShrink(this);
return true;
}
function MapGetSize(){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.size',this);
}
var j=%_JSCollectionGetTable(this);
return((%_FixedArrayGet(j,(1)|0)));
}
function MapClearJS(){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.clear',this);
}
%_MapClear(this);
}
function MapForEach(D,E){
if(!(%_ClassOf(this)==='Map')){
throw MakeTypeError(33,
'Map.prototype.forEach',this);
}
if(!(%_ClassOf(D)==='Function'))throw MakeTypeError(12,D);
var F=false;
if((E===null)){
if(%IsSloppyModeFunction(D))E=(void 0);
}else if(!(E===(void 0))){
F=(!(%_IsSpecObject(E))&&%IsSloppyModeFunction(D));
}
var G=new MapIterator(this,3);
var H=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(D);
var I=[(void 0),(void 0)];
while(%MapIteratorNext(G,I)){
if(H)%DebugPrepareStepInIfStepping(D);
var J=F?$toObject(E):E;
%_CallFunction(J,I[1],I[0],this,D);
}
}
%SetCode(c,MapConstructor);
%FunctionSetLength(c,0);
%FunctionSetPrototype(c,new d());
%AddNamedProperty(c.prototype,"constructor",c,2);
%AddNamedProperty(
c.prototype,symbolToStringTag,"Map",2|1);
%FunctionSetLength(MapForEach,1);
b.InstallGetter(c.prototype,"size",MapGetSize);
b.InstallFunctions(c.prototype,2,[
"get",MapGet,
"set",MapSet,
"has",MapHas,
"delete",MapDelete,
"clear",MapClearJS,
"forEach",MapForEach
]);
$getHash=GetHash;
$getExistingHash=GetExistingHash;
$mapGet=MapGet;
$mapSet=MapSet;
$mapHas=MapHas;
$mapDelete=MapDelete;
$setAdd=SetAdd;
$setHas=SetHas;
$setDelete=SetDelete;
$mapFromArray=function(M){
var N=new c;
var O=M.length;
for(var P=0;P0?"Promise.resolve":"Promise.reject";
%DebugAsyncTaskEvent({type:"enqueue",id:C,name:D});
}
}
function PromiseIdResolveHandler(o){return o}
function PromiseIdRejectHandler(p){throw p}
function PromiseNopResolver(){}
function IsPromise(o){
return(%_IsSpecObject(o))&&(!(o[d]===(void 0)));
}
function PromiseCreate(){
return new l(PromiseNopResolver)
}
function PromiseResolve(n,o){
PromiseDone(n,+1,o,g)
}
function PromiseReject(n,p){
if((n[d])==0){
var G=(%_DebugIsActive()!=0);
if(G||!(!(n[j]===(void 0)))){
%PromiseRejectEvent(n,p,G);
}
}
PromiseDone(n,-1,p,h)
}
function PromiseDeferred(){
if(this===l){
var n=PromiseInit(new l(i));
return{
promise:n,
resolve:function(o){PromiseResolve(n,o)},
reject:function(p){PromiseReject(n,p)}
};
}else{
var B={promise:(void 0),reject:(void 0),resolve:(void 0)};
B.promise=new this(function(H,I){
B.resolve=H;
B.reject=I;
});
return B;
}
}
function PromiseResolved(o){
if(this===l){
return PromiseCreateAndSet(+1,o);
}else{
return new this(function(H,I){H(o)});
}
}
function PromiseRejected(p){
var n;
if(this===l){
n=PromiseCreateAndSet(-1,p);
%PromiseRejectEvent(n,p,false);
}else{
n=new this(function(H,I){I(p)});
}
return n;
}
function PromiseChain(t,u){
t=(t===(void 0))?PromiseIdResolveHandler:t;
u=(u===(void 0))?PromiseIdRejectHandler:u;
var z=%_CallFunction(this.constructor,PromiseDeferred);
switch((this[d])){
case(void 0):
throw MakeTypeError(51,this);
case 0:
(this[g]).push(t,z);
(this[h]).push(u,z);
break;
case+1:
PromiseEnqueue((this[e]),
[t,z],
+1);
break;
case-1:
if(!(!(this[j]===(void 0)))){
%PromiseRevokeReject(this);
}
PromiseEnqueue((this[e]),
[u,z],
-1);
break;
}
(this[j]=true);
if((%_DebugIsActive()!=0)){
%DebugPromiseEvent({promise:z.promise,parentPromise:this});
}
return z.promise;
}
function PromiseCatch(u){
return this.then((void 0),u);
}
function PromiseThen(t,u){
t=(%_ClassOf(t)==='Function')?t
:PromiseIdResolveHandler;
u=(%_ClassOf(u)==='Function')?u
:PromiseIdRejectHandler;
var J=this;
var x=this.constructor;
return %_CallFunction(
this,
function(o){
o=PromiseCoerce(x,o);
if(o===J){
if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(u)))%DebugPrepareStepInIfStepping(u);
return u(MakeTypeError(75,o));
}else if(IsPromise(o)){
return o.then(t,u);
}else{
if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(t)))%DebugPrepareStepInIfStepping(t);
return t(o);
}
},
u,
PromiseChain
);
}
function PromiseCast(o){
return IsPromise(o)?o:new this(function(H){H(o)});
}
function PromiseAll(K){
var z=%_CallFunction(this,PromiseDeferred);
var L=[];
try{
var M=0;
var F=0;
for(var r of K){
this.resolve(r).then(
(function(F){
return function(o){
L[F]=o;
if(--M===0)z.resolve(L);
}
})(F),
function(p){z.reject(p);});
++F;
++M;
}
if(M===0){
z.resolve(L);
}
}catch(e){
z.reject(e)
}
return z.promise;
}
function PromiseRace(K){
var z=%_CallFunction(this,PromiseDeferred);
try{
for(var r of K){
this.resolve(r).then(
function(o){z.resolve(o)},
function(p){z.reject(p)});
}
}catch(e){
z.reject(e)
}
return z.promise;
}
function PromiseHasUserDefinedRejectHandlerRecursive(n){
var N=(n[h]);
if((N===(void 0)))return false;
for(var F=0;F128){
v=%_SubString(v,0,111)+"......"+
%_SubString(v,v.length-2,v.length);
}
return v;
}
if((typeof(u)==='symbol'))return %_CallFunction(u,$symbolToString);
if((%_IsObject(u))
&&%GetDataProperty(u,"toString")===h){
var w=%GetDataProperty(u,"constructor");
if(typeof w=="function"){
var x=w.name;
if((typeof(x)==='string')&&x!==""){
return"#<"+x+">";
}
}
}
if(CanBeSafelyTreatedAsAnErrorObject(u)){
return %_CallFunction(u,ErrorToString);
}
return %_CallFunction(u,NoSideEffectsObjectToString);
}
function CanBeSafelyTreatedAsAnErrorObject(u){
switch(%_ClassOf(u)){
case'Error':
case'EvalError':
case'RangeError':
case'ReferenceError':
case'SyntaxError':
case'TypeError':
case'URIError':
return true;
}
var y=%GetDataProperty(u,"toString");
return u instanceof m&&y===ErrorToString;
}
function ToStringCheckErrorObject(u){
if(CanBeSafelyTreatedAsAnErrorObject(u)){
return %_CallFunction(u,ErrorToString);
}else{
return $toString(u);
}
}
function ToDetailString(u){
if(u!=null&&(%_IsObject(u))&&u.toString===h){
var w=u.constructor;
if(typeof w=="function"){
var x=w.name;
if((typeof(x)==='string')&&x!==""){
return"#<"+x+">";
}
}
}
return ToStringCheckErrorObject(u);
}
function MakeGenericError(w,z,A,B,C){
if((A===(void 0))&&(typeof(z)==='string'))A=[];
return new w(FormatMessage(z,A,B,C));
}
%FunctionSetInstanceClassName(Script,'Script');
%AddNamedProperty(Script.prototype,'constructor',Script,
2|4|1);
%SetCode(Script,function(D){
throw MakeError(5);
});
function FormatMessage(z,A,B,C){
var A=NoSideEffectToString(A);
var B=NoSideEffectToString(B);
var C=NoSideEffectToString(C);
try{
return %FormatMessageString(z,A,B,C);
}catch(e){
return"";
}
}
function GetLineNumber(E){
var F=%MessageGetStartPosition(E);
if(F==-1)return 0;
var G=%MessageGetScript(E);
var H=G.locationFromPosition(F,true);
if(H==null)return 0;
return H.line+1;
}
function GetSourceLine(E){
var G=%MessageGetScript(E);
var F=%MessageGetStartPosition(E);
var H=G.locationFromPosition(F,true);
if(H==null)return"";
return H.sourceText();
}
function ScriptLineFromPosition(I){
var J=0;
var K=this.lineCount()-1;
var L=this.line_ends;
if(I>L[K]){
return-1;
}
if(I<=L[0]){
return 0;
}
while(K>=1){
var M=(J+K)>>1;
if(I>L[M]){
J=M+1;
}else if(I<=L[M-1]){
K=M-1;
}else{
return M;
}
}
return-1;
}
function ScriptLocationFromPosition(I,
include_resource_offset){
var N=this.lineFromPosition(I);
if(N==-1)return null;
var L=this.line_ends;
var O=N==0?0:L[N-1]+1;
var P=L[N];
if(P>0&&%_CallFunction(this.source,P-1,i)=='\r'){
P--;
}
var Q=I-O;
if(include_resource_offset){
N+=this.line_offset;
if(N==this.line_offset){
Q+=this.column_offset;
}
}
return new SourceLocation(this,I,N,Q,O,P);
}
function ScriptLocationFromLine(R,S,T){
var N=0;
if(!(R===(void 0))){
N=R-this.line_offset;
}
var Q=S||0;
if(N==0){
Q-=this.column_offset;
}
var U=T||0;
if(N<0||Q<0||U<0)return null;
if(N==0){
return this.locationFromPosition(U+Q,false);
}else{
var V=this.lineFromPosition(U);
if(V==-1||V+N>=this.lineCount()){
return null;
}
return this.locationFromPosition(
this.line_ends[V+N-1]+1+Q);
}
}
function ScriptSourceSlice(W,X){
var Y=(W===(void 0))?this.line_offset
:W;
var Z=(X===(void 0))?this.line_offset+this.lineCount()
:X;
Y-=this.line_offset;
Z-=this.line_offset;
if(Y<0)Y=0;
if(Z>this.lineCount())Z=this.lineCount();
if(Y>=this.lineCount()||
Z<0||
Y>Z){
return null;
}
var L=this.line_ends;
var aa=Y==0?0:L[Y-1]+1;
var ab=Z==0?0:L[Z-1]+1;
return new SourceSlice(this,
Y+this.line_offset,
Z+this.line_offset,
aa,ab);
}
function ScriptSourceLine(R){
var N=0;
if(!(R===(void 0))){
N=R-this.line_offset;
}
if(N<0||this.lineCount()<=N){
return null;
}
var L=this.line_ends;
var O=N==0?0:L[N-1]+1;
var P=L[N];
return %_CallFunction(this.source,O,P,k);
}
function ScriptLineCount(){
return this.line_ends.length;
}
function ScriptLineEnd(ac){
return this.line_ends[ac];
}
function ScriptNameOrSourceURL(){
if(this.source_url)return this.source_url;
return this.name;
}
b.SetUpLockedPrototype(Script,[
"source",
"name",
"source_url",
"source_mapping_url",
"line_ends",
"line_offset",
"column_offset"
],[
"lineFromPosition",ScriptLineFromPosition,
"locationFromPosition",ScriptLocationFromPosition,
"locationFromLine",ScriptLocationFromLine,
"sourceSlice",ScriptSourceSlice,
"sourceLine",ScriptSourceLine,
"lineCount",ScriptLineCount,
"nameOrSourceURL",ScriptNameOrSourceURL,
"lineEnd",ScriptLineEnd
]
);
function SourceLocation(G,I,N,Q,O,P){
this.script=G;
this.position=I;
this.line=N;
this.column=Q;
this.start=O;
this.end=P;
}
function SourceLocationSourceText(){
return %_CallFunction(this.script.source,
this.start,
this.end,
k);
}
b.SetUpLockedPrototype(SourceLocation,
["script","position","line","column","start","end"],
["sourceText",SourceLocationSourceText]
);
function SourceSlice(G,Y,Z,aa,ab){
this.script=G;
this.from_line=Y;
this.to_line=Z;
this.from_position=aa;
this.to_position=ab;
}
function SourceSliceSourceText(){
return %_CallFunction(this.script.source,
this.from_position,
this.to_position,
k);
}
b.SetUpLockedPrototype(SourceSlice,
["script","from_line","to_line","from_position","to_position"],
["sourceText",SourceSliceSourceText]
);
function GetPositionInLine(E){
var G=%MessageGetScript(E);
var F=%MessageGetStartPosition(E);
var H=G.locationFromPosition(F,false);
if(H==null)return-1;
return F-H.start;
}
function GetStackTraceLine(ad,ae,af,ag){
return new CallSite(ad,ae,af,false).toString();
}
var ah=(%CreatePrivateSymbol("CallSite#receiver"));
var ai=(%CreatePrivateSymbol("CallSite#function"));
var aj=(%CreatePrivateSymbol("CallSite#position"));
var ak=(%CreatePrivateSymbol("CallSite#strict_mode"));
function CallSite(al,ae,af,am){
(this[ah]=al);
(this[ai]=ae);
(this[aj]=af);
(this[ak]=am);
}
function CallSiteGetThis(){
return(this[ak])
?(void 0):(this[ah]);
}
function CallSiteGetFunction(){
return(this[ak])
?(void 0):(this[ai]);
}
function CallSiteGetPosition(){
return(this[aj]);
}
function CallSiteGetTypeName(){
return GetTypeName((this[ah]),false);
}
function CallSiteIsToplevel(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteIsToplevelRT(al,ae,af);
}
function CallSiteIsEval(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteIsEvalRT(al,ae,af);
}
function CallSiteGetEvalOrigin(){
var G=%FunctionGetScript((this[ai]));
return FormatEvalOrigin(G);
}
function CallSiteGetScriptNameOrSourceURL(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetScriptNameOrSourceUrlRT(al,ae,af);
}
function CallSiteGetFunctionName(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetFunctionNameRT(al,ae,af);
}
function CallSiteGetMethodName(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetMethodNameRT(al,ae,af);
}
function CallSiteGetFileName(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetFileNameRT(al,ae,af);
}
function CallSiteGetLineNumber(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetLineNumberRT(al,ae,af);
}
function CallSiteGetColumnNumber(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteGetColumnNumberRT(al,ae,af);
}
function CallSiteIsNative(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteIsNativeRT(al,ae,af);
}
function CallSiteIsConstructor(){
var al=(this[ah]);
var ae=(this[ai]);
var af=(this[aj]);
return %CallSiteIsConstructorRT(al,ae,af);
}
function CallSiteToString(){
var an;
var ao="";
if(this.isNative()){
ao="native";
}else{
an=this.getScriptNameOrSourceURL();
if(!an&&this.isEval()){
ao=this.getEvalOrigin();
ao+=", ";
}
if(an){
ao+=an;
}else{
ao+="";
}
var ap=this.getLineNumber();
if(ap!=null){
ao+=":"+ap;
var aq=this.getColumnNumber();
if(aq){
ao+=":"+aq;
}
}
}
var N="";
var ar=this.getFunctionName();
var as=true;
var at=this.isConstructor();
var au=!(this.isToplevel()||at);
if(au){
var av=GetTypeName((this[ah]),true);
var aw=this.getMethodName();
if(ar){
if(av&&
%_CallFunction(ar,av,j)!=0){
N+=av+".";
}
N+=ar;
if(aw&&
(%_CallFunction(ar,"."+aw,j)!=
ar.length-aw.length-1)){
N+=" [as "+aw+"]";
}
}else{
N+=av+"."+(aw||"");
}
}else if(at){
N+="new "+(ar||"");
}else if(ar){
N+=ar;
}else{
N+=ao;
as=false;
}
if(as){
N+=" ("+ao+")";
}
return N;
}
b.SetUpLockedPrototype(CallSite,["receiver","fun","pos"],[
"getThis",CallSiteGetThis,
"getTypeName",CallSiteGetTypeName,
"isToplevel",CallSiteIsToplevel,
"isEval",CallSiteIsEval,
"getEvalOrigin",CallSiteGetEvalOrigin,
"getScriptNameOrSourceURL",CallSiteGetScriptNameOrSourceURL,
"getFunction",CallSiteGetFunction,
"getFunctionName",CallSiteGetFunctionName,
"getMethodName",CallSiteGetMethodName,
"getFileName",CallSiteGetFileName,
"getLineNumber",CallSiteGetLineNumber,
"getColumnNumber",CallSiteGetColumnNumber,
"isNative",CallSiteIsNative,
"getPosition",CallSiteGetPosition,
"isConstructor",CallSiteIsConstructor,
"toString",CallSiteToString
]);
function FormatEvalOrigin(G){
var ax=G.nameOrSourceURL();
if(ax){
return ax;
}
var ay="eval at ";
if(G.eval_from_function_name){
ay+=G.eval_from_function_name;
}else{
ay+="";
}
var az=G.eval_from_script;
if(az){
if(az.compilation_type==1){
ay+=" ("+FormatEvalOrigin(az)+")";
}else{
if(az.name){
ay+=" ("+az.name;
var H=az.locationFromPosition(
G.eval_from_script_position,true);
if(H){
ay+=":"+(H.line+1);
ay+=":"+(H.column+1);
}
ay+=")";
}else{
ay+=" (unknown source)";
}
}
}
return ay;
}
function FormatErrorString(aA){
try{
return %_CallFunction(aA,ErrorToString);
}catch(e){
try{
return"";
}catch(ee){
return"";
}
}
}
function GetStackFrames(aB){
var aC=new d();
var aD=aB[0];
for(var M=1;M";
}catch(ee){
N="";
}
}
aJ.push(" at "+N);
}
return %_CallFunction(aJ,"\n",g);
}
function GetTypeName(al,aL){
if((al==null))return null;
var w=al.constructor;
if(!w){
return aL?null:
%_CallFunction(al,NoSideEffectsObjectToString);
}
var x=w.name;
if(!x){
return aL?null:
%_CallFunction(al,NoSideEffectsObjectToString);
}
return x;
}
var aM=(%CreatePrivateSymbol("formatted stack trace"));
var aN=function(){
var aO=(void 0);
var aP=this;
while(aP){
var aO=
(aP[aM]);
if((aO===(void 0))){
var aI=(aP[$stackTraceSymbol]);
if((aI===(void 0))){
aP=%_GetPrototype(aP);
continue;
}
aO=FormatStackTrace(aP,aI);
(aP[$stackTraceSymbol]=(void 0));
(aP[aM]=aO);
}
return aO;
}
return(void 0);
};
var aQ=function(aR){
if((%HasOwnProperty(this,$stackTraceSymbol))){
(this[$stackTraceSymbol]=(void 0));
(this[aM]=aR);
}
};
var aS=function(){};
function DefineError(a,aT){
var aU=aT.name;
%AddNamedProperty(a,aU,aT,2);
if(aU=='Error'){
var aV=function(){};
%FunctionSetPrototype(aV,c.prototype);
%FunctionSetInstanceClassName(aV,'Error');
%FunctionSetPrototype(aT,new aV());
}else{
%FunctionSetPrototype(aT,new m());
%InternalSetPrototype(aT,m);
}
%FunctionSetInstanceClassName(aT,'Error');
%AddNamedProperty(aT.prototype,'constructor',aT,2);
%AddNamedProperty(aT.prototype,'name',aU,2);
%SetCode(aT,function(aW){
if(%_IsConstructCall()){
try{aS(this,aT);}catch(e){}
if(!(aW===(void 0))){
%AddNamedProperty(this,'message',$toString(aW),2);
}
}else{
return new aT(aW);
}
});
%SetNativeFlag(aT);
return aT;
};
m=DefineError(a,function Error(){});
t=DefineError(a,function EvalError(){});
o=DefineError(a,function RangeError(){});
r=DefineError(a,function ReferenceError(){});
q=DefineError(a,function SyntaxError(){});
n=DefineError(a,function TypeError(){});
p=DefineError(a,function URIError(){});
%AddNamedProperty(m.prototype,'message','',2);
var aX=new d();
var aY=new c();
function GetPropertyWithoutInvokingMonkeyGetters(aA,aU){
var aZ=aA;
while(aZ&&!%HasOwnProperty(aZ,aU)){
aZ=%_GetPrototype(aZ);
}
if((aZ===null))return(void 0);
if(!(%_IsObject(aZ)))return aA[aU];
var ba=%GetOwnProperty(aZ,aU);
if(ba&&ba[0]){
var bb=aU==="name";
if(aZ===r.prototype)
return bb?"ReferenceError":(void 0);
if(aZ===q.prototype)
return bb?"SyntaxError":(void 0);
if(aZ===n.prototype)
return bb?"TypeError":(void 0);
}
return aA[aU];
}
function ErrorToStringDetectCycle(aA){
if(!%PushIfAbsent(aX,aA))throw aY;
try{
var aU=GetPropertyWithoutInvokingMonkeyGetters(aA,"name");
aU=(aU===(void 0))?"Error":((typeof(%IS_VAR(aU))==='string')?aU:$nonStringToString(aU));
var E=GetPropertyWithoutInvokingMonkeyGetters(aA,"message");
E=(E===(void 0))?"":((typeof(%IS_VAR(E))==='string')?E:$nonStringToString(E));
if(aU==="")return E;
if(E==="")return aU;
return aU+": "+E;
}finally{
aX.length=aX.length-1;
}
}
function ErrorToString(){
if(!(%_IsSpecObject(this))){
throw MakeTypeError(13,"Error.prototype.toString");
}
try{
return ErrorToStringDetectCycle(this);
}catch(e){
if(e===aY){
return'';
}
throw e;
}
}
b.InstallFunctions(m.prototype,2,
['toString',ErrorToString]);
$errorToString=ErrorToString;
$getStackTraceLine=GetStackTraceLine;
$messageGetPositionInLine=GetPositionInLine;
$messageGetLineNumber=GetLineNumber;
$messageGetSourceLine=GetSourceLine;
$noSideEffectToString=NoSideEffectToString;
$toDetailString=ToDetailString;
$Error=m;
$EvalError=t;
$RangeError=o;
$ReferenceError=r;
$SyntaxError=q;
$TypeError=n;
$URIError=p;
MakeError=function(z,A,B,C){
return MakeGenericError(m,z,A,B,C);
}
MakeEvalError=function(z,A,B,C){
return MakeGenericError(t,z,A,B,C);
}
MakeRangeError=function(z,A,B,C){
return MakeGenericError(o,z,A,B,C);
}
MakeReferenceError=function(z,A,B,C){
return MakeGenericError(r,z,A,B,C);
}
MakeSyntaxError=function(z,A,B,C){
return MakeGenericError(q,z,A,B,C);
}
MakeTypeError=function(z,A,B,C){
return MakeGenericError(n,z,A,B,C);
}
MakeURIError=function(){
return MakeGenericError(p,232);
}
$stackOverflowBoilerplate=MakeRangeError(144);
%DefineAccessorPropertyUnchecked($stackOverflowBoilerplate,'stack',
aN,aQ,
2);
aS=function captureStackTrace(u,bc){
e(u,'stack',{get:aN,
set:aQ,
configurable:true});
%CollectStackTrace(u,bc?bc:aS);
};
m.captureStackTrace=aS;
});
jsonÉ:
var $jsonSerializeAdapter;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.JSON;
var d=b.InternalArray;
var e;
var g;
var h;
b.Import(function(i){
e=i.MathMax;
g=i.MathMin;
h=i.ObjectHasOwnProperty;
});
function Revive(j,k,l){
var m=j[k];
if((%_IsObject(m))){
if((%_IsArray(m))){
var n=m.length;
for(var o=0;o0){
var E=",\n"+x;
D="[\n"+x+A.join(E)+"\n"+
z+"]";
}else{
D="[]";
}
w.pop();
return D;
}
function SerializeObject(u,v,w,x,y){
if(!%PushIfAbsent(w,u))throw MakeTypeError(17);
var z=x;
x+=y;
var A=new d();
if((%_IsArray(v))){
var n=v.length;
for(var o=0;o0){
var E=",\n"+x;
D="{\n"+x+A.join(E)+"\n"+
z+"}";
}else{
D="{}";
}
w.pop();
return D;
}
function JSONSerialize(G,j,v,w,x,y){
var u=j[G];
if((%_IsSpecObject(u))){
var H=u.toJSON;
if((%_ClassOf(H)==='Function')){
u=%_CallFunction(u,G,H);
}
}
if((%_ClassOf(v)==='Function')){
u=%_CallFunction(j,G,u,v);
}
if((typeof(u)==='string')){
return %QuoteJSONString(u);
}else if((typeof(u)==='number')){
return((%_IsSmi(%IS_VAR(u))||u-u==0)?%_NumberToString(u):"null");
}else if((typeof(u)==='boolean')){
return u?"true":"false";
}else if((u===null)){
return"null";
}else if((%_IsSpecObject(u))&&!(typeof u=="function")){
if((%_IsArray(u))){
return SerializeArray(u,v,w,x,y);
}else if((%_ClassOf(u)==='Number')){
u=$toNumber(u);
return((%_IsSmi(%IS_VAR(u))||u-u==0)?%_NumberToString(u):"null");
}else if((%_ClassOf(u)==='String')){
return %QuoteJSONString($toString(u));
}else if((%_ClassOf(u)==='Boolean')){
return %_ValueOf(u)?"true":"false";
}else{
return SerializeObject(u,v,w,x,y);
}
}
return(void 0);
}
function JSONStringify(u,v,I){
if(%_ArgumentsLength()==1){
return %BasicJSONStringify(u);
}
if((%_IsArray(v))){
var J=new d();
var K={__proto__:null};
var n=v.length;
for(var o=0;o10){
y=%_SubString(I,0,10);
}else{
y=I;
}
}else{
y="";
}
return JSONSerialize('',{'':u},v,new d(),"",y);
}
%AddNamedProperty(c,symbolToStringTag,"JSON",1|2);
b.InstallFunctions(c,2,[
"parse",JSONParse,
"stringify",JSONStringify
]);
$jsonSerializeAdapter=function(G,N){
var j={};
j[G]=N;
return JSONSerialize(G,j,(void 0),new d(),"","");
}
})
8array-iteratoriA
var $arrayValues;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Array;
var d=a.Uint8Array;
var e=a.Int8Array;
var g=a.Uint16Array;
var h=a.Int16Array;
var i=a.Uint32Array;
var j=a.Int32Array;
var k=a.Float32Array;
var l=a.Float64Array;
var m=a.Uint8ClampedArray;
var n=(%CreateGlobalPrivateSymbol("ArrayIterator#object"));
var o=(%CreateGlobalPrivateSymbol("ArrayIterator#next"));
var p=(%CreateGlobalPrivateSymbol("ArrayIterator#kind"));
function ArrayIterator(){}
function CreateArrayIterator(q,r){
var t=$toObject(q);
var u=new ArrayIterator;
(u[n]=t);
(u[o]=0);
(u[p]=r);
return u;
}
function CreateIteratorResultObject(v,w){
return{value:v,done:w};
}
function ArrayIteratorIterator(){
return this;
}
function ArrayIteratorNext(){
var u=$toObject(this);
if(!(!(u[o]===(void 0)))){
throw MakeTypeError(33,
'Array Iterator.prototype.next',this);
}
var q=(u[n]);
if((q===(void 0))){
return CreateIteratorResultObject((void 0),true);
}
var x=(u[o]);
var y=(u[p]);
var z=(q.length>>>0);
if(x>=z){
(u[n]=(void 0));
return CreateIteratorResultObject((void 0),true);
}
(u[o]=x+1);
if(y==2){
return CreateIteratorResultObject(q[x],false);
}
if(y==3){
return CreateIteratorResultObject([x,q[x]],false);
}
return CreateIteratorResultObject(x,false);
}
function ArrayEntries(){
return CreateArrayIterator(this,3);
}
function ArrayValues(){
return CreateArrayIterator(this,2);
}
function ArrayKeys(){
return CreateArrayIterator(this,1);
}
%FunctionSetPrototype(ArrayIterator,{__proto__:$iteratorPrototype});
%FunctionSetInstanceClassName(ArrayIterator,'Array Iterator');
b.InstallFunctions(ArrayIterator.prototype,2,[
'next',ArrayIteratorNext
]);
b.SetFunctionName(ArrayIteratorIterator,symbolIterator);
%AddNamedProperty(ArrayIterator.prototype,symbolIterator,
ArrayIteratorIterator,2);
%AddNamedProperty(ArrayIterator.prototype,symbolToStringTag,
"Array Iterator",1|2);
b.InstallFunctions(c.prototype,2,[
'entries',ArrayEntries,
'keys',ArrayKeys
]);
%AddNamedProperty(c.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(d.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(d.prototype,'values',ArrayValues,2);
%AddNamedProperty(d.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(d.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(e.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(e.prototype,'values',ArrayValues,2);
%AddNamedProperty(e.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(e.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(g.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(g.prototype,'values',ArrayValues,2);
%AddNamedProperty(g.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(g.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(h.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(h.prototype,'values',ArrayValues,2);
%AddNamedProperty(h.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(h.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(i.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(i.prototype,'values',ArrayValues,2);
%AddNamedProperty(i.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(i.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(j.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(j.prototype,'values',ArrayValues,2);
%AddNamedProperty(j.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(j.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(k.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(k.prototype,'values',ArrayValues,2);
%AddNamedProperty(k.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(k.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(l.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(l.prototype,'values',ArrayValues,2);
%AddNamedProperty(l.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(l.prototype,symbolIterator,ArrayValues,
2);
%AddNamedProperty(m.prototype,'entries',ArrayEntries,2);
%AddNamedProperty(m.prototype,'values',ArrayValues,2);
%AddNamedProperty(m.prototype,'keys',ArrayKeys,2);
%AddNamedProperty(m.prototype,symbolIterator,ArrayValues,
2);
b.Export(function(A){
A.ArrayIteratorCreateResultObject=CreateIteratorResultObject;
});
$arrayValues=ArrayValues;
})
>>0);
if(l>=m){
(k[g]=(void 0));
return d((void 0),true);
}
var n=%_StringCharCodeAt(j,l);
var o=%_StringCharFromCode(n);
l++;
if(n>=0xD800&&n<=0xDBFF&&l=0xDC00&&p<=0xDFFF){
o+=%_StringCharFromCode(p);
l++;
}
}
(k[h]=l);
return d(o,false);
}
function StringPrototypeIterator(){
return CreateStringIterator(this);
}
%FunctionSetPrototype(StringIterator,{__proto__:$iteratorPrototype});
%FunctionSetInstanceClassName(StringIterator,'String Iterator');
b.InstallFunctions(StringIterator.prototype,2,[
'next',StringIteratorNext
]);
%AddNamedProperty(StringIterator.prototype,symbolToStringTag,
"String Iterator",1|2);
b.SetFunctionName(StringPrototypeIterator,symbolIterator);
%AddNamedProperty(c.prototype,symbolIterator,
StringPrototypeIterator,2);
})
$templatesÉ
var $getTemplateCallSite;
(function(a,b){
"use strict";
%CheckIsBootstrapping();
var c=a.Map;
var d=b.InternalArray;
var e=new c;
var g=c.prototype.get;
var h=c.prototype.set;
function SameCallSiteElements(i,j){
var k=i.length;
var j=j.raw;
if(k!==j.length)return false;
for(var l=0;l0){
if(l in p){
p[r]=p[l];
}else{
delete p[r];
}
l=l+v;
r=r+v;
u--;
}
return p;
}
function ArrayCopyWithin(m,n,o){
if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError(14,"Array.prototype.copyWithin");
var p=((%_IsSpecObject(%IS_VAR(this)))?this:$toObject(this));
var q=$toLength(p.length);
return InnerArrayCopyWithin(m,n,o,p,q);
}
function InnerArrayFind(w,x,p,q){
if(!(%_ClassOf(w)==='Function')){
throw MakeTypeError(12,w);
}
var y=false;
if((x===null)){
if(%IsSloppyModeFunction(w))x=(void 0);
}else if(!(x===(void 0))){
y=(!(%_IsSpecObject(x))&&%IsSloppyModeFunction(w));
}
for(var z=0;zq)z=q;
}
if(o<0){
o+=q;
if(o<0)o=0;
}else{
if(o>q)o=q;
}
if((o-z)>0&&j(p)){
throw MakeTypeError(9);
}
for(;z>>0);
return InnerArrayFill(C,n,o,p,q);
}
function AddArrayElement(D,p,z,C){
if(D===c){
%AddElement(p,z,C);
}else{
k(p,z,{
value:C,writable:true,configurable:true,enumerable:true
});
}
}
function ArrayFrom(E,F,G){
var H=$toObject(E);
var I=!(F===(void 0));
if(I){
if(!(%_ClassOf(F)==='Function')){
throw MakeTypeError(12,F);
}else if(%IsSloppyModeFunction(F)){
if((G===null)){
G=(void 0);
}else if(!(G===(void 0))){
G=((%_IsSpecObject(%IS_VAR(G)))?G:$toObject(G));
}
}
}
var J=g(H,symbolIterator);
var K;
var L;
var M;
var N;
if(!(J===(void 0))){
L=%IsConstructor(this)?new this():[];
var O=e(H,J);
K=0;
while(true){
var P=O.next();
if(!(%_IsObject(P))){
throw MakeTypeError(38,P);
}
if(P.done){
L.length=K;
return L;
}
N=P.value;
if(I){
M=%_CallFunction(G,N,K,F);
}else{
M=N;
}
AddArrayElement(this,L,K,M);
K++;
}
}else{
var Q=$toLength(H.length);
L=%IsConstructor(this)?new this(Q):new c(Q);
for(K=0;K0){
return N(Q,%_Arguments(0));
}else{
return N(Q);
}
}
}
k(R,P);
%FunctionRemovePrototype(R);
%SetNativeFlag(R);
this[P]=R;
}
return this[P];
}
k(getter,M);
%FunctionRemovePrototype(getter);
%SetNativeFlag(getter);
j(L.prototype,M,{
get:getter,
enumerable:false,
configurable:true
});
}
function supportedLocalesOf(U,V,W){
if((%_CallFunction(U,GetServiceRE(),u)===null)){
throw MakeError(6,U);
}
if((W===(void 0))){
W={};
}else{
W=$toObject(W);
}
var X=W.localeMatcher;
if(!(X===(void 0))){
X=h(X);
if(X!=='lookup'&&X!=='best fit'){
throw MakeRangeError(140,X);
}
}else{
X='best fit';
}
var Y=initializeLocaleList(V);
if((B[U]===(void 0))){
B[U]=getAvailableLocalesOf(U);
}
if(X==='best fit'){
return initializeLocaleList(bestFitSupportedLocalesOf(
Y,B[U]));
}
return initializeLocaleList(lookupSupportedLocalesOf(
Y,B[U]));
}
function lookupSupportedLocalesOf(Y,Z){
var aa=[];
for(var ab=0;ab=3&&O<=8&&!(aq===(void 0))){
ap[aq]=ar;
aq=(void 0);
}else{
return{};
}
}
return ap;
}
function setOptions(as,ap,at,af,au){
var an='';
var av=function updateExtension(aw,ak){
return'-'+aw+'-'+h(ak);
}
var ax=function updateProperty(ag,ah,ak){
if(ah==='boolean'&&(typeof ak==='string')){
ak=(ak==='true')?true:false;
}
if(!(ag===(void 0))){
defineWEProperty(au,ag,ak);
}
}
for(var aw in at){
if(%HasOwnProperty(at,aw)){
var ak=(void 0);
var ay=at[aw];
if(!(ay.property===(void 0))){
ak=af(ay.property,ay.type,ay.values);
}
if(!(ak===(void 0))){
ax(ay.property,ay.type,ak);
an+=av(aw,ak);
continue;
}
if(%HasOwnProperty(ap,aw)){
ak=ap[aw];
if(!(ak===(void 0))){
ax(ay.property,ay.type,ak);
an+=av(aw,ak);
}else if(ay.type==='boolean'){
ax(ay.property,ay.type,true);
an+=av(aw,true);
}
}
}
}
return an===''?'':'-u'+an;
}
function freezeArray(az){
var aA=az.length;
for(var ab=0;ab>>0);
for(var aN=0;aNbq){
throw MakeRangeError(143,ag);
}
return p(ak);
}
return br;
}
function initializeNumberFormat(bs,V,W){
if(%IsInitializedIntlObject(bs)){
throw MakeTypeError(94,"NumberFormat");
}
if((W===(void 0))){
W={};
}
var af=getGetOption(W,'numberformat');
var ac=resolveLocale('numberformat',V,W);
var bg={};
defineWEProperty(bg,'style',af(
'style','string',['decimal','percent','currency'],'decimal'));
var bo=af('currency','string');
if(!(bo===(void 0))&&!isWellFormedCurrencyCode(bo)){
throw MakeRangeError(128,bo);
}
if(bg.style==='currency'&&(bo===(void 0))){
throw MakeTypeError(21);
}
var bt=af(
'currencyDisplay','string',['code','symbol','name'],'symbol');
if(bg.style==='currency'){
defineWEProperty(bg,'currency',%StringToUpperCase(bo));
defineWEProperty(bg,'currencyDisplay',bt);
}
var bu=getNumberOption(W,'minimumIntegerDigits',1,21,1);
defineWEProperty(bg,'minimumIntegerDigits',bu);
var bv=getNumberOption(W,'minimumFractionDigits',0,20,0);
defineWEProperty(bg,'minimumFractionDigits',bv);
var bw=getNumberOption(W,'maximumFractionDigits',bv,20,3);
defineWEProperty(bg,'maximumFractionDigits',bw);
var bx=W['minimumSignificantDigits'];
var by=W['maximumSignificantDigits'];
if(!(bx===(void 0))||!(by===(void 0))){
bx=getNumberOption(W,'minimumSignificantDigits',1,21,0);
defineWEProperty(bg,'minimumSignificantDigits',bx);
by=getNumberOption(W,'maximumSignificantDigits',bx,21,21);
defineWEProperty(bg,'maximumSignificantDigits',by);
}
defineWEProperty(bg,'useGrouping',af(
'useGrouping','boolean',(void 0),true));
var ap=parseExtension(ac.extension);
var bz={
'nu':{'property':(void 0),'type':'string'}
};
var an=setOptions(W,ap,bz,
af,bg);
var bl=ac.locale+an;
var al=i({},{
currency:{writable:true},
currencyDisplay:{writable:true},
locale:{writable:true},
maximumFractionDigits:{writable:true},
minimumFractionDigits:{writable:true},
minimumIntegerDigits:{writable:true},
numberingSystem:{writable:true},
requestedLocale:{value:bl,writable:true},
style:{value:bg.style,writable:true},
useGrouping:{writable:true}
});
if(%HasOwnProperty(bg,'minimumSignificantDigits')){
defineWEProperty(al,'minimumSignificantDigits',(void 0));
}
if(%HasOwnProperty(bg,'maximumSignificantDigits')){
defineWEProperty(al,'maximumSignificantDigits',(void 0));
}
var bA=%CreateNumberFormat(bl,
bg,
al);
if(bg.style==='currency'){
j(al,'currencyDisplay',{value:bt,
writable:true});
}
%MarkAsInitializedIntlObjectOfType(bs,'numberformat',bA);
j(bs,'resolved',{value:al});
return bs;
}
%AddNamedProperty(A,'NumberFormat',function(){
var V=%_Arguments(0);
var W=%_Arguments(1);
if(!this||this===A){
return new A.NumberFormat(V,W);
}
return initializeNumberFormat($toObject(this),V,W);
},
2
);
%AddNamedProperty(A.NumberFormat.prototype,'resolvedOptions',function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
if(!%IsInitializedIntlObjectOfType(this,'numberformat')){
throw MakeTypeError(95,"NumberFormat");
}
var bB=this;
var ac=getOptimalLanguageTag(bB.resolved.requestedLocale,
bB.resolved.locale);
var bC={
locale:ac,
numberingSystem:bB.resolved.numberingSystem,
style:bB.resolved.style,
useGrouping:bB.resolved.useGrouping,
minimumIntegerDigits:bB.resolved.minimumIntegerDigits,
minimumFractionDigits:bB.resolved.minimumFractionDigits,
maximumFractionDigits:bB.resolved.maximumFractionDigits,
};
if(bC.style==='currency'){
defineWECProperty(bC,'currency',bB.resolved.currency);
defineWECProperty(bC,'currencyDisplay',
bB.resolved.currencyDisplay);
}
if(%HasOwnProperty(bB.resolved,'minimumSignificantDigits')){
defineWECProperty(bC,'minimumSignificantDigits',
bB.resolved.minimumSignificantDigits);
}
if(%HasOwnProperty(bB.resolved,'maximumSignificantDigits')){
defineWECProperty(bC,'maximumSignificantDigits',
bB.resolved.maximumSignificantDigits);
}
return bC;
},
2
);
k(A.NumberFormat.prototype.resolvedOptions,'resolvedOptions');
%FunctionRemovePrototype(A.NumberFormat.prototype.resolvedOptions);
%SetNativeFlag(A.NumberFormat.prototype.resolvedOptions);
%AddNamedProperty(A.NumberFormat,'supportedLocalesOf',function(V){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
return supportedLocalesOf('numberformat',V,%_Arguments(1));
},
2
);
k(A.NumberFormat.supportedLocalesOf,'supportedLocalesOf');
%FunctionRemovePrototype(A.NumberFormat.supportedLocalesOf);
%SetNativeFlag(A.NumberFormat.supportedLocalesOf);
function formatNumber(bA,ak){
var bD=$toNumber(ak)+0;
return %InternalNumberFormat(%GetImplFromInitializedIntlObject(bA),
bD);
}
function parseNumber(bA,ak){
return %InternalNumberParse(%GetImplFromInitializedIntlObject(bA),
h(ak));
}
addBoundMethod(A.NumberFormat,'format',formatNumber,1);
addBoundMethod(A.NumberFormat,'v8Parse',parseNumber,1);
function toLDMLString(W){
var af=getGetOption(W,'dateformat');
var bE='';
var bF=af('weekday','string',['narrow','short','long']);
bE+=appendToLDMLString(
bF,{narrow:'EEEEE',short:'EEE',long:'EEEE'});
bF=af('era','string',['narrow','short','long']);
bE+=appendToLDMLString(
bF,{narrow:'GGGGG',short:'GGG',long:'GGGG'});
bF=af('year','string',['2-digit','numeric']);
bE+=appendToLDMLString(bF,{'2-digit':'yy','numeric':'y'});
bF=af('month','string',
['2-digit','numeric','narrow','short','long']);
bE+=appendToLDMLString(bF,{'2-digit':'MM','numeric':'M',
'narrow':'MMMMM','short':'MMM','long':'MMMM'});
bF=af('day','string',['2-digit','numeric']);
bE+=appendToLDMLString(
bF,{'2-digit':'dd','numeric':'d'});
var bG=af('hour12','boolean');
bF=af('hour','string',['2-digit','numeric']);
if((bG===(void 0))){
bE+=appendToLDMLString(bF,{'2-digit':'jj','numeric':'j'});
}else if(bG===true){
bE+=appendToLDMLString(bF,{'2-digit':'hh','numeric':'h'});
}else{
bE+=appendToLDMLString(bF,{'2-digit':'HH','numeric':'H'});
}
bF=af('minute','string',['2-digit','numeric']);
bE+=appendToLDMLString(bF,{'2-digit':'mm','numeric':'m'});
bF=af('second','string',['2-digit','numeric']);
bE+=appendToLDMLString(bF,{'2-digit':'ss','numeric':'s'});
bF=af('timeZoneName','string',['short','long']);
bE+=appendToLDMLString(bF,{short:'z',long:'zzzz'});
return bE;
}
function appendToLDMLString(bF,bH){
if(!(bF===(void 0))){
return bH[bF];
}else{
return'';
}
}
function fromLDMLString(bE){
bE=%_CallFunction(bE,GetQuotedStringRE(),'',
v);
var W={};
var bI=%_CallFunction(bE,/E{3,5}/g,u);
W=appendToDateTimeObject(
W,'weekday',bI,{EEEEE:'narrow',EEE:'short',EEEE:'long'});
bI=%_CallFunction(bE,/G{3,5}/g,u);
W=appendToDateTimeObject(
W,'era',bI,{GGGGG:'narrow',GGG:'short',GGGG:'long'});
bI=%_CallFunction(bE,/y{1,2}/g,u);
W=appendToDateTimeObject(
W,'year',bI,{y:'numeric',yy:'2-digit'});
bI=%_CallFunction(bE,/M{1,5}/g,u);
W=appendToDateTimeObject(W,'month',bI,{MM:'2-digit',
M:'numeric',MMMMM:'narrow',MMM:'short',MMMM:'long'});
bI=%_CallFunction(bE,/L{1,5}/g,u);
W=appendToDateTimeObject(W,'month',bI,{LL:'2-digit',
L:'numeric',LLLLL:'narrow',LLL:'short',LLLL:'long'});
bI=%_CallFunction(bE,/d{1,2}/g,u);
W=appendToDateTimeObject(
W,'day',bI,{d:'numeric',dd:'2-digit'});
bI=%_CallFunction(bE,/h{1,2}/g,u);
if(bI!==null){
W['hour12']=true;
}
W=appendToDateTimeObject(
W,'hour',bI,{h:'numeric',hh:'2-digit'});
bI=%_CallFunction(bE,/H{1,2}/g,u);
if(bI!==null){
W['hour12']=false;
}
W=appendToDateTimeObject(
W,'hour',bI,{H:'numeric',HH:'2-digit'});
bI=%_CallFunction(bE,/m{1,2}/g,u);
W=appendToDateTimeObject(
W,'minute',bI,{m:'numeric',mm:'2-digit'});
bI=%_CallFunction(bE,/s{1,2}/g,u);
W=appendToDateTimeObject(
W,'second',bI,{s:'numeric',ss:'2-digit'});
bI=%_CallFunction(bE,/z|zzzz/g,u);
W=appendToDateTimeObject(
W,'timeZoneName',bI,{z:'short',zzzz:'long'});
return W;
}
function appendToDateTimeObject(W,bF,bI,bH){
if((bI===null)){
if(!%HasOwnProperty(W,bF)){
defineWEProperty(W,bF,(void 0));
}
return W;
}
var ag=bI[0];
defineWEProperty(W,bF,bH[ag]);
return W;
}
function toDateTimeOptions(W,bJ,bK){
if((W===(void 0))){
W={};
}else{
W=((%_IsSpecObject(%IS_VAR(W)))?W:$toObject(W));
}
var bL=true;
if((bJ==='date'||bJ==='any')&&
(!(W.weekday===(void 0))||!(W.year===(void 0))||
!(W.month===(void 0))||!(W.day===(void 0)))){
bL=false;
}
if((bJ==='time'||bJ==='any')&&
(!(W.hour===(void 0))||!(W.minute===(void 0))||
!(W.second===(void 0)))){
bL=false;
}
if(bL&&(bK==='date'||bK==='all')){
j(W,'year',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
j(W,'month',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
j(W,'day',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
}
if(bL&&(bK==='time'||bK==='all')){
j(W,'hour',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
j(W,'minute',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
j(W,'second',{value:'numeric',
writable:true,
enumerable:true,
configurable:true});
}
return W;
}
function initializeDateTimeFormat(bM,V,W){
if(%IsInitializedIntlObject(bM)){
throw MakeTypeError(94,"DateTimeFormat");
}
if((W===(void 0))){
W={};
}
var ac=resolveLocale('dateformat',V,W);
W=toDateTimeOptions(W,'any','date');
var af=getGetOption(W,'dateformat');
var X=af('formatMatcher','string',
['basic','best fit'],'best fit');
var bE=toLDMLString(W);
var bN=canonicalizeTimeZoneID(W.timeZone);
var bg={};
var ap=parseExtension(ac.extension);
var bO={
'ca':{'property':(void 0),'type':'string'},
'nu':{'property':(void 0),'type':'string'}
};
var an=setOptions(W,ap,bO,
af,bg);
var bl=ac.locale+an;
var al=i({},{
calendar:{writable:true},
day:{writable:true},
era:{writable:true},
hour12:{writable:true},
hour:{writable:true},
locale:{writable:true},
minute:{writable:true},
month:{writable:true},
numberingSystem:{writable:true},
pattern:{writable:true},
requestedLocale:{value:bl,writable:true},
second:{writable:true},
timeZone:{writable:true},
timeZoneName:{writable:true},
tz:{value:bN,writable:true},
weekday:{writable:true},
year:{writable:true}
});
var bA=%CreateDateTimeFormat(
bl,{skeleton:bE,timeZone:bN},al);
if(!(bN===(void 0))&&bN!==al.timeZone){
throw MakeRangeError(149,bN);
}
%MarkAsInitializedIntlObjectOfType(bM,'dateformat',bA);
j(bM,'resolved',{value:al});
return bM;
}
%AddNamedProperty(A,'DateTimeFormat',function(){
var V=%_Arguments(0);
var W=%_Arguments(1);
if(!this||this===A){
return new A.DateTimeFormat(V,W);
}
return initializeDateTimeFormat($toObject(this),V,W);
},
2
);
%AddNamedProperty(A.DateTimeFormat.prototype,'resolvedOptions',function(){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
if(!%IsInitializedIntlObjectOfType(this,'dateformat')){
throw MakeTypeError(95,"DateTimeFormat");
}
var bP={
'gregorian':'gregory',
'japanese':'japanese',
'buddhist':'buddhist',
'roc':'roc',
'persian':'persian',
'islamic-civil':'islamicc',
'islamic':'islamic',
'hebrew':'hebrew',
'chinese':'chinese',
'indian':'indian',
'coptic':'coptic',
'ethiopic':'ethiopic',
'ethiopic-amete-alem':'ethioaa'
};
var bB=this;
var bQ=fromLDMLString(bB.resolved.pattern);
var bR=bP[bB.resolved.calendar];
if((bR===(void 0))){
bR=bB.resolved.calendar;
}
var ac=getOptimalLanguageTag(bB.resolved.requestedLocale,
bB.resolved.locale);
var bC={
locale:ac,
numberingSystem:bB.resolved.numberingSystem,
calendar:bR,
timeZone:bB.resolved.timeZone
};
addWECPropertyIfDefined(bC,'timeZoneName',bQ.timeZoneName);
addWECPropertyIfDefined(bC,'era',bQ.era);
addWECPropertyIfDefined(bC,'year',bQ.year);
addWECPropertyIfDefined(bC,'month',bQ.month);
addWECPropertyIfDefined(bC,'day',bQ.day);
addWECPropertyIfDefined(bC,'weekday',bQ.weekday);
addWECPropertyIfDefined(bC,'hour12',bQ.hour12);
addWECPropertyIfDefined(bC,'hour',bQ.hour);
addWECPropertyIfDefined(bC,'minute',bQ.minute);
addWECPropertyIfDefined(bC,'second',bQ.second);
return bC;
},
2
);
k(A.DateTimeFormat.prototype.resolvedOptions,
'resolvedOptions');
%FunctionRemovePrototype(A.DateTimeFormat.prototype.resolvedOptions);
%SetNativeFlag(A.DateTimeFormat.prototype.resolvedOptions);
%AddNamedProperty(A.DateTimeFormat,'supportedLocalesOf',function(V){
if(%_IsConstructCall()){
throw MakeTypeError(74);
}
return supportedLocalesOf('dateformat',V,%_Arguments(1));
},
2
);
k(A.DateTimeFormat.supportedLocalesOf,'supportedLocalesOf');
%FunctionRemovePrototype(A.DateTimeFormat.supportedLocalesOf);
%SetNativeFlag(A.DateTimeFormat.supportedLocalesOf);
function formatDate(bA,bS){
var bT;
if((bS===(void 0))){
bT=%DateCurrentTime();
}else{
bT=$toNumber(bS);
}
if(!n(bT))throw MakeRangeError(122);
return %InternalDateFormat(%GetImplFromInitializedIntlObject(bA),
new d(bT));
}
function parseDate(bA,ak){
return %InternalDateParse(%GetImplFromInitializedIntlObject(bA),
h(ak));
}
addBoundMethod(A.DateTimeFormat,'format',formatDate,0);
addBoundMethod(A.DateTimeFormat,'v8Parse',parseDate,1);
function canonicalizeTimeZoneID(bU){
if((bU===(void 0))){
return bU;
}
var bV=%StringToUpperCase(bU);
if(bV==='UTC'||bV==='GMT'||
bV==='ETC/UTC'||bV==='ETC/GMT'){
return'UTC';
}
var bI=%_CallFunction(bU,GetTimezoneNameCheckRE(),u);
if((bI===null))throw MakeRangeError(123,bU);
var bC=toTitleCaseWord(bI[1])+'/'+toTitleCaseWord(bI[2]);
var ab=3;
while(!(bI[ab]===(void 0))&&ab