! / 1488985388 0 0 0 2558 ` * ŦŦŦŦŦŦŦŦŦŦ_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetBuiltinsCountEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetDebuggerCountEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE8GetIndexEPKc_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE17GetRawScriptsSizeEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE18GetRawScriptSourceEi_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE13GetScriptNameEi_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetScriptsSourceEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE19SetRawScriptsSourceENS0_6VectorIKcEE_ZN2v88internal25pLinuxKernelMemoryBarrierE_ZN2v88internal19pLinuxKernelCmpxchgE_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetBuiltinsCountEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetDebuggerCountEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE8GetIndexEPKc_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE17GetRawScriptsSizeEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE18GetRawScriptSourceEi_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE13GetScriptNameEi_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetScriptsSourceEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE19SetRawScriptsSourceENS0_6VectorIKcEE_ZN2v88internal25pLinuxKernelMemoryBarrierE_ZN2v88internal19pLinuxKernelCmpxchgE_ZN2v88internal8Snapshot24context_cell_space_used_E_ZN2v88internal8Snapshot23context_map_space_used_E_ZN2v88internal8Snapshot24context_code_space_used_E_ZN2v88internal8Snapshot24context_data_space_used_E_ZN2v88internal8Snapshot27context_pointer_space_used_E_ZN2v88internal8Snapshot23context_new_space_used_E_ZN2v88internal8Snapshot16cell_space_used_E_ZN2v88internal8Snapshot15map_space_used_E_ZN2v88internal8Snapshot16code_space_used_E_ZN2v88internal8Snapshot16data_space_used_E_ZN2v88internal8Snapshot19pointer_space_used_E_ZN2v88internal8Snapshot15new_space_used_E_ZN2v88internal8Snapshot17context_raw_size_E_ZN2v88internal8Snapshot13context_size_E_ZN2v88internal8Snapshot17context_raw_data_E_ZN2v88internal8Snapshot13context_data_E_ZN2v88internal8Snapshot9raw_size_E_ZN2v88internal8Snapshot5size_E_ZN2v88internal8Snapshot9raw_data_E_ZN2v88internal8Snapshot5data_E_ZN2v88internal25pLinuxKernelMemoryBarrierE_ZN2v88internal19pLinuxKernelCmpxchgE// 44 ` experimental-libraries.o/ snapshot-empty.o/ libraries.o/ 1488985388 1000 1000 100664 244416 ` ELF(4( pG pG9IyDF7I FyD5I FyD` 2I FyD(L  -I FyD *I FyD 'I FyD $I FyD !I FyD I FyD I FyD I FyD I FyD( I FyD(O0 th\PBJ:pG),)5)?)E)N)W)l)u )~ ) ) )T )PK"B`{D`pGNKJfbB`{Dh3`pGIKIB`{Dh33`pGEKCbB`{Dh?3s`pG@KBB`{Dh`pG=KGIB`{Dh'S=3`pG8KEuB`{DhCF3`pG4KDB`{DhjC3`pG/K@RB`{Dh]3#`pG*KAB`{Dh33`pG&K@4rB`{Dh3>3`pG!KF"B`{Dh3s`pGK@RB`{Dh33`pGKC"B`{DhO3;3`pGKABB`{Dha3h3`pG:0 |hVD)#)')+)/)3)7)A)E )I )M )Q )1 )S-K"B`{D`pG+K"B`{D`pG)K"B`{D`pG'K"B`{D`pG%K"B`{D`pG#K"B`{D`pG!K"B`{D`pGK"B`{D`pGK"B`{D`pGK "B`{D`pGK"B`{D`pGK"B`{D`pGK"B`{D`pGK"B`{D`pGK"B`{D`pG|tld\TLD<IFJ:yD`B`pGJzD`pG  var $Object=global.Object; var $Array=global.Array; var $String=global.String; var $Number=global.Number; var $Function=global.Function; var $Boolean=global.Boolean; var $NaN=%GetRootNaN(); var builtins=this; function EQUALS(a){ if((typeof(this)==='string')&&(typeof(a)==='string'))return %StringEquals(this,a); var b=this; while(true){ if((typeof(b)==='number')){ while(true){ if((typeof(a)==='number'))return %NumberEquals(b,a); if((a==null))return 1; if(!(%_IsSpecObject(a))){ return %NumberEquals(b,%ToNumber(a)); } a=%ToPrimitive(a,0); } }else if((typeof(b)==='string')){ while(true){ if((typeof(a)==='string'))return %StringEquals(b,a); if((typeof(a)==='number'))return %NumberEquals(%ToNumber(b),a); if((typeof(a)==='boolean'))return %NumberEquals(%ToNumber(b),%ToNumber(a)); if((a==null))return 1; a=%ToPrimitive(a,0); } }else if((typeof(b)==='boolean')){ if((typeof(a)==='boolean'))return %_ObjectEquals(b,a)?0:1; if((a==null))return 1; if((typeof(a)==='number'))return %NumberEquals(%ToNumber(b),a); if((typeof(a)==='string'))return %NumberEquals(%ToNumber(b),%ToNumber(a)); b=%ToNumber(b); a=%ToPrimitive(a,0); }else if((b==null)){ return(a==null)?0:1; }else{ if((%_IsSpecObject(a))){ return %_ObjectEquals(b,a)?0:1; } if((a==null))return 1; if((typeof(a)==='boolean'))a=%ToNumber(a); b=%ToPrimitive(b,0); } } } function STRICT_EQUALS(a){ if((typeof(this)==='string')){ if(!(typeof(a)==='string'))return 1; return %StringEquals(this,a); } if((typeof(this)==='number')){ if(!(typeof(a)==='number'))return 1; return %NumberEquals(this,a); } return %_ObjectEquals(this,a)?0:1; } function COMPARE(a,b){ var c; var d; if((typeof(this)==='string')){ if((typeof(a)==='string'))return %_StringCompare(this,a); if((typeof(a)==='undefined'))return b; c=this; }else if((typeof(this)==='number')){ if((typeof(a)==='number'))return %NumberCompare(this,a,b); if((typeof(a)==='undefined'))return b; c=this; }else if((typeof(this)==='undefined')){ if(!(typeof(a)==='undefined')){ %ToPrimitive(a,1); } return b; }else if((typeof(a)==='undefined')){ %ToPrimitive(this,1); return b; }else{ c=%ToPrimitive(this,1); } d=%ToPrimitive(a,1); if((typeof(c)==='string')&&(typeof(d)==='string')){ return %_StringCompare(c,d); }else{ var e=%ToNumber(c); var f=%ToNumber(d); if((!%_IsSmi(%IS_VAR(e))&&!(e==e))||(!%_IsSmi(%IS_VAR(f))&&!(f==f)))return b; return %NumberCompare(e,f,b); } } function ADD(a){ if((typeof(this)==='number')&&(typeof(a)==='number'))return %NumberAdd(this,a); if((typeof(this)==='string')&&(typeof(a)==='string'))return %_StringAdd(this,a); var b=%ToPrimitive(this,0); var c=%ToPrimitive(a,0); if((typeof(b)==='string')){ return %_StringAdd(b,%ToString(c)); }else if((typeof(c)==='string')){ return %_StringAdd(%NonStringToString(b),c); }else{ return %NumberAdd(%ToNumber(b),%ToNumber(c)); } } function STRING_ADD_LEFT(a){ if(!(typeof(a)==='string')){ if((%_ClassOf(a)==='String')&&%_IsStringWrapperSafeForDefaultValueOf(a)){ a=%_ValueOf(a); }else{ a=(typeof(a)==='number') ?%_NumberToString(a) :%ToString(%ToPrimitive(a,0)); } } return %_StringAdd(this,a); } function STRING_ADD_RIGHT(a){ var b=this; if(!(typeof(b)==='string')){ if((%_ClassOf(b)==='String')&&%_IsStringWrapperSafeForDefaultValueOf(b)){ b=%_ValueOf(b); }else{ b=(typeof(b)==='number') ?%_NumberToString(b) :%ToString(%ToPrimitive(b,0)); } } return %_StringAdd(b,a); } function SUB(a){ var b=(typeof(this)==='number')?this:%NonNumberToNumber(this); if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); return %NumberSub(b,a); } function MUL(a){ var b=(typeof(this)==='number')?this:%NonNumberToNumber(this); if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); return %NumberMul(b,a); } function DIV(a){ var b=(typeof(this)==='number')?this:%NonNumberToNumber(this); if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); return %NumberDiv(b,a); } function MOD(a){ var b=(typeof(this)==='number')?this:%NonNumberToNumber(this); if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); return %NumberMod(b,a); } function BIT_OR(a){ var b=(typeof(this)==='number')?this:%NonNumberToNumber(this); if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); return %NumberOr(b,a); } function BIT_AND(a){ var b; if((typeof(this)==='number')){ b=this; if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); }else{ b=%NonNumberToNumber(this); if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); if((!%_IsSmi(%IS_VAR(b))&&!(b==b)))return 0; } return %NumberAnd(b,a); } function BIT_XOR(a){ var b=(typeof(this)==='number')?this:%NonNumberToNumber(this); if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); return %NumberXor(b,a); } function UNARY_MINUS(){ var a=(typeof(this)==='number')?this:%NonNumberToNumber(this); return %NumberUnaryMinus(a); } function BIT_NOT(){ var a=(typeof(this)==='number')?this:%NonNumberToNumber(this); return %NumberNot(a); } function SHL(a){ var b=(typeof(this)==='number')?this:%NonNumberToNumber(this); if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); return %NumberShl(b,a); } function SAR(a){ var b; if((typeof(this)==='number')){ b=this; if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); }else{ b=%NonNumberToNumber(this); if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); if((!%_IsSmi(%IS_VAR(b))&&!(b==b)))return 0; } return %NumberSar(b,a); } function SHR(a){ var b=(typeof(this)==='number')?this:%NonNumberToNumber(this); if(!(typeof(a)==='number'))a=%NonNumberToNumber(a); return %NumberShr(b,a); } function DELETE(a,b){ return %DeleteProperty(%ToObject(this),%ToString(a),b); } function IN(a){ if(!(%_IsSpecObject(a))){ throw %MakeTypeError('invalid_in_operator_use',[this,a]); } return %_IsNonNegativeSmi(this)? %HasElement(a,this):%HasProperty(a,%ToString(this)); } function INSTANCE_OF(a){ var b=this; if(!(%_ClassOf(a)==='Function')){ throw %MakeTypeError('instanceof_function_expected',[b]); } if(!(%_IsSpecObject(b))){ return 1; } var c=%BoundFunctionGetBindings(a); if(c){ a=c[0]; } var d=a.prototype; if(!(%_IsSpecObject(d))){ throw %MakeTypeError('instanceof_nonobject_proto',[d]); } return %IsInPrototypeChain(d,b)?0:1; } function FILTER_KEY(a){ var b=%ToString(a); if(%HasProperty(this,b))return b; return 0; } function CALL_NON_FUNCTION(){ var a=%GetFunctionDelegate(this); if(!(%_IsFunction(a))){ throw %MakeTypeError('called_non_callable',[typeof this]); } return %Apply(a,this,arguments,0,%_ArgumentsLength()); } function CALL_NON_FUNCTION_AS_CONSTRUCTOR(){ var a=%GetConstructorDelegate(this); if(!(%_IsFunction(a))){ throw %MakeTypeError('called_non_callable',[typeof this]); } return %Apply(a,this,arguments,0,%_ArgumentsLength()); } function CALL_FUNCTION_PROXY(){ var a=%_ArgumentsLength()-1; var b=%_Arguments(a); var c=%GetCallTrap(b); return %Apply(c,this,arguments,0,a); } function CALL_FUNCTION_PROXY_AS_CONSTRUCTOR(){ var a=this; var b=%GetConstructTrap(a); return %Apply(b,this,arguments,0,%_ArgumentsLength()); } function APPLY_PREPARE(a){ var b; if((%_IsArray(a))){ b=a.length; if(%_IsSmi(b)&&b>=0&&b<0x800000&& (%_ClassOf(this)==='Function')){ return b; } } b=(a==null)?0:%ToUint32(a.length); if(b>0x800000){ throw %MakeRangeError('stack_overflow',[]); } if(!(%_ClassOf(this)==='Function')){ throw %MakeTypeError('apply_non_function', [%ToString(this),typeof this]); } if(a!=null&&!(%_IsSpecObject(a))){ throw %MakeTypeError('apply_wrong_args',[]); } return b; } function APPLY_OVERFLOW(a){ throw %MakeRangeError('stack_overflow',[]); } function TO_OBJECT(){ return %ToObject(this); } function TO_NUMBER(){ return %ToNumber(this); } function TO_STRING(){ return %ToString(this); } function ToPrimitive(a,b){ if((typeof(a)==='string'))return a; if(!(%_IsSpecObject(a)))return a; if(b==0)b=((%_ClassOf(a)==='Date'))?2:1; return(b==1)?%DefaultNumber(a):%DefaultString(a); } function ToBoolean(a){ if((typeof(a)==='boolean'))return a; if((typeof(a)==='string'))return a.length!=0; if(a==null)return false; if((typeof(a)==='number'))return!((a==0)||(!%_IsSmi(%IS_VAR(a))&&!(a==a))); return true; } function ToNumber(a){ if((typeof(a)==='number'))return a; if((typeof(a)==='string')){ return %_HasCachedArrayIndex(a)?%_GetCachedArrayIndex(a) :%StringToNumber(a); } if((typeof(a)==='boolean'))return a?1:0; if((typeof(a)==='undefined'))return $NaN; return((a===null))?0:ToNumber(%DefaultNumber(a)); } function NonNumberToNumber(a){ if((typeof(a)==='string')){ return %_HasCachedArrayIndex(a)?%_GetCachedArrayIndex(a) :%StringToNumber(a); } if((typeof(a)==='boolean'))return a?1:0; if((typeof(a)==='undefined'))return $NaN; return((a===null))?0:ToNumber(%DefaultNumber(a)); } function ToString(a){ if((typeof(a)==='string'))return a; if((typeof(a)==='number'))return %_NumberToString(a); if((typeof(a)==='boolean'))return a?'true':'false'; if((typeof(a)==='undefined'))return'undefined'; return((a===null))?'null':%ToString(%DefaultString(a)); } function NonStringToString(a){ if((typeof(a)==='number'))return %_NumberToString(a); if((typeof(a)==='boolean'))return a?'true':'false'; if((typeof(a)==='undefined'))return'undefined'; return((a===null))?'null':%ToString(%DefaultString(a)); } function ToObject(a){ if((typeof(a)==='string'))return new $String(a); if((typeof(a)==='number'))return new $Number(a); if((typeof(a)==='boolean'))return new $Boolean(a); if((a==null)&&!(%_IsUndetectableObject(a))){ throw %MakeTypeError('null_to_object',[]); } return a; } function ToInteger(a){ if(%_IsSmi(a))return a; return %NumberToInteger(ToNumber(a)); } function ToUint32(a){ if(%_IsSmi(a)&&a>=0)return a; return %NumberToJSUint32(ToNumber(a)); } function ToInt32(a){ if(%_IsSmi(a))return a; return %NumberToJSInt32(ToNumber(a)); } function SameValue(a,b){ if(typeof a!=typeof b)return false; if((typeof(a)==='number')){ if((!%_IsSmi(%IS_VAR(a))&&!(a==a))&&(!%_IsSmi(%IS_VAR(b))&&!(b==b)))return true; if(a===0&&b===0&&(1/a)!=(1/b))return false; } return a===b; } function IsPrimitive(a){ return!(%_IsSpecObject(a)); } function DefaultNumber(a){ var b=a.valueOf; if((%_ClassOf(b)==='Function')){ var c=%_CallFunction(a,b); if(%IsPrimitive(c))return c; } var d=a.toString; if((%_ClassOf(d)==='Function')){ var e=%_CallFunction(a,d); if(%IsPrimitive(e))return e; } throw %MakeTypeError('cannot_convert_to_primitive',[]); } function DefaultString(a){ var b=a.toString; if((%_ClassOf(b)==='Function')){ var c=%_CallFunction(a,b); if(%IsPrimitive(c))return c; } var d=a.valueOf; if((%_ClassOf(d)==='Function')){ var e=%_CallFunction(a,d); if(%IsPrimitive(e))return e; } throw %MakeTypeError('cannot_convert_to_primitive',[]); } %FunctionSetPrototype($Array,new $Array(0)); var $isNaN=GlobalIsNaN; var $isFinite=GlobalIsFinite; function InstallFunctions(a,b,c){ if(c.length>=8){ %OptimizeObjectForAddingMultipleProperties(a,c.length>>1); } for(var d=0;d>1)+(b?b.length:0); if(e>=4){ %OptimizeObjectForAddingMultipleProperties(d,e); } if(b){ for(var f=0;f>0)); if(!(b==0||(2<=b&&b<=36))){ return $NaN; } } if(%_HasCachedArrayIndex(a)&& (b==0||b==10)){ return %_GetCachedArrayIndex(a); } return %StringParseInt(a,b); } function GlobalParseFloat(a){ a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); if(%_HasCachedArrayIndex(a))return %_GetCachedArrayIndex(a); return %StringParseFloat(a); } function GlobalEval(a){ if(!(typeof(a)==='string'))return a; var b=%GlobalReceiver(global); var c=(global===b); if(c){ throw new $EvalError('The "this" value passed to eval must '+ 'be the global object from which eval originated'); } var d=%CompileString(a); if(!(%_IsFunction(d)))return d; return %_CallFunction(b,d); } function SetUpGlobal(){ %CheckIsBootstrapping(); %SetProperty(global,"NaN",$NaN,2|4|1); %SetProperty(global,"Infinity",1/0,2|4|1); %SetProperty(global,"undefined",void 0, 2|4|1); InstallFunctions(global,2,$Array( "isNaN",GlobalIsNaN, "isFinite",GlobalIsFinite, "parseInt",GlobalParseInt, "parseFloat",GlobalParseFloat, "eval",GlobalEval )); } SetUpGlobal(); %SetCode($Boolean,function(a){ if(%_IsConstructCall()){ %_SetValueOf(this,ToBoolean(a)); }else{ return ToBoolean(a); } }); %FunctionSetPrototype($Boolean,new $Boolean(false)); %SetProperty($Boolean.prototype,"constructor",$Boolean,2); $Object.prototype.constructor=$Object; function ObjectToString(){ if((typeof(this)==='undefined')&&!(%_IsUndetectableObject(this))){ return'[object Undefined]'; } if((this===null))return'[object Null]'; return"[object "+%_ClassOf(ToObject(this))+"]"; } function ObjectToLocaleString(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Object.prototype.toLocaleString"]); } return this.toString(); } function ObjectValueOf(){ return ToObject(this); } function ObjectHasOwnProperty(a){ if(%IsJSProxy(this)){ var b=%GetHandler(this); return CallTrap1(b,"hasOwn",DerivedHasOwnTrap,((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a))); } return %HasLocalProperty(((%_IsSpecObject(%IS_VAR(this)))?this:ToObject(this)),((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a))); } function ObjectIsPrototypeOf(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Object.prototype.isPrototypeOf"]); } if(!(%_IsSpecObject(a)))return false; return %IsInPrototypeChain(this,a); } function ObjectPropertyIsEnumerable(a){ var b=ToString(a); if(%IsJSProxy(this)){ var c=GetOwnProperty(this,b); return(typeof(c)==='undefined')?false:c.isEnumerable(); } return %IsPropertyEnumerable(ToObject(this),b); } function ObjectDefineGetter(a,b){ var c=this; if(c==null&&!(%_IsUndetectableObject(c))){ c=%GlobalReceiver(global); } if(!(%_ClassOf(b)==='Function')){ throw new $TypeError( 'Object.prototype.__defineGetter__: Expecting function'); } var d=new PropertyDescriptor(); d.setGet(b); d.setEnumerable(true); d.setConfigurable(true); DefineOwnProperty(ToObject(c),ToString(a),d,false); } function ObjectLookupGetter(a){ var b=this; if(b==null&&!(%_IsUndetectableObject(b))){ b=%GlobalReceiver(global); } return %LookupAccessor(ToObject(b),ToString(a),0); } function ObjectDefineSetter(a,b){ var c=this; if(c==null&&!(%_IsUndetectableObject(c))){ c=%GlobalReceiver(global); } if(!(%_ClassOf(b)==='Function')){ throw new $TypeError( 'Object.prototype.__defineSetter__: Expecting function'); } var d=new PropertyDescriptor(); d.setSet(b); d.setEnumerable(true); d.setConfigurable(true); DefineOwnProperty(ToObject(c),ToString(a),d,false); } function ObjectLookupSetter(a){ var b=this; if(b==null&&!(%_IsUndetectableObject(b))){ b=%GlobalReceiver(global); } return %LookupAccessor(ToObject(b),ToString(a),1); } function ObjectKeys(a){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.keys"]); } if(%IsJSProxy(a)){ var b=%GetHandler(a); var c=CallTrap0(b,"keys",DerivedKeysTrap); return ToStringArray(c,"keys"); } return %LocalKeys(a); } function IsAccessorDescriptor(a){ if((typeof(a)==='undefined'))return false; return a.hasGetter()||a.hasSetter(); } function IsDataDescriptor(a){ if((typeof(a)==='undefined'))return false; return a.hasValue()||a.hasWritable(); } function IsGenericDescriptor(a){ if((typeof(a)==='undefined'))return false; return!(IsAccessorDescriptor(a)||IsDataDescriptor(a)); } function IsInconsistentDescriptor(a){ return IsAccessorDescriptor(a)&&IsDataDescriptor(a); } function FromPropertyDescriptor(a){ if((typeof(a)==='undefined'))return a; if(IsDataDescriptor(a)){ return{value:a.getValue(), writable:a.isWritable(), enumerable:a.isEnumerable(), configurable:a.isConfigurable()}; } return{get:a.getGet(), set:a.getSet(), enumerable:a.isEnumerable(), configurable:a.isConfigurable()}; } function FromGenericPropertyDescriptor(a){ if((typeof(a)==='undefined'))return a; var b=new $Object(); if(a.hasValue()){ %IgnoreAttributesAndSetProperty(b,"value",a.getValue(),0); } if(a.hasWritable()){ %IgnoreAttributesAndSetProperty(b,"writable",a.isWritable(),0); } if(a.hasGetter()){ %IgnoreAttributesAndSetProperty(b,"get",a.getGet(),0); } if(a.hasSetter()){ %IgnoreAttributesAndSetProperty(b,"set",a.getSet(),0); } if(a.hasEnumerable()){ %IgnoreAttributesAndSetProperty(b,"enumerable", a.isEnumerable(),0); } if(a.hasConfigurable()){ %IgnoreAttributesAndSetProperty(b,"configurable", a.isConfigurable(),0); } return b; } function ToPropertyDescriptor(a){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("property_desc_object",[a]); } var b=new PropertyDescriptor(); if("enumerable"in a){ b.setEnumerable(ToBoolean(a.enumerable)); } if("configurable"in a){ b.setConfigurable(ToBoolean(a.configurable)); } if("value"in a){ b.setValue(a.value); } if("writable"in a){ b.setWritable(ToBoolean(a.writable)); } if("get"in a){ var c=a.get; if(!(typeof(c)==='undefined')&&!(%_ClassOf(c)==='Function')){ throw MakeTypeError("getter_must_be_callable",[c]); } b.setGet(c); } if("set"in a){ var d=a.set; if(!(typeof(d)==='undefined')&&!(%_ClassOf(d)==='Function')){ throw MakeTypeError("setter_must_be_callable",[d]); } b.setSet(d); } if(IsInconsistentDescriptor(b)){ throw MakeTypeError("value_and_accessor",[a]); } return b; } function ToCompletePropertyDescriptor(a){ var b=ToPropertyDescriptor(a); if(IsGenericDescriptor(b)||IsDataDescriptor(b)){ if(!b.hasValue())b.setValue(void 0); if(!b.hasWritable())b.setWritable(false); }else{ if(!b.hasGetter())b.setGet(void 0); if(!b.hasSetter())b.setSet(void 0); } if(!b.hasEnumerable())b.setEnumerable(false); if(!b.hasConfigurable())b.setConfigurable(false); return b; } function PropertyDescriptor(){ this.value_=void 0; this.hasValue_=false; this.writable_=false; this.hasWritable_=false; this.enumerable_=false; this.hasEnumerable_=false; this.configurable_=false; this.hasConfigurable_=false; this.get_=void 0; this.hasGetter_=false; this.set_=void 0; this.hasSetter_=false; } SetUpLockedPrototype(PropertyDescriptor,$Array( "value_", "hasValue_", "writable_", "hasWritable_", "enumerable_", "hasEnumerable_", "configurable_", "hasConfigurable_", "get_", "hasGetter_", "set_", "hasSetter_" ),$Array( "toString",function(){ return"[object PropertyDescriptor]"; }, "setValue",function(a){ this.value_=a; this.hasValue_=true; }, "getValue",function(){ return this.value_; }, "hasValue",function(){ return this.hasValue_; }, "setEnumerable",function(a){ this.enumerable_=a; this.hasEnumerable_=true; }, "isEnumerable",function(){ return this.enumerable_; }, "hasEnumerable",function(){ return this.hasEnumerable_; }, "setWritable",function(a){ this.writable_=a; this.hasWritable_=true; }, "isWritable",function(){ return this.writable_; }, "hasWritable",function(){ return this.hasWritable_; }, "setConfigurable",function(a){ this.configurable_=a; this.hasConfigurable_=true; }, "hasConfigurable",function(){ return this.hasConfigurable_; }, "isConfigurable",function(){ return this.configurable_; }, "setGet",function(a){ this.get_=a; this.hasGetter_=true; }, "getGet",function(){ return this.get_; }, "hasGetter",function(){ return this.hasGetter_; }, "setSet",function(a){ this.set_=a; this.hasSetter_=true; }, "getSet",function(){ return this.set_; }, "hasSetter",function(){ return this.hasSetter_; })); function ConvertDescriptorArrayToDescriptor(a){ if(a===false){ throw'Internal error: invalid desc_array'; } if((typeof(a)==='undefined')){ return void 0; } var b=new PropertyDescriptor(); if(a[0]){ b.setGet(a[2]); b.setSet(a[3]); }else{ b.setValue(a[1]); b.setWritable(a[4]); } b.setEnumerable(a[5]); b.setConfigurable(a[6]); return b; } function GetTrap(a,b,c){ var d=a[b]; if((typeof(d)==='undefined')){ if((typeof(c)==='undefined')){ throw MakeTypeError("handler_trap_missing",[a,b]); } d=c; }else if(!(%_ClassOf(d)==='Function')){ throw MakeTypeError("handler_trap_must_be_callable",[a,b]); } return d; } function CallTrap0(a,b,c){ return %_CallFunction(a,GetTrap(a,b,c)); } function CallTrap1(a,b,c,d){ return %_CallFunction(a,d,GetTrap(a,b,c)); } function CallTrap2(a,b,c,d,e){ return %_CallFunction(a,d,e,GetTrap(a,b,c)); } function GetOwnProperty(a,b){ var c=ToString(b); if(%IsJSProxy(a)){ var d=%GetHandler(a); var e=CallTrap1(d,"getOwnPropertyDescriptor",void 0,c); if((typeof(e)==='undefined'))return e; var f=ToCompletePropertyDescriptor(e); if(!f.isConfigurable()){ throw MakeTypeError("proxy_prop_not_configurable", [d,"getOwnPropertyDescriptor",c,e]); } return f; } var g=%GetOwnProperty(ToObject(a),ToString(b)); if(g===false)return void 0; return ConvertDescriptorArrayToDescriptor(g); } function Delete(a,b,c){ var d=GetOwnProperty(a,b); if((typeof(d)==='undefined'))return true; if(d.isConfigurable()){ %DeleteProperty(a,b,0); return true; }else if(c){ throw MakeTypeError("define_disallowed",[b]); }else{ return; } } function DefineProxyProperty(a,b,c,d){ var e=%GetHandler(a); var f=CallTrap2(e,"defineProperty",void 0,b,c); if(!ToBoolean(f)){ if(d){ throw MakeTypeError("handler_returned_false", [e,"defineProperty"]); }else{ return false; } } return true; } function DefineObjectProperty(a,b,c,d){ var e=%GetOwnProperty(ToObject(a),ToString(b)); if(e===false)return void 0; var f=ConvertDescriptorArrayToDescriptor(e); var g=%IsExtensible(ToObject(a)); if((typeof(f)==='undefined')&&!g){ if(d){ throw MakeTypeError("define_disallowed",[b]); }else{ return false; } } if(!(typeof(f)==='undefined')){ if((IsGenericDescriptor(c)|| IsDataDescriptor(c)==IsDataDescriptor(f))&& (!c.hasEnumerable()|| SameValue(c.isEnumerable(),f.isEnumerable()))&& (!c.hasConfigurable()|| SameValue(c.isConfigurable(),f.isConfigurable()))&& (!c.hasWritable()|| SameValue(c.isWritable(),f.isWritable()))&& (!c.hasValue()|| SameValue(c.getValue(),f.getValue()))&& (!c.hasGetter()|| SameValue(c.getGet(),f.getGet()))&& (!c.hasSetter()|| SameValue(c.getSet(),f.getSet()))){ return true; } if(!f.isConfigurable()){ if(c.isConfigurable()|| (c.hasEnumerable()&& c.isEnumerable()!=f.isEnumerable())){ if(d){ throw MakeTypeError("redefine_disallowed",[b]); }else{ return false; } } if(!IsGenericDescriptor(c)){ if(IsDataDescriptor(f)!=IsDataDescriptor(c)){ if(d){ throw MakeTypeError("redefine_disallowed",[b]); }else{ return false; } } if(IsDataDescriptor(f)&&IsDataDescriptor(c)){ if(!f.isWritable()&&c.isWritable()){ if(d){ throw MakeTypeError("redefine_disallowed",[b]); }else{ return false; } } if(!f.isWritable()&&c.hasValue()&& !SameValue(c.getValue(),f.getValue())){ if(d){ throw MakeTypeError("redefine_disallowed",[b]); }else{ return false; } } } if(IsAccessorDescriptor(c)&&IsAccessorDescriptor(f)){ if(c.hasSetter()&&!SameValue(c.getSet(),f.getSet())){ if(d){ throw MakeTypeError("redefine_disallowed",[b]); }else{ return false; } } if(c.hasGetter()&&!SameValue(c.getGet(),f.getGet())){ if(d){ throw MakeTypeError("redefine_disallowed",[b]); }else{ return false; } } } } } } var h=0; if(c.hasEnumerable()){ h|=c.isEnumerable()?0:2; }else if(!(typeof(f)==='undefined')){ h|=f.isEnumerable()?0:2; }else{ h|=2; } if(c.hasConfigurable()){ h|=c.isConfigurable()?0:4; }else if(!(typeof(f)==='undefined')){ h|=f.isConfigurable()?0:4; }else h|=4; if(IsDataDescriptor(c)|| (IsGenericDescriptor(c)&& ((typeof(f)==='undefined')||IsDataDescriptor(f)))){ if(c.hasWritable()){ h|=c.isWritable()?0:1; }else if(!(typeof(f)==='undefined')){ h|=f.isWritable()?0:1; }else{ h|=1; } var i=void 0; if(c.hasValue()){ i=c.getValue(); }else if(!(typeof(f)==='undefined')&&IsDataDescriptor(f)){ i=f.getValue(); } %DefineOrRedefineDataProperty(a,b,i,h); }else{ var j=c.hasGetter()?c.getGet():null; var k=c.hasSetter()?c.getSet():null; %DefineOrRedefineAccessorProperty(a,b,j,k,h); } return true; } function DefineArrayProperty(a,b,c,d){ if(b=="length"){ var e=a.length; if(!c.hasValue()){ return DefineObjectProperty(a,"length",c,d); } var f=ToUint32(c.getValue()); if(f!=ToNumber(c.getValue())){ throw new $RangeError('defineProperty() array length out of range'); } var g=GetOwnProperty(a,"length"); if(f!=e&&!g.isWritable()){ if(d){ throw MakeTypeError("redefine_disallowed",[b]); }else{ return false; } } var h=false; while(f=e&&!g.isWritable())|| !DefineObjectProperty(a,b,c,true)){ if(d){ throw MakeTypeError("define_disallowed",[b]); }else{ return false; } } if(m>=e){ a.length=m+1; } return true; } return DefineObjectProperty(a,b,c,d); } function DefineOwnProperty(a,b,c,d){ if(%IsJSProxy(a)){ var e=FromGenericPropertyDescriptor(c); return DefineProxyProperty(a,b,e,d); }else if((%_IsArray(a))){ return DefineArrayProperty(a,b,c,d); }else{ return DefineObjectProperty(a,b,c,d); } } function ObjectGetPrototypeOf(a){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.getPrototypeOf"]); } return %GetPrototype(a); } function ObjectGetOwnPropertyDescriptor(a,b){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object", ["Object.getOwnPropertyDescriptor"]); } var c=GetOwnProperty(a,b); return FromPropertyDescriptor(c); } function ToStringArray(a,b){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("proxy_non_object_prop_names",[a,b]); } var c=ToUint32(a.length); var d=new $Array(c); var e={__proto__:null}; for(var f=0;f36){ throw new $RangeError('toString() radix argument must be between 2 and 36'); } return %NumberToRadixString(b,a); } function NumberToLocaleString(){ return %_CallFunction(this,NumberToString); } function NumberValueOf(){ if(!(typeof(this)==='number')&&!(%_ClassOf(this)==='Number')){ throw new $TypeError('Number.prototype.valueOf is not generic'); } return %_ValueOf(this); } function NumberToFixed(a){ var b=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw MakeTypeError("incompatible_method_receiver", ["Number.prototype.toFixed",this]); } b=%_ValueOf(this); } var c=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); if(c<0||c>20){ throw new $RangeError("toFixed() digits argument must be between 0 and 20"); } if((!%_IsSmi(%IS_VAR(b))&&!(b==b)))return"NaN"; if(b==1/0)return"Infinity"; if(b==-1/0)return"-Infinity"; return %NumberToFixed(b,c); } function NumberToExponential(a){ var b=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw MakeTypeError("incompatible_method_receiver", ["Number.prototype.toExponential",this]); } b=%_ValueOf(this); } var c=(typeof(a)==='undefined')?void 0:(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); if((!%_IsSmi(%IS_VAR(b))&&!(b==b)))return"NaN"; if(b==1/0)return"Infinity"; if(b==-1/0)return"-Infinity"; if((typeof(c)==='undefined')){ c=-1; }else if(c<0||c>20){ throw new $RangeError("toExponential() argument must be between 0 and 20"); } return %NumberToExponential(b,c); } function NumberToPrecision(a){ var b=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw MakeTypeError("incompatible_method_receiver", ["Number.prototype.toPrecision",this]); } b=%_ValueOf(this); } if((typeof(a)==='undefined'))return ToString(%_ValueOf(this)); var c=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); if((!%_IsSmi(%IS_VAR(b))&&!(b==b)))return"NaN"; if(b==1/0)return"Infinity"; if(b==-1/0)return"-Infinity"; if(c<1||c>21){ throw new $RangeError("toPrecision() argument must be between 1 and 21"); } return %NumberToPrecision(b,c); } function NumberIsFinite(a){ return(typeof(a)==='number')&&(%_IsSmi(%IS_VAR(a))||((a==a)&&(a!=1/0)&&(a!=-1/0))); } function NumberIsNaN(a){ return(typeof(a)==='number')&&(!%_IsSmi(%IS_VAR(a))&&!(a==a)); } function SetUpNumber(){ %CheckIsBootstrapping(); %OptimizeObjectForAddingMultipleProperties($Number.prototype,8); %SetProperty($Number.prototype,"constructor",$Number,2); %OptimizeObjectForAddingMultipleProperties($Number,5); %SetProperty($Number, "MAX_VALUE", 1.7976931348623157e+308, 2|4|1); %SetProperty($Number,"MIN_VALUE",5e-324, 2|4|1); %SetProperty($Number,"NaN",$NaN,2|4|1); %SetProperty($Number, "NEGATIVE_INFINITY", -1/0, 2|4|1); %SetProperty($Number, "POSITIVE_INFINITY", 1/0, 2|4|1); %ToFastProperties($Number); InstallFunctions($Number.prototype,2,$Array( "toString",NumberToString, "toLocaleString",NumberToLocaleString, "valueOf",NumberValueOf, "toFixed",NumberToFixed, "toExponential",NumberToExponential, "toPrecision",NumberToPrecision )); InstallFunctions($Number,2,$Array( "isFinite",NumberIsFinite, "isNaN",NumberIsNaN )); } SetUpNumber(); $Function.prototype.constructor=$Function; function FunctionSourceString(a){ while(%IsJSFunctionProxy(a)){ a=%GetCallTrap(a); } if(!(%_IsFunction(a))){ throw new $TypeError('Function.prototype.toString is not generic'); } var b=%FunctionGetSourceCode(a); if(!(typeof(b)==='string')||%FunctionIsBuiltin(a)){ var c=%FunctionGetName(a); if(c){ return'function '+c+'() { [native code] }'; }else{ return'function () { [native code] }'; } } var c=%FunctionNameShouldPrintAsAnonymous(a) ?'anonymous' :%FunctionGetName(a); return'function '+c+b; } function FunctionToString(){ return FunctionSourceString(this); } function FunctionBind(a){ if(!(%_ClassOf(this)==='Function')){ throw new $TypeError('Bind must be called on a function'); } var b=function(){ "use strict"; if(%_IsConstructCall()){ return %NewObjectFromBound(b); } var c=%BoundFunctionGetBindings(b); var d=%_ArgumentsLength(); if(d==0){ return %Apply(c[0],c[1],c,2,c.length-2); } if(c.length===2){ return %Apply(c[0],c[1],arguments,0,d); } var e=c.length-2; var f=new InternalArray(e+d); for(var g=0;g>>0)===j)){ var d=%_ArgumentsLength(); if(d>0)d--; i=j-d; if(i<0)i=0; } } var k=%FunctionBindArguments(b,this, a,i); return k; } function NewFunction(a){ var b=%_ArgumentsLength(); var c=''; if(b>1){ c=new InternalArray(b-1); for(var d=0;d0)?ToString(%_Arguments(b-1)):''; var f='(function('+c+') {\n'+e+'\n})'; var g=%GlobalReceiver(global); var h=%_CallFunction(g,%CompileString(f)); %FunctionMarkNameShouldPrintAsAnonymous(h); return %SetNewFunctionAttributes(h); } %SetCode($Function,NewFunction); function SetUpFunction(){ %CheckIsBootstrapping(); InstallFunctions($Function.prototype,2,$Array( "bind",FunctionBind, "toString",FunctionToString )); } SetUpFunction(); var visited_arrays=new InternalArray(); function GetSortedArrayKeys(a,b){ var c=b.length; var d=[]; for(var e=0;e1000&& (!%_IsSmi(b)|| %EstimateNumberOfElements(a)<(b>>2)); } function Join(a,b,c,d){ if(b==0)return''; var e=(%_IsArray(a)); if(e){ if(!%PushIfAbsent(visited_arrays,a))return''; } try{ if(UseSparseVariant(a,b,e)){ if(c.length==0){ return SparseJoin(a,b,d); }else{ return SparseJoinWithSeparator(a,b,d,c); } } if(b==1){ var f=a[0]; if((typeof(f)==='string'))return f; return d(f); } var g=new InternalArray(b); if(c.length==0){ var h=0; for(var i=0;i=b){ var m=a[j]; if(!(typeof(m)==='undefined')||j in a){ f[j-b]=m; } } } } } } function SmartMove(a,b,c,d,f){ var g=new InternalArray(d-c+f); var h=%GetArrayKeys(a,d); var i=h.length; for(var j=0;j=b+c){ var n=a[k]; if(!(typeof(n)==='undefined')||k in a){ g[k-c+f]=n; } } } } } %MoveArrayContents(g,a); } function SimpleSlice(a,b,c,d,f){ for(var g=0;gc){ for(var g=d-c;g>b;g--){ var h=g+c-1; var i=g+f-1; var j=a[h]; if(!(typeof(j)==='undefined')||h in a){ a[i]=j; }else{ delete a[i]; } } }else{ for(var g=b;gd-c+f;g--){ delete a[g-1]; } } } } function ArrayToString(){ var a; var b; if((%_IsArray(this))){ b=this.join; if(b===ArrayJoin){ return Join(this,this.length,',',ConvertToString); } a=this; }else{ a=ToObject(this); b=a.join; } if(!(%_ClassOf(b)==='Function')){ return %_CallFunction(a,ObjectToString); } return %_CallFunction(a,b); } function ArrayToLocaleString(){ var a=ToObject(this); var b=a.length; var c=(b>>>0); if(c===0)return""; return Join(a,c,',',ConvertToLocaleString); } function ArrayJoin(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.join"]); } var b=(this.length>>>0); if((typeof(a)==='undefined')){ a=','; }else if(!(typeof(a)==='string')){ a=NonStringToString(a); } var c=%_FastAsciiArrayJoin(this,a); if(!(typeof(c)==='undefined'))return c; return Join(this,b,a,ConvertToString); } function ArrayPop(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.pop"]); } var a=(this.length>>>0); if(a==0){ this.length=a; return; } a--; var b=this[a]; delete this[a]; this.length=a; return b; } function ArrayPush(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.push"]); } var a=(this.length>>>0); var b=%_ArgumentsLength(); for(var c=0;c=g){ j=g; while(c[++f]==g){} k=b-g-1; } var l=a[j]; if(!(typeof(l)==='undefined')||j in a){ var m=a[k]; if(!(typeof(m)==='undefined')||k in a){ a[j]=m; a[k]=l; }else{ a[k]=l; delete a[j]; } }else{ var m=a[k]; if(!(typeof(m)==='undefined')||k in a){ a[j]=m; delete a[k]; } } } } function ArrayReverse(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.reverse"]); } var a=(this.length>>>0)-1; if(UseSparseVariant(this,a,(%_IsArray(this)))){ SparseReverse(this,a+1); return this; } for(var b=0;b>>0); if(a===0){ this.length=0; return; } var b=this[0]; if((%_IsArray(this))&&!%IsObserved(this)){ SmartMove(this,0,1,a,0); }else{ SimpleMove(this,0,1,a,0); } this.length=a-1; return b; } function ArrayUnshift(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.unshift"]); } var b=(this.length>>>0); var c=%_ArgumentsLength(); if((%_IsArray(this))&&!%IsObserved(this)){ SmartMove(this,0,0,b,c); }else{ SimpleMove(this,0,0,b,c); } for(var d=0;d>>0); var d=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); var f=c; if(b!==void 0)f=(%_IsSmi(%IS_VAR(b))?b:%NumberToInteger(ToNumber(b))); if(d<0){ d+=c; if(d<0)d=0; }else{ if(d>c)d=c; } if(f<0){ f+=c; if(f<0)f=0; }else{ if(f>c)f=c; } var g=[]; if(f1000)&& (%EstimateNumberOfElements(this)>>0); var f=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); if(f<0){ f+=d; if(f<0)f=0; }else{ if(f>d)f=d; } var g=0; if(c==1){ g=d-f; }else{ g=(%_IsSmi(%IS_VAR(b))?b:%NumberToInteger(ToNumber(b))); if(g<0)g=0; if(g>d-f)g=d-f; } var h=[]; h.length=g; var i=0; if(c>2){ i=c-2; } var j=true; if((%_IsArray(this))&& !%IsObserved(this)&& i!==g){ var k=%EstimateNumberOfElements(this); if(d>20&&(k>>2)<(d-f)){ j=false; } } if(j){ SimpleSlice(this,f,g,d,h); SimpleMove(this,f,g,d,i); }else{ SmartSlice(this,f,g,d,h); SmartMove(this,f,g,d,i); } var l=f; var m=2; var n=%_ArgumentsLength(); while(m=h;l--){ var m=g[l]; var n=%_CallFunction(d,m,k,a); if(n>0){ g[l+1]=m; }else{ break; } } g[l+1]=k; } }; var o=function(g,h,i){ var q=[]; var r=200+((i-h)&15); for(var j=h+1;j>1][0]; return t; } var u=function QuickSort(g,h,i){ var t=0; while(true){ if(i-h<=10){ f(g,h,i); return; } if(i-h>1000){ t=o(g,h,i); }else{ t=h+((i-h)>>1); } var w=g[h]; var z=g[i-1]; var A=g[t]; var B=%_CallFunction(d,w,z,a); if(B>0){ var m=w; w=z; z=m; } var C=%_CallFunction(d,w,A,a); if(C>=0){ var m=w; w=A; A=z; z=m; }else{ var D=%_CallFunction(d,z,A,a); if(D>0){ var m=z; z=A; A=m; } } g[h]=w; g[i-1]=A; var E=z; var G=h+1; var H=i-1; g[t]=g[G]; g[G]=E; partition:for(var j=G+1;j0){ do{ H--; if(H==j)break partition; var I=g[H]; n=%_CallFunction(d,I,E,a); }while(n>0); g[j]=g[H]; g[H]=k; if(n<0){ k=g[j]; g[j]=g[G]; g[G]=k; G++; } } } if(i-H0){ if(O[0]==-1){ var P=O[1]; for(var j=0;j=M){M=j+1;} } } }else{ for(var j=0;j=M){M=Q+1;} } } } } } return M; }; var R=function(K,h,i){ for(var N=K.__proto__;N;N=N.__proto__){ var O=%GetArrayKeys(N,i); if(O.length>0){ if(O[0]==-1){ var P=O[1]; for(var j=h;j>>0); if(L<2)return this; var X=(%_IsArray(this)); var Y; if(!X){ Y=J(this,L); } var Z=%RemoveArrayHoles(this,L); if(Z==-1){ Z=S(this); } u(this,0,Z); if(!X&&(Z+1>>0); if(!(%_ClassOf(a)==='Function')){ throw MakeTypeError('called_non_callable',[a]); } if((b==null)){ b=%GetDefaultReceiver(a)||b; }else if(!(%_IsSpecObject(b))){ b=ToObject(b); } if(%DebugCallbackSupportsStepping(a)){ for(var g=0;g>>0); if(!(%_ClassOf(a)==='Function')){ throw MakeTypeError('called_non_callable',[a]); } if((b==null)){ b=%GetDefaultReceiver(a)||b; }else if(!(%_IsSpecObject(b))){ b=ToObject(b); } if(%DebugCallbackSupportsStepping(a)){ for(var g=0;g>>0); if(!(%_ClassOf(a)==='Function')){ throw MakeTypeError('called_non_callable',[a]); } if((b==null)){ b=%GetDefaultReceiver(a)||b; }else if(!(%_IsSpecObject(b))){ b=ToObject(b); } if(%DebugCallbackSupportsStepping(a)){ for(var g=0;g>>0); if(!(%_ClassOf(a)==='Function')){ throw MakeTypeError('called_non_callable',[a]); } if((b==null)){ b=%GetDefaultReceiver(a)||b; }else if(!(%_IsSpecObject(b))){ b=ToObject(b); } var g=new $Array(); var h=new InternalArray(d); if(%DebugCallbackSupportsStepping(a)){ for(var i=0;i>>0); if(c==0)return-1; if((typeof(b)==='undefined')){ b=0; }else{ b=(%_IsSmi(%IS_VAR(b))?b:%NumberToInteger(ToNumber(b))); if(b<0){ b=c+b; if(b<0)b=0; } } var d=b; var g=c; if(UseSparseVariant(this,c,(%_IsArray(this)))){ var h=%GetArrayKeys(this,c); if(h.length==2&&h[0]<0){ var i=-(h[0]+1); var j=i+h[1]; if(d>>0); if(c==0)return-1; if(%_ArgumentsLength()<2){ b=c-1; }else{ b=(%_IsSmi(%IS_VAR(b))?b:%NumberToInteger(ToNumber(b))); if(b<0)b+=c; if(b<0)return-1; else if(b>=c)b=c-1; } var d=0; var g=b; if(UseSparseVariant(this,c,(%_IsArray(this)))){ var h=%GetArrayKeys(this,b+1); if(h.length==2&&h[0]<0){ var i=-(h[0]+1); var j=i+h[1]; if(d=0){ var m=k[l]; if(!(typeof(m)==='undefined')&&this[m]===a)return m; l--; } return-1; } } if(!(typeof(a)==='undefined')){ for(var l=g;l>=d;l--){ if(this[l]===a)return l; } return-1; } for(var l=g;l>=d;l--){ if((typeof(this[l])==='undefined')&&l in this){ return l; } } return-1; } function ArrayReduce(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.reduce"]); } var c=ToObject(this); var d=ToUint32(c.length); if(!(%_ClassOf(a)==='Function')){ throw MakeTypeError('called_non_callable',[a]); } var g=0; find_initial:if(%_ArgumentsLength()<2){ for(;g=0;g--){ b=c[g]; if(!(typeof(b)==='undefined')||g in c){ g--; break find_initial; } } throw MakeTypeError('reduce_no_initial',[]); } var h=%GetDefaultReceiver(a); if(%DebugCallbackSupportsStepping(a)){ for(;g>=0;g--){ if(g in c){ var i=c[g]; %DebugPrepareStepInIfStepping(a); b= %_CallFunction(h,b,i,g,c,a); } } }else{ for(;g>=0;g--){ if(g in c){ var i=c[g]; b= %_CallFunction(h,b,i,g,c,a); } } } return b; } function ArrayIsArray(a){ return(%_IsArray(a)); } function SetUpArray(){ %CheckIsBootstrapping(); %SetProperty($Array.prototype,"constructor",$Array,2); InstallFunctions($Array,2,$Array( "isArray",ArrayIsArray )); var a=%SpecialArrayFunctions({}); var b=function(c,d,g){ var h=d; if(a.hasOwnProperty(c)){ h=a[c]; } if(!(typeof(g)==='undefined')){ %FunctionSetLength(h,g); } return h; }; InstallFunctions($Array.prototype,2,$Array( "toString",b("toString",ArrayToString), "toLocaleString",b("toLocaleString",ArrayToLocaleString), "join",b("join",ArrayJoin), "pop",b("pop",ArrayPop), "push",b("push",ArrayPush,1), "concat",b("concat",ArrayConcat,1), "reverse",b("reverse",ArrayReverse), "shift",b("shift",ArrayShift), "unshift",b("unshift",ArrayUnshift,1), "slice",b("slice",ArraySlice,2), "splice",b("splice",ArraySplice,2), "sort",b("sort",ArraySort), "filter",b("filter",ArrayFilter,1), "forEach",b("forEach",ArrayForEach,1), "some",b("some",ArraySome,1), "every",b("every",ArrayEvery,1), "map",b("map",ArrayMap,1), "indexOf",b("indexOf",ArrayIndexOf,1), "lastIndexOf",b("lastIndexOf",ArrayLastIndexOf,1), "reduce",b("reduce",ArrayReduce,1), "reduceRight",b("reduceRight",ArrayReduceRight,1) )); %FinishArrayPrototypeSetup($Array.prototype); SetUpLockedPrototype(InternalArray,$Array(),$Array( "indexOf",b("indexOf",ArrayIndexOf), "join",b("join",ArrayJoin), "pop",b("pop",ArrayPop), "push",b("push",ArrayPush), "splice",b("splice",ArraySplice) )); } SetUpArray(); %SetCode($String,function(a){ var b=%_ArgumentsLength()==0?'':((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); if(%_IsConstructCall()){ %_SetValueOf(this,b); }else{ return b; } }); %FunctionSetPrototype($String,new $String()); function StringToString(){ if(!(typeof(this)==='string')&&!(%_ClassOf(this)==='String')){ throw new $TypeError('String.prototype.toString is not generic'); } return %_ValueOf(this); } function StringValueOf(){ if(!(typeof(this)==='string')&&!(%_ClassOf(this)==='String')){ throw new $TypeError('String.prototype.valueOf is not generic'); } return %_ValueOf(this); } function StringCharAt(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.charAt"]); } var b=%_StringCharAt(this,a); if(%_IsSmi(b)){ b=%_StringCharAt(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)),(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a)))); } return b; } function StringCharCodeAt(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.charCodeAt"]); } var b=%_StringCharCodeAt(this,a); if(!%_IsSmi(b)){ b=%_StringCharCodeAt(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)),(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a)))); } return b; } function StringConcat(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.concat"]); } var a=%_ArgumentsLength(); var b=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); if(a===1){ return b+%_Arguments(0); } var c=new InternalArray(a+1); c[0]=b; for(var d=0;d1){ c=%_Arguments(1); c=(%_IsSmi(%IS_VAR(c))?c:%NumberToInteger(ToNumber(c))); if(c<0)c=0; if(c>b.length)c=b.length; } return %StringIndexOf(b,a,c); } function StringLastIndexOf(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.lastIndexOf"]); } var b=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); var c=b.length; var a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); var d=a.length; var g=c-d; if(%_ArgumentsLength()>1){ var h=ToNumber(%_Arguments(1)); if(!(!%_IsSmi(%IS_VAR(h))&&!(h==h))){ h=(%_IsSmi(%IS_VAR(h))?h:%NumberToInteger(ToNumber(h))); if(h<0){ h=0; } if(h+d0xFF&& (typeof(b)==='string')&& %StringIndexOf(b,'$',0)<0){ return %StringReplaceOneCharWithString(c,a,b); } var h=%StringIndexOf(c,a,0); if(h<0)return c; var i=h+a.length; var j=SubString(c,0,h); if((%_ClassOf(b)==='Function')){ var k=%GetDefaultReceiver(b); j+=%_CallFunction(k,a,h,c,b); }else{ reusableMatchInfo[3]=h; reusableMatchInfo[4]=i; b=((typeof(%IS_VAR(b))==='string')?b:NonStringToString(b)); j=ExpandReplacement(b,c,reusableMatchInfo,j); } return j+SubString(c,i,c.length); } function ExpandReplacement(a,b,c,d){ var g=a.length; var h=%StringIndexOf(a,'$',0); if(h<0){ if(g>0)d+=a; return d; } if(h>0)d+=SubString(a,0,h); while(true){ var i='$'; var j=h+1; if(jj){ d+=SubString(a,j,h); } } return d; } function CaptureString(a,b,c){ var d=c<<1; var g=b[(3+(d))]; if(g<0)return; var h=b[(3+(d+1))]; return SubString(a,g,h); } var reusableReplaceArray=new InternalArray(16); function StringReplaceGlobalRegExpWithFunction(a,b,c){ var d=reusableReplaceArray; if(d){ reusableReplaceArray=null; }else{ d=new InternalArray(16); } var g=%RegExpExecMultiple(b, a, lastMatchInfo, d); b.lastIndex=0; if((g===null)){ reusableReplaceArray=d; return a; } var h=g.length; if(((lastMatchInfo)[0])==2){ var i=0; var j=new InternalArray(null,0,a); var k=%GetDefaultReceiver(c); for(var l=0;l0){ i=(m>>11)+(m&0x7ff); }else{ i=g[++l]-m; } }else{ j[0]=m; j[1]=i; lastMatchInfoOverride=j; var n= %_CallFunction(k,m,i,a,c); g[l]=((typeof(%IS_VAR(n))==='string')?n:NonStringToString(n)); i+=m.length; } } }else{ var k=%GetDefaultReceiver(c); for(var l=0;l>1; var k; var l=%GetDefaultReceiver(c); if(j==1){ var m=SubString(a,g,i); k=%_CallFunction(l,m,g,a,c); }else{ var n=new InternalArray(j+2); for(var o=0;od){ return''; } } if(h<0){ h+=d; if(h<0){ return''; } }else{ if(h>d){ h=d; } } if(h<=g){ return''; } return SubString(c,g,h); } function StringSplit(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.split"]); } var c=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); b=((typeof(b)==='undefined'))?0xffffffff:(b>>>0); if((typeof(a)==='undefined')){ return[c]; } var d=c.length; if(!(%_IsRegExp(a))){ a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); if(b===0)return[]; var g=a.length; if(g===0)return %StringToArray(c,b); var h=%StringSplit(c,a,b); return h; } if(b===0)return[]; return StringSplitOnRegExp(c,a,b,d); } function StringSplitOnRegExp(a,b,c,d){ %_Log('regexp','regexp-split,%0S,%1r',[a,b]); if(d===0){ if(DoRegExpExec(b,a,0,0)!=null){ return[]; } return[a]; } var g=0; var h=0; var i=0; var j=[]; outer_loop: while(true){ if(h===d){ j.push(SubString(a,g,d)); break; } var k=DoRegExpExec(b,a,h); if(k==null||d===(i=k[3])){ j.push(SubString(a,g,d)); break; } var l=k[4]; if(h===l&&l===g){ h++; continue; } if(g+1==i){ j.push(%_StringCharAt(a,g)); }else{ j.push(%_SubString(a,g,i)); } if(j.length===c)break; var m=((k)[0])+3; for(var n=3+2;nd){ g=d; } var h=d; if(!(typeof(b)==='undefined')){ h=(%_IsSmi(%IS_VAR(b))?b:%NumberToInteger(ToNumber(b))); if(h>d){ h=d; }else{ if(h<0)h=0; if(g>h){ var i=h; h=g; g=i; } } } return((g+1==h) ?%_StringCharAt(c,g) :%_SubString(c,g,h)); } function StringSubstr(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.substr"]); } var c=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); var d; if(b===void 0){ d=c.length; }else{ d=(%_IsSmi(%IS_VAR(b))?b:%NumberToInteger(ToNumber(b))); if(d<=0)return''; } if(a===void 0){ a=0; }else{ a=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); if(a>=c.length)return''; if(a<0){ a+=c.length; if(a<0)a=0; } } var g=a+d; if(g>c.length)g=c.length; return((a+1==g) ?%_StringCharAt(c,a) :%_SubString(c,a,g)); } function StringToLowerCase(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.toLowerCase"]); } return %StringToLowerCase(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this))); } function StringToLocaleLowerCase(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.toLocaleLowerCase"]); } return %StringToLowerCase(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this))); } function StringToUpperCase(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.toUpperCase"]); } return %StringToUpperCase(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this))); } function StringToLocaleUpperCase(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.toLocaleUpperCase"]); } return %StringToUpperCase(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this))); } function StringTrim(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.trim"]); } return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)),true,true); } function StringTrimLeft(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.trimLeft"]); } return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)),true,false); } function StringTrimRight(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.trimRight"]); } return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)),false,true); } var static_charcode_array=new InternalArray(4); function StringFromCharCode(a){ var b=%_ArgumentsLength(); if(b==1){ if(!%_IsSmi(a))a=ToNumber(a); return %_StringCharFromCode(a&0xffff); } var c=%NewString(b,true); var d; for(d=0;d0x7f)break; %_OneByteSeqStringSetChar(c,d,a); } if(d==b)return c; c=%TruncateString(c,d); var g=%NewString(b-d,false); for(var h=0;d/g,">") .replace(/"/g,""") .replace(/'/g,"'"); } function StringLink(a){ return""+this+""; } function StringAnchor(a){ return""+this+""; } function StringFontcolor(a){ return""+this+""; } function StringFontsize(a){ return""+this+""; } function StringBig(){ return""+this+""; } function StringBlink(){ return""+this+""; } function StringBold(){ return""+this+""; } function StringFixed(){ return""+this+""; } function StringItalics(){ return""+this+""; } function StringSmall(){ return""+this+""; } function StringStrike(){ return""+this+""; } function StringSub(){ return""+this+""; } function StringSup(){ return""+this+""; } function ReplaceResultBuilder(a){ if(%_ArgumentsLength()>1){ this.elements=%_Arguments(1); }else{ this.elements=new InternalArray(); } this.special_string=a; } SetUpLockedPrototype(ReplaceResultBuilder, $Array("elements","special_string"),$Array( "add",function(a){ a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); if(a.length>0)this.elements.push(a); }, "addSpecialSlice",function(a,b){ var c=b-a; if(a<0||c<=0)return; if(a<0x80000&&c<0x800){ this.elements.push((a<<11)|c); }else{ var d=this.elements; d.push(-c); d.push(a); } }, "generate",function(){ var a=this.elements; return %StringBuilderConcat(a,a.length,this.special_string); } )); function SetUpString(){ %CheckIsBootstrapping(); %SetProperty($String.prototype,"constructor",$String,2); InstallFunctions($String,2,$Array( "fromCharCode",StringFromCharCode )); InstallFunctions($String.prototype,2,$Array( "valueOf",StringValueOf, "toString",StringToString, "charAt",StringCharAt, "charCodeAt",StringCharCodeAt, "concat",StringConcat, "indexOf",StringIndexOf, "lastIndexOf",StringLastIndexOf, "localeCompare",StringLocaleCompare, "match",StringMatch, "replace",StringReplace, "search",StringSearch, "slice",StringSlice, "split",StringSplit, "substring",StringSubstring, "substr",StringSubstr, "toLowerCase",StringToLowerCase, "toLocaleLowerCase",StringToLocaleLowerCase, "toUpperCase",StringToUpperCase, "toLocaleUpperCase",StringToLocaleUpperCase, "trim",StringTrim, "trimLeft",StringTrimLeft, "trimRight",StringTrimRight, "link",StringLink, "anchor",StringAnchor, "fontcolor",StringFontcolor, "fontsize",StringFontsize, "big",StringBig, "blink",StringBlink, "bold",StringBold, "fixed",StringFixed, "italics",StringItalics, "small",StringSmall, "strike",StringStrike, "sub",StringSub, "sup",StringSup )); } SetUpString(); var hexCharArray=0; var hexCharCodeArray=0; function URIAddEncodedOctetToBuffer(a,b,c){ b[c++]=37; b[c++]=hexCharCodeArray[a>>4]; b[c++]=hexCharCodeArray[a&0x0F]; return c; } function URIEncodeOctets(a,b,c){ if(hexCharCodeArray===0){ hexCharCodeArray=[48,49,50,51,52,53,54,55,56,57, 65,66,67,68,69,70]; } c=URIAddEncodedOctetToBuffer(a[0],b,c); if(a[1])c=URIAddEncodedOctetToBuffer(a[1],b,c); if(a[2])c=URIAddEncodedOctetToBuffer(a[2],b,c); if(a[3])c=URIAddEncodedOctetToBuffer(a[3],b,c); return c; } function URIEncodeSingle(a,b,c){ var d=(a>>12)&0xF; var g=(a>>6)&63; var h=a&63; var i=new $Array(3); if(a<=0x007F){ i[0]=a; }else if(a<=0x07FF){ i[0]=g+192; i[1]=h+128; }else{ i[0]=d+224; i[1]=g+128; i[2]=h+128; } return URIEncodeOctets(i,b,c); } function URIEncodePair(a,b,c,d){ var g=((a>>6)&0xF)+1; var h=(a>>2)&0xF; var i=a&3; var j=(b>>6)&0xF; var k=b&63; var l=new $Array(4); l[0]=(g>>2)+240; l[1]=(((g&3)<<4)|h)+128; l[2]=((i<<4)|j)+128; l[3]=k+128; return URIEncodeOctets(l,c,d); } function URIHexCharsToCharCode(a,b){ var c=HexValueOf(a); var d=HexValueOf(b); if(c==-1||d==-1){ throw new $URIError("URI malformed"); } return(c<<4)|d; } function URIDecodeOctets(a,b,c){ var d; var g=a[0]; if(g<0x80){ d=g; }else if(g<0xc2){ throw new $URIError("URI malformed"); }else{ var h=a[1]; if(g<0xe0){ var i=g&0x1f; if((h<0x80)||(h>0xbf)){ throw new $URIError("URI malformed"); } var j=h&0x3f; d=(i<<6)+j; if(d<0x80||d>0x7ff){ throw new $URIError("URI malformed"); } }else{ var k=a[2]; if(g<0xf0){ var i=g&0x0f; if((h<0x80)||(h>0xbf)){ throw new $URIError("URI malformed"); } var j=h&0x3f; if((k<0x80)||(k>0xbf)){ throw new $URIError("URI malformed"); } var l=k&0x3f; d=(i<<12)+(j<<6)+l; if((d<0x800)||(d>0xffff)){ throw new $URIError("URI malformed"); } }else{ var m=a[3]; if(g<0xf8){ var i=(g&0x07); if((h<0x80)||(h>0xbf)){ throw new $URIError("URI malformed"); } var j=(h&0x3f); if((k<0x80)||(k>0xbf)){ throw new $URIError("URI malformed"); } var l=(k&0x3f); if((m<0x80)||(m>0xbf)){ throw new $URIError("URI malformed"); } var o=(m&0x3f); d=(i<<18)+(j<<12)+(l<<6)+o; if((d<0x10000)||(d>0x10ffff)){ throw new $URIError("URI malformed"); } }else{ throw new $URIError("URI malformed"); } } } } if(0xD800<=d&&d<=0xDFFF){ throw new $URIError("URI malformed"); } if(d<0x10000){ %_TwoByteSeqStringSetChar(b,c++,d); return c; }else{ %_TwoByteSeqStringSetChar(b,c++,(d>>10)+0xd7c0); %_TwoByteSeqStringSetChar(b,c++,(d&0x3ff)+0xdc00); return c; } } function Encode(a,b){ var c=a.length; var d=new InternalArray(c); var g=0; for(var h=0;h=0xDC00&&i<=0xDFFF)throw new $URIError("URI malformed"); if(i<0xD800||i>0xDBFF){ g=URIEncodeSingle(i,d,g); }else{ h++; if(h==c)throw new $URIError("URI malformed"); var j=a.charCodeAt(h); if(j<0xDC00||j>0xDFFF)throw new $URIError("URI malformed"); g=URIEncodePair(i,j,d,g); } } } var k=%NewString(d.length,true); for(var l=0;l=c)throw new $URIError("URI malformed"); var j=URIHexCharsToCharCode(a.charCodeAt(h+1),a.charCodeAt(h+2)); if(j>>7)break; if(b(j)){ %_OneByteSeqStringSetChar(d,g++,37); %_OneByteSeqStringSetChar(d,g++,a.charCodeAt(h+1)); %_OneByteSeqStringSetChar(d,g++,a.charCodeAt(h+2)); }else{ %_OneByteSeqStringSetChar(d,g++,j); } h+=2; }else{ if(i>0x7f)break; %_OneByteSeqStringSetChar(d,g++,i); } } d=%TruncateString(d,g); if(h==c)return d; var k=%NewString(c-h,false); g=0; for(;h=c)throw new $URIError("URI malformed"); var j=URIHexCharsToCharCode(a.charCodeAt(++h),a.charCodeAt(++h)); if(j>>7){ var l=0; while(((j<<++l)&0x80)!=0){} if(l==1||l>4)throw new $URIError("URI malformed"); var m=new $Array(l); m[0]=j; if(h+3*(l-1)>=c)throw new $URIError("URI malformed"); for(var o=1;o=48&&a<=57)return a-48; if(a>=65&&a<=70)return a-55; if(a>=97&&a<=102)return a-87; return-1; } function CharCodeToHex4Str(a){ var b=""; if(hexCharArray===0){ hexCharArray=["0","1","2","3","4","5","6","7","8","9", "A","B","C","D","E","F"]; } for(var c=0;c<4;++c){ var d=hexCharArray[a&0x0F]; b=d+b; a=a>>>4; } return b; } function IsValidHex(a){ for(var b=0;b=0?a:-a; if(!(typeof(a)==='number'))a=NonNumberToNumber(a); if(a===0)return 0; return a>0?a:-a; } function MathAcos(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %Math_acos(a); } function MathAsin(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %Math_asin(a); } function MathAtan(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %Math_atan(a); } function MathAtan2(a,b){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); if(!(typeof(b)==='number'))b=NonNumberToNumber(b); return %Math_atan2(a,b); } function MathCeil(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %Math_ceil(a); } function MathCos(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %_MathCos(a); } function MathExp(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %Math_exp(a); } function MathFloor(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); if(a<0x80000000&&a>0){ return(a>>>0); }else{ return %Math_floor(a); } } function MathLog(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %_MathLog(a); } function MathMax(a,b){ var c=%_ArgumentsLength(); if(c==2){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); if(!(typeof(b)==='number'))b=NonNumberToNumber(b); if(b>a)return b; if(a>b)return a; if(a==b){ return(a==0&&!%_IsSmi(a)&&1/a<0)?b:a; } return 0/0; } var d=-1/0; for(var g=0;gd|| (d==0&&h==0&&!%_IsSmi(d)&&1/d<0)){ d=h; } } return d; } function MathMin(a,b){ var c=%_ArgumentsLength(); if(c==2){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); if(!(typeof(b)==='number'))b=NonNumberToNumber(b); if(b>a)return a; if(a>b)return b; if(a==b){ return(a==0&&!%_IsSmi(a)&&1/a<0)?a:b; } return 0/0; } var d=1/0; for(var g=0;g>>0; if(d<4){ try{ h=NoSideEffectToString(b[d]); }catch(e){ if(%IsJSModule(b[d])) h="module"; else if((%_IsSpecObject(b[d]))) h="object"; else h="#"; } } } c+=h; } return c; } function NoSideEffectToString(a){ if((typeof(a)==='string'))return a; if((typeof(a)==='number'))return %_NumberToString(a); if((typeof(a)==='boolean'))return x?'true':'false'; if((typeof(a)==='undefined'))return'undefined'; if((a===null))return'null'; if((%_IsFunction(a)))return %_CallFunction(a,FunctionToString); if((%_IsObject(a))&&%GetDataProperty(a,"toString")===ObjectToString){ var b=%GetDataProperty(a,"constructor"); if(typeof b=="function"){ var c=b.name; if((typeof(c)==='string')&&c!==""){ return"#<"+c+">"; } } } if(IsNativeErrorObject(a))return %_CallFunction(a,ErrorToString); return %_CallFunction(a,ObjectToString); } function IsNativeErrorObject(a){ switch(%_ClassOf(a)){ case'Error': case'EvalError': case'RangeError': case'ReferenceError': case'SyntaxError': case'TypeError': case'URIError': return true; } return false; } function ToStringCheckErrorObject(a){ if(IsNativeErrorObject(a)){ return %_CallFunction(a,ErrorToString); }else{ return ToString(a); } } function ToDetailString(a){ if(a!=null&&(%_IsObject(a))&&a.toString===ObjectToString){ var b=a.constructor; if(typeof b=="function"){ var c=b.name; if((typeof(c)==='string')&&c!==""){ return"#<"+c+">"; } } } return ToStringCheckErrorObject(a); } function MakeGenericError(a,b,c){ if((typeof(c)==='undefined'))c=[]; return new a(FormatMessage(b,c)); } %FunctionSetInstanceClassName(Script,'Script'); %SetProperty(Script.prototype,'constructor',Script, 2|4|1); %SetCode(Script,function(a){ throw new $Error("Not supported"); }); function FormatMessage(a,b){ var c=kMessages[a]; if(!c)return""; return FormatString(c,b); } function GetLineNumber(a){ var b=%MessageGetStartPosition(a); if(b==-1)return 0; var c=%MessageGetScript(a); var d=c.locationFromPosition(b,true); if(d==null)return 0; return d.line+1; } function GetSourceLine(a){ var b=%MessageGetScript(a); var c=%MessageGetStartPosition(a); var d=b.locationFromPosition(c,true); if(d==null)return""; d.restrict(); return d.sourceText(); } function MakeTypeError(a,b){ return MakeGenericError($TypeError,a,b); } function MakeRangeError(a,b){ return MakeGenericError($RangeError,a,b); } function MakeSyntaxError(a,b){ return MakeGenericError($SyntaxError,a,b); } function MakeReferenceError(a,b){ return MakeGenericError($ReferenceError,a,b); } function MakeEvalError(a,b){ return MakeGenericError($EvalError,a,b); } function MakeError(a,b){ return MakeGenericError($Error,a,b); } function ScriptLineFromPosition(a){ var b=0; var c=this.lineCount()-1; var d=this.line_ends; if(a>d[c]){ return-1; } if(a<=d[0]){ return 0; } while(c>=1){ var g=(b+c)>>1; if(a>d[g]){ b=g+1; }else if(a<=d[g-1]){ c=g-1; }else{ return g; } } return-1; } function ScriptLocationFromPosition(position, include_resource_offset){ var a=this.lineFromPosition(position); if(a==-1)return null; var b=this.line_ends; var c=a==0?0:b[a-1]+1; var d=b[a]; if(d>0&&%_CallFunction(this.source,d-1,StringCharAt)=='\r'){ d--; } var g=position-c; if(include_resource_offset){ a+=this.line_offset; if(a==this.line_offset){ g+=this.column_offset; } } return new SourceLocation(this,position,a,g,c,d); } function ScriptLocationFromLine(a,b,c){ var d=0; if(!(typeof(a)==='undefined')){ d=a-this.line_offset; } var g=b||0; if(d==0){ g-=this.column_offset; } var h=c||0; if(d<0||g<0||h<0)return null; if(d==0){ return this.locationFromPosition(h+g,false); }else{ var i=this.lineFromPosition(h); if(i==-1||i+d>=this.lineCount()){ return null; } return this.locationFromPosition( this.line_ends[i+d-1]+1+g); } } function ScriptSourceSlice(a,b){ var c=(typeof(a)==='undefined')?this.line_offset :a; var d=(typeof(b)==='undefined')?this.line_offset+this.lineCount() :b; c-=this.line_offset; d-=this.line_offset; if(c<0)c=0; if(d>this.lineCount())d=this.lineCount(); if(c>=this.lineCount()|| d<0|| c>d){ return null; } var g=this.line_ends; var h=c==0?0:g[c-1]+1; var i=d==0?0:g[d-1]+1; return new SourceSlice(this, c+this.line_offset, d+this.line_offset, h,i); } function ScriptSourceLine(a){ var b=0; if(!(typeof(a)==='undefined')){ b=a-this.line_offset; } if(b<0||this.lineCount()<=b){ return null; } var c=this.line_ends; var d=b==0?0:c[b-1]+1; var g=c[b]; return %_CallFunction(this.source,d,g,StringSubstring); } function ScriptLineCount(){ return this.line_ends.length; } function ScriptNameOrSourceURL(){ if(this.line_offset>0||this.column_offset>0){ return this.name; } if(this.hasCachedNameOrSourceURL){ return this.cachedNameOrSourceURL; } this.hasCachedNameOrSourceURL=true; var a=ToString(this.source); var b=%StringIndexOf(a,"sourceURL=",0); this.cachedNameOrSourceURL=this.name; if(b>4){ var c= /\/\/@[\040\t]sourceURL=[\040\t]*([^\s\'\"]*)[\040\t]*$/gm; var d=new InternalArray((3+(3))+1); var g= %_RegExpExec(c,a,b-4,d); if(g){ this.cachedNameOrSourceURL= SubString(a,d[(3+(2))],d[(3+(3))]); } } return this.cachedNameOrSourceURL; } SetUpLockedPrototype(Script, $Array("source","name","line_ends","line_offset","column_offset", "cachedNameOrSourceURL","hasCachedNameOrSourceURL"), $Array( "lineFromPosition",ScriptLineFromPosition, "locationFromPosition",ScriptLocationFromPosition, "locationFromLine",ScriptLocationFromLine, "sourceSlice",ScriptSourceSlice, "sourceLine",ScriptSourceLine, "lineCount",ScriptLineCount, "nameOrSourceURL",ScriptNameOrSourceURL ) ); function SourceLocation(a,b,c,d,g,h){ this.script=a; this.position=b; this.line=c; this.column=d; this.start=g; this.end=h; } var kLineLengthLimit=78; function SourceLocationRestrict(a,b){ var c; var d; if(!(typeof(a)==='undefined')){ c=a; }else{ c=kLineLengthLimit; } if(!(typeof(b)==='undefined')){ d=b; }else{ if(c<=20){ d=$floor(c/2); }else{ d=c-10; } } if(d>=c){ d=c-1; } if(this.end-this.start>c){ var g=this.position-d; var h=this.position+c-d; if(this.start"); } }else if(j){ g+="new "+(h||""); }else if(h){ g+=h; }else{ g+=b; i=false; } if(i){ g+=" ("+b+")"; } return g; } SetUpLockedPrototype(CallSite,$Array("receiver","fun","pos"),$Array( "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(a){ var b=a.nameOrSourceURL(); if(b){ return b; } var c="eval at "; if(a.eval_from_function_name){ c+=a.eval_from_function_name; }else{ c+=""; } var d=a.eval_from_script; if(d){ if(d.compilation_type==1){ c+=" ("+FormatEvalOrigin(d)+")"; }else{ if(d.name){ c+=" ("+d.name; var g=d.locationFromPosition( a.eval_from_script_position,true); if(g){ c+=":"+(g.line+1); c+=":"+(g.column+1); } c+=")"; }else{ c+=" (unknown source)"; } } } return c; } function FormatErrorString(a){ try{ return %_CallFunction(a,ErrorToString); }catch(e){ try{ return""; }catch(ee){ return""; } } } function GetStackFrames(a){ var b=new InternalArray(); for(var c=0;c"; }catch(ee){ h=""; } } c.push(" at "+h); } return %_CallFunction(c,"\n",ArrayJoin); } function GetTypeName(a,b){ var c=a.receiver.constructor; if(!c){ return b?null: %_CallFunction(a.receiver,ObjectToString); } var d=c.name; if(!d){ return b?null: %_CallFunction(a.receiver,ObjectToString); } return d; } var formatting_custom_stack_trace=false; function captureStackTrace(a,b){ var c=$Error.stackTraceLimit; if(!c||!(typeof(c)==='number'))return; if(c<0||c>10000){ c=10000; } var d=%CollectStackTrace(a, b?b:captureStackTrace, c); if((%_IsFunction($Error.prepareStackTrace))&&!formatting_custom_stack_trace){ var g=[]; %MoveArrayContents(GetStackFrames(d),g); formatting_custom_stack_trace=true; try{ a.stack=$Error.prepareStackTrace(a,g); }catch(e){ throw e; }finally{ formatting_custom_stack_trace=false; } return; } var h=FormatErrorString(a); var i=function(){ if((typeof(d)==='string'))return d; d=FormatStackTrace(h,GetStackFrames(d)); h=void 0; return d; }; %MarkOneShotGetter(i); var j=function(k){ %DefineOrRedefineDataProperty(this,'stack',k,0); }; %DefineOrRedefineAccessorProperty(a,'stack',i,j,2); } function SetUpError(){ var a=function(b){ var c=b.name; %SetProperty(global,c,b,2); %SetProperty(builtins,'$'+c,b,2|4|1); if(c=='Error'){ var d=function(){}; %FunctionSetPrototype(d,$Object.prototype); %FunctionSetInstanceClassName(d,'Error'); %FunctionSetPrototype(b,new d()); }else{ %FunctionSetPrototype(b,new $Error()); } %FunctionSetInstanceClassName(b,'Error'); %SetProperty(b.prototype,'constructor',b,2); %SetProperty(b.prototype,"name",c,2); %SetCode(b,function(g){ if(%_IsConstructCall()){ %IgnoreAttributesAndSetProperty(this,'stack',void 0,2); if(!(typeof(g)==='undefined')){ %IgnoreAttributesAndSetProperty( this,'message',ToString(g),2); } captureStackTrace(this,b); }else{ return new b(g); } }); %SetNativeFlag(b); }; a(function Error(){}); a(function TypeError(){}); a(function RangeError(){}); a(function SyntaxError(){}); a(function ReferenceError(){}); a(function EvalError(){}); a(function URIError(){}); } SetUpError(); $Error.captureStackTrace=captureStackTrace; %SetProperty($Error.prototype,'message','',2); var visited_errors=new InternalArray(); var cyclic_error_marker=new $Object(); function GetPropertyWithoutInvokingMonkeyGetters(a,b){ while(a&&!%HasLocalProperty(a,b)){ a=a.__proto__; } if(a===null)return void 0; if(!(%_IsObject(a)))return a[b]; var c=%GetOwnProperty(a,b); if(c&&c[0]){ var d=b==="name"; if(a===$ReferenceError.prototype) return d?"ReferenceError":void 0; if(a===$SyntaxError.prototype) return d?"SyntaxError":void 0; if(a===$TypeError.prototype) return d?"TypeError":void 0; } return a[b]; } function ErrorToStringDetectCycle(a){ if(!%PushIfAbsent(visited_errors,a))throw cyclic_error_marker; try{ var b=GetPropertyWithoutInvokingMonkeyGetters(a,"name"); b=(typeof(b)==='undefined')?"Error":((typeof(%IS_VAR(b))==='string')?b:NonStringToString(b)); var c=GetPropertyWithoutInvokingMonkeyGetters(a,"message"); c=(typeof(c)==='undefined')?"":((typeof(%IS_VAR(c))==='string')?c:NonStringToString(c)); if(b==="")return c; if(c==="")return b; return b+": "+c; }finally{ visited_errors.length=visited_errors.length-1; } } function ErrorToString(){ if(!(%_IsSpecObject(this))){ throw MakeTypeError("called_on_non_object",["Error.prototype.toString"]); } try{ return ErrorToStringDetectCycle(this); }catch(e){ if(e===cyclic_error_marker){ return''; } throw e; } } InstallFunctions($Error.prototype,2,['toString',ErrorToString]); function SetUpStackOverflowBoilerplate(){ var a=MakeRangeError('stack_overflow',[]); var b=a.name+": "+a.message; function getter(){ var c=this; while(!(%_ClassOf(c)==='Error')){ c=%GetPrototype(c); if(c==null)return MakeSyntaxError('illegal_access',[]); } var d=%GetOverflowedStackTrace(c); if((typeof(d)==='string'))return d; if((%_IsArray(d))){ var g=FormatStackTrace(b,GetStackFrames(d)); %SetOverflowedStackTrace(c,g); return g; } return void 0; } %MarkOneShotGetter(getter); function setter(h){ %DefineOrRedefineDataProperty(this,'stack',h,0); %SetOverflowedStackTrace(this,void 0); } %DefineOrRedefineAccessorProperty( a,'stack',getter,setter,2); return a; } var kStackOverflowBoilerplate=SetUpStackOverflowBoilerplate(); function CreateDate(a){ var b=new $Date(); b.setTime(a); return b; } var kApiFunctionCache={}; var functionCache=kApiFunctionCache; function Instantiate(a,b){ if(!%IsTemplate(a))return a; var c=%GetTemplateField(a,0); switch(c){ case 0: return InstantiateFunction(a,b); case 1: var d=%GetTemplateField(a,2); var g=typeof d==='undefined'? {}:new(Instantiate(d))(); ConfigureTemplateInstance(g,a); g=%ToFastProperties(g); return g; default: throw'Unknown API tag <'+c+'>'; } } function InstantiateFunction(a,b){ var c=kApiFunctionCache; var d=%GetTemplateField(a,2); var g= (d in c)&&(c[d]!=-1); if(!g){ try{ c[d]=null; var h=%CreateApiFunction(a); if(b)%FunctionSetName(h,b); c[d]=h; var i=%GetTemplateField(a,5); var j=%GetTemplateField(a,14); h.prototype=typeof i==='undefined'? {}:Instantiate(i); if(j&(1<<3)){ %FunctionSetReadOnlyPrototype(h); } %SetProperty(h.prototype,"constructor",h,2); var k=%GetTemplateField(a,6); if(!(typeof k==='undefined')){ var l=Instantiate(k); h.prototype.__proto__=l.prototype; } ConfigureTemplateInstance(h,a); }catch(e){ c[d]=-1; throw e; } } return c[d]; } function ConfigureTemplateInstance(a,b){ var c=%GetTemplateField(b,1); if(c){ var d=%DisableAccessChecks(a); try{ for(var g=0;g0){ this.ignoreCount_--; return false; } return true; }; function IsBreakPointTriggered(a,b){ return b.isTriggered(MakeExecutionState(a)); } function ScriptBreakPoint(type,script_id_or_name,opt_line,opt_column, opt_groupId){ this.type_=type; if(type==Debug.ScriptBreakPointType.ScriptId){ this.script_id_=script_id_or_name; }else if(type==Debug.ScriptBreakPointType.ScriptName){ this.script_name_=script_id_or_name; }else if(type==Debug.ScriptBreakPointType.ScriptRegExp){ this.script_regexp_object_=new RegExp(script_id_or_name); }else{ throw new Error("Unexpected breakpoint type "+type); } this.line_=opt_line||0; this.column_=opt_column; this.groupId_=opt_groupId; this.hit_count_=0; this.active_=true; this.condition_=null; this.ignoreCount_=0; this.break_points_=[]; } ScriptBreakPoint.prototype.cloneForOtherScript=function(a){ var b=new ScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, a.id,this.line_,this.column_,this.groupId_); b.number_=next_break_point_number++; script_break_points.push(b); b.hit_count_=this.hit_count_; b.active_=this.active_; b.condition_=this.condition_; b.ignoreCount_=this.ignoreCount_; return b; }; ScriptBreakPoint.prototype.number=function(){ return this.number_; }; ScriptBreakPoint.prototype.groupId=function(){ return this.groupId_; }; ScriptBreakPoint.prototype.type=function(){ return this.type_; }; ScriptBreakPoint.prototype.script_id=function(){ return this.script_id_; }; ScriptBreakPoint.prototype.script_name=function(){ return this.script_name_; }; ScriptBreakPoint.prototype.script_regexp_object=function(){ return this.script_regexp_object_; }; ScriptBreakPoint.prototype.line=function(){ return this.line_; }; ScriptBreakPoint.prototype.column=function(){ return this.column_; }; ScriptBreakPoint.prototype.actual_locations=function(){ var a=[]; for(var b=0;b=this.frameCount()){ throw new Error('Illegal frame index.'); } return new FrameMirror(this.break_id,a); }; ExecutionState.prototype.setSelectedFrame=function(a){ var b=%ToNumber(a); if(b<0||b>=this.frameCount())throw new Error('Illegal frame index.'); this.selected_frame=b; }; ExecutionState.prototype.selectedFrame=function(){ return this.selected_frame; }; ExecutionState.prototype.debugCommandProcessor=function(a){ return new DebugCommandProcessor(this,a); }; function MakeBreakEvent(a,b){ return new BreakEvent(a,b); } function BreakEvent(a,b){ this.exec_state_=a; this.break_points_hit_=b; } BreakEvent.prototype.executionState=function(){ return this.exec_state_; }; BreakEvent.prototype.eventType=function(){ return Debug.DebugEvent.Break; }; BreakEvent.prototype.func=function(){ return this.exec_state_.frame(0).func(); }; BreakEvent.prototype.sourceLine=function(){ return this.exec_state_.frame(0).sourceLine(); }; BreakEvent.prototype.sourceColumn=function(){ return this.exec_state_.frame(0).sourceColumn(); }; BreakEvent.prototype.sourceLineText=function(){ return this.exec_state_.frame(0).sourceLineText(); }; BreakEvent.prototype.breakPointsHit=function(){ return this.break_points_hit_; }; BreakEvent.prototype.toJSONProtocol=function(){ var a={seq:next_response_seq++, type:"event", event:"break", body:{invocationText:this.exec_state_.frame(0).invocationText(), } }; var b=this.func().script(); if(b){ a.body.sourceLine=this.sourceLine(), a.body.sourceColumn=this.sourceColumn(), a.body.sourceLineText=this.sourceLineText(), a.body.script=MakeScriptObject_(b,false); } if(this.breakPointsHit()){ a.body.breakpoints=[]; for(var c=0;c0){ a.body.sourceLine=this.sourceLine(); a.body.sourceColumn=this.sourceColumn(); a.body.sourceLineText=this.sourceLineText(); var b=this.func().script(); if(b){ a.body.script=MakeScriptObject_(b,false); } }else{ a.body.sourceLine=-1; } return a.toJSONProtocol(); }; function MakeCompileEvent(a,b,c){ return new CompileEvent(a,b,c); } function CompileEvent(a,b,c){ this.exec_state_=a; this.script_=MakeMirror(b); this.before_=c; } CompileEvent.prototype.executionState=function(){ return this.exec_state_; }; CompileEvent.prototype.eventType=function(){ if(this.before_){ return Debug.DebugEvent.BeforeCompile; }else{ return Debug.DebugEvent.AfterCompile; } }; CompileEvent.prototype.script=function(){ return this.script_; }; CompileEvent.prototype.toJSONProtocol=function(){ var a=new ProtocolMessage(); a.running=true; if(this.before_){ a.event="beforeCompile"; }else{ a.event="afterCompile"; } a.body={}; a.body.script=this.script_; return a.toJSONProtocol(); }; function MakeNewFunctionEvent(a){ return new NewFunctionEvent(a); } function NewFunctionEvent(a){ this.func=a; } NewFunctionEvent.prototype.eventType=function(){ return Debug.DebugEvent.NewFunction; }; NewFunctionEvent.prototype.name=function(){ return this.func.name; }; NewFunctionEvent.prototype.setBreakPoint=function(a){ Debug.setBreakPoint(this.func,a||0); }; function MakeScriptCollectedEvent(a,b){ return new ScriptCollectedEvent(a,b); } function ScriptCollectedEvent(a,b){ this.exec_state_=a; this.id_=b; } ScriptCollectedEvent.prototype.id=function(){ return this.id_; }; ScriptCollectedEvent.prototype.executionState=function(){ return this.exec_state_; }; ScriptCollectedEvent.prototype.toJSONProtocol=function(){ var a=new ProtocolMessage(); a.running=true; a.event="scriptCollected"; a.body={}; a.body.script={id:this.id()}; return a.toJSONProtocol(); }; function MakeScriptObject_(a,b){ var c={id:a.id(), name:a.name(), lineOffset:a.lineOffset(), columnOffset:a.columnOffset(), lineCount:a.lineCount(), }; if(!(typeof(a.data())==='undefined')){ c.data=a.data(); } if(b){ c.source=a.source(); } return c; } function DebugCommandProcessor(a,b){ this.exec_state_=a; this.running_=b||false; } DebugCommandProcessor.prototype.processDebugRequest=function(a){ return this.processDebugJSONRequest(a); }; function ProtocolMessage(a){ this.seq=next_response_seq++; if(a){ this.type='response'; this.request_seq=a.seq; this.command=a.command; }else{ this.type='event'; } this.success=true; this.running=undefined; } ProtocolMessage.prototype.setOption=function(a,b){ if(!this.options_){ this.options_={}; } this.options_[a]=b; }; ProtocolMessage.prototype.failed=function(a,b){ this.success=false; this.message=a; if((%_IsObject(b))){ this.error_details=b; } }; ProtocolMessage.prototype.toJSONProtocol=function(){ var a={}; a.seq=this.seq; if(this.request_seq){ a.request_seq=this.request_seq; } a.type=this.type; if(this.event){ a.event=this.event; } if(this.command){ a.command=this.command; } if(this.success){ a.success=this.success; }else{ a.success=false; } if(this.body){ var b; var c=MakeMirrorSerializer(true,this.options_); if(this.body instanceof Mirror){ b=c.serializeValue(this.body); }else if(this.body instanceof Array){ b=[]; for(var d=0;d=this.exec_state_.frameCount()){ return b.failed('Invalid frame "'+d+'"'); } b.body=this.exec_state_.frame(o).evaluate( c,Boolean(h),j); return; }else{ b.body=this.exec_state_.frame().evaluate( c,Boolean(h),j); return; } }; DebugCommandProcessor.prototype.lookupRequest_=function(a,b){ if(!a.arguments){ return b.failed('Missing arguments'); } var c=a.arguments.handles; if((typeof(c)==='undefined')){ return b.failed('Argument "handles" missing'); } if(!(typeof(a.arguments.includeSource)==='undefined')){ includeSource=%ToBoolean(a.arguments.includeSource); b.setOption('includeSource',includeSource); } var d={}; for(var g=0;g=this.exec_state_.frameCount()){ return b.failed('Invalid frame "'+g+'"'); } g=this.exec_state_.frame(h); } } var i=g.func().script(); if(!i){ return b.failed('No source'); } var j=i.sourceSlice(c,d); if(!j){ return b.failed('Invalid line interval'); } b.body={}; b.body.source=j.sourceText(); b.body.fromLine=j.from_line; b.body.toLine=j.to_line; b.body.fromPosition=j.from_position; b.body.toPosition=j.to_position; b.body.totalLines=i.lineCount(); }; DebugCommandProcessor.prototype.scriptsRequest_=function(a,b){ var c=ScriptTypeFlag(Debug.ScriptType.Normal); var d=false; var g=null; if(a.arguments){ if(!(typeof(a.arguments.types)==='undefined')){ c=%ToNumber(a.arguments.types); if(isNaN(c)||c<0){ return b.failed('Invalid types "'+ a.arguments.types+'"'); } } if(!(typeof(a.arguments.includeSource)==='undefined')){ d=%ToBoolean(a.arguments.includeSource); b.setOption('includeSource',d); } if((%_IsArray(a.arguments.ids))){ g={}; var h=a.arguments.ids; for(var i=0;i=0){ q=true; } } if(!q)continue; } if(c&ScriptTypeFlag(m[i].type)){ b.body.push(MakeMirror(m[i])); } } }; DebugCommandProcessor.prototype.threadsRequest_=function(a,b){ var c=this.exec_state_.threadCount(); var d=[]; for(var g=0;g=this.exec_state_.frameCount()){ return response.failed('Invalid frame "'+a+'"'); } b=this.exec_state_.frame(c); }else{ b=this.exec_state_.frame(); } var d=Debug.LiveEdit.RestartFrame(b); response.body={result:d}; }; DebugCommandProcessor.prototype.debuggerFlagsRequest_=function(request, response){ if(!request.arguments){ response.failed('Missing arguments'); return; } var a=request.arguments.flags; response.body={flags:[]}; if(!(typeof(a)==='undefined')){ for(var b=0;b>>4; } return b; } function ObjectToProtocolObject_(a,b){ var c={}; for(var d in a){ if(typeof d=='string'){ var g=ValueToProtocolValue_(a[d], b); if(!(typeof(g)==='undefined')){ c[d]=g; } } } return c; } function ArrayToProtocolArray_(a,b){ var c=[]; for(var d=0;d"; }; function ValueMirror(a,b,c){ %_CallFunction(this,a,Mirror); this.value_=b; if(!c){ this.allocateHandle_(); }else{ this.allocateTransientHandle_(); } } inherits(ValueMirror,Mirror); Mirror.prototype.handle=function(){ return this.handle_; }; ValueMirror.prototype.isPrimitive=function(){ var a=this.type(); return a==='undefined'|| a==='null'|| a==='boolean'|| a==='number'|| a==='string'; }; ValueMirror.prototype.value=function(){ return this.value_; }; function UndefinedMirror(){ %_CallFunction(this,UNDEFINED_TYPE,void 0,ValueMirror); } inherits(UndefinedMirror,ValueMirror); UndefinedMirror.prototype.toText=function(){ return'undefined'; }; function NullMirror(){ %_CallFunction(this,NULL_TYPE,null,ValueMirror); } inherits(NullMirror,ValueMirror); NullMirror.prototype.toText=function(){ return'null'; }; function BooleanMirror(a){ %_CallFunction(this,BOOLEAN_TYPE,a,ValueMirror); } inherits(BooleanMirror,ValueMirror); BooleanMirror.prototype.toText=function(){ return this.value_?'true':'false'; }; function NumberMirror(a){ %_CallFunction(this,NUMBER_TYPE,a,ValueMirror); } inherits(NumberMirror,ValueMirror); NumberMirror.prototype.toText=function(){ return %NumberToString(this.value_); }; function StringMirror(a){ %_CallFunction(this,STRING_TYPE,a,ValueMirror); } inherits(StringMirror,ValueMirror); StringMirror.prototype.length=function(){ return this.value_.length; }; StringMirror.prototype.getTruncatedValue=function(a){ if(a!=-1&&this.length()>a){ return this.value_.substring(0,a)+ '... (length: '+this.length()+')'; } return this.value_; }; StringMirror.prototype.toText=function(){ return this.getTruncatedValue(kMaxProtocolStringLength); }; function ObjectMirror(a,b,c){ %_CallFunction(this,b||OBJECT_TYPE,a,c,ValueMirror); } inherits(ObjectMirror,ValueMirror); ObjectMirror.prototype.className=function(){ return %_ClassOf(this.value_); }; ObjectMirror.prototype.constructorFunction=function(){ return MakeMirror(%DebugGetProperty(this.value_,'constructor')); }; ObjectMirror.prototype.prototypeObject=function(){ return MakeMirror(%DebugGetProperty(this.value_,'prototype')); }; ObjectMirror.prototype.protoObject=function(){ return MakeMirror(%DebugGetPrototype(this.value_)); }; ObjectMirror.prototype.hasNamedInterceptor=function(){ var a=%GetInterceptorInfo(this.value_); return(a&2)!=0; }; ObjectMirror.prototype.hasIndexedInterceptor=function(){ var a=%GetInterceptorInfo(this.value_); return(a&1)!=0; }; ObjectMirror.prototype.propertyNames=function(a,b){ a=a||PropertyKind.Named|PropertyKind.Indexed; var c; var d; var g=0; if(a&PropertyKind.Named){ c=%GetLocalPropertyNames(this.value_); g+=c.length; if(this.hasNamedInterceptor()&&(a&PropertyKind.Named)){ var h= %GetNamedInterceptorPropertyNames(this.value_); if(h){ c=c.concat(h); g+=h.length; } } } if(a&PropertyKind.Indexed){ d=%GetLocalElementNames(this.value_); g+=d.length; if(this.hasIndexedInterceptor()&&(a&PropertyKind.Indexed)){ var i= %GetIndexedInterceptorElementNames(this.value_); if(i){ d=d.concat(i); g+=i.length; } } } b=Math.min(b||g,g); var j=new Array(b); var k=0; if(a&PropertyKind.Named){ for(var l=0;k'; }; ObjectMirror.GetInternalProperties=function(a){ if((%_ClassOf(a)==='String')||(%_ClassOf(a)==='Number')|| (%_ClassOf(a)==='Boolean')){ var b=%_ValueOf(a); return[new InternalPropertyMirror("[[PrimitiveValue]]",b)]; }else if((%_IsFunction(a))){ var c=%BoundFunctionGetBindings(a); var d=[]; if(c&&(%_IsArray(c))){ d.push(new InternalPropertyMirror("[[TargetFunction]]", c[0])); d.push(new InternalPropertyMirror("[[BoundThis]]",c[1])); var g=[]; for(var h=2;hb)return new Array(); var c=new Array(b-a+1); for(var d=a;d<=b;d++){ var g=%DebugGetPropertyDetails(this.value_,%ToString(d)); var h; if(g){ h=new PropertyMirror(this,d,g); }else{ h=GetUndefinedMirror(); } c[d-a]=h; } return c; }; function DateMirror(a){ %_CallFunction(this,a,ObjectMirror); } inherits(DateMirror,ObjectMirror); DateMirror.prototype.toText=function(){ var a=JSON.stringify(this.value_); return a.substring(1,a.length-1); }; function RegExpMirror(a){ %_CallFunction(this,a,REGEXP_TYPE,ObjectMirror); } inherits(RegExpMirror,ObjectMirror); RegExpMirror.prototype.source=function(){ return this.value_.source; }; RegExpMirror.prototype.global=function(){ return this.value_.global; }; RegExpMirror.prototype.ignoreCase=function(){ return this.value_.ignoreCase; }; RegExpMirror.prototype.multiline=function(){ return this.value_.multiline; }; RegExpMirror.prototype.toText=function(){ return"/"+this.source()+"/"; }; function ErrorMirror(a){ %_CallFunction(this,a,ERROR_TYPE,ObjectMirror); } inherits(ErrorMirror,ObjectMirror); ErrorMirror.prototype.message=function(){ return this.value_.message; }; ErrorMirror.prototype.toText=function(){ var a; try{ str=%_CallFunction(this.value_,builtins.ErrorToString); }catch(e){ str='#'; } return str; }; function PropertyMirror(a,b,c){ %_CallFunction(this,PROPERTY_TYPE,Mirror); this.mirror_=a; this.name_=b; this.value_=c[0]; this.details_=c[1]; if(c.length>2){ this.exception_=c[2]; this.getter_=c[3]; this.setter_=c[4]; } } inherits(PropertyMirror,Mirror); PropertyMirror.prototype.isReadOnly=function(){ return(this.attributes()&PropertyAttribute.ReadOnly)!=0; }; PropertyMirror.prototype.isEnum=function(){ return(this.attributes()&PropertyAttribute.DontEnum)==0; }; PropertyMirror.prototype.canDelete=function(){ return(this.attributes()&PropertyAttribute.DontDelete)==0; }; PropertyMirror.prototype.name=function(){ return this.name_; }; PropertyMirror.prototype.isIndexed=function(){ for(var a=0;a0; }; FrameDetails.prototype.inlinedFrameIndex=function(){ %CheckExecutionState(this.break_id_); var a=kFrameDetailsFlagInlinedFrameIndexMask; return(this.details_[kFrameDetailsFlagsIndex]&a)>>2; }; FrameDetails.prototype.argumentCount=function(){ %CheckExecutionState(this.break_id_); return this.details_[kFrameDetailsArgumentCountIndex]; }; FrameDetails.prototype.argumentName=function(a){ %CheckExecutionState(this.break_id_); if(a>=0&&a=0&&a=0&&a=0&&a0){ for(var c=0;c0){ a+=this.lineOffset(); a+='-'; a+=this.lineOffset()+this.lineCount()-1; }else{ a+=this.lineCount(); } a+=')'; return a; }; function ContextMirror(a){ %_CallFunction(this,CONTEXT_TYPE,Mirror); this.data_=a; this.allocateHandle_(); } inherits(ContextMirror,Mirror); ContextMirror.prototype.data=function(){ return this.data_; }; function MakeMirrorSerializer(a,b){ return new JSONProtocolSerializer(a,b); } function JSONProtocolSerializer(a,b){ this.details_=a; this.options_=b; this.mirrors_=[]; } JSONProtocolSerializer.prototype.serializeReference=function(a){ return this.serialize_(a,true,true); }; JSONProtocolSerializer.prototype.serializeValue=function(a){ var b=this.serialize_(a,false,true); return b; }; JSONProtocolSerializer.prototype.serializeReferencedObjects=function(){ var a=[]; var b=this.mirrors_.length; for(var c=0;cthis.maxStringLength_()){ var b=mirror.getTruncatedValue(this.maxStringLength_()); a.value=b; a.fromIndex=0; a.toIndex=this.maxStringLength_(); }else{ a.value=mirror.value(); } a.length=mirror.length(); break; case OBJECT_TYPE: case FUNCTION_TYPE: case ERROR_TYPE: case REGEXP_TYPE: this.serializeObject_(mirror,a,details); break; case PROPERTY_TYPE: case INTERNAL_PROPERTY_TYPE: throw new Error('PropertyMirror cannot be serialized independently'); break; case FRAME_TYPE: this.serializeFrame_(mirror,a); break; case SCOPE_TYPE: this.serializeScope_(mirror,a); break; case SCRIPT_TYPE: if(mirror.name()){ a.name=mirror.name(); } a.id=mirror.id(); a.lineOffset=mirror.lineOffset(); a.columnOffset=mirror.columnOffset(); a.lineCount=mirror.lineCount(); if(mirror.data()){ a.data=mirror.data(); } if(this.includeSource_()){ a.source=mirror.source(); }else{ var c=mirror.source().substring(0,80); a.sourceStart=c; } a.sourceLength=mirror.source().length; a.scriptType=mirror.scriptType(); a.compilationType=mirror.compilationType(); if(mirror.compilationType()==1&& mirror.evalFromScript()){ a.evalFromScript= this.serializeReference(mirror.evalFromScript()); var d=mirror.evalFromLocation(); if(d){ a.evalFromLocation={line:d.line, column:d.column}; } if(mirror.evalFromFunctionName()){ a.evalFromFunctionName=mirror.evalFromFunctionName(); } } if(mirror.context()){ a.context=this.serializeReference(mirror.context()); } break; case CONTEXT_TYPE: a.data=mirror.data(); break; } a.text=mirror.toText(); return a; }; JSONProtocolSerializer.prototype.serializeObject_=function(mirror,content, details){ content.className=mirror.className(); content.constructorFunction= this.serializeReference(mirror.constructorFunction()); content.protoObject=this.serializeReference(mirror.protoObject()); content.prototypeObject=this.serializeReference(mirror.prototypeObject()); if(mirror.hasNamedInterceptor()){ content.namedInterceptor=true; } if(mirror.hasIndexedInterceptor()){ content.indexedInterceptor=true; } if(mirror.isFunction()){ content.name=mirror.name(); if(!(typeof(mirror.inferredName())==='undefined')){ content.inferredName=mirror.inferredName(); } content.resolved=mirror.resolved(); if(mirror.resolved()){ content.source=mirror.source(); } if(mirror.script()){ content.script=this.serializeReference(mirror.script()); content.scriptId=mirror.script().id(); serializeLocationFields(mirror.sourceLocation(),content); } content.scopes=[]; for(var a=0;a0){ var j=[]; for(var a=0;a0){ return'Infinity'; }else{ return'-Infinity'; } } return a; } Debug.LiveEdit=new function(){ var a; var b="stack_update_needs_step_in"; function ApplyPatchMultiChunk(script,diff_array,new_source,preview_only, change_log){ var c=script.source; var d=GatherCompileInfo(c,script); var g=BuildCodeInfoTree(d); var h=new PosTranslator(diff_array); MarkChangedFunctions(g,h.GetChunks()); FindLiveSharedInfos(g,script); var i; try{ i=GatherCompileInfo(new_source,script); }catch(e){ var j= new Failure("Failed to compile new version of script: "+e); if(e instanceof SyntaxError){ var k={ type:"liveedit_compile_error", syntaxErrorMessage:e.message }; CopyErrorPositionToDetails(e,k); j.details=k; } throw j; } var l=BuildCodeInfoTree(i); FindCorrespondingFunctions(g,l); var m=new Array(); var o=new Array(); var q=new Array(); var r=new Array(); function HarvestTodo(t){ function CollectDamaged(u){ o.push(u); for(var w=0;wP[D].start_position){ R=D; } } if(R!=w){ var S=P[R]; var T=Q[R]; P[R]=P[w]; Q[R]=Q[w]; P[w]=S; Q[w]=T; } } var U=0; function ResetIndexes(W,X){ var Y=-1; while(U=aM.pos1+aM.len1){ return aG+aM.pos2+aM.len2-aM.pos1-aM.len1; } if(!aH){ aH=PosTranslator.DefaultInsideChunkHandler; } return aH(aG,aM); }; PosTranslator.DefaultInsideChunkHandler=function(aG,aN){ Assert(false,"Cannot translate position in changed area"); }; PosTranslator.ShiftWithTopInsideChunkHandler= function(aG,aN){ return aG-aN.pos1+aN.pos2; }; var a={ UNCHANGED:"unchanged", SOURCE_CHANGED:"source changed", CHANGED:"changed", DAMAGED:"damaged" }; function CodeInfoTreeNode(aO,aP,aQ){ this.info=aO; this.children=aP; this.array_index=aQ; this.parent=void 0; this.status=a.UNCHANGED; this.status_explanation=void 0; this.new_start_pos=void 0; this.new_end_pos=void 0; this.corresponding_node=void 0; this.unmatched_new_nodes=void 0; this.textual_corresponding_node=void 0; this.textually_unmatched_new_nodes=void 0; this.live_shared_function_infos=void 0; } function BuildCodeInfoTree(aR){ var aS=0; function BuildNode(){ var aT=aS; aS++; var aU=new Array(); while(aS=aA.length;}; this.TranslatePos=function(aG){return aG+aZ;}; }; function ProcessInternals(ba){ ba.new_start_pos=aX.TranslatePos( ba.info.start_position); var bb=0; var bc=false; var bd=false; while(!aX.done()&& aX.current().pos1= aX.current().pos1+aX.current().len1){ bc=true; aX.next(); continue; }else if(be.info.start_position<=aX.current().pos1&& be.info.end_position>=aX.current().pos1+ aX.current().len1){ ProcessInternals(be); bd=bd|| (be.status!=a.UNCHANGED); bc=bc|| (be.status==a.DAMAGED); bb++; continue; }else{ bc=true; be.status=a.DAMAGED; be.status_explanation= "Text diff overlaps with function boundary"; bb++; continue; } }else{ if(aX.current().pos1+aX.current().len1<= ba.info.end_position){ ba.status=a.CHANGED; aX.next(); continue; }else{ ba.status=a.DAMAGED; ba.status_explanation= "Text diff overlaps with function boundary"; return; } } Assert("Unreachable",false); } while(bb0){ return br; } } function TraverseTree(u){ u.live_shared_function_infos=FindFunctionInfos(u.info); for(var w=0;w0){ aa.push({dropped_from_stack:bF}); } if(bE.length>0){ aa.push({functions_on_stack:bE}); throw new Failure("Blocked by functions on stack"); } return bF.length; } var bA={ AVAILABLE_FOR_PATCH:1, BLOCKED_ON_ACTIVE_STACK:2, BLOCKED_ON_OTHER_STACK:3, BLOCKED_UNDER_NATIVE_CODE:4, REPLACED_ON_ACTIVE_STACK:5 }; bA.SymbolName=function(bI){ var bJ=bA; for(name in bJ){ if(bJ[name]==bI){ return name; } } }; function Failure(au){ this.message=au; } this.Failure=Failure; Failure.prototype.toString=function(){ return"LiveEdit Failure: "+this.message; }; function CopyErrorPositionToDetails(bK,k){ function createPositionStruct(N,bL){ if(bL==-1)return; var bM=N.locationFromPosition(bL,true); if(bM==null)return; return{ line:bM.line+1, column:bM.column+1, position:bL }; } if(!("scriptObject"in bK)||!("startPosition"in bK)){ return; } var N=bK.scriptObject; var bN={ start:createPositionStruct(N,bK.startPosition), end:createPositionStruct(N,bK.endPosition) }; k.position=bN; } function GetPcFromSourcePos(bO,bP){ return %GetFunctionCodePositionFromSource(bO,bP); } this.GetPcFromSourcePos=GetPcFromSourcePos; function SetScriptSource(N,bQ,bR,aa){ var c=N.source; var bS=CompareStrings(c,bQ); return ApplyPatchMultiChunk(N,bS,bQ,bR, aa); } this.SetScriptSource=SetScriptSource; function CompareStrings(bT,bU){ return %LiveEditCompareStrings(bT,bU); } function ApplySingleChunkPatch(N,change_pos,change_len,new_str, aa){ var c=N.source; var bQ=c.substring(0,change_pos)+ new_str+c.substring(change_pos+change_len); return ApplyPatchMultiChunk(N, [change_pos,change_pos+change_len,change_pos+new_str.length], bQ,false,aa); } function DescribeChangeTree(bf){ function ProcessOldNode(u){ var bV=[]; for(var w=0;w1000000|| b<-10000000||b>10000000){ return $NaN; } return %DateMakeDay(a|0,b|0)+c-1; } function MakeDate(a,b){ var b=a*86400000+b; if($abs(b)>8640002592000000)return $NaN; return b; } function TimeClip(a){ if(!$isFinite(a))return $NaN; if($abs(a)>8640000000000000)return $NaN; return(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); } var Date_cache={ time:$NaN, string:null }; %SetCode($Date,function(a,b,c,d,g,h,i){ if(!%_IsConstructCall()){ return(new $Date()).toString(); } var j=%_ArgumentsLength(); var k; if(j==0){ k=%DateCurrentTime(); (%DateSetValue(this,k,1)); }else if(j==1){ if((typeof(a)==='number')){ k=a; }else if((typeof(a)==='string')){ var l=Date_cache; if(l.string===a){ k=l.time; }else{ k=DateParse(a); if(!(!%_IsSmi(%IS_VAR(k))&&!(k==k))){ l.time=k; l.string=a; } } }else{ var m=ToPrimitive(a,1); k=(typeof(m)==='string')?DateParse(m):ToNumber(m); } (%DateSetValue(this,k,1)); }else{ a=ToNumber(a); b=ToNumber(b); c=j>2?ToNumber(c):1; d=j>3?ToNumber(d):0; g=j>4?ToNumber(g):0; h=j>5?ToNumber(h):0; i=j>6?ToNumber(i):0; a=(!(!%_IsSmi(%IS_VAR(a))&&!(a==a))&& 0<=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a)))&& (%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a)))<=99)?1900+(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))):a; var o=MakeDay(a,b,c); var m=MakeTime(d,g,h,i); k=MakeDate(o,m); (%DateSetValue(this,k,0)); } }); %FunctionSetPrototype($Date,new $Date($NaN)); var WeekDays=['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; var Months=['Jan','Feb','Mar','Apr','May','Jun', 'Jul','Aug','Sep','Oct','Nov','Dec']; function TwoDigitString(a){ return a<10?"0"+a:""+a; } function DateString(a){ return WeekDays[(%_DateField(a,4))]+' ' +Months[(%_DateField(a,2))]+' ' +TwoDigitString((%_DateField(a,3)))+' ' +(%_DateField(a,1)); } var LongWeekDays=['Sunday','Monday','Tuesday','Wednesday', 'Thursday','Friday','Saturday']; var LongMonths=['January','February','March','April','May','June', 'July','August','September','October','November','December']; function LongDateString(a){ return LongWeekDays[(%_DateField(a,4))]+', ' +LongMonths[(%_DateField(a,2))]+' ' +TwoDigitString((%_DateField(a,3)))+', ' +(%_DateField(a,1)); } function TimeString(a){ return TwoDigitString((%_DateField(a,5)))+':' +TwoDigitString((%_DateField(a,6)))+':' +TwoDigitString((%_DateField(a,7))); } function TimeStringUTC(a){ return TwoDigitString((%_DateField(a,15)))+':' +TwoDigitString((%_DateField(a,16)))+':' +TwoDigitString((%_DateField(a,17))); } function LocalTimezoneString(a){ var b=LocalTimezone((%_DateField(a,0))); var c=-(%_DateField(a,21)); var d=(c>=0)?1:-1; var g=$floor((d*c)/60); var h=$floor((d*c)%60); var i=' GMT'+((d==1)?'+':'-')+ TwoDigitString(g)+TwoDigitString(h); return i+' ('+b+')'; } function DatePrintString(a){ return DateString(a)+' '+TimeString(a); } var parse_buffer=$Array(8); function DateParse(a){ var b=%DateParseString(ToString(a),parse_buffer); if((b===null))return $NaN; var c=MakeDay(b[0],b[1],b[2]); var d=MakeTime(b[3],b[4],b[5],b[6]); var g=MakeDate(c,d); if((b[7]===null)){ return TimeClip(UTC(g)); }else{ return TimeClip(g-b[7]*1000); } } function DateUTC(a,b,c,d,g,h,i){ a=ToNumber(a); b=ToNumber(b); var j=%_ArgumentsLength(); c=j>2?ToNumber(c):1; d=j>3?ToNumber(d):0; g=j>4?ToNumber(g):0; h=j>5?ToNumber(h):0; i=j>6?ToNumber(i):0; a=(!(!%_IsSmi(%IS_VAR(a))&&!(a==a))&& 0<=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a)))&& (%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a)))<=99)?1900+(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))):a; var k=MakeDay(a,b,c); var l=MakeTime(d,g,h,i); return TimeClip(MakeDate(k,l)); } function DateNow(){ return %DateCurrentTime(); } function DateToString(){ var a=(%_DateField(this,0)) if((!%_IsSmi(%IS_VAR(a))&&!(a==a)))return'Invalid Date'; var b=LocalTimezoneString(this) return DatePrintString(this)+b; } function DateToDateString(){ var a=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(a))&&!(a==a)))return'Invalid Date'; return DateString(this); } function DateToTimeString(){ var a=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(a))&&!(a==a)))return'Invalid Date'; var b=LocalTimezoneString(this); return TimeString(this)+b; } function DateToLocaleString(){ return %_CallFunction(this,DateToString); } function DateToLocaleDateString(){ var a=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(a))&&!(a==a)))return'Invalid Date'; return LongDateString(this); } function DateToLocaleTimeString(){ var a=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(a))&&!(a==a)))return'Invalid Date'; return TimeString(this); } function DateValueOf(){ return(%_DateField(this,0)); } function DateGetTime(){ return(%_DateField(this,0)); } function DateGetFullYear(){ return(%_DateField(this,1)); } function DateGetUTCFullYear(){ return(%_DateField(this,11)); } function DateGetMonth(){ return(%_DateField(this,2)); } function DateGetUTCMonth(){ return(%_DateField(this,12)); } function DateGetDate(){ return(%_DateField(this,3)); } function DateGetUTCDate(){ return(%_DateField(this,13)); } function DateGetDay(){ return(%_DateField(this,4)); } function DateGetUTCDay(){ return(%_DateField(this,14)); } function DateGetHours(){ return(%_DateField(this,5)); } function DateGetUTCHours(){ return(%_DateField(this,15)); } function DateGetMinutes(){ return(%_DateField(this,6)); } function DateGetUTCMinutes(){ return(%_DateField(this,16)); } function DateGetSeconds(){ return(%_DateField(this,7)); } function DateGetUTCSeconds(){ return(%_DateField(this,17)) } function DateGetMilliseconds(){ return(%_DateField(this,8)); } function DateGetUTCMilliseconds(){ return(%_DateField(this,18)); } function DateGetTimezoneOffset(){ return(%_DateField(this,21)); } function DateSetTime(a){ if(%_ClassOf(this)!=='Date')ThrowDateTypeError(); (%DateSetValue(this,ToNumber(a),1)); return(%_DateField(this,0)); } function DateSetMilliseconds(a){ var b=(%_DateField(this,0)+%_DateField(this,21)); a=ToNumber(a); var c=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),(%_DateField(this,7)),a); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),c),0)); } function DateSetUTCMilliseconds(a){ var b=(%_DateField(this,0)); a=ToNumber(a); var c=MakeTime((%_DateField(this,15)), (%_DateField(this,16)), (%_DateField(this,17)), a); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),c),1)); } function DateSetSeconds(a,b){ var c=(%_DateField(this,0)+%_DateField(this,21)); a=ToNumber(a); b=%_ArgumentsLength()<2?(%_DateField(this,8)):ToNumber(b); var d=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),a,b); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),d),0)); } function DateSetUTCSeconds(a,b){ var c=(%_DateField(this,0)); a=ToNumber(a); b=%_ArgumentsLength()<2?(%_DateField(this,18)):ToNumber(b); var d=MakeTime((%_DateField(this,15)),(%_DateField(this,16)),a,b); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),d),1)); } function DateSetMinutes(a,b,c){ var d=(%_DateField(this,0)+%_DateField(this,21)); a=ToNumber(a); var g=%_ArgumentsLength(); b=g<2?(%_DateField(this,7)):ToNumber(b); c=g<3?(%_DateField(this,8)):ToNumber(c); var h=MakeTime((%_DateField(this,5)),a,b,c); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),h),0)); } function DateSetUTCMinutes(a,b,c){ var d=(%_DateField(this,0)); a=ToNumber(a); var g=%_ArgumentsLength(); b=g<2?(%_DateField(this,17)):ToNumber(b); c=g<3?(%_DateField(this,18)):ToNumber(c); var h=MakeTime((%_DateField(this,15)),a,b,c); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),h),1)); } function DateSetHours(a,b,c,d){ var g=(%_DateField(this,0)+%_DateField(this,21)); a=ToNumber(a); var h=%_ArgumentsLength(); b=h<2?(%_DateField(this,6)):ToNumber(b); c=h<3?(%_DateField(this,7)):ToNumber(c); d=h<4?(%_DateField(this,8)):ToNumber(d); var i=MakeTime(a,b,c,d); return(%DateSetValue(this,MakeDate((%_DateField(this,9)),i),0)); } function DateSetUTCHours(a,b,c,d){ var g=(%_DateField(this,0)); a=ToNumber(a); var h=%_ArgumentsLength(); b=h<2?(%_DateField(this,16)):ToNumber(b); c=h<3?(%_DateField(this,17)):ToNumber(c); d=h<4?(%_DateField(this,18)):ToNumber(d); var i=MakeTime(a,b,c,d); return(%DateSetValue(this,MakeDate((%_DateField(this,19)),i),1)); } function DateSetDate(a){ var b=(%_DateField(this,0)+%_DateField(this,21)); a=ToNumber(a); var c=MakeDay((%_DateField(this,1)),(%_DateField(this,2)),a); return(%DateSetValue(this,MakeDate(c,(%_DateField(this,10))),0)); } function DateSetUTCDate(a){ var b=(%_DateField(this,0)); a=ToNumber(a); var c=MakeDay((%_DateField(this,11)),(%_DateField(this,12)),a); return(%DateSetValue(this,MakeDate(c,(%_DateField(this,20))),1)); } function DateSetMonth(a,b){ var c=(%_DateField(this,0)+%_DateField(this,21)); a=ToNumber(a); b=%_ArgumentsLength()<2?(%_DateField(this,3)):ToNumber(b); var d=MakeDay((%_DateField(this,1)),a,b); return(%DateSetValue(this,MakeDate(d,(%_DateField(this,10))),0)); } function DateSetUTCMonth(a,b){ var c=(%_DateField(this,0)); a=ToNumber(a); b=%_ArgumentsLength()<2?(%_DateField(this,13)):ToNumber(b); var d=MakeDay((%_DateField(this,11)),a,b); return(%DateSetValue(this,MakeDate(d,(%_DateField(this,20))),1)); } function DateSetFullYear(a,b,c){ var d=(%_DateField(this,0)+%_DateField(this,21)); a=ToNumber(a); var g=%_ArgumentsLength(); var h; if((!%_IsSmi(%IS_VAR(d))&&!(d==d))){ b=g<2?0:ToNumber(b); c=g<3?1:ToNumber(c); h=0; }else{ b=g<2?(%_DateField(this,2)):ToNumber(b); c=g<3?(%_DateField(this,3)):ToNumber(c); h=(%_DateField(this,10)); } var i=MakeDay(a,b,c); return(%DateSetValue(this,MakeDate(i,h),0)); } function DateSetUTCFullYear(a,b,c){ var d=(%_DateField(this,0)); a=ToNumber(a); var g=%_ArgumentsLength(); var h; if((!%_IsSmi(%IS_VAR(d))&&!(d==d))){ b=g<2?0:ToNumber(b); c=g<3?1:ToNumber(c); h=0; }else{ b=g<2?(%_DateField(this,12)):ToNumber(b); c=g<3?(%_DateField(this,13)):ToNumber(c); h=(%_DateField(this,20)); } var i=MakeDay(a,b,c); return(%DateSetValue(this,MakeDate(i,h),1)); } function DateToUTCString(){ var a=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(a))&&!(a==a)))return'Invalid Date'; return WeekDays[(%_DateField(this,14))]+', ' +TwoDigitString((%_DateField(this,13)))+' ' +Months[(%_DateField(this,12))]+' ' +(%_DateField(this,11))+' ' +TimeStringUTC(this)+' GMT'; } function DateGetYear(){ return(%_DateField(this,1))-1900; } function DateSetYear(a){ if(%_ClassOf(this)!=='Date')ThrowDateTypeError(); a=ToNumber(a); if((!%_IsSmi(%IS_VAR(a))&&!(a==a)))return(%DateSetValue(this,$NaN,1)); a=(0<=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a)))&&(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a)))<=99) ?1900+(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))):a; var b=(%_DateField(this,0)+%_DateField(this,21)); var c,d,g; if((!%_IsSmi(%IS_VAR(b))&&!(b==b))){ c=0; d=1; g=0; }else{ c=(%_DateField(this,2)); d=(%_DateField(this,3)); g=(%_DateField(this,10)); } var h=MakeDay(a,c,d); return(%DateSetValue(this,MakeDate(h,g),0)); } function DateToGMTString(){ return %_CallFunction(this,DateToUTCString); } function PadInt(a,b){ if(b==1)return a; return a=0&&b<=9999){ c=PadInt(b,4); }else{ if(b<0){ c="-"+PadInt(-b,6); }else{ c="+"+PadInt(b,6); } } return c+ '-'+PadInt(this.getUTCMonth()+1,2)+ '-'+PadInt(this.getUTCDate(),2)+ 'T'+PadInt(this.getUTCHours(),2)+ ':'+PadInt(this.getUTCMinutes(),2)+ ':'+PadInt(this.getUTCSeconds(),2)+ '.'+PadInt(this.getUTCMilliseconds(),3)+ 'Z'; } function DateToJSON(a){ var b=ToObject(this); var c=DefaultNumber(b); if((typeof(c)==='number')&&!(%_IsSmi(%IS_VAR(c))||((c==c)&&(c!=1/0)&&(c!=-1/0)))){ return null; } return b.toISOString(); } function ResetDateCache(){ timezone_cache_time=$NaN; timezone_cache_timezone=undefined; cache=Date_cache; cache.time=$NaN; cache.string=null; } function SetUpDate(){ %CheckIsBootstrapping(); InstallFunctions($Date,2,$Array( "UTC",DateUTC, "parse",DateParse, "now",DateNow )); %SetProperty($Date.prototype,"constructor",$Date,2); InstallFunctions($Date.prototype,2,$Array( "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 )); } SetUpDate(); var $JSON=global.JSON; function Revive(a,b,c){ var d=a[b]; if((%_IsObject(d))){ if((%_IsArray(d))){ var g=d.length; for(var h=0;h0){ var o=",\n"+d; m="[\n"+d+i.join(o)+"\n"+ h+"]"; }else{ m="[]"; } c.pop(); return m; } function SerializeObject(a,b,c,d,g){ if(!%PushIfAbsent(c,a)){ throw MakeTypeError('circular_structure',$Array()); } var h=d; d+=g; var i=new InternalArray(); if((%_IsArray(b))){ var j=b.length; for(var k=0;k0){ var r=",\n"+d; q="{\n"+d+i.join(r)+"\n"+ h+"}"; }else{ q="{}"; } c.pop(); return q; } function JSONSerialize(a,b,c,d,g,h){ var i=b[a]; if((%_IsSpecObject(i))){ var j=i.toJSON; if((%_ClassOf(j)==='Function')){ i=%_CallFunction(i,a,j); } } if((%_ClassOf(c)==='Function')){ i=%_CallFunction(b,a,i,c); } if((typeof(i)==='string')){ return %QuoteJSONString(i); }else if((typeof(i)==='number')){ return((%_IsSmi(%IS_VAR(i))||i-i==0)?%_NumberToString(i):"null"); }else if((typeof(i)==='boolean')){ return i?"true":"false"; }else if((i===null)){ return"null"; }else if((%_IsSpecObject(i))&&!(typeof i=="function")){ if((%_IsArray(i))){ return SerializeArray(i,c,d,g,h); }else if((%_ClassOf(i)==='Number')){ i=ToNumber(i); return((%_IsSmi(%IS_VAR(i))||i-i==0)?%_NumberToString(i):"null"); }else if((%_ClassOf(i)==='String')){ return %QuoteJSONString(ToString(i)); }else if((%_ClassOf(i)==='Boolean')){ return %_ValueOf(i)?"true":"false"; }else{ return SerializeObject(i,c,d,g,h); } } return void 0; } function JSONStringify(a,b,c){ if(%_ArgumentsLength()==1){ return %BasicJSONStringify(a); } if((%_IsObject(c))){ if((%_ClassOf(c)==='Number')){ c=ToNumber(c); }else if((%_ClassOf(c)==='String')){ c=ToString(c); } } var d; if((typeof(c)==='number')){ c=MathMax(0,MathMin(ToInteger(c),10)); d=SubString(" ",0,c); }else if((typeof(c)==='string')){ if(c.length>10){ d=SubString(c,0,10); }else{ d=c; } }else{ d=""; } return JSONSerialize('',{'':a},b,new InternalArray(),"",d); } function SetUpJSON(){ %CheckIsBootstrapping(); InstallFunctions($JSON,2,$Array( "parse",JSONParse, "stringify",JSONStringify )); } function JSONSerializeAdapter(a,b){ var c={}; c[a]=b; return JSONSerialize(a,c,void 0,new InternalArray(),"",""); } SetUpJSON(); var $RegExp=global.RegExp; function DoConstructRegExp(a,b,c){ if((%_IsRegExp(b))){ if(!(typeof(c)==='undefined')){ throw MakeTypeError('regexp_flags',[]); } c=(b.global?'g':'') +(b.ignoreCase?'i':'') +(b.multiline?'m':''); b=b.source; } b=(typeof(b)==='undefined')?'':ToString(b); c=(typeof(c)==='undefined')?'':ToString(c); var d=false; var g=false; var h=false; for(var i=0;i>1; var d=a[3]; var g=a[4]; var h=%_RegExpConstructResult(c,d,b); if(d+1==g){ h[0]=%_StringCharAt(b,d); }else{ h[0]=%_SubString(b,d,g); } var i=3+2; for(var j=1;ja.length){ this.lastIndex=0; return null; } }else{ c=0; } %_Log('regexp','regexp-exec,%0r,%1S,%2i',[this,a,b]); var g=%_RegExpExec(this,a,c,lastMatchInfo); if(g===null){ this.lastIndex=0; return null; } lastMatchInfoOverride=null; if(d){ this.lastIndex=lastMatchInfo[4]; } return BuildResultFromMatchInfo(g,a); } var regexp_key; var regexp_val; function RegExpTest(a){ if(!(%_IsRegExp(this))){ throw MakeTypeError('incompatible_method_receiver', ['RegExp.prototype.test',this]); } a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); var b=this.lastIndex; var c=(%_IsSmi(%IS_VAR(b))?b:%NumberToInteger(ToNumber(b))); if(this.global){ if(c<0||c>a.length){ this.lastIndex=0; return false; } %_Log('regexp','regexp-exec,%0r,%1S,%2i',[this,a,b]); var d=%_RegExpExec(this,a,c,lastMatchInfo); if(d===null){ this.lastIndex=0; return false; } lastMatchInfoOverride=null; this.lastIndex=lastMatchInfo[4]; return true; }else{ var g=this; if(%_StringCharCodeAt(g.source,0)==46&& %_StringCharCodeAt(g.source,1)==42&& %_StringCharCodeAt(g.source,2)!=63){ g=TrimRegExp(g); } %_Log('regexp','regexp-exec,%0r,%1S,%2i',[g,a,b]); var d=%_RegExpExec(g,a,0,lastMatchInfo); if(d===null){ this.lastIndex=0; return false; } lastMatchInfoOverride=null; return true; } } function TrimRegExp(a){ if(!%_ObjectEquals(regexp_key,a)){ regexp_key=a; regexp_val= new $RegExp(SubString(a.source,2,a.source.length), (a.ignoreCase?a.multiline?"im":"i" :a.multiline?"m":"")); } return regexp_val; } function RegExpToString(){ if(!(%_IsRegExp(this))){ throw MakeTypeError('incompatible_method_receiver', ['RegExp.prototype.toString',this]); } var a='/'+this.source+'/'; if(this.global)a+='g'; if(this.ignoreCase)a+='i'; if(this.multiline)a+='m'; return a; } function RegExpGetLastMatch(){ if(lastMatchInfoOverride!==null){ return((lastMatchInfoOverride)[0]); } var a=((lastMatchInfo)[1]); return SubString(a, lastMatchInfo[3], lastMatchInfo[4]); } function RegExpGetLastParen(){ if(lastMatchInfoOverride){ var a=lastMatchInfoOverride; if(a.length<=3)return''; return a[a.length-3]; } var b=((lastMatchInfo)[0]); if(b<=2)return''; var c=((lastMatchInfo)[1]); var d=lastMatchInfo[(3+(b-2))]; var g=lastMatchInfo[(3+(b-1))]; if(d!=-1&&g!=-1){ return SubString(c,d,g); } return""; } function RegExpGetLeftContext(){ var a; var b; if(!lastMatchInfoOverride){ a=lastMatchInfo[3]; b=((lastMatchInfo)[1]); }else{ var c=lastMatchInfoOverride; a=((c)[(c).length-2]); b=((c)[(c).length-1]); } return SubString(b,0,a); } function RegExpGetRightContext(){ var a; var b; if(!lastMatchInfoOverride){ a=lastMatchInfo[4]; b=((lastMatchInfo)[1]); }else{ var c=lastMatchInfoOverride; b=((c)[(c).length-1]); var d=((c)[0]); a=((c)[(c).length-2])+d.length; } return SubString(b,a,b.length); } function RegExpMakeCaptureGetter(a){ return function(){ if(lastMatchInfoOverride){ if(a=((lastMatchInfo)[0]))return''; var c=lastMatchInfo[(3+(b))]; var d=lastMatchInfo[(3+(b+1))]; if(c==-1||d==-1)return''; return SubString(((lastMatchInfo)[1]),c,d); }; } var lastMatchInfo=new InternalArray( 2, "", void 0, 0, 0 ); var lastMatchInfoOverride=null; function SetUpRegExp(){ %CheckIsBootstrapping(); %FunctionSetInstanceClassName($RegExp,'RegExp'); %SetProperty($RegExp.prototype,'constructor',$RegExp,2); %SetCode($RegExp,RegExpConstructor); InstallFunctions($RegExp.prototype,2,$Array( "exec",RegExpExec, "test",RegExpTest, "toString",RegExpToString, "compile",RegExpCompile )); %FunctionSetLength($RegExp.prototype.compile,1); var a=function(){ var b=((lastMatchInfo)[2]); return(typeof(b)==='undefined')?"":b; }; var c=function(d){ ((lastMatchInfo)[2])=ToString(d); }; %OptimizeObjectForAddingMultipleProperties($RegExp,22); %DefineOrRedefineAccessorProperty($RegExp,'input',a, c,4); %DefineOrRedefineAccessorProperty($RegExp,'$_',a, c,2|4); %DefineOrRedefineAccessorProperty($RegExp,'$input',a, c,2|4); var g=false; var h=function(){return g;}; var i=function(j){g=j?true:false;}; %DefineOrRedefineAccessorProperty($RegExp,'multiline',h, i,4); %DefineOrRedefineAccessorProperty($RegExp,'$*',h, i, 2|4); var k=function(l){}; %DefineOrRedefineAccessorProperty($RegExp,'lastMatch',RegExpGetLastMatch, k,4); %DefineOrRedefineAccessorProperty($RegExp,'$&',RegExpGetLastMatch, k,2|4); %DefineOrRedefineAccessorProperty($RegExp,'lastParen',RegExpGetLastParen, k,4); %DefineOrRedefineAccessorProperty($RegExp,'$+',RegExpGetLastParen, k,2|4); %DefineOrRedefineAccessorProperty($RegExp,'leftContext', RegExpGetLeftContext,k, 4); %DefineOrRedefineAccessorProperty($RegExp,'$`',RegExpGetLeftContext, k,2|4); %DefineOrRedefineAccessorProperty($RegExp,'rightContext', RegExpGetRightContext,k, 4); %DefineOrRedefineAccessorProperty($RegExp,"$'",RegExpGetRightContext, k,2|4); for(var m=1;m<10;++m){ %DefineOrRedefineAccessorProperty($RegExp,'$'+m, RegExpMakeCaptureGetter(m),k, 4); } %ToFastProperties($RegExp); } SetUpRegExp(); debugmirrorliveeditruntimev8nativesarraystringurimathmessagesapinativesdatejsonregexpnative debug.jsnative mirror.jsnative liveedit.jsnative runtime.jsnative v8natives.jsnative array.jsnative string.jsnative uri.jsnative math.jsnative messages.jsnative apinatives.jsnative date.jsnative json.jsnative regexp.jsGCC: (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.3) 4.8.4A4aeabi*7-A A  ".symtab.strtab.shstrtab.text.data.bss.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetBuiltinsCountEv.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetDebuggerCountEv.rel.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE8GetIndexEPKc.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE17GetRawScriptsSizeEv.rel.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE18GetRawScriptSourceEi.rel.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE13GetScriptNameEi.rel.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetScriptsSourceEv.rel.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE19SetRawScriptsSourceENS0_6VectorIKcEE.data._ZN2v88internal25pLinuxKernelMemoryBarrierE.rodata._ZN2v88internalL7sourcesE.rel.data.rel.local._ZN2v88internalL11raw_sourcesE.rodata.str1.4.data._ZN2v88internal19pLinuxKernelCmpxchgE.comment.note.GNU-stack.ARM.attributes4!4'4,48<  ظ"\ zhv x $( 0x 'L#  ~dz |<;7 j2yD0H3{p{5F #l).$3088=@BDGLLXRdXt   ^|   djpv|`$8Pp   :>  & u(  k!!libraries.cc$t$d.LC0.LC1.LC2.LC12.LC3.LC4.LC5.LC6.LC7.LC8.LC9.LC10.LC11.LC13.LC14.LC15.LC16.LC17.LC18.LC19.LC20.LC21.LC27.LC22.LC23.LC24.LC25.LC26.LC28_ZN2v88internalL7sourcesE_ZN2v88internalL11raw_sourcesE_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetBuiltinsCountEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetDebuggerCountEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE8GetIndexEPKcstrcmp_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE17GetRawScriptsSizeEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE18GetRawScriptSourceEi_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE13GetScriptNameEi_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetScriptsSourceEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE19SetRawScriptsSourceENS0_6VectorIKcEE_ZN2v88internal25pLinuxKernelMemoryBarrierE_ZN2v88internal19pLinuxKernelCmpxchgE I I I0 IF IV If Iv I I I I I I I   <<<<<<<<<<<<<<#$%&'() *+,-. /$09<9/0 1488985383 1000 1000 100664 17088 ` ELF(64( pG pG IyDF I FyDPI FyD(O0  ,"CpGI))K"B`{D`pGK@BB`{Dh`pG KAB`{DhC`pGKORB`{DhS3`pG<2&I) ) K"B`{D`pG K"B`{D`pGK"B`{D`pGK"B`{D`pG( JCA`zD`pGJzD`pG  "use strict"; global.Proxy=new $Object(); var $Proxy=global.Proxy function ProxyCreate(a,b){ if(!(%_IsSpecObject(a))) throw MakeTypeError("handler_non_object",["create"]) if((typeof(b)==='undefined')) b=null else if(!((%_IsSpecObject(b))||b===null)) throw MakeTypeError("proto_non_object",["create"]) return %CreateJSProxy(a,b) } function ProxyCreateFunction(a,b,c){ if(!(%_IsSpecObject(a))) throw MakeTypeError("handler_non_object",["create"]) if(!(%_ClassOf(b)==='Function')) throw MakeTypeError("trap_function_expected",["createFunction","call"]) if((typeof(c)==='undefined')){ c=DerivedConstructTrap(b) }else if((%_ClassOf(c)==='Function')){ var d=c c=function(){ return %Apply(d,void 0,arguments,0,%_ArgumentsLength()); } }else{ throw MakeTypeError("trap_function_expected", ["createFunction","construct"]) } return %CreateJSFunctionProxy( a,b,c,$Function.prototype) } %CheckIsBootstrapping() InstallFunctions($Proxy,2,[ "create",ProxyCreate, "createFunction",ProxyCreateFunction ]) function DerivedConstructTrap(a){ return function(){ var b=this.prototype if(!(%_IsSpecObject(b)))b=$Object.prototype var c=new $Object() c.__proto__=b var d=%Apply(a,c,arguments,0,%_ArgumentsLength()); return(%_IsSpecObject(d))?d:c } } function DelegateCallAndConstruct(a,b){ return function(){ return %Apply(%_IsConstructCall()?b:a, this,arguments,0,%_ArgumentsLength()) } } function DerivedGetTrap(a,b){ var c=this.getPropertyDescriptor(b) if((typeof(c)==='undefined')){return c} if('value'in c){ return c.value }else{ if((typeof(c.get)==='undefined')){return c.get} return %_CallFunction(a,c.get) } } function DerivedSetTrap(a,b,c){ var d=this.getOwnPropertyDescriptor(b) if(d){ if('writable'in d){ if(d.writable){ d.value=c this.defineProperty(b,d) return true }else{ return false } }else{ if(d.set){ %_CallFunction(a,c,d.set) return true }else{ return false } } } d=this.getPropertyDescriptor(b) if(d){ if('writable'in d){ if(d.writable){ }else{ return false } }else{ if(d.set){ %_CallFunction(a,c,d.set) return true }else{ return false } } } this.defineProperty(b,{ value:c, writable:true, enumerable:true, configurable:true}); return true; } function DerivedHasTrap(a){ return!!this.getPropertyDescriptor(a) } function DerivedHasOwnTrap(a){ return!!this.getOwnPropertyDescriptor(a) } function DerivedKeysTrap(){ var a=this.getOwnPropertyNames() var b=[] for(var c=0,count=0;c=0){ d.splice(e,1); if(d.length===0)%SetIsObserved(a,false); } return a; } function EnqueueChangeRecord(a,b){ for(var c=0;cI4!&+  P 0$  < 5(:8?P   D0^}@]d` L K !#!experimental-libraries.cc$t$d.LC0.LC1.LC2.LC3.LC4.LC5.LC6_ZN2v88internalL7sourcesE_ZN2v88internalL11raw_sourcesE_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetBuiltinsCountEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetDebuggerCountEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE8GetIndexEPKcstrcmp_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE17GetRawScriptsSizeEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE18GetRawScriptSourceEi_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE13GetScriptNameEi_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetScriptsSourceEv_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE19SetRawScriptsSourceENS0_6VectorIKcEE_ZN2v88internal25pLinuxKernelMemoryBarrierE_ZN2v88internal19pLinuxKernelCmpxchgE 3 3 34 8 <PT&X&\&<@DH#&#/26 1488985383 1000 1000 100664 4910 ` ELF(4( GCC: (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.3) 4.8.4A4aeabi*7-A A  ".symtab.strtab.shstrtab.text.data.bss.rodata._ZN2v88internal8Snapshot13context_size_E.data._ZN2v88internal25pLinuxKernelMemoryBarrierE.rodata._ZN2v88internal8Snapshot23context_map_space_used_E.bss._ZN2v88internal8Snapshot17context_raw_data_E.rodata._ZN2v88internal8Snapshot5data_E.rodata._ZN2v88internal8Snapshot5size_E.rodata._ZN2v88internal8Snapshot19pointer_space_used_E.rodata._ZN2v88internal8Snapshot27context_pointer_space_used_E.rodata._ZN2v88internal8Snapshot16data_space_used_E.rodata._ZN2v88internal8Snapshot23context_new_space_used_E.rodata._ZN2v88internal8Snapshot24context_cell_space_used_E.rodata._ZN2v88internal8Snapshot24context_code_space_used_E.data._ZN2v88internal19pLinuxKernelCmpxchgE.rodata._ZN2v88internal8Snapshot15map_space_used_E.rodata._ZN2v88internal8Snapshot9raw_size_E.rodata._ZN2v88internal8Snapshot13context_data_E.rodata._ZN2v88internal8Snapshot24context_data_space_used_E.rodata._ZN2v88internal8Snapshot16code_space_used_E.rodata._ZN2v88internal8Snapshot17context_raw_size_E.rodata._ZN2v88internal8Snapshot15new_space_used_E.bss._ZN2v88internal8Snapshot9raw_data_E.rodata._ZN2v88internal8Snapshot16cell_space_used_E.comment.note.GNU-stack.ARM.attributes4!4'4,4]8<@@$DLHLPT1Xm\`dh4leptx |=f03p5 4 P          J}  O{  -X( Hl!!snapshot-empty.cc$d_ZN2v88internal8Snapshot24context_cell_space_used_E_ZN2v88internal8Snapshot23context_map_space_used_E_ZN2v88internal8Snapshot24context_code_space_used_E_ZN2v88internal8Snapshot24context_data_space_used_E_ZN2v88internal8Snapshot27context_pointer_space_used_E_ZN2v88internal8Snapshot23context_new_space_used_E_ZN2v88internal8Snapshot16cell_space_used_E_ZN2v88internal8Snapshot15map_space_used_E_ZN2v88internal8Snapshot16code_space_used_E_ZN2v88internal8Snapshot16data_space_used_E_ZN2v88internal8Snapshot19pointer_space_used_E_ZN2v88internal8Snapshot15new_space_used_E_ZN2v88internal8Snapshot17context_raw_size_E_ZN2v88internal8Snapshot13context_size_E_ZN2v88internal8Snapshot17context_raw_data_E_ZN2v88internal8Snapshot13context_data_E_ZN2v88internal8Snapshot9raw_size_E_ZN2v88internal8Snapshot5size_E_ZN2v88internal8Snapshot9raw_data_E_ZN2v88internal8Snapshot5data_E_ZN2v88internal25pLinuxKernelMemoryBarrierE_ZN2v88internal19pLinuxKernelCmpxchgE