!<arch> / 0 0 0 0 2288 ` ���$�� ��� ��� ��� ��� ��� ��� ��� ��������������������������"<�"<�"<�"<�"<�"<�"<�"<�"<�"<�"<�"<�"<�"<�"<�"<�"<�"<�"<�"<_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE13GetScriptNameEi�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetBuiltinsCountEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetDebuggerCountEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetScriptsSourceEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE17GetRawScriptsSizeEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE18GetRawScriptSourceEi�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE19SetRawScriptsSourceENS0_6VectorIKcEE�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE8GetIndexEPKc�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE13GetScriptNameEi�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetBuiltinsCountEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetDebuggerCountEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetScriptsSourceEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE17GetRawScriptsSizeEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE18GetRawScriptSourceEi�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE19SetRawScriptsSourceENS0_6VectorIKcEE�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE8GetIndexEPKc�_ZN2v88internal8Snapshot13context_data_E�_ZN2v88internal8Snapshot13context_size_E�_ZN2v88internal8Snapshot15map_space_used_E�_ZN2v88internal8Snapshot15new_space_used_E�_ZN2v88internal8Snapshot16cell_space_used_E�_ZN2v88internal8Snapshot16code_space_used_E�_ZN2v88internal8Snapshot16data_space_used_E�_ZN2v88internal8Snapshot17context_raw_data_E�_ZN2v88internal8Snapshot17context_raw_size_E�_ZN2v88internal8Snapshot19pointer_space_used_E�_ZN2v88internal8Snapshot23context_map_space_used_E�_ZN2v88internal8Snapshot23context_new_space_used_E�_ZN2v88internal8Snapshot24context_cell_space_used_E�_ZN2v88internal8Snapshot24context_code_space_used_E�_ZN2v88internal8Snapshot24context_data_space_used_E�_ZN2v88internal8Snapshot27context_pointer_space_used_E�_ZN2v88internal8Snapshot5data_E�_ZN2v88internal8Snapshot5size_E�_ZN2v88internal8Snapshot9raw_data_E�_ZN2v88internal8Snapshot9raw_size_E�// 44 ` experimental-libraries.o/ snapshot-empty.o/ libraries.o/ 0 0 0 100644 249336 ` ELF ���������>������������������������������@�����@�;�8�UH�����]������UH�����]������UH��SPH��H�5�����������1����U��H�5����H��������������9��H�5����H����������������H�5����H����������������H�5����H������������������H�5����H������������������H�5����H������������������H�5����H������������������H�5����H�������������tyH�5����H���������� ���taH�5����H���������� ���tIH�5����H�������������t1H�5����H�������������tH�5����H�����������Ѓ� H��[]����UH��:��]������UH��� ��v1�H�����]�H� ��Hc�H��ม��H�����f���]øl�H���������]ø���H������>��]ú�)��H�����]ø�)��H�����Ip��]øF���H�����uP��]ø����H������A��]ø�,�H��������]ø>F�H�����4��]ørU�H������b��]ø��H��������]ø;<�H������:��]ø�v�H������ ��]øh��H��������]Ð���� ��� ���3���A���T���g���z���������������������������������������UH��� wHc�H� ������H� ����H��]�1�H�����]���UH��H������:��]���������������UH��H�=����]�debug�mirror�liveedit�runtime�v8natives�array�string�uri�math�messages�apinatives�date�json�regexp����������native debug.js�native mirror.js�native liveedit.js�native runtime.js�native v8natives.js�native array.js�native string.js�native uri.js�native math.js�native messages.js�native apinatives.js�native date.js�native json.js�native regexp.js��������� 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<c.length;d+=2){ var e=c[d]; var f=c[d+1]; %FunctionSetName(f,e); %FunctionRemovePrototype(f); %SetProperty(a,e,f,b); %SetNativeFlag(f); } %ToFastProperties(a); } function InstallGetter(a,b,c){ %FunctionSetName(c,b); %FunctionRemovePrototype(c); %DefineOrRedefineAccessorProperty(a,b,c,null,2); %SetNativeFlag(c); } function SetUpLockedPrototype(a,b,c){ %CheckIsBootstrapping(); var d=a.prototype; var e=(c.length>>1)+(b?b.length:0); if(e>=4){ %OptimizeObjectForAddingMultipleProperties(d,e); } if(b){ for(var f=0;f<b.length;f++){ %SetProperty(d,b[f],void 0,2|4); } } for(var f=0;f<c.length;f+=2){ var g=c[f]; var h=c[f+1]; %SetProperty(d,g,h,2|4|1); %SetNativeFlag(h); } d.__proto__=null; %ToFastProperties(d); } function GlobalIsNaN(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return(!%_IsSmi(%IS_VAR(a))&&!(a==a)); } function GlobalIsFinite(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return(%_IsSmi(%IS_VAR(a))||((a==a)&&(a!=1/0)&&(a!=-1/0))); } function GlobalParseInt(a,b){ if((typeof(b)==='undefined')||b===10||b===0){ if(%_IsSmi(a))return a; if((typeof(a)==='number')&& ((0.01<a&&a<1e9)|| (-1e9<a&&a<-0.01))){ return a|0; } a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); b=b|0; }else{ a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); b=(%_IsSmi(%IS_VAR(b))?b:(b>>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--){ if(!Delete(a,ToString(e),false)){ f=e+1; h=true; break; } } var i=%IsObserved(a); if(i)%SetIsObserved(a,false); a.length=f; c.value_=void 0; c.hasValue_=false; h=!DefineObjectProperty(a,"length",c,d)||h; if(i)%SetIsObserved(a,true); if(h){ if(d){ throw MakeTypeError("redefine_disallowed",[b]); }else{ return false; } } if(i){ var j=GetOwnProperty(a,"length"); var k=g.value_!==j.value_; var l=g.writable_!==j.writable_|| g.configurable_!==j.configurable_|| g.enumerable_!==j.configurable_; if(k||l){ NotifyChange(l?"reconfigured":"updated", a,"length",g.value_); } } return true; } var m=ToUint32(b); if(m==ToNumber(b)&&m!=4294967295){ var e=a.length; var g=GetOwnProperty(a,"length"); if((m>=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;f<c;f++){ var g=ToString(a[f]); if(%HasLocalProperty(e,g)){ throw MakeTypeError("proxy_repeated_prop_name",[a,b,g]); } d[f]=g; e[g]=0; } return d; } function ObjectGetOwnPropertyNames(a){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.getOwnPropertyNames"]); } if(%IsJSProxy(a)){ var b=%GetHandler(a); var c=CallTrap0(b,"getOwnPropertyNames",void 0); return ToStringArray(c,"getOwnPropertyNames"); } var d=%GetLocalElementNames(a); if(%GetInterceptorInfo(a)&1){ var e= %GetIndexedInterceptorElementNames(a); if(e){ d=d.concat(e); } } d=d.concat(%GetLocalPropertyNames(a)); if(%GetInterceptorInfo(a)&2){ var f= %GetNamedInterceptorPropertyNames(a); if(f){ d=d.concat(f); } } var g={__proto__:null}; var h=0; for(var i=0;i<d.length;++i){ var j=ToString(d[i]); if(g[j]===true){ continue; } g[j]=true; d[h++]=j; } d.length=h; return d; } function ObjectCreate(a,b){ if(!(%_IsSpecObject(a))&&a!==null){ throw MakeTypeError("proto_object_or_null",[a]); } var c=new $Object(); c.__proto__=a; if(!(typeof(b)==='undefined'))ObjectDefineProperties(c,b); return c; } function ObjectDefineProperty(a,b,c){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.defineProperty"]); } var d=ToString(b); if(%IsJSProxy(a)){ var e={__proto__:null}; for(var f in c){ e[f]=c[f]; } DefineProxyProperty(a,d,e,true); }else{ var g=ToPropertyDescriptor(c); DefineOwnProperty(a,d,g,true); } return a; } function GetOwnEnumerablePropertyNames(a){ var b=new InternalArray(); for(var c in a){ if(%HasLocalProperty(a,c)){ b.push(c); } } return b; } function ObjectDefineProperties(a,b){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.defineProperties"]); } var c=ToObject(b); var d=GetOwnEnumerablePropertyNames(c); var e=new InternalArray(); for(var f=0;f<d.length;f++){ e.push(ToPropertyDescriptor(c[d[f]])); } for(var f=0;f<d.length;f++){ DefineOwnProperty(a,d[f],e[f],true); } return a; } function ProxyFix(a){ var b=%GetHandler(a); var c=CallTrap0(b,"fix",void 0); if((typeof(c)==='undefined')){ throw MakeTypeError("handler_returned_undefined",[b,"fix"]); } if(%IsJSFunctionProxy(a)){ var d=%GetCallTrap(a); var e=%GetConstructTrap(a); var f=DelegateCallAndConstruct(d,e); %Fix(a); %SetCode(a,f); var g=new $Object(); $Object.defineProperty(g,"constructor", {value:a,writable:true,enumerable:false,configurable:true}); %FunctionSetPrototype(a,g); a.length=0; }else{ %Fix(a); } ObjectDefineProperties(a,c); } function ObjectSeal(a){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.seal"]); } if(%IsJSProxy(a)){ ProxyFix(a); } var b=ObjectGetOwnPropertyNames(a); for(var c=0;c<b.length;c++){ var d=b[c]; var e=GetOwnProperty(a,d); if(e.isConfigurable()){ e.setConfigurable(false); DefineOwnProperty(a,d,e,true); } } %PreventExtensions(a); return a; } function ObjectFreeze(a){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.freeze"]); } if(%IsJSProxy(a)){ ProxyFix(a); } var b=ObjectGetOwnPropertyNames(a); for(var c=0;c<b.length;c++){ var d=b[c]; var e=GetOwnProperty(a,d); if(e.isWritable()||e.isConfigurable()){ if(IsDataDescriptor(e))e.setWritable(false); e.setConfigurable(false); DefineOwnProperty(a,d,e,true); } } %PreventExtensions(a); return a; } function ObjectPreventExtension(a){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.preventExtension"]); } if(%IsJSProxy(a)){ ProxyFix(a); } %PreventExtensions(a); return a; } function ObjectIsSealed(a){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.isSealed"]); } if(%IsJSProxy(a)){ return false; } var b=ObjectGetOwnPropertyNames(a); for(var c=0;c<b.length;c++){ var d=b[c]; var e=GetOwnProperty(a,d); if(e.isConfigurable())return false; } if(!ObjectIsExtensible(a)){ return true; } return false; } function ObjectIsFrozen(a){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.isFrozen"]); } if(%IsJSProxy(a)){ return false; } var b=ObjectGetOwnPropertyNames(a); for(var c=0;c<b.length;c++){ var d=b[c]; var e=GetOwnProperty(a,d); if(IsDataDescriptor(e)&&e.isWritable())return false; if(e.isConfigurable())return false; } if(!ObjectIsExtensible(a)){ return true; } return false; } function ObjectIsExtensible(a){ if(!(%_IsSpecObject(a))){ throw MakeTypeError("called_on_non_object",["Object.isExtensible"]); } if(%IsJSProxy(a)){ return true; } return %IsExtensible(a); } function ObjectIs(a,b){ if(a===b){ return(a!==0)||(1/ a === 1 /b); }else{ return(a!==a)&&(b!==b); } } %SetCode($Object,function(a){ if(%_IsConstructCall()){ if(a==null)return this; return ToObject(a); }else{ if(a==null)return{}; return ToObject(a); } }); %SetExpectedNumberOfProperties($Object,4); function SetUpObject(){ %CheckIsBootstrapping(); InstallFunctions($Object.prototype,2,$Array( "toString",ObjectToString, "toLocaleString",ObjectToLocaleString, "valueOf",ObjectValueOf, "hasOwnProperty",ObjectHasOwnProperty, "isPrototypeOf",ObjectIsPrototypeOf, "propertyIsEnumerable",ObjectPropertyIsEnumerable, "__defineGetter__",ObjectDefineGetter, "__lookupGetter__",ObjectLookupGetter, "__defineSetter__",ObjectDefineSetter, "__lookupSetter__",ObjectLookupSetter )); InstallFunctions($Object,2,$Array( "keys",ObjectKeys, "create",ObjectCreate, "defineProperty",ObjectDefineProperty, "defineProperties",ObjectDefineProperties, "freeze",ObjectFreeze, "getPrototypeOf",ObjectGetPrototypeOf, "getOwnPropertyDescriptor",ObjectGetOwnPropertyDescriptor, "getOwnPropertyNames",ObjectGetOwnPropertyNames, "is",ObjectIs, "isExtensible",ObjectIsExtensible, "isFrozen",ObjectIsFrozen, "isSealed",ObjectIsSealed, "preventExtensions",ObjectPreventExtension, "seal",ObjectSeal )); } SetUpObject(); function BooleanToString(){ var a=this; if(!(typeof(a)==='boolean')){ if(!(%_ClassOf(a)==='Boolean')){ throw new $TypeError('Boolean.prototype.toString is not generic'); } a=%_ValueOf(a); } return a?'true':'false'; } function BooleanValueOf(){ if(!(typeof(this)==='boolean')&&!(%_ClassOf(this)==='Boolean')){ throw new $TypeError('Boolean.prototype.valueOf is not generic'); } return %_ValueOf(this); } function SetUpBoolean(){ %CheckIsBootstrapping(); InstallFunctions($Boolean.prototype,2,$Array( "toString",BooleanToString, "valueOf",BooleanValueOf )); } SetUpBoolean(); %SetCode($Number,function(a){ var b=%_ArgumentsLength()==0?0:ToNumber(a); if(%_IsConstructCall()){ %_SetValueOf(this,b); }else{ return b; } }); %FunctionSetPrototype($Number,new $Number(0)); function NumberToString(a){ var b=this; if(!(typeof(this)==='number')){ if(!(%_ClassOf(this)==='Number')){ throw new $TypeError('Number.prototype.toString is not generic'); } b=%_ValueOf(this); } if((typeof(a)==='undefined')||a===10){ return %_NumberToString(b); } a=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); if(a<2||a>36){ 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<e;g++){ f[g]=c[g+2]; } for(var h=0;h<d;h++){ f[g++]=%_Arguments(h); } return %Apply(c[0],c[1],f,0,e+d); }; %FunctionRemovePrototype(b); var i=0; if(%_ClassOf(this)=="Function"){ var j=this.length; if((typeof j==="number")&& ((j>>>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;d<b-1;d++)c[d]=%_Arguments(d); c=Join(c,b-1,',',NonStringToString); if(c.indexOf(')')!=-1)throw MakeSyntaxError('unable_to_parse',[]); } var e=(b>0)?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;e<c;e++){ var f=b[e]; if(f<0){ var g=-1-f; var h=g+b[++e]; for(;g<h;g++){ var i=a[g]; if(!(typeof(i)==='undefined')||g in a){ d.push(g); } } }else{ if(!(typeof(f)==='undefined')){ var i=a[f]; if(!(typeof(i)==='undefined')||f in a){ d.push(f); } } } } %_CallFunction(d,function(j,k){return j-k;},ArraySort); return d; } function SparseJoinWithSeparator(a,b,c,d){ var e=GetSortedArrayKeys(a,%GetArrayKeys(a,b)); var f=0; var g=new InternalArray(e.length*2); var h=-1; for(var i=0;i<e.length;i++){ var j=e[i]; if(j!=h){ var k=a[j]; if(!(typeof(k)==='string'))k=c(k); g[i*2]=j; g[i*2+1]=k; h=j; } } return %SparseJoinWithSeparator(g,b,d); } function SparseJoin(a,b,c){ var d=GetSortedArrayKeys(a,%GetArrayKeys(a,b)); var e=-1; var f=d.length; var g=new InternalArray(f); var h=0; for(var i=0;i<f;i++){ var j=d[i]; if(j!=e){ var k=a[j]; if(!(typeof(k)==='string'))k=c(k); g[h++]=k; e=j; } } return %StringBuilderConcat(g,h,''); } function UseSparseVariant(a,b,c){ return c&& b>1000&& (!%_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;i++){ var f=a[i]; if(!(typeof(f)==='string'))f=d(f); g[h++]=f; } g.length=h; var j=%_FastAsciiArrayJoin(g,''); if(!(typeof(j)==='undefined'))return j; return %StringBuilderConcat(g,h,''); } if(!(typeof(a[0])==='number')){ for(var i=0;i<b;i++){ var f=a[i]; if(!(typeof(f)==='string'))f=d(f); g[i]=f; } }else{ for(var i=0;i<b;i++){ var f=a[i]; if((typeof(f)==='number')){ f=%_NumberToString(f); }else if(!(typeof(f)==='string')){ f=d(f); } g[i]=f; } } var j=%_FastAsciiArrayJoin(g,c); if(!(typeof(j)==='undefined'))return j; return %StringBuilderJoin(g,b,c); }finally{ if(e)visited_arrays.length=visited_arrays.length-1; } } function ConvertToString(a){ if((typeof(a)==='number'))return %_NumberToString(a); if((typeof(a)==='boolean'))return a?'true':'false'; return((a==null))?'':%ToString(%DefaultString(a)); } function ConvertToLocaleString(a){ if((a==null)){ return''; }else{ var b=ToObject(a); return %ToString(b.toLocaleString()); } } function SmartSlice(a,b,c,d,f){ var g=%GetArrayKeys(a,b+c); var h=g.length; for(var i=0;i<h;i++){ var j=g[i]; if(j<0){ var k=-1-j; var l=k+g[++i]; if(k<b){ k=b; } for(;k<l;k++){ var m=a[k]; if(!(typeof(m)==='undefined')||k in a){ f[k-b]=m; } } }else{ if(!(typeof(j)==='undefined')){ if(j>=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<i;j++){ var k=h[j]; if(k<0){ var l=-1-k; var m=l+h[++j]; while(l<b&&l<m){ var n=a[l]; if(!(typeof(n)==='undefined')||l in a){ g[l]=n; } l++; } l=b+c; while(l<m){ var n=a[l]; if(!(typeof(n)==='undefined')||l in a){ g[l-c+f]=n; } l++; } }else{ if(!(typeof(k)==='undefined')){ if(k<b){ var n=a[k]; if(!(typeof(n)==='undefined')||k in a){ g[k]=n; } }else if(k>=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;g<c;g++){ var h=b+g; var i=a[h]; if(!(typeof(i)==='undefined')||h in a){ f[g]=i; } } } function SimpleMove(a,b,c,d,f){ if(f!==c){ if(f>c){ 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;g<d-c;g++){ var h=g+c; var i=g+f; var j=a[h]; if(!(typeof(j)==='undefined')||h in a){ a[i]=j; }else{ delete a[i]; } } for(var g=d;g>d-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<b;c++){ this[c+a]=%_Arguments(c); } this.length=a+b; return this.length; } function ArrayConcat(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.concat"]); } var b=ToObject(this); var c=%_ArgumentsLength(); var d=new InternalArray(1+c); d[0]=b; for(var f=0;f<c;f++){ d[f+1]=%_Arguments(f); } return %ArrayConcat(d); } function SparseReverse(a,b){ var c=GetSortedArrayKeys(a,%GetArrayKeys(a,b)); var d=c.length-1; var f=0; while(f<=d){ var g=c[f]; var h=c[d]; var i=b-h-1; var j,k; if(i<=g){ k=h; while(c[--d]==h){} j=i; } if(i>=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<a;b++,a--){ var c=this[b]; if(!(typeof(c)==='undefined')||b in this){ var d=this[a]; if(!(typeof(d)==='undefined')||a in this){ this[b]=d; this[a]=c; }else{ this[a]=c; delete this[b]; } }else{ var d=this[a]; if(!(typeof(d)==='undefined')||a in this){ this[b]=d; delete this[a]; } } } return this; } function ArrayShift(){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.shift"]); } var a=(this.length>>>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<c;d++){ this[d]=%_Arguments(d); } this.length=b+c; return b+c; } function ArraySlice(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.slice"]); } var c=(this.length>>>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(f<d)return g; if((%_IsArray(this))&& !%IsObserved(this)&& (f>1000)&& (%EstimateNumberOfElements(this)<f)){ SmartSlice(this,d,f-d,c,g); }else{ SimpleSlice(this,d,f-d,c,g); } g.length=f-d; return g; } function ArraySplice(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.splice"]); } var c=%_ArgumentsLength(); var d=(this.length>>>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<n){ this[l++]=%_Arguments(m++); } this.length=d-g+i; return h; } function ArraySort(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.sort"]); } if(!(%_ClassOf(a)==='Function')){ a=function(b,c){ if(b===c)return 0; if(%_IsSmi(b)&&%_IsSmi(c)){ return %SmiLexicographicCompare(b,c); } b=ToString(b); c=ToString(c); if(b==c)return 0; else return b<c?-1:1; }; } var d=%GetDefaultReceiver(a); var f=function InsertionSort(g,h,i){ for(var j=h+1;j<i;j++){ var k=g[j]; for(var l=j-1;l>=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<i-1;j+=r){ q.push([j,g[j]]); } q.sort(function(g,s){ return %_CallFunction(d,g[1],s[1],a)}); var t=q[q.length>>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;j<H;j++){ var k=g[j]; var n=%_CallFunction(d,k,E,a); if(n<0){ g[j]=g[G]; g[G]=k; G++; }else if(n>0){ 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-H<G-h){ u(g,H,i); i=G; }else{ u(g,h,G); h=H; } } }; var J=function CopyFromPrototype(K,L){ var M=0; for(var N=K.__proto__;N;N=N.__proto__){ var O=%GetArrayKeys(N,L); if(O.length>0){ if(O[0]==-1){ var P=O[1]; for(var j=0;j<P;j++){ if(!K.hasOwnProperty(j)&&N.hasOwnProperty(j)){ K[j]=N[j]; if(j>=M){M=j+1;} } } }else{ for(var j=0;j<O.length;j++){ var Q=O[j]; if(!(typeof(Q)==='undefined')&& !K.hasOwnProperty(Q)&&N.hasOwnProperty(Q)){ K[Q]=N[Q]; if(Q>=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<P;j++){ if(N.hasOwnProperty(j)){ K[j]=void 0; } } }else{ for(var j=0;j<O.length;j++){ var Q=O[j]; if(!(typeof(Q)==='undefined')&&h<=Q&& N.hasOwnProperty(Q)){ K[Q]=void 0; } } } } } }; var S=function SafeRemoveArrayHoles(K){ var T=0; var U=L-1; var W=0; while(T<U){ while(T<U&& !(typeof(K[T])==='undefined')){ T++; } if(!K.hasOwnProperty(T)){ W++; } while(T<U&& (typeof(K[U])==='undefined')){ if(!K.hasOwnProperty(U)){ W++; } U--; } if(T<U){ K[T]=K[U]; K[U]=void 0; } } if(!(typeof(K[T])==='undefined'))T++; var j; for(j=T;j<L-W;j++){ K[j]=void 0; } for(j=L-W;j<L;j++){ if(j in K.__proto__){ K[j]=void 0; }else{ delete K[j]; } } return T; }; var L=(this.length>>>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<Y)){ R(this,Z,Y); } return this; } function ArrayFilter(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.filter"]); } var c=ToObject(this); var d=ToUint32(c.length); 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(); var i=0; if(%DebugCallbackSupportsStepping(a)){ for(var j=0;j<d;j++){ if(j in c){ var k=c[j]; %DebugPrepareStepInIfStepping(a); if(%_CallFunction(b,k,j,c,a)){ h[i++]=k; } } } }else{ for(var j=0;j<d;j++){ if(j in c){ var k=c[j]; if(%_CallFunction(b,k,j,c,a)){ h[i++]=k; } } } } %MoveArrayContents(h,g); return g; } function ArrayForEach(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.forEach"]); } var c=ToObject(this); var d=(c.length>>>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<d;g++){ if(g in c){ var h=c[g]; %DebugPrepareStepInIfStepping(a); %_CallFunction(b,h,g,c,a); } } }else{ for(var g=0;g<d;g++){ if(g in c){ var h=c[g]; %_CallFunction(b,h,g,c,a); } } } } function ArraySome(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.some"]); } var c=ToObject(this); var d=(c.length>>>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<d;g++){ if(g in c){ var h=c[g]; %DebugPrepareStepInIfStepping(a); if(%_CallFunction(b,h,g,c,a))return true; } } }else{ for(var g=0;g<d;g++){ if(g in c){ var h=c[g]; if(%_CallFunction(b,h,g,c,a))return true; } } } return false; } function ArrayEvery(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.every"]); } var c=ToObject(this); var d=(c.length>>>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<d;g++){ if(g in c){ var h=c[g]; %DebugPrepareStepInIfStepping(a); if(!%_CallFunction(b,h,g,c,a))return false; } } }else{ for(var g=0;g<d;g++){ if(g in c){ var h=c[g]; if(!%_CallFunction(b,h,g,c,a))return false; } } } return true; } function ArrayMap(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.map"]); } var c=ToObject(this); var d=(c.length>>>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<d;i++){ if(i in c){ var j=c[i]; %DebugPrepareStepInIfStepping(a); h[i]=%_CallFunction(b,j,i,c,a); } } }else{ for(var i=0;i<d;i++){ if(i in c){ var j=c[i]; h[i]=%_CallFunction(b,j,i,c,a); } } } %MoveArrayContents(h,g); return g; } function ArrayIndexOf(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.indexOf"]); } var c=(this.length>>>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<i)d=i; g=j; }else{ if(h.length==0)return-1; var k=GetSortedArrayKeys(this,h); var l=k.length; var m=0; while(m<l&&k[m]<b)m++; while(m<l){ var n=k[m]; if(!(typeof(n)==='undefined')&&this[n]===a)return n; m++; } return-1; } } if(!(typeof(a)==='undefined')){ for(var m=d;m<g;m++){ if(this[m]===a)return m; } return-1; } for(var m=d;m<g;m++){ if((typeof(this[m])==='undefined')&&m in this){ return m; } } return-1; } function ArrayLastIndexOf(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.lastIndexOf"]); } var c=(this.length>>>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<i)d=i; g=j; }else{ if(h.length==0)return-1; var k=GetSortedArrayKeys(this,h); var l=k.length-1; while(l>=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<d;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<d;g++){ if(g in c){ var i=c[g]; %DebugPrepareStepInIfStepping(a); b= %_CallFunction(h,b,i,g,c,a); } } }else{ for(;g<d;g++){ if(g in c){ var i=c[g]; b= %_CallFunction(h,b,i,g,c,a); } } } return b; } function ArrayReduceRight(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["Array.prototype.reduceRight"]); } var c=ToObject(this); var d=ToUint32(c.length); if(!(%_ClassOf(a)==='Function')){ throw MakeTypeError('called_non_callable',[a]); } var g=d-1; 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;d<a;d++){ var g=%_Arguments(d); c[d+1]=((typeof(%IS_VAR(g))==='string')?g:NonStringToString(g)); } return %StringBuilderConcat(c,a+1,""); } %FunctionSetLength(StringConcat,1); function StringIndexOf(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.indexOf"]); } var b=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); var c=0; if(%_ArgumentsLength()>1){ 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+d<c){ g=h; } } } if(g<0){ return-1; } return %StringLastIndexOf(b,a,g); } function StringLocaleCompare(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.localeCompare"]); } if(%_ArgumentsLength()===0)return 0; return %StringLocaleCompare(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)), ((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a))); } function StringMatch(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.match"]); } var b=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); if((%_IsRegExp(a))){ ToInteger(a.lastIndex); if(!a.global)return RegExpExecNoTests(a,b,0); %_Log('regexp','regexp-match,%0S,%1r',[b,a]); var c=%StringMatch(b,a,lastMatchInfo); if(c!==null)lastMatchInfoOverride=null; a.lastIndex=0; return c; } a=new $RegExp(a); return RegExpExecNoTests(a,b,0); } function SubString(a,b,c){ if(b+1==c)return %_StringCharAt(a,b); return %_SubString(a,b,c); } var reusableMatchInfo=[2,"","",-1,-1]; function StringReplace(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.replace"]); } var c=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); if((%_IsRegExp(a))){ ToInteger(a.lastIndex); %_Log('regexp','regexp-replace,%0r,%1S',[a,c]); if((%_ClassOf(b)==='Function')){ if(a.global){ return StringReplaceGlobalRegExpWithFunction(c,a,b); }else{ return StringReplaceNonGlobalRegExpWithFunction(c, a, b); } }else{ if(lastMatchInfoOverride==null){ var d=%StringReplaceRegExpWithString(c, a, ((typeof(%IS_VAR(b))==='string')?b:NonStringToString(b)), lastMatchInfo); if((typeof(d)==='undefined')){ a.lastIndex=0; return c; } if(a.global)a.lastIndex=0; return d; }else{ var g=lastMatchInfo[1]; lastMatchInfo[1]=0; var d=%StringReplaceRegExpWithString(c, a, ((typeof(%IS_VAR(b))==='string')?b:NonStringToString(b)), lastMatchInfo); if((typeof(d)==='undefined')){ a.lastIndex=0; lastMatchInfo[1]=g; return c; } if(%_IsSmi(lastMatchInfo[1])){ lastMatchInfo[1]=g; }else{ lastMatchInfoOverride=null; } if(a.global)a.lastIndex=0; return d; } } } a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); if(a.length==1&& c.length>0xFF&& (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(j<g){ var k=%_StringCharCodeAt(a,j); if(k==36){ ++j; d+='$'; }else if(k==38){ ++j; d+=SubString(b,c[3],c[4]); }else if(k==96){ ++j; d+=SubString(b,0,c[3]); }else if(k==39){ ++j; d+=SubString(b,c[4],b.length); }else{ d+='$'; } }else{ d+='$'; } h=%StringIndexOf(a,'$',j); if(h<0){ if(j<g){ d+=SubString(a,j,g); } return d; } if(h>j){ 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;l<h;l++){ var m=g[l]; if(%_IsSmi(m)){ if(m>0){ 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<h;l++){ var m=g[l]; if(!%_IsSmi(m)){ lastMatchInfoOverride=m; var n=%Apply(c,k,m,0,m.length); g[l]=((typeof(%IS_VAR(n))==='string')?n:NonStringToString(n)); } } } var o=new ReplaceResultBuilder(a,g); var q=o.generate(); d.length=0; reusableReplaceArray=d; return q; } function StringReplaceNonGlobalRegExpWithFunction(a,b,c){ var d=DoRegExpExec(b,a,0); if((d===null)){ b.lastIndex=0; return a; } var g=d[3]; var h=SubString(a,0,g); var i=d[4]; var j=((d)[0])>>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;o<j;o++){ n[o]=CaptureString(a,d,o); } n[o]=g; n[o+1]=a; k=%Apply(c,l,n,0,o+2); } h+=k; return h+SubString(a,i,a.length); } function StringSearch(a){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.search"]); } var b; if((typeof(a)==='string')){ b=%_GetFromCache(0,a); }else if((%_IsRegExp(a))){ b=a; }else{ b=new $RegExp(a); } var c=DoRegExpExec(b,((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)),0); if(c){ return c[3]; } return-1; } function StringSlice(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.slice"]); } var c=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); var d=c.length; var g=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); var h=d; if(b!==void 0){ h=(%_IsSmi(%IS_VAR(b))?b:%NumberToInteger(ToNumber(b))); } if(g<0){ g+=d; if(g<0){ g=0; } }else{ if(g>d){ 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;n<m;){ var o=k[n++]; var q=k[n++]; if(q!=-1){ if(o+1==q){ j.push(%_StringCharAt(a,o)); }else{ j.push(%_SubString(a,o,q)); } }else{ j.push(void 0); } if(j.length===c)break outer_loop; } h=g=l; } return j; } function StringSubstring(a,b){ if((this==null)&&!(%_IsUndetectableObject(this))){ throw MakeTypeError("called_on_null_or_undefined", ["String.prototype.subString"]); } var c=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); var d=c.length; var g=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); if(g<0){ g=0; }else if(g>d){ 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;d<b;d++){ var a=%_Arguments(d); if(!%_IsSmi(a))a=ToNumber(a)&0xffff; if(a<0)a=a&0xffff; if(a>0x7f)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<b;d++,h++){ var a=%_Arguments(d); if(!%_IsSmi(a))a=ToNumber(a)&0xffff; %_TwoByteSeqStringSetChar(g,h,a); } return c+g; } function HtmlEscape(a){ return((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)).replace(/</g,"<") .replace(/>/g,">") .replace(/"/g,""") .replace(/'/g,"'"); } function StringLink(a){ return"<a href=\""+HtmlEscape(a)+"\">"+this+"</a>"; } function StringAnchor(a){ return"<a name=\""+HtmlEscape(a)+"\">"+this+"</a>"; } function StringFontcolor(a){ return"<font color=\""+HtmlEscape(a)+"\">"+this+"</font>"; } function StringFontsize(a){ return"<font size=\""+HtmlEscape(a)+"\">"+this+"</font>"; } function StringBig(){ return"<big>"+this+"</big>"; } function StringBlink(){ return"<blink>"+this+"</blink>"; } function StringBold(){ return"<b>"+this+"</b>"; } function StringFixed(){ return"<tt>"+this+"</tt>"; } function StringItalics(){ return"<i>"+this+"</i>"; } function StringSmall(){ return"<small>"+this+"</small>"; } function StringStrike(){ return"<strike>"+this+"</strike>"; } function StringSub(){ return"<sub>"+this+"</sub>"; } function StringSup(){ return"<sup>"+this+"</sup>"; } 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<c;h++){ var i=a.charCodeAt(h); if(b(i)){ d[g++]=i; }else{ if(i>=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<d.length;l++){ %_OneByteSeqStringSetChar(k,l,d[l]); } return k; } function Decode(a,b){ var c=a.length; var d=%NewString(c,true); var g=0; var h=0; for(;h<c;h++){ var i=a.charCodeAt(h); if(i==37){ if(h+2>=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;h++){ var i=a.charCodeAt(h); if(i==37){ if(h+2>=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<l;o++){ if(a.charAt(++h)!='%')throw new $URIError("URI malformed"); m[o]=URIHexCharsToCharCode(a.charCodeAt(++h), a.charCodeAt(++h)); } g=URIDecodeOctets(m,k,g); }else if(b(j)){ %_TwoByteSeqStringSetChar(k,g++,37); %_TwoByteSeqStringSetChar(k,g++,a.charCodeAt(h-1)); %_TwoByteSeqStringSetChar(k,g++,a.charCodeAt(h)); }else{ %_TwoByteSeqStringSetChar(k,g++,j); } }else{ %_TwoByteSeqStringSetChar(k,g++,i); } } k=%TruncateString(k,g); return d+k; } function URIDecode(a){ var b=function(c){ if(35<=c&&c<=36)return true; if(c==38)return true; if(43<=c&&c<=44)return true; if(c==47)return true; if(58<=c&&c<=59)return true; if(c==61)return true; if(63<=c&&c<=64)return true; return false; }; var d=ToString(a); return Decode(d,b); } function URIDecodeComponent(a){ var b=function(c){return false;}; var d=ToString(a); return Decode(d,b); } function isAlphaNumeric(a){ if(97<=a&&a<=122)return true; if(65<=a&&a<=90)return true; if(48<=a&&a<=57)return true; return false; } function URIEncode(a){ var b=function(c){ if(isAlphaNumeric(c))return true; if(c==33)return true; if(35<=c&&c<=36)return true; if(38<=c&&c<=47)return true; if(58<=c&&c<=59)return true; if(c==61)return true; if(63<=c&&c<=64)return true; if(c==95)return true; if(c==126)return true; return false; }; var d=ToString(a); return Encode(d,b); } function URIEncodeComponent(a){ var b=function(c){ if(isAlphaNumeric(c))return true; if(c==33)return true; if(39<=c&&c<=42)return true; if(45<=c&&c<=46)return true; if(c==95)return true; if(c==126)return true; return false; }; var d=ToString(a); return Encode(d,b); } function HexValueOf(a){ if(a>=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<a.length;++b){ var c=a.charCodeAt(b); if((48<=c&&c<=57)|| (65<=c&&c<=70)|| (97<=c&&c<=102)){ }else{ return false; } } return true; } function URIEscape(a){ var b=ToString(a); return %URIEscape(b); } function URIUnescape(a){ var b=ToString(a); return %URIUnescape(b); } function SetUpUri(){ %CheckIsBootstrapping(); InstallFunctions(global,2,$Array( "escape",URIEscape, "unescape",URIUnescape, "decodeURI",URIDecode, "decodeURIComponent",URIDecodeComponent, "encodeURI",URIEncode, "encodeURIComponent",URIEncodeComponent )); } SetUpUri(); var $floor=MathFloor; var $abs=MathAbs; function MathConstructor(){} %FunctionSetInstanceClassName(MathConstructor,'Math'); var $Math=new MathConstructor(); $Math.__proto__=$Object.prototype; %SetProperty(global,"Math",$Math,2); function MathAbs(a){ if(%_IsSmi(a))return a>=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;g<c;g++){ var h=%_Arguments(g); if(!(typeof(h)==='number'))h=NonNumberToNumber(h); if((!%_IsSmi(%IS_VAR(h))&&!(h==h))||h>d|| (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<c;g++){ var h=%_Arguments(g); if(!(typeof(h)==='number'))h=NonNumberToNumber(h); if((!%_IsSmi(%IS_VAR(h))&&!(h==h))||h<d|| (d==0&&h==0&&!%_IsSmi(h)&&1/h<0)){ d=h; } } return d; } function MathPow(a,b){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); if(!(typeof(b)==='number'))b=NonNumberToNumber(b); return %_MathPow(a,b); } function MathRandom(){ return %_RandomHeapNumber(); } function MathRound(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %RoundNumber(a); } function MathSin(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %_MathSin(a); } function MathSqrt(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %_MathSqrt(a); } function MathTan(a){ if(!(typeof(a)==='number'))a=NonNumberToNumber(a); return %_MathTan(a); } function SetUpMath(){ %CheckIsBootstrapping(); %OptimizeObjectForAddingMultipleProperties($Math,8); %SetProperty($Math, "E", 2.7182818284590452354, 2|4|1); %SetProperty($Math, "LN10", 2.302585092994046, 2|4|1); %SetProperty($Math, "LN2", 0.6931471805599453, 2|4|1); %SetProperty($Math, "LOG2E", 1.4426950408889634, 2|4|1); %SetProperty($Math, "LOG10E", 0.4342944819032518, 2|4|1); %SetProperty($Math, "PI", 3.1415926535897932, 2|4|1); %SetProperty($Math, "SQRT1_2", 0.7071067811865476, 2|4|1); %SetProperty($Math, "SQRT2", 1.4142135623730951, 2|4|1); %ToFastProperties($Math); InstallFunctions($Math,2,$Array( "random",MathRandom, "abs",MathAbs, "acos",MathAcos, "asin",MathAsin, "atan",MathAtan, "ceil",MathCeil, "cos",MathCos, "exp",MathExp, "floor",MathFloor, "log",MathLog, "round",MathRound, "sin",MathSin, "sqrt",MathSqrt, "tan",MathTan, "atan2",MathAtan2, "pow",MathPow, "max",MathMax, "min",MathMin )); } SetUpMath(); var kMessages={ cyclic_proto:["Cyclic __proto__ value"], code_gen_from_strings:["%0"], unexpected_token:["Unexpected token ","%0"], unexpected_token_number:["Unexpected number"], unexpected_token_string:["Unexpected string"], unexpected_token_identifier:["Unexpected identifier"], unexpected_reserved:["Unexpected reserved word"], unexpected_strict_reserved:["Unexpected strict mode reserved word"], unexpected_eos:["Unexpected end of input"], malformed_regexp:["Invalid regular expression: /","%0","/: ","%1"], unterminated_regexp:["Invalid regular expression: missing /"], regexp_flags:["Cannot supply flags when constructing one RegExp from another"], incompatible_method_receiver:["Method ","%0"," called on incompatible receiver ","%1"], invalid_lhs_in_assignment:["Invalid left-hand side in assignment"], invalid_lhs_in_for_in:["Invalid left-hand side in for-in"], invalid_lhs_in_postfix_op:["Invalid left-hand side expression in postfix operation"], invalid_lhs_in_prefix_op:["Invalid left-hand side expression in prefix operation"], multiple_defaults_in_switch:["More than one default clause in switch statement"], newline_after_throw:["Illegal newline after throw"], redeclaration:["%0"," '","%1","' has already been declared"], no_catch_or_finally:["Missing catch or finally after try"], unknown_label:["Undefined label '","%0","'"], uncaught_exception:["Uncaught ","%0"], stack_trace:["Stack Trace:\n","%0"], called_non_callable:["%0"," is not a function"], undefined_method:["Object ","%1"," has no method '","%0","'"], property_not_function:["Property '","%0","' of object ","%1"," is not a function"], cannot_convert_to_primitive:["Cannot convert object to primitive value"], not_constructor:["%0"," is not a constructor"], not_defined:["%0"," is not defined"], non_object_property_load:["Cannot read property '","%0","' of ","%1"], non_object_property_store:["Cannot set property '","%0","' of ","%1"], non_object_property_call:["Cannot call method '","%0","' of ","%1"], with_expression:["%0"," has no properties"], illegal_invocation:["Illegal invocation"], no_setter_in_callback:["Cannot set property ","%0"," of ","%1"," which has only a getter"], apply_non_function:["Function.prototype.apply was called on ","%0",", which is a ","%1"," and not a function"], apply_wrong_args:["Function.prototype.apply: Arguments list has wrong type"], invalid_in_operator_use:["Cannot use 'in' operator to search for '","%0","' in ","%1"], instanceof_function_expected:["Expecting a function in instanceof check, but got ","%0"], instanceof_nonobject_proto:["Function has non-object prototype '","%0","' in instanceof check"], null_to_object:["Cannot convert null to object"], reduce_no_initial:["Reduce of empty array with no initial value"], getter_must_be_callable:["Getter must be a function: ","%0"], setter_must_be_callable:["Setter must be a function: ","%0"], value_and_accessor:["Invalid property. A property cannot both have accessors and be writable or have a value, ","%0"], proto_object_or_null:["Object prototype may only be an Object or null"], property_desc_object:["Property description must be an object: ","%0"], redefine_disallowed:["Cannot redefine property: ","%0"], define_disallowed:["Cannot define property:","%0",", object is not extensible."], non_extensible_proto:["%0"," is not extensible"], handler_non_object:["Proxy.","%0"," called with non-object as handler"], proto_non_object:["Proxy.","%0"," called with non-object as prototype"], trap_function_expected:["Proxy.","%0"," called with non-function for '","%1","' trap"], handler_trap_missing:["Proxy handler ","%0"," has no '","%1","' trap"], handler_trap_must_be_callable:["Proxy handler ","%0"," has non-callable '","%1","' trap"], handler_returned_false:["Proxy handler ","%0"," returned false from '","%1","' trap"], handler_returned_undefined:["Proxy handler ","%0"," returned undefined from '","%1","' trap"], proxy_prop_not_configurable:["Proxy handler ","%0"," returned non-configurable descriptor for property '","%2","' from '","%1","' trap"], proxy_non_object_prop_names:["Trap '","%1","' returned non-object ","%0"], proxy_repeated_prop_name:["Trap '","%1","' returned repeated property name '","%2","'"], invalid_weakmap_key:["Invalid value used as weak map key"], not_date_object:["this is not a Date object."], observe_non_object:["Object.","%0"," cannot ","%0"," non-object"], observe_non_function:["Object.","%0"," cannot deliver to non-function"], observe_callback_frozen:["Object.observe cannot deliver to a frozen function object"], observe_type_non_string:["Invalid changeRecord with non-string 'type' property"], observe_notify_non_notifier:["notify called on non-notifier object"], invalid_array_length:["Invalid array length"], stack_overflow:["Maximum call stack size exceeded"], invalid_time_value:["Invalid time value"], unable_to_parse:["Parse error"], invalid_regexp_flags:["Invalid flags supplied to RegExp constructor '","%0","'"], invalid_regexp:["Invalid RegExp pattern /","%0","/"], illegal_break:["Illegal break statement"], illegal_continue:["Illegal continue statement"], illegal_return:["Illegal return statement"], illegal_let:["Illegal let declaration outside extended mode"], error_loading_debugger:["Error loading debugger"], no_input_to_regexp:["No input to ","%0"], invalid_json:["String '","%0","' is not valid JSON"], circular_structure:["Converting circular structure to JSON"], called_on_non_object:["%0"," called on non-object"], called_on_null_or_undefined:["%0"," called on null or undefined"], array_indexof_not_defined:["Array.getIndexOf: Argument undefined"], object_not_extensible:["Can't add property ","%0",", object is not extensible"], illegal_access:["Illegal access"], invalid_preparser_data:["Invalid preparser data for function ","%0"], strict_mode_with:["Strict mode code may not include a with statement"], strict_catch_variable:["Catch variable may not be eval or arguments in strict mode"], too_many_arguments:["Too many arguments in function call (only 32766 allowed)"], too_many_parameters:["Too many parameters in function definition (only 32766 allowed)"], too_many_variables:["Too many variables declared (only 131071 allowed)"], strict_param_name:["Parameter name eval or arguments is not allowed in strict mode"], strict_param_dupe:["Strict mode function may not have duplicate parameter names"], strict_var_name:["Variable name may not be eval or arguments in strict mode"], strict_function_name:["Function name may not be eval or arguments in strict mode"], strict_octal_literal:["Octal literals are not allowed in strict mode."], strict_duplicate_property:["Duplicate data property in object literal not allowed in strict mode"], accessor_data_property:["Object literal may not have data and accessor property with the same name"], accessor_get_set:["Object literal may not have multiple get/set accessors with the same name"], strict_lhs_assignment:["Assignment to eval or arguments is not allowed in strict mode"], strict_lhs_postfix:["Postfix increment/decrement may not have eval or arguments operand in strict mode"], strict_lhs_prefix:["Prefix increment/decrement may not have eval or arguments operand in strict mode"], strict_reserved_word:["Use of future reserved word in strict mode"], strict_delete:["Delete of an unqualified identifier in strict mode."], strict_delete_property:["Cannot delete property '","%0","' of ","%1"], strict_const:["Use of const in strict mode."], strict_function:["In strict mode code, functions can only be declared at top level or immediately within another function."], strict_read_only_property:["Cannot assign to read only property '","%0","' of ","%1"], strict_cannot_assign:["Cannot assign to read only '","%0","' in strict mode"], strict_poison_pill:["'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them"], strict_caller:["Illegal access to a strict mode caller function."], unprotected_let:["Illegal let declaration in unprotected statement context."], unprotected_const:["Illegal const declaration in unprotected statement context."], cant_prevent_ext_external_array_elements:["Cannot prevent extension of an object with external array elements"], redef_external_array_element:["Cannot redefine a property of an object with external array elements"], harmony_const_assign:["Assignment to constant variable."], invalid_module_path:["Module does not export '","%0","', or export is not itself a module"], module_type_error:["Module '","%0","' used improperly"], module_export_undefined:["Export '","%0","' is not defined in module"], }; function FormatString(a,b){ var c=""; var d=0; for(var g=0;g<a.length;g++){ var h=a[g]; if(h.length==2&&%_StringCharCodeAt(h,0)==0x25){ var d=(%_StringCharCodeAt(h,1)-0x30)>>>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="#<error>"; } } } 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"<unknown message "+a+">"; 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<g&&h<this.end){ this.start=g; this.end=h; }else if(this.start<g){ this.start=this.end-c; }else{ this.end=this.start+c; } } } function SourceLocationSourceText(){ return %_CallFunction(this.script.source, this.start, this.end, StringSubstring); } SetUpLockedPrototype(SourceLocation, $Array("script","position","line","column","start","end"), $Array( "restrict",SourceLocationRestrict, "sourceText",SourceLocationSourceText ) ); function SourceSlice(a,b,c,d,g){ this.script=a; this.from_line=b; this.to_line=c; this.from_position=d; this.to_position=g; } function SourceSliceSourceText(){ return %_CallFunction(this.script.source, this.from_position, this.to_position, StringSubstring); } SetUpLockedPrototype(SourceSlice, $Array("script","from_line","to_line","from_position","to_position"), $Array("sourceText",SourceSliceSourceText) ); function GetPositionInLine(a){ var b=%MessageGetScript(a); var c=%MessageGetStartPosition(a); var d=b.locationFromPosition(c,false); if(d==null)return-1; d.restrict(); return c-d.start; } function GetStackTraceLine(a,b,c,d){ return new CallSite(a,b,c).toString(); } function CallSite(a,b,c){ this.receiver=a; this.fun=b; this.pos=c; } function CallSiteGetThis(){ return this.receiver; } function CallSiteGetTypeName(){ return GetTypeName(this,false); } function CallSiteIsToplevel(){ if(this.receiver==null){ return true; } return(%_ClassOf(this.receiver)==='global'); } function CallSiteIsEval(){ var a=%FunctionGetScript(this.fun); return a&&a.compilation_type==1; } function CallSiteGetEvalOrigin(){ var a=%FunctionGetScript(this.fun); return FormatEvalOrigin(a); } function CallSiteGetScriptNameOrSourceURL(){ var a=%FunctionGetScript(this.fun); return a?a.nameOrSourceURL():null; } function CallSiteGetFunction(){ return this.fun; } function CallSiteGetFunctionName(){ var a=this.fun.name; if(a){ return a; } a=%FunctionGetInferredName(this.fun); if(a){ return a; } var b=%FunctionGetScript(this.fun); if(b&&b.compilation_type==1){ return"eval"; } return null; } function CallSiteGetMethodName(){ var a=this.fun.name; if(a&&this.receiver&& (%_CallFunction(this.receiver, a, ObjectLookupGetter)===this.fun|| %_CallFunction(this.receiver, a, ObjectLookupSetter)===this.fun|| %GetDataProperty(this.receiver,a)===this.fun)){ return a; } var b=null; for(var c in this.receiver){ if(%_CallFunction(this.receiver,c,ObjectLookupGetter)===this.fun|| %_CallFunction(this.receiver,c,ObjectLookupSetter)===this.fun|| %GetDataProperty(this.receiver,c)===this.fun){ if(b){ return null; } b=c; } } if(b){ return b; } return null; } function CallSiteGetFileName(){ var a=%FunctionGetScript(this.fun); return a?a.name:null; } function CallSiteGetLineNumber(){ if(this.pos==-1){ return null; } var a=%FunctionGetScript(this.fun); var b=null; if(a){ b=a.locationFromPosition(this.pos,true); } return b?b.line+1:null; } function CallSiteGetColumnNumber(){ if(this.pos==-1){ return null; } var a=%FunctionGetScript(this.fun); var b=null; if(a){ b=a.locationFromPosition(this.pos,true); } return b?b.column+1:null; } function CallSiteIsNative(){ var a=%FunctionGetScript(this.fun); return a?(a.type==0):false; } function CallSiteGetPosition(){ return this.pos; } function CallSiteIsConstructor(){ var a=this.receiver; var b=a?%GetDataProperty(a,"constructor"):null; if(!b){ return false; } return this.fun===b; } function CallSiteToString(){ var a; var b=""; if(this.isNative()){ b="native"; }else{ if(this.isEval()){ a=this.getScriptNameOrSourceURL(); if(!a){ b=this.getEvalOrigin(); b+=", "; } }else{ a=this.getFileName(); } if(a){ b+=a; }else{ b+="<anonymous>"; } var c=this.getLineNumber(); if(c!=null){ b+=":"+c; var d=this.getColumnNumber(); if(d){ b+=":"+d; } } } var g=""; var h=this.getFunctionName(); var i=true; var j=this.isConstructor(); var k=!(this.isToplevel()||j); if(k){ var l=GetTypeName(this,true); var m=this.getMethodName(); if(h){ if(l&& %_CallFunction(h,l,StringIndexOf)!=0){ g+=l+"."; } g+=h; if(m&& (%_CallFunction(h,"."+m,StringIndexOf)!= h.length-m.length-1)){ g+=" [as "+m+"]"; } }else{ g+=l+"."+(m||"<anonymous>"); } }else if(j){ g+="new "+(h||"<anonymous>"); }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+="<anonymous>"; } 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"<error: "+e+">"; }catch(ee){ return"<error>"; } } } function GetStackFrames(a){ var b=new InternalArray(); for(var c=0;c<a.length;c+=4){ var d=a[c]; var g=a[c+1]; var h=a[c+2]; var i=a[c+3]; var j=%FunctionGetPositionForOffset(h,i); b.push(new CallSite(d,g,j)); } return b; } function FormatStackTrace(a,b){ var c=new InternalArray(); c.push(a); for(var d=0;d<b.length;d++){ var g=b[d]; var h; try{ h=g.toString(); }catch(e){ try{ h="<error: "+e+">"; }catch(ee){ h="<error>"; } } 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;g<c[0];g+=3){ var h=c[g+1]; var i=c[g+2]; var j=c[g+3]; var k=Instantiate(i,h); %SetProperty(a,h,k,j); } }finally{ if(d)%EnableAccessChecks(a); } } } var kDefaultBacktraceLength=10; var Debug={}; var sourceLineBeginningSkip=/^(?:\s*(?:\/\*.*?\*\/)*)*/; Debug.DebugEvent={Break:1, Exception:2, NewFunction:3, BeforeCompile:4, AfterCompile:5, ScriptCollected:6}; Debug.ExceptionBreak={Caught:0, Uncaught:1}; Debug.StepAction={StepOut:0, StepNext:1, StepIn:2, StepMin:3, StepInMin:4}; Debug.ScriptType={Native:0, Extension:1, Normal:2}; Debug.ScriptCompilationType={Host:0, Eval:1, JSON:2}; Debug.ScriptBreakPointType={ScriptId:0, ScriptName:1, ScriptRegExp:2}; function ScriptTypeFlag(a){ return(1<<a); } var next_response_seq=0; var next_break_point_number=1; var break_points=[]; var script_break_points=[]; var debugger_flags={ breakPointsActive:{ value:true, getValue:function(){return this.value;}, setValue:function(a){ this.value=!!a; %SetDisableBreak(!this.value); } }, breakOnCaughtException:{ getValue:function(){return Debug.isBreakOnException();}, setValue:function(a){ if(a){ Debug.setBreakOnException(); }else{ Debug.clearBreakOnException(); } } }, breakOnUncaughtException:{ getValue:function(){return Debug.isBreakOnUncaughtException();}, setValue:function(a){ if(a){ Debug.setBreakOnUncaughtException(); }else{ Debug.clearBreakOnUncaughtException(); } } }, }; function MakeBreakPoint(a,b){ var c=new BreakPoint(a,b); break_points.push(c); return c; } function BreakPoint(a,b){ this.source_position_=a; if(b){ this.script_break_point_=b; }else{ this.number_=next_break_point_number++; } this.hit_count_=0; this.active_=true; this.condition_=null; this.ignoreCount_=0; } BreakPoint.prototype.number=function(){ return this.number_; }; BreakPoint.prototype.func=function(){ return this.func_; }; BreakPoint.prototype.source_position=function(){ return this.source_position_; }; BreakPoint.prototype.hit_count=function(){ return this.hit_count_; }; BreakPoint.prototype.active=function(){ if(this.script_break_point()){ return this.script_break_point().active(); } return this.active_; }; BreakPoint.prototype.condition=function(){ if(this.script_break_point()&&this.script_break_point().condition()){ return this.script_break_point().condition(); } return this.condition_; }; BreakPoint.prototype.ignoreCount=function(){ return this.ignoreCount_; }; BreakPoint.prototype.script_break_point=function(){ return this.script_break_point_; }; BreakPoint.prototype.enable=function(){ this.active_=true; }; BreakPoint.prototype.disable=function(){ this.active_=false; }; BreakPoint.prototype.setCondition=function(a){ this.condition_=a; }; BreakPoint.prototype.setIgnoreCount=function(a){ this.ignoreCount_=a; }; BreakPoint.prototype.isTriggered=function(a){ if(!this.active())return false; if(this.condition()){ try{ var b=a.frame(0).evaluate(this.condition()); if(!(b instanceof ValueMirror)||!%ToBoolean(b.value_)){ return false; } }catch(e){ return false; } } this.hit_count_++; if(this.script_break_point_){ this.script_break_point_.hit_count_++; } if(this.ignoreCount_>0){ this.ignoreCount_--; return false; } return true; }; function IsBreakPointTriggered(a,b){ return b.isTriggered(MakeExecutionState(a)); } function ScriptBreakPoint(type,script_id_or_name,opt_line,opt_column, opt_groupId){ 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.break_points_.length;b++){ a.push(this.break_points_[b].actual_location); } return a; }; ScriptBreakPoint.prototype.update_positions=function(a,b){ this.line_=a; this.column_=b; }; ScriptBreakPoint.prototype.hit_count=function(){ return this.hit_count_; }; ScriptBreakPoint.prototype.active=function(){ return this.active_; }; ScriptBreakPoint.prototype.condition=function(){ return this.condition_; }; ScriptBreakPoint.prototype.ignoreCount=function(){ return this.ignoreCount_; }; ScriptBreakPoint.prototype.enable=function(){ this.active_=true; }; ScriptBreakPoint.prototype.disable=function(){ this.active_=false; }; ScriptBreakPoint.prototype.setCondition=function(a){ this.condition_=a; }; ScriptBreakPoint.prototype.setIgnoreCount=function(a){ this.ignoreCount_=a; for(var b=0;b<this.break_points_.length;b++){ this.break_points_[b].setIgnoreCount(a); } }; ScriptBreakPoint.prototype.matchesScript=function(a){ if(this.type_==Debug.ScriptBreakPointType.ScriptId){ return this.script_id_==a.id; }else{ if(!(a.line_offset<=this.line_&& this.line_<a.line_offset+a.lineCount())){ return false; } if(this.type_==Debug.ScriptBreakPointType.ScriptName){ return this.script_name_==a.nameOrSourceURL(); }else if(this.type_==Debug.ScriptBreakPointType.ScriptRegExp){ return this.script_regexp_object_.test(a.nameOrSourceURL()); }else{ throw new Error("Unexpected breakpoint type "+this.type_); } } }; ScriptBreakPoint.prototype.set=function(a){ var b=this.column(); var c=this.line(); if((typeof(b)==='undefined')){ var d=a.sourceLine(this.line()); if(!a.sourceColumnStart_){ a.sourceColumnStart_=new Array(a.lineCount()); } if((typeof(a.sourceColumnStart_[c])==='undefined')){ a.sourceColumnStart_[c]= d.match(sourceLineBeginningSkip)[0].length; } b=a.sourceColumnStart_[c]; } var g=Debug.findScriptSourcePosition(a,this.line(),b); if(g===null)return; break_point=MakeBreakPoint(g,this); break_point.setIgnoreCount(this.ignoreCount()); var h=%SetScriptBreakPoint(a,g,break_point); if((typeof(h)==='undefined')){ h=g; } var i=a.locationFromPosition(h,true); break_point.actual_location={line:i.line, column:i.column, script_id:a.id}; this.break_points_.push(break_point); return break_point; }; ScriptBreakPoint.prototype.clear=function(){ var a=[]; for(var b=0;b<break_points.length;b++){ if(break_points[b].script_break_point()&& break_points[b].script_break_point()===this){ %ClearBreakPoint(break_points[b]); }else{ a.push(break_points[b]); } } break_points=a; this.break_points_=[]; }; function UpdateScriptBreakPoints(a){ for(var b=0;b<script_break_points.length;b++){ var c=script_break_points[b]; if((c.type()==Debug.ScriptBreakPointType.ScriptName|| c.type()==Debug.ScriptBreakPointType.ScriptRegExp)&& c.matchesScript(a)){ c.set(a); } } } function GetScriptBreakPoints(a){ var b=[]; for(var c=0;c<script_break_points.length;c++){ if(script_break_points[c].matchesScript(a)){ b.push(script_break_points[c]); } } return b; } Debug.setListener=function(a,b){ if(!(%_IsFunction(a))&&!(typeof(a)==='undefined')&&!(a===null)){ throw new Error('Parameters have wrong types.'); } %SetDebugEventListener(a,b); }; Debug.breakExecution=function(a){ %Break(); }; Debug.breakLocations=function(a){ if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.'); return %GetBreakLocations(a); }; Debug.findScript=function(a){ if((%_IsFunction(a))){ return %FunctionGetScript(a); }else if((%_IsRegExp(a))){ var b=Debug.scripts(); var c=null; var d=0; for(var g in b){ var h=b[g]; if(a.test(h.name)){ c=h; d++; } } if(d==1){ return c; }else{ return undefined; } }else{ return %GetScript(a); } }; Debug.scriptSource=function(a){ return this.findScript(a).source; }; Debug.source=function(a){ if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.'); return %FunctionGetSourceCode(a); }; Debug.disassemble=function(a){ if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.'); return %DebugDisassembleFunction(a); }; Debug.disassembleConstructor=function(a){ if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.'); return %DebugDisassembleConstructor(a); }; Debug.ExecuteInDebugContext=function(a,b){ if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.'); return %ExecuteInDebugContext(a,!!b); }; Debug.sourcePosition=function(a){ if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.'); return %FunctionGetScriptSourcePosition(a); }; Debug.findFunctionSourceLocation=function(a,b,c){ var d=%FunctionGetScript(a); var g=%FunctionGetScriptSourcePosition(a); return d.locationFromLine(b,c,g); }; Debug.findScriptSourcePosition=function(a,b,c){ var d=a.locationFromLine(b,c); return d?d.position:null; }; Debug.findBreakPoint=function(a,b){ var c; for(var d=0;d<break_points.length;d++){ if(break_points[d].number()==a){ c=break_points[d]; if(b){ break_points.splice(d,1); } break; } } if(c){ return c; }else{ return this.findScriptBreakPoint(a,b); } }; Debug.findBreakPointActualLocations=function(a){ for(var b=0;b<script_break_points.length;b++){ if(script_break_points[b].number()==a){ return script_break_points[b].actual_locations(); } } for(var b=0;b<break_points.length;b++){ if(break_points[b].number()==a){ return[break_points[b].actual_location]; } } return[]; }; Debug.setBreakPoint=function(a,b,c,d){ if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.'); if(%FunctionIsAPIFunction(a)){ throw new Error('Cannot set break point in native code.'); } var g= this.findFunctionSourceLocation(a,b,c).position; var h=g-this.sourcePosition(a); var i=%FunctionGetScript(a); if(i.type==Debug.ScriptType.Native){ throw new Error('Cannot set break point in native code.'); } if(i&&i.id){ h+=%FunctionGetScriptSourcePosition(a); var j=i.locationFromPosition(h,false); return this.setScriptBreakPointById(i.id, j.line,j.column, d); }else{ var k=MakeBreakPoint(h); var l= %SetFunctionBreakPoint(a,h,k); l+=this.sourcePosition(a); var m=i.locationFromPosition(l,true); k.actual_location={line:m.line, column:m.column, script_id:i.id}; k.setCondition(d); return k.number(); } }; Debug.setBreakPointByScriptIdAndPosition=function(script_id,position, condition,enabled) { break_point=MakeBreakPoint(position); break_point.setCondition(condition); if(!enabled){ break_point.disable(); } var a=this.scripts(); for(var b=0;b<a.length;b++){ if(script_id==a[b].id){ break_point.actual_position=%SetScriptBreakPoint(a[b],position, break_point); break; } } return break_point; }; Debug.enableBreakPoint=function(a){ var b=this.findBreakPoint(a,false); if(b){ b.enable(); } }; Debug.disableBreakPoint=function(a){ var b=this.findBreakPoint(a,false); if(b){ b.disable(); } }; Debug.changeBreakPointCondition=function(a,b){ var c=this.findBreakPoint(a,false); c.setCondition(b); }; Debug.changeBreakPointIgnoreCount=function(a,b){ if(b<0){ throw new Error('Invalid argument'); } var c=this.findBreakPoint(a,false); c.setIgnoreCount(b); }; Debug.clearBreakPoint=function(a){ var b=this.findBreakPoint(a,true); if(b){ return %ClearBreakPoint(b); }else{ b=this.findScriptBreakPoint(a,true); if(!b){ throw new Error('Invalid breakpoint'); } } }; Debug.clearAllBreakPoints=function(){ for(var a=0;a<break_points.length;a++){ break_point=break_points[a]; %ClearBreakPoint(break_point); } break_points=[]; }; Debug.disableAllBreakPoints=function(){ for(var a=1;a<next_break_point_number;a++){ Debug.disableBreakPoint(a); } %ChangeBreakOnException(Debug.ExceptionBreak.Caught,false); %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught,false); }; Debug.findScriptBreakPoint=function(a,b){ var c; for(var d=0;d<script_break_points.length;d++){ if(script_break_points[d].number()==a){ c=script_break_points[d]; if(b){ c.clear(); script_break_points.splice(d,1); } break; } } return c; }; Debug.setScriptBreakPoint=function(type,script_id_or_name, opt_line,opt_column,opt_condition, opt_groupId){ var a= new ScriptBreakPoint(type,script_id_or_name,opt_line,opt_column, opt_groupId); a.number_=next_break_point_number++; a.setCondition(opt_condition); script_break_points.push(a); var b=this.scripts(); for(var c=0;c<b.length;c++){ if(a.matchesScript(b[c])){ a.set(b[c]); } } return a.number(); }; Debug.setScriptBreakPointById=function(script_id, opt_line,opt_column, opt_condition,opt_groupId){ return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, script_id,opt_line,opt_column, opt_condition,opt_groupId); }; Debug.setScriptBreakPointByName=function(script_name, opt_line,opt_column, opt_condition,opt_groupId){ return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptName, script_name,opt_line,opt_column, opt_condition,opt_groupId); }; Debug.setScriptBreakPointByRegExp=function(script_regexp, opt_line,opt_column, opt_condition,opt_groupId){ return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptRegExp, script_regexp,opt_line,opt_column, opt_condition,opt_groupId); }; Debug.enableScriptBreakPoint=function(a){ var b=this.findScriptBreakPoint(a,false); b.enable(); }; Debug.disableScriptBreakPoint=function(a){ var b=this.findScriptBreakPoint(a,false); b.disable(); }; Debug.changeScriptBreakPointCondition=function( break_point_number,condition){ var a=this.findScriptBreakPoint(break_point_number,false); a.setCondition(condition); }; Debug.changeScriptBreakPointIgnoreCount=function( break_point_number,ignoreCount){ if(ignoreCount<0){ throw new Error('Invalid argument'); } var a=this.findScriptBreakPoint(break_point_number,false); a.setIgnoreCount(ignoreCount); }; Debug.scriptBreakPoints=function(){ return script_break_points; }; Debug.clearStepping=function(){ %ClearStepping(); }; Debug.setBreakOnException=function(){ return %ChangeBreakOnException(Debug.ExceptionBreak.Caught,true); }; Debug.clearBreakOnException=function(){ return %ChangeBreakOnException(Debug.ExceptionBreak.Caught,false); }; Debug.isBreakOnException=function(){ return!!%IsBreakOnException(Debug.ExceptionBreak.Caught); }; Debug.setBreakOnUncaughtException=function(){ return %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught,true); }; Debug.clearBreakOnUncaughtException=function(){ return %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught,false); }; Debug.isBreakOnUncaughtException=function(){ return!!%IsBreakOnException(Debug.ExceptionBreak.Uncaught); }; Debug.showBreakPoints=function(a,b){ if(!(%_IsFunction(a)))throw new Error('Parameters have wrong types.'); var c=b?this.scriptSource(a):this.source(a); var d=b?this.sourcePosition(a):0; var g=this.breakLocations(a); if(!g)return c; g.sort(function(h,i){return h-i;}); var j=""; var k=0; var l; for(var m=0;m<g.length;m++){ l=g[m]-d; j+=c.slice(k,l); j+="[B"+m+"]"; k=l; } l=c.length; j+=c.substring(k,l); return j; }; Debug.scripts=function(){ return %DebugGetLoadedScripts(); }; Debug.debuggerFlags=function(){ return debugger_flags; }; Debug.MakeMirror=MakeMirror; function MakeExecutionState(a){ return new ExecutionState(a); } function ExecutionState(a){ this.break_id=a; this.selected_frame=0; } ExecutionState.prototype.prepareStep=function(a,b){ var c=Debug.StepAction.StepIn; if(!(typeof(a)==='undefined'))c=%ToNumber(a); var d=b?%ToNumber(b):1; return %PrepareStep(this.break_id,c,d); }; ExecutionState.prototype.evaluateGlobal=function(source,disable_break, opt_additional_context){ return MakeMirror(%DebugEvaluateGlobal(this.break_id,source, Boolean(disable_break), opt_additional_context)); }; ExecutionState.prototype.frameCount=function(){ return %GetFrameCount(this.break_id); }; ExecutionState.prototype.threadCount=function(){ return %GetThreadCount(this.break_id); }; ExecutionState.prototype.frame=function(a){ if(a==null)a=this.selected_frame; if(a<0||a>=this.frameCount()){ throw new Error('Illegal frame index.'); } return new FrameMirror(this.break_id,a); }; ExecutionState.prototype.setSelectedFrame=function(a){ var b=%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;c<this.breakPointsHit().length;c++){ var d=this.breakPointsHit()[c]; var g=d.script_break_point(); var h; if(g){ h=g.number(); }else{ h=d.number(); } a.body.breakpoints.push(h); } } return JSON.stringify(ObjectToProtocolObject_(a)); }; function MakeExceptionEvent(a,b,c){ return new ExceptionEvent(a,b,c); } function ExceptionEvent(a,b,c){ this.exec_state_=a; this.exception_=b; this.uncaught_=c; } ExceptionEvent.prototype.executionState=function(){ return this.exec_state_; }; ExceptionEvent.prototype.eventType=function(){ return Debug.DebugEvent.Exception; }; ExceptionEvent.prototype.exception=function(){ return this.exception_; }; ExceptionEvent.prototype.uncaught=function(){ return this.uncaught_; }; ExceptionEvent.prototype.func=function(){ return this.exec_state_.frame(0).func(); }; ExceptionEvent.prototype.sourceLine=function(){ return this.exec_state_.frame(0).sourceLine(); }; ExceptionEvent.prototype.sourceColumn=function(){ return this.exec_state_.frame(0).sourceColumn(); }; ExceptionEvent.prototype.sourceLineText=function(){ return this.exec_state_.frame(0).sourceLineText(); }; ExceptionEvent.prototype.toJSONProtocol=function(){ var a=new ProtocolMessage(); a.event="exception"; a.body={uncaught:this.uncaught_, exception:MakeMirror(this.exception_) }; if(this.exec_state_.frameCount()>0){ a.body.sourceLine=this.sourceLine(); a.body.sourceColumn=this.sourceColumn(); a.body.sourceLineText=this.sourceLineText(); var b=this.func().script(); if(b){ a.body.script=MakeScriptObject_(b,false); } }else{ a.body.sourceLine=-1; } return a.toJSONProtocol(); }; function MakeCompileEvent(a,b,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.body.length;d++){ if(this.body[d]instanceof Mirror){ b.push(c.serializeValue(this.body[d])); }else{ b.push(ObjectToProtocolObject_(this.body[d],c)); } } }else{ b=ObjectToProtocolObject_(this.body,c); } a.body=b; a.refs=c.serializeReferencedObjects(); } if(this.message){ a.message=this.message; } if(this.error_details){ a.error_details=this.error_details; } a.running=this.running; return JSON.stringify(a); }; DebugCommandProcessor.prototype.createResponse=function(a){ return new ProtocolMessage(a); }; DebugCommandProcessor.prototype.processDebugJSONRequest=function( json_request){ var a; var b; try{ try{ a=JSON.parse(json_request); b=this.createResponse(a); if(!a.type){ throw new Error('Type not specified'); } if(a.type!='request'){ throw new Error("Illegal type '"+a.type+"' in request"); } if(!a.command){ throw new Error('Command not specified'); } if(a.arguments){ var c=a.arguments; if(c.inlineRefs||c.compactFormat){ b.setOption('inlineRefs',true); } if(!(typeof(c.maxStringLength)==='undefined')){ b.setOption('maxStringLength',c.maxStringLength); } } if(a.command=='continue'){ this.continueRequest_(a,b); }else if(a.command=='break'){ this.breakRequest_(a,b); }else if(a.command=='setbreakpoint'){ this.setBreakPointRequest_(a,b); }else if(a.command=='changebreakpoint'){ this.changeBreakPointRequest_(a,b); }else if(a.command=='clearbreakpoint'){ this.clearBreakPointRequest_(a,b); }else if(a.command=='clearbreakpointgroup'){ this.clearBreakPointGroupRequest_(a,b); }else if(a.command=='disconnect'){ this.disconnectRequest_(a,b); }else if(a.command=='setexceptionbreak'){ this.setExceptionBreakRequest_(a,b); }else if(a.command=='listbreakpoints'){ this.listBreakpointsRequest_(a,b); }else if(a.command=='backtrace'){ this.backtraceRequest_(a,b); }else if(a.command=='frame'){ this.frameRequest_(a,b); }else if(a.command=='scopes'){ this.scopesRequest_(a,b); }else if(a.command=='scope'){ this.scopeRequest_(a,b); }else if(a.command=='setVariableValue'){ this.setVariableValueRequest_(a,b); }else if(a.command=='evaluate'){ this.evaluateRequest_(a,b); }else if(a.command=='lookup'){ this.lookupRequest_(a,b); }else if(a.command=='references'){ this.referencesRequest_(a,b); }else if(a.command=='source'){ this.sourceRequest_(a,b); }else if(a.command=='scripts'){ this.scriptsRequest_(a,b); }else if(a.command=='threads'){ this.threadsRequest_(a,b); }else if(a.command=='suspend'){ this.suspendRequest_(a,b); }else if(a.command=='version'){ this.versionRequest_(a,b); }else if(a.command=='profile'){ this.profileRequest_(a,b); }else if(a.command=='changelive'){ this.changeLiveRequest_(a,b); }else if(a.command=='restartframe'){ this.restartFrameRequest_(a,b); }else if(a.command=='flags'){ this.debuggerFlagsRequest_(a,b); }else if(a.command=='v8flags'){ this.v8FlagsRequest_(a,b); }else if(a.command=='gc'){ this.gcRequest_(a,b); }else{ throw new Error('Unknown command "'+a.command+'" in request'); } }catch(e){ if(!b){ b=this.createResponse(); } b.success=false; b.message=%ToString(e); } try{ if(!(typeof(b.running)==='undefined')){ this.running_=b.running; } b.running=this.running_; return b.toJSONProtocol(); }catch(e){ return'{"seq":'+b.seq+','+ '"request_seq":'+a.seq+','+ '"type":"response",'+ '"success":false,'+ '"message":"Internal error: '+%ToString(e)+'"}'; } }catch(e){ return'{"seq":0,"type":"response","success":false,"message":"Internal error"}'; } }; DebugCommandProcessor.prototype.continueRequest_=function(a,b){ if(a.arguments){ var c=1; var d=Debug.StepAction.StepIn; var g=a.arguments.stepaction; var h=a.arguments.stepcount; if(h){ c=%ToNumber(h); if(c<0){ throw new Error('Invalid stepcount argument "'+h+'".'); } } if(g){ if(g=='in'){ d=Debug.StepAction.StepIn; }else if(g=='min'){ d=Debug.StepAction.StepMin; }else if(g=='next'){ d=Debug.StepAction.StepNext; }else if(g=='out'){ d=Debug.StepAction.StepOut; }else{ throw new Error('Invalid stepaction argument "'+g+'".'); } } this.exec_state_.prepareStep(d,c); } b.running=true; }; DebugCommandProcessor.prototype.breakRequest_=function(a,b){ }; DebugCommandProcessor.prototype.setBreakPointRequest_= function(a,b){ if(!a.arguments){ b.failed('Missing arguments'); return; } var c=a.arguments.type; var d=a.arguments.target; var g=a.arguments.line; var h=a.arguments.column; var i=(typeof(a.arguments.enabled)==='undefined')? true:a.arguments.enabled; var j=a.arguments.condition; var k=a.arguments.ignoreCount; var l=a.arguments.groupId; if(!c||(typeof(d)==='undefined')){ b.failed('Missing argument "type" or "target"'); return; } var m; if(c=='function'){ if(!(typeof(d)==='string')){ b.failed('Argument "target" is not a string value'); return; } var o; try{ o=this.exec_state_.evaluateGlobal(d).value(); }catch(e){ b.failed('Error: "'+%ToString(e)+ '" evaluating "'+d+'"'); return; } if(!(%_IsFunction(o))){ b.failed('"'+d+'" does not evaluate to a function'); return; } m=Debug.setBreakPoint(o,g,h,j); }else if(c=='handle'){ var q=parseInt(d,10); var r=LookupMirror(q); if(!r){ return b.failed('Object #'+q+'# not found'); } if(!r.isFunction()){ return b.failed('Object #'+q+'# is not a function'); } m=Debug.setBreakPoint(r.value(), g,h,j); }else if(c=='script'){ m= Debug.setScriptBreakPointByName(d,g,h,j, l); }else if(c=='scriptId'){ m= Debug.setScriptBreakPointById(d,g,h,j,l); }else if(c=='scriptRegExp'){ m= Debug.setScriptBreakPointByRegExp(d,g,h,j, l); }else{ b.failed('Illegal type "'+c+'"'); return; } var t=Debug.findBreakPoint(m); if(k){ Debug.changeBreakPointIgnoreCount(m,k); } if(!i){ Debug.disableBreakPoint(m); } b.body={type:c, breakpoint:m}; if(t instanceof ScriptBreakPoint){ if(t.type()==Debug.ScriptBreakPointType.ScriptId){ b.body.type='scriptId'; b.body.script_id=t.script_id(); }else if(t.type()==Debug.ScriptBreakPointType.ScriptName){ b.body.type='scriptName'; b.body.script_name=t.script_name(); }else if(t.type()==Debug.ScriptBreakPointType.ScriptRegExp){ b.body.type='scriptRegExp'; b.body.script_regexp=t.script_regexp_object().source; }else{ throw new Error("Internal error: Unexpected breakpoint type: "+ t.type()); } b.body.line=t.line(); b.body.column=t.column(); b.body.actual_locations=t.actual_locations(); }else{ b.body.type='function'; b.body.actual_locations=[t.actual_location]; } }; DebugCommandProcessor.prototype.changeBreakPointRequest_=function( request,response){ if(!request.arguments){ response.failed('Missing arguments'); return; } var a=%ToNumber(request.arguments.breakpoint); var b=request.arguments.enabled; var c=request.arguments.condition; var d=request.arguments.ignoreCount; if(!a){ response.failed('Missing argument "breakpoint"'); return; } if(!(typeof(b)==='undefined')){ if(b){ Debug.enableBreakPoint(a); }else{ Debug.disableBreakPoint(a); } } if(!(typeof(c)==='undefined')){ Debug.changeBreakPointCondition(a,c); } if(!(typeof(d)==='undefined')){ Debug.changeBreakPointIgnoreCount(a,d); } }; DebugCommandProcessor.prototype.clearBreakPointGroupRequest_=function( request,response){ if(!request.arguments){ response.failed('Missing arguments'); return; } var a=request.arguments.groupId; if(!a){ response.failed('Missing argument "groupId"'); return; } var b=[]; var c=[]; for(var d=0;d<script_break_points.length;d++){ var g=script_break_points[d]; if(g.groupId()==a){ b.push(g.number()); g.clear(); }else{ c.push(g); } } script_break_points=c; response.body={breakpoints:b}; }; DebugCommandProcessor.prototype.clearBreakPointRequest_=function( request,response){ if(!request.arguments){ response.failed('Missing arguments'); return; } var a=%ToNumber(request.arguments.breakpoint); if(!a){ response.failed('Missing argument "breakpoint"'); return; } Debug.clearBreakPoint(a); response.body={breakpoint:a}; }; DebugCommandProcessor.prototype.listBreakpointsRequest_=function( request,response){ var a=[]; for(var b=0;b<script_break_points.length;b++){ var c=script_break_points[b]; var d={ number:c.number(), line:c.line(), column:c.column(), groupId:c.groupId(), hit_count:c.hit_count(), active:c.active(), condition:c.condition(), ignoreCount:c.ignoreCount(), actual_locations:c.actual_locations() }; if(c.type()==Debug.ScriptBreakPointType.ScriptId){ d.type='scriptId'; d.script_id=c.script_id(); }else if(c.type()==Debug.ScriptBreakPointType.ScriptName){ d.type='scriptName'; d.script_name=c.script_name(); }else if(c.type()==Debug.ScriptBreakPointType.ScriptRegExp){ d.type='scriptRegExp'; d.script_regexp=c.script_regexp_object().source; }else{ throw new Error("Internal error: Unexpected breakpoint type: "+ c.type()); } a.push(d); } response.body={ breakpoints:a, breakOnExceptions:Debug.isBreakOnException(), breakOnUncaughtExceptions:Debug.isBreakOnUncaughtException() }; }; DebugCommandProcessor.prototype.disconnectRequest_= function(a,b){ Debug.disableAllBreakPoints(); this.continueRequest_(a,b); }; DebugCommandProcessor.prototype.setExceptionBreakRequest_= function(a,b){ if(!a.arguments){ b.failed('Missing arguments'); return; } var c=a.arguments.type; if(!c){ b.failed('Missing argument "type"'); return; } var d; if(c=='all'){ d=!Debug.isBreakOnException(); }else if(c=='uncaught'){ d=!Debug.isBreakOnUncaughtException(); } if(!(typeof(a.arguments.enabled)==='undefined')){ d=a.arguments.enabled; if((d!=true)&&(d!=false)){ b.failed('Illegal value for "enabled":"'+d+'"'); } } if(c=='all'){ %ChangeBreakOnException(Debug.ExceptionBreak.Caught,d); }else if(c=='uncaught'){ %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught,d); }else{ b.failed('Unknown "type":"'+c+'"'); } b.body={'type':c,'enabled':d}; }; DebugCommandProcessor.prototype.backtraceRequest_=function( request,response){ var a=this.exec_state_.frameCount(); if(a==0){ response.body={ totalFrames:a }; return; } var b=0; var c=kDefaultBacktraceLength; if(request.arguments){ if(request.arguments.fromFrame){ b=request.arguments.fromFrame; } if(request.arguments.toFrame){ c=request.arguments.toFrame; } if(request.arguments.bottom){ var d=a-b; b=a-c; c=d; } if(b<0||c<0){ return response.failed('Invalid frame number'); } } c=Math.min(a,c); if(c<=b){ var g='Invalid frame range'; return response.failed(g); } var h=[]; for(var i=b;i<c;i++){ h.push(this.exec_state_.frame(i)); } response.body={ fromFrame:b, toFrame:c, totalFrames:a, frames:h }; }; DebugCommandProcessor.prototype.frameRequest_=function(a,b){ if(this.exec_state_.frameCount()==0){ return b.failed('No frames'); } if(a.arguments){ var c=a.arguments.number; if(c<0||this.exec_state_.frameCount()<=c){ return b.failed('Invalid frame number'); } this.exec_state_.setSelectedFrame(a.arguments.number); } b.body=this.exec_state_.frame(); }; DebugCommandProcessor.prototype.resolveFrameFromScopeDescription_= function(a){ if(a&&!(typeof(a.frameNumber)==='undefined')){ frame_index=a.frameNumber; if(frame_index<0||this.exec_state_.frameCount()<=frame_index){ throw new Error('Invalid frame number'); } return this.exec_state_.frame(frame_index); }else{ return this.exec_state_.frame(); } }; DebugCommandProcessor.prototype.resolveScopeHolder_= function(a){ if(a&&"functionHandle"in a){ if(!(typeof(a.functionHandle)==='number')){ throw new Error('Function handle must be a number'); } var b=LookupMirror(a.functionHandle); if(!b){ throw new Error('Failed to find function object by handle'); } if(!b.isFunction()){ throw new Error('Value of non-function type is found by handle'); } return b; }else{ if(this.exec_state_.frameCount()==0){ throw new Error('No scopes'); } var c=this.resolveFrameFromScopeDescription_(a); return c; } } DebugCommandProcessor.prototype.scopesRequest_=function(a,b){ var c=this.resolveScopeHolder_(a.arguments); var d=c.scopeCount(); var g=[]; for(var h=0;h<d;h++){ g.push(c.scope(h)); } b.body={ fromScope:0, toScope:d, totalScopes:d, scopes:g }; }; DebugCommandProcessor.prototype.scopeRequest_=function(a,b){ var c=this.resolveScopeHolder_(a.arguments); var d=0; if(a.arguments&&!(typeof(a.arguments.number)==='undefined')){ d=%ToNumber(a.arguments.number); if(d<0||c.scopeCount()<=d){ return b.failed('Invalid scope number'); } } b.body=c.scope(d); }; DebugCommandProcessor.resolveValue_=function(a){ if("handle"in a){ var b=LookupMirror(a.handle); if(!b){ throw new Error("Failed to resolve value by handle, ' #"+ mapping.handle+"# not found"); } return b.value(); }else if("stringDescription"in a){ if(a.type==BOOLEAN_TYPE){ return Boolean(a.stringDescription); }else if(a.type==NUMBER_TYPE){ return Number(a.stringDescription); }if(a.type==STRING_TYPE){ return String(a.stringDescription); }else{ throw new Error("Unknown type"); } }else if("value"in a){ return a.value; }else if(a.type==UNDEFINED_TYPE){ return void 0; }else if(a.type==NULL_TYPE){ return null; }else{ throw new Error("Failed to parse value description"); } }; DebugCommandProcessor.prototype.setVariableValueRequest_= function(a,b){ if(!a.arguments){ b.failed('Missing arguments'); return; } if((typeof(a.arguments.name)==='undefined')){ b.failed('Missing variable name'); } var c=a.arguments.name; var d=a.arguments.scope; var g=this.resolveScopeHolder_(d); if((typeof(d.number)==='undefined')){ b.failed('Missing scope number'); } var h=%ToNumber(d.number); var i=g.scope(h); var j= DebugCommandProcessor.resolveValue_(a.arguments.newValue); i.setVariableValue(c,j); var k=MakeMirror(j); b.body={ newValue:k }; }; DebugCommandProcessor.prototype.evaluateRequest_=function(a,b){ if(!a.arguments){ return b.failed('Missing arguments'); } var c=a.arguments.expression; var d=a.arguments.frame; var g=a.arguments.global; var h=a.arguments.disable_break; var i=a.arguments.additional_context; try{ c=String(c); }catch(e){ return b.failed('Failed to convert expression argument to string'); } if(!(typeof(d)==='undefined')&&g){ return b.failed('Arguments "frame" and "global" are exclusive'); } var j; if(i){ j={}; for(var k=0;k<i.length;k++){ var l=i[k]; if(!(typeof(l.name)==='string')){ return b.failed("Context element #"+k+ " doesn't contain name:string property"); } var m=DebugCommandProcessor.resolveValue_(l); j[l.name]=m; } } if(g){ b.body=this.exec_state_.evaluateGlobal( c,Boolean(h),j); return; } if((typeof(h)==='undefined')){ h=true; } if(this.exec_state_.frameCount()==0){ return b.failed('No frames'); } if(!(typeof(d)==='undefined')){ var o=%ToNumber(d); if(o<0||o>=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<c.length;g++){ var h=c[g]; var i=LookupMirror(h); if(!i){ return b.failed('Object #'+h+'# not found'); } d[h]=i; } b.body=d; }; DebugCommandProcessor.prototype.referencesRequest_= function(a,b){ if(!a.arguments){ return b.failed('Missing arguments'); } var c=a.arguments.type; var d=a.arguments.handle; if((typeof(c)==='undefined')){ return b.failed('Argument "type" missing'); } if((typeof(d)==='undefined')){ return b.failed('Argument "handle" missing'); } if(c!='referencedBy'&&c!='constructedBy'){ return b.failed('Invalid type "'+c+'"'); } var g=LookupMirror(d); if(g){ if(c=='referencedBy'){ b.body=g.referencedBy(); }else{ b.body=g.constructedBy(); } }else{ return b.failed('Object #'+d+'# not found'); } }; DebugCommandProcessor.prototype.sourceRequest_=function(a,b){ if(this.exec_state_.frameCount()==0){ return b.failed('No source'); } var c; var d; var g=this.exec_state_.frame(); if(a.arguments){ c=a.arguments.fromLine; d=a.arguments.toLine; if(!(typeof(a.arguments.frame)==='undefined')){ var h=%ToNumber(a.arguments.frame); if(h<0||h>=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<h.length;i++){ g[h[i]]=true; } } var j=null; var k=null; if(!(typeof(a.arguments.filter)==='undefined')){ var l=%ToNumber(a.arguments.filter); if(!isNaN(l)){ k=l; } j=a.arguments.filter; } } var m=%DebugGetLoadedScripts(); b.body=[]; for(var i=0;i<m.length;i++){ if(g&&!g[m[i].id]){ continue; } if(j||k){ var o=m[i]; var q=false; if(k&&!q){ if(o.id&&o.id===k){ q=true; } } if(j&&!q){ if(o.name&&o.name.indexOf(j)>=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<c;g++){ var h=%GetThreadDetails(this.exec_state_.break_id,g); var i={current:h[0], id:h[1] }; d.push(i); } b.body={ totalThreads:c, threads:d }; }; DebugCommandProcessor.prototype.suspendRequest_=function(a,b){ b.running=false; }; DebugCommandProcessor.prototype.versionRequest_=function(a,b){ b.body={ V8Version:%GetV8Version() }; }; DebugCommandProcessor.prototype.profileRequest_=function(a,b){ if(a.arguments.command=='resume'){ %ProfilerResume(); }else if(a.arguments.command=='pause'){ %ProfilerPause(); }else{ return b.failed('Unknown command'); } b.body={}; }; DebugCommandProcessor.prototype.changeLiveRequest_=function( request,response){ if(!request.arguments){ return response.failed('Missing arguments'); } var a=request.arguments.script_id; var b=!!request.arguments.preview_only; var c=%DebugGetLoadedScripts(); var d=null; for(var g=0;g<c.length;g++){ if(c[g].id==a){ d=c[g]; } } if(!d){ response.failed('Script not found'); return; } var h=new Array(); if(!(typeof(request.arguments.new_source)==='string')){ throw"new_source argument expected"; } var i=request.arguments.new_source; var j; try{ j=Debug.LiveEdit.SetScriptSource(d, i,b,h); }catch(e){ if(e instanceof Debug.LiveEdit.Failure&&"details"in e){ response.failed(e.message,e.details); return; } throw e; } response.body={change_log:h,result:j}; if(!b&&!this.running_&&j.stack_modified){ response.body.stepin_recommended=true; } }; DebugCommandProcessor.prototype.restartFrameRequest_=function( request,response){ if(!request.arguments){ return response.failed('Missing arguments'); } var a=request.arguments.frame; if(this.exec_state_.frameCount()==0){ return response.failed('No frames'); } var b; if(!(typeof(a)==='undefined')){ var c=%ToNumber(a); if(c<0||c>=this.exec_state_.frameCount()){ return response.failed('Invalid frame "'+a+'"'); } b=this.exec_state_.frame(c); }else{ b=this.exec_state_.frame(); } var d=Debug.LiveEdit.RestartFrame(b); response.body={result:d}; }; DebugCommandProcessor.prototype.debuggerFlagsRequest_=function(request, response){ if(!request.arguments){ response.failed('Missing arguments'); return; } var a=request.arguments.flags; response.body={flags:[]}; if(!(typeof(a)==='undefined')){ for(var b=0;b<a.length;b++){ var c=a[b].name; var d=debugger_flags[c]; if(!d){ continue; } if('value'in a[b]){ d.setValue(a[b].value); } response.body.flags.push({name:c,value:d.getValue()}); } }else{ for(var c in debugger_flags){ var g=debugger_flags[c].getValue(); response.body.flags.push({name:c,value:g}); } } }; DebugCommandProcessor.prototype.v8FlagsRequest_=function(a,b){ var c=a.arguments.flags; if(!c)c=''; %SetFlags(c); }; DebugCommandProcessor.prototype.gcRequest_=function(a,b){ var c=a.arguments.type; if(!c)c='all'; var d=%GetHeapUsage(); %CollectGarbage(c); var g=%GetHeapUsage(); b.body={"before":d,"after":g}; }; DebugCommandProcessor.prototype.isRunning=function(){ return this.running_; }; DebugCommandProcessor.prototype.systemBreak=function(a,b){ return %SystemBreak(); }; function NumberToHex8Str(a){ var b=""; for(var c=0;c<8;++c){ var d=hexCharArray[a&0x0F]; b=d+b; a=a>>>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<a.length;d++){ c.push(ValueToProtocolValue_(a[d],b)); } return c; } function ValueToProtocolValue_(a,b){ var c; switch(typeof a){ case'object': if(a instanceof Mirror){ c=b.serializeValue(a); }else if((%_IsArray(a))){ c=ArrayToProtocolArray_(a,b); }else{ c=ObjectToProtocolObject_(a,b); } break; case'boolean': case'string': case'number': c=a; break; default: c=null; } return c; } Debug.TestApi={ CommandProcessorResolveValue:DebugCommandProcessor.resolveValue_ }; var next_handle_=0; var next_transient_handle_=-1; var mirror_cache_=[]; function ClearMirrorCache(){ next_handle_=0; mirror_cache_=[]; } function MakeMirror(a,b){ var c; if(!b){ for(id in mirror_cache_){ c=mirror_cache_[id]; if(c.value()===a){ return c; } if(c.isNumber()&&isNaN(c.value())&& typeof a=='number'&&isNaN(a)){ return c; } } } if((typeof(a)==='undefined')){ c=new UndefinedMirror(); }else if((a===null)){ c=new NullMirror(); }else if((typeof(a)==='boolean')){ c=new BooleanMirror(a); }else if((typeof(a)==='number')){ c=new NumberMirror(a); }else if((typeof(a)==='string')){ c=new StringMirror(a); }else if((%_IsArray(a))){ c=new ArrayMirror(a); }else if((%_ClassOf(a)==='Date')){ c=new DateMirror(a); }else if((%_IsFunction(a))){ c=new FunctionMirror(a); }else if((%_IsRegExp(a))){ c=new RegExpMirror(a); }else if((%_ClassOf(a)==='Error')){ c=new ErrorMirror(a); }else if((%_ClassOf(a)==='Script')){ c=new ScriptMirror(a); }else{ c=new ObjectMirror(a,OBJECT_TYPE,b); } mirror_cache_[c.handle()]=c; return c; } function LookupMirror(a){ return mirror_cache_[a]; } function GetUndefinedMirror(){ return MakeMirror(void 0); } function inherits(a,b){ var c=function(){}; c.prototype=b.prototype; a.super_=b.prototype; a.prototype=new c(); a.prototype.constructor=a; } var UNDEFINED_TYPE='undefined'; var NULL_TYPE='null'; var BOOLEAN_TYPE='boolean'; var NUMBER_TYPE='number'; var STRING_TYPE='string'; var OBJECT_TYPE='object'; var FUNCTION_TYPE='function'; var REGEXP_TYPE='regexp'; var ERROR_TYPE='error'; var PROPERTY_TYPE='property'; var INTERNAL_PROPERTY_TYPE='internalProperty'; var FRAME_TYPE='frame'; var SCRIPT_TYPE='script'; var CONTEXT_TYPE='context'; var SCOPE_TYPE='scope'; var kMaxProtocolStringLength=80; var PropertyKind={}; PropertyKind.Named=1; PropertyKind.Indexed=2; var PropertyType={}; PropertyType.Normal=0; PropertyType.Field=1; PropertyType.ConstantFunction=2; PropertyType.Callbacks=3; PropertyType.Handler=4; PropertyType.Interceptor=5; PropertyType.Transition=6; PropertyType.Nonexistent=7; var PropertyAttribute={}; PropertyAttribute.None=0; PropertyAttribute.ReadOnly=1; PropertyAttribute.DontEnum=2; PropertyAttribute.DontDelete=4; var ScopeType={Global:0, Local:1, With:2, Closure:3, Catch:4, Block:5}; function Mirror(a){ this.type_=a; } Mirror.prototype.type=function(){ return this.type_; }; Mirror.prototype.isValue=function(){ return this instanceof ValueMirror; }; Mirror.prototype.isUndefined=function(){ return this instanceof UndefinedMirror; }; Mirror.prototype.isNull=function(){ return this instanceof NullMirror; }; Mirror.prototype.isBoolean=function(){ return this instanceof BooleanMirror; }; Mirror.prototype.isNumber=function(){ return this instanceof NumberMirror; }; Mirror.prototype.isString=function(){ return this instanceof StringMirror; }; Mirror.prototype.isObject=function(){ return this instanceof ObjectMirror; }; Mirror.prototype.isFunction=function(){ return this instanceof FunctionMirror; }; Mirror.prototype.isUnresolvedFunction=function(){ return this instanceof UnresolvedFunctionMirror; }; Mirror.prototype.isArray=function(){ return this instanceof ArrayMirror; }; Mirror.prototype.isDate=function(){ return this instanceof DateMirror; }; Mirror.prototype.isRegExp=function(){ return this instanceof RegExpMirror; }; Mirror.prototype.isError=function(){ return this instanceof ErrorMirror; }; Mirror.prototype.isProperty=function(){ return this instanceof PropertyMirror; }; Mirror.prototype.isInternalProperty=function(){ return this instanceof InternalPropertyMirror; }; Mirror.prototype.isFrame=function(){ return this instanceof FrameMirror; }; Mirror.prototype.isScript=function(){ return this instanceof ScriptMirror; }; Mirror.prototype.isContext=function(){ return this instanceof ContextMirror; }; Mirror.prototype.isScope=function(){ return this instanceof ScopeMirror; }; Mirror.prototype.allocateHandle_=function(){ this.handle_=next_handle_++; }; Mirror.prototype.allocateTransientHandle_=function(){ this.handle_=next_transient_handle_--; }; Mirror.prototype.toText=function(){ return"#<"+this.constructor.name+">"; }; function ValueMirror(a,b,c){ %_CallFunction(this,a,Mirror); this.value_=b; if(!c){ this.allocateHandle_(); }else{ this.allocateTransientHandle_(); } } inherits(ValueMirror,Mirror); Mirror.prototype.handle=function(){ return this.handle_; }; ValueMirror.prototype.isPrimitive=function(){ var a=this.type(); return a==='undefined'|| a==='null'|| a==='boolean'|| a==='number'|| a==='string'; }; 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<b&&l<c.length;l++){ j[k++]=c[l]; } } if(a&PropertyKind.Indexed){ for(var l=0;k<b&&l<d.length;l++){ j[k++]=d[l]; } } return j; }; ObjectMirror.prototype.properties=function(a,b){ var c=this.propertyNames(a,b); var d=new Array(c.length); for(var g=0;g<c.length;g++){ d[g]=this.property(c[g]); } return d; }; ObjectMirror.prototype.internalProperties=function(){ return ObjectMirror.GetInternalProperties(this.value_); } ObjectMirror.prototype.property=function(a){ var b=%DebugGetPropertyDetails(this.value_,%ToString(a)); if(b){ return new PropertyMirror(this,a,b); } return GetUndefinedMirror(); }; ObjectMirror.prototype.lookupProperty=function(a){ var b=this.properties(); for(var c=0;c<b.length;c++){ var d=b[c]; if(d.propertyType()!=PropertyType.Callbacks){ if(%_ObjectEquals(d.value_,a.value_)){ return d; } } } return GetUndefinedMirror(); }; ObjectMirror.prototype.referencedBy=function(a){ var b=%DebugReferencedBy(this.value_, Mirror.prototype,a||0); for(var c=0;c<b.length;c++){ b[c]=MakeMirror(b[c]); } return b; }; ObjectMirror.prototype.toText=function(){ var a; var b=this.constructorFunction(); if(!b.isFunction()){ a=this.className(); }else{ a=b.name(); if(!a){ a=this.className(); } } return'#<'+a+'>'; }; ObjectMirror.GetInternalProperties=function(a){ 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;h<c.length;h++){ g.push(c[h]); } d.push(new InternalPropertyMirror("[[BoundArgs]]",g)); } return d; } return[]; } function FunctionMirror(a){ %_CallFunction(this,a,FUNCTION_TYPE,ObjectMirror); this.resolved_=true; } inherits(FunctionMirror,ObjectMirror); FunctionMirror.prototype.resolved=function(){ return this.resolved_; }; FunctionMirror.prototype.name=function(){ return %FunctionGetName(this.value_); }; FunctionMirror.prototype.inferredName=function(){ return %FunctionGetInferredName(this.value_); }; FunctionMirror.prototype.source=function(){ if(this.resolved()){ return builtins.FunctionSourceString(this.value_); } }; FunctionMirror.prototype.script=function(){ if(this.resolved()){ var a=%FunctionGetScript(this.value_); if(a){ return MakeMirror(a); } } }; FunctionMirror.prototype.sourcePosition_=function(){ if(this.resolved()){ return %FunctionGetScriptSourcePosition(this.value_); } }; FunctionMirror.prototype.sourceLocation=function(){ if(this.resolved()&&this.script()){ return this.script().locationFromPosition(this.sourcePosition_(), true); } }; FunctionMirror.prototype.constructedBy=function(a){ if(this.resolved()){ var b=%DebugConstructedBy(this.value_,a||0); for(var c=0;c<b.length;c++){ b[c]=MakeMirror(b[c]); } return b; }else{ return[]; } }; FunctionMirror.prototype.scopeCount=function(){ if(this.resolved()){ return %GetFunctionScopeCount(this.value()); }else{ return 0; } }; FunctionMirror.prototype.scope=function(a){ if(this.resolved()){ return new ScopeMirror(void 0,this,a); } }; FunctionMirror.prototype.toText=function(){ return this.source(); }; function UnresolvedFunctionMirror(a){ %_CallFunction(this,FUNCTION_TYPE,a,ValueMirror); this.propertyCount_=0; this.elementCount_=0; this.resolved_=false; } inherits(UnresolvedFunctionMirror,FunctionMirror); UnresolvedFunctionMirror.prototype.className=function(){ return'Function'; }; UnresolvedFunctionMirror.prototype.constructorFunction=function(){ return GetUndefinedMirror(); }; UnresolvedFunctionMirror.prototype.prototypeObject=function(){ return GetUndefinedMirror(); }; UnresolvedFunctionMirror.prototype.protoObject=function(){ return GetUndefinedMirror(); }; UnresolvedFunctionMirror.prototype.name=function(){ return this.value_; }; UnresolvedFunctionMirror.prototype.inferredName=function(){ return undefined; }; UnresolvedFunctionMirror.prototype.propertyNames=function(a,b){ return[]; }; function ArrayMirror(a){ %_CallFunction(this,a,ObjectMirror); } inherits(ArrayMirror,ObjectMirror); ArrayMirror.prototype.length=function(){ return this.value_.length; }; ArrayMirror.prototype.indexedPropertiesFromRange=function(opt_from_index, opt_to_index){ var a=opt_from_index||0; var b=opt_to_index||this.length()-1; if(a>b)return new Array(); var c=new Array(b-a+1); for(var d=a;d<=b;d++){ var 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='#<Error>'; } 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;a<this.name_.length;a++){ if(this.name_[a]<'0'||'9'<this.name_[a]){ return false; } } return true; }; PropertyMirror.prototype.value=function(){ return MakeMirror(this.value_,false); }; PropertyMirror.prototype.isException=function(){ return this.exception_?true:false; }; PropertyMirror.prototype.attributes=function(){ return %DebugPropertyAttributesFromDetails(this.details_); }; PropertyMirror.prototype.propertyType=function(){ return %DebugPropertyTypeFromDetails(this.details_); }; PropertyMirror.prototype.insertionIndex=function(){ return %DebugPropertyIndexFromDetails(this.details_); }; PropertyMirror.prototype.hasGetter=function(){ return this.getter_?true:false; }; PropertyMirror.prototype.hasSetter=function(){ return this.setter_?true:false; }; PropertyMirror.prototype.getter=function(){ if(this.hasGetter()){ return MakeMirror(this.getter_); }else{ return GetUndefinedMirror(); } }; PropertyMirror.prototype.setter=function(){ if(this.hasSetter()){ return MakeMirror(this.setter_); }else{ return GetUndefinedMirror(); } }; PropertyMirror.prototype.isNative=function(){ return(this.propertyType()==PropertyType.Interceptor)|| ((this.propertyType()==PropertyType.Callbacks)&& !this.hasGetter()&&!this.hasSetter()); }; function InternalPropertyMirror(a,b){ %_CallFunction(this,INTERNAL_PROPERTY_TYPE,Mirror); this.name_=a; this.value_=b; } inherits(InternalPropertyMirror,Mirror); InternalPropertyMirror.prototype.name=function(){ return this.name_; }; InternalPropertyMirror.prototype.value=function(){ return MakeMirror(this.value_,false); }; var kFrameDetailsFrameIdIndex=0; var kFrameDetailsReceiverIndex=1; var kFrameDetailsFunctionIndex=2; var kFrameDetailsArgumentCountIndex=3; var kFrameDetailsLocalCountIndex=4; var kFrameDetailsSourcePositionIndex=5; var kFrameDetailsConstructCallIndex=6; var kFrameDetailsAtReturnIndex=7; var kFrameDetailsFlagsIndex=8; var kFrameDetailsFirstDynamicIndex=9; var kFrameDetailsNameIndex=0; var kFrameDetailsValueIndex=1; var kFrameDetailsNameValueSize=2; var kFrameDetailsFlagDebuggerFrameMask=1<<0; var kFrameDetailsFlagOptimizedFrameMask=1<<1; var kFrameDetailsFlagInlinedFrameIndexMask=7<<2; function FrameDetails(a,b){ this.break_id_=a; this.details_=%GetFrameDetails(a,b); } FrameDetails.prototype.frameId=function(){ %CheckExecutionState(this.break_id_); return this.details_[kFrameDetailsFrameIdIndex]; }; FrameDetails.prototype.receiver=function(){ %CheckExecutionState(this.break_id_); return this.details_[kFrameDetailsReceiverIndex]; }; FrameDetails.prototype.func=function(){ %CheckExecutionState(this.break_id_); return this.details_[kFrameDetailsFunctionIndex]; }; FrameDetails.prototype.isConstructCall=function(){ %CheckExecutionState(this.break_id_); return this.details_[kFrameDetailsConstructCallIndex]; }; FrameDetails.prototype.isAtReturn=function(){ %CheckExecutionState(this.break_id_); return this.details_[kFrameDetailsAtReturnIndex]; }; FrameDetails.prototype.isDebuggerFrame=function(){ %CheckExecutionState(this.break_id_); var a=kFrameDetailsFlagDebuggerFrameMask; return(this.details_[kFrameDetailsFlagsIndex]&a)==a; }; FrameDetails.prototype.isOptimizedFrame=function(){ %CheckExecutionState(this.break_id_); var a=kFrameDetailsFlagOptimizedFrameMask; return(this.details_[kFrameDetailsFlagsIndex]&a)==a; }; FrameDetails.prototype.isInlinedFrame=function(){ return this.inlinedFrameIndex()>0; }; FrameDetails.prototype.inlinedFrameIndex=function(){ %CheckExecutionState(this.break_id_); var a=kFrameDetailsFlagInlinedFrameIndexMask; return(this.details_[kFrameDetailsFlagsIndex]&a)>>2; }; FrameDetails.prototype.argumentCount=function(){ %CheckExecutionState(this.break_id_); return this.details_[kFrameDetailsArgumentCountIndex]; }; FrameDetails.prototype.argumentName=function(a){ %CheckExecutionState(this.break_id_); if(a>=0&&a<this.argumentCount()){ return this.details_[kFrameDetailsFirstDynamicIndex+ a*kFrameDetailsNameValueSize+ kFrameDetailsNameIndex]; } }; FrameDetails.prototype.argumentValue=function(a){ %CheckExecutionState(this.break_id_); if(a>=0&&a<this.argumentCount()){ return this.details_[kFrameDetailsFirstDynamicIndex+ a*kFrameDetailsNameValueSize+ kFrameDetailsValueIndex]; } }; FrameDetails.prototype.localCount=function(){ %CheckExecutionState(this.break_id_); return this.details_[kFrameDetailsLocalCountIndex]; }; FrameDetails.prototype.sourcePosition=function(){ %CheckExecutionState(this.break_id_); return this.details_[kFrameDetailsSourcePositionIndex]; }; FrameDetails.prototype.localName=function(a){ %CheckExecutionState(this.break_id_); if(a>=0&&a<this.localCount()){ var b=kFrameDetailsFirstDynamicIndex+ this.argumentCount()*kFrameDetailsNameValueSize; return this.details_[b+ a*kFrameDetailsNameValueSize+ kFrameDetailsNameIndex]; } }; FrameDetails.prototype.localValue=function(a){ %CheckExecutionState(this.break_id_); if(a>=0&&a<this.localCount()){ var b=kFrameDetailsFirstDynamicIndex+ this.argumentCount()*kFrameDetailsNameValueSize; return this.details_[b+ a*kFrameDetailsNameValueSize+ kFrameDetailsValueIndex]; } }; FrameDetails.prototype.returnValue=function(){ %CheckExecutionState(this.break_id_); var a= kFrameDetailsFirstDynamicIndex+ (this.argumentCount()+this.localCount())*kFrameDetailsNameValueSize; if(this.details_[kFrameDetailsAtReturnIndex]){ return this.details_[a]; } }; FrameDetails.prototype.scopeCount=function(){ return %GetScopeCount(this.break_id_,this.frameId()); }; function FrameMirror(a,b){ %_CallFunction(this,FRAME_TYPE,Mirror); this.break_id_=a; this.index_=b; this.details_=new FrameDetails(a,b); } inherits(FrameMirror,Mirror); FrameMirror.prototype.index=function(){ return this.index_; }; FrameMirror.prototype.func=function(){ var a=this.details_.func(); if((%_IsFunction(a))){ return MakeMirror(a); }else{ return new UnresolvedFunctionMirror(a); } }; FrameMirror.prototype.receiver=function(){ return MakeMirror(this.details_.receiver()); }; FrameMirror.prototype.isConstructCall=function(){ return this.details_.isConstructCall(); }; FrameMirror.prototype.isAtReturn=function(){ return this.details_.isAtReturn(); }; FrameMirror.prototype.isDebuggerFrame=function(){ return this.details_.isDebuggerFrame(); }; FrameMirror.prototype.isOptimizedFrame=function(){ return this.details_.isOptimizedFrame(); }; FrameMirror.prototype.isInlinedFrame=function(){ return this.details_.isInlinedFrame(); }; FrameMirror.prototype.inlinedFrameIndex=function(){ return this.details_.inlinedFrameIndex(); }; FrameMirror.prototype.argumentCount=function(){ return this.details_.argumentCount(); }; FrameMirror.prototype.argumentName=function(a){ return this.details_.argumentName(a); }; FrameMirror.prototype.argumentValue=function(a){ return MakeMirror(this.details_.argumentValue(a)); }; FrameMirror.prototype.localCount=function(){ return this.details_.localCount(); }; FrameMirror.prototype.localName=function(a){ return this.details_.localName(a); }; FrameMirror.prototype.localValue=function(a){ return MakeMirror(this.details_.localValue(a)); }; FrameMirror.prototype.returnValue=function(){ return MakeMirror(this.details_.returnValue()); }; FrameMirror.prototype.sourcePosition=function(){ return this.details_.sourcePosition(); }; FrameMirror.prototype.sourceLocation=function(){ if(this.func().resolved()&&this.func().script()){ return this.func().script().locationFromPosition(this.sourcePosition(), true); } }; FrameMirror.prototype.sourceLine=function(){ if(this.func().resolved()){ var a=this.sourceLocation(); if(a){ return a.line; } } }; FrameMirror.prototype.sourceColumn=function(){ if(this.func().resolved()){ var a=this.sourceLocation(); if(a){ return a.column; } } }; FrameMirror.prototype.sourceLineText=function(){ if(this.func().resolved()){ var a=this.sourceLocation(); if(a){ return a.sourceText(); } } }; FrameMirror.prototype.scopeCount=function(){ return this.details_.scopeCount(); }; FrameMirror.prototype.scope=function(a){ return new ScopeMirror(this,void 0,a); }; FrameMirror.prototype.evaluate=function(source,disable_break, opt_context_object){ var a=%DebugEvaluate(this.break_id_, this.details_.frameId(), this.details_.inlinedFrameIndex(), source, Boolean(disable_break), opt_context_object); return MakeMirror(a); }; FrameMirror.prototype.invocationText=function(){ var a=''; var b=this.func(); var c=this.receiver(); if(this.isConstructCall()){ a+='new '; a+=b.name()?b.name():'[anonymous]'; }else if(this.isDebuggerFrame()){ a+='[debugger]'; }else{ var d= !c.className||(c.className()!='global'); if(d){ a+=c.toText(); } var g=GetUndefinedMirror(); if(c.isObject()){ for(var h=c; !h.isNull()&&g.isUndefined(); h=h.protoObject()){ g=h.lookupProperty(b); } } if(!g.isUndefined()){ if(!g.isIndexed()){ if(d){ a+='.'; } a+=g.name(); }else{ a+='['; a+=g.name(); a+=']'; } if(b.name()&&b.name()!=g.name()){ a+='(aka '+b.name()+')'; } }else{ if(d){ a+='.'; } a+=b.name()?b.name():'[anonymous]'; } } if(!this.isDebuggerFrame()){ a+='('; for(var i=0;i<this.argumentCount();i++){ if(i!=0)a+=', '; if(this.argumentName(i)){ a+=this.argumentName(i); a+='='; } a+=this.argumentValue(i).toText(); } a+=')'; } if(this.isAtReturn()){ a+=' returning '; a+=this.returnValue().toText(); } return a; }; FrameMirror.prototype.sourceAndPositionText=function(){ var a=''; var b=this.func(); if(b.resolved()){ if(b.script()){ if(b.script().name()){ a+=b.script().name(); }else{ a+='[unnamed]'; } if(!this.isDebuggerFrame()){ var c=this.sourceLocation(); a+=' line '; a+=!(typeof(c)==='undefined')?(c.line+1):'?'; a+=' column '; a+=!(typeof(c)==='undefined')?(c.column+1):'?'; if(!(typeof(this.sourcePosition())==='undefined')){ a+=' (position '+(this.sourcePosition()+1)+')'; } } }else{ a+='[no source]'; } }else{ a+='[unresolved]'; } return a; }; FrameMirror.prototype.localsText=function(){ var a=''; var b=this.localCount(); if(b>0){ for(var c=0;c<b;++c){ a+=' var '; a+=this.localName(c); a+=' = '; a+=this.localValue(c).toText(); if(c<b-1)a+='\n'; } } return a; }; FrameMirror.prototype.restart=function(){ var a=%LiveEditRestartFrame(this.break_id_,this.index_); if((typeof(a)==='undefined')){ a="Failed to find requested frame"; } return a; }; FrameMirror.prototype.toText=function(a){ var b=''; b+='#'+(this.index()<=9?'0':'')+this.index(); b+=' '; b+=this.invocationText(); b+=' '; b+=this.sourceAndPositionText(); if(a){ b+='\n'; b+=this.localsText(); } return b; }; var kScopeDetailsTypeIndex=0; var kScopeDetailsObjectIndex=1; function ScopeDetails(a,b,c){ if(a){ this.break_id_=a.break_id_; this.details_=%GetScopeDetails(a.break_id_, a.details_.frameId(), a.details_.inlinedFrameIndex(), c); this.frame_id_=a.details_.frameId(); this.inlined_frame_id_=a.details_.inlinedFrameIndex(); }else{ this.details_=%GetFunctionScopeDetails(b.value(),c); this.fun_value_=b.value(); this.break_id_=undefined; } this.index_=c; } ScopeDetails.prototype.type=function(){ if(!(typeof(this.break_id_)==='undefined')){ %CheckExecutionState(this.break_id_); } return this.details_[kScopeDetailsTypeIndex]; }; ScopeDetails.prototype.object=function(){ if(!(typeof(this.break_id_)==='undefined')){ %CheckExecutionState(this.break_id_); } return this.details_[kScopeDetailsObjectIndex]; }; ScopeDetails.prototype.setVariableValueImpl=function(a,b){ var c; if(!(typeof(this.break_id_)==='undefined')){ %CheckExecutionState(this.break_id_); c=%SetScopeVariableValue(this.break_id_,this.frame_id_, this.inlined_frame_id_,this.index_,a,b); }else{ c=%SetScopeVariableValue(this.fun_value_,null,null,this.index_, a,b); } if(!c){ throw new Error("Failed to set variable value"); } }; function ScopeMirror(a,b,c){ %_CallFunction(this,SCOPE_TYPE,Mirror); if(a){ this.frame_index_=a.index_; }else{ this.frame_index_=undefined; } this.scope_index_=c; this.details_=new ScopeDetails(a,b,c); } inherits(ScopeMirror,Mirror); ScopeMirror.prototype.frameIndex=function(){ return this.frame_index_; }; ScopeMirror.prototype.scopeIndex=function(){ return this.scope_index_; }; ScopeMirror.prototype.scopeType=function(){ return this.details_.type(); }; ScopeMirror.prototype.scopeObject=function(){ var a=this.scopeType()==ScopeType.Local|| this.scopeType()==ScopeType.Closure; return MakeMirror(this.details_.object(),a); }; ScopeMirror.prototype.setVariableValue=function(a,b){ this.details_.setVariableValueImpl(a,b); }; function ScriptMirror(a){ %_CallFunction(this,SCRIPT_TYPE,Mirror); this.script_=a; this.context_=new ContextMirror(a.context_data); this.allocateHandle_(); } inherits(ScriptMirror,Mirror); ScriptMirror.prototype.value=function(){ return this.script_; }; ScriptMirror.prototype.name=function(){ return this.script_.name||this.script_.nameOrSourceURL(); }; ScriptMirror.prototype.id=function(){ return this.script_.id; }; ScriptMirror.prototype.source=function(){ return this.script_.source; }; ScriptMirror.prototype.setSource=function(a){ %DebugSetScriptSource(this.script_,a); }; ScriptMirror.prototype.lineOffset=function(){ return this.script_.line_offset; }; ScriptMirror.prototype.columnOffset=function(){ return this.script_.column_offset; }; ScriptMirror.prototype.data=function(){ return this.script_.data; }; ScriptMirror.prototype.scriptType=function(){ return this.script_.type; }; ScriptMirror.prototype.compilationType=function(){ return this.script_.compilation_type; }; ScriptMirror.prototype.lineCount=function(){ return this.script_.lineCount(); }; ScriptMirror.prototype.locationFromPosition=function( position,include_resource_offset){ return this.script_.locationFromPosition(position,include_resource_offset); }; ScriptMirror.prototype.sourceSlice=function(a,b){ return this.script_.sourceSlice(a,b); }; ScriptMirror.prototype.context=function(){ return this.context_; }; ScriptMirror.prototype.evalFromScript=function(){ return MakeMirror(this.script_.eval_from_script); }; ScriptMirror.prototype.evalFromFunctionName=function(){ return MakeMirror(this.script_.eval_from_function_name); }; ScriptMirror.prototype.evalFromLocation=function(){ var a=this.evalFromScript(); if(!a.isUndefined()){ var b=this.script_.eval_from_script_position; return a.locationFromPosition(b,true); } }; ScriptMirror.prototype.toText=function(){ var a=''; a+=this.name(); a+=' (lines: '; if(this.lineOffset()>0){ a+=this.lineOffset(); a+='-'; a+=this.lineOffset()+this.lineCount()-1; }else{ a+=this.lineCount(); } a+=')'; return a; }; function ContextMirror(a){ %_CallFunction(this,CONTEXT_TYPE,Mirror); this.data_=a; this.allocateHandle_(); } inherits(ContextMirror,Mirror); ContextMirror.prototype.data=function(){ return this.data_; }; function MakeMirrorSerializer(a,b){ return new JSONProtocolSerializer(a,b); } function JSONProtocolSerializer(a,b){ this.details_=a; this.options_=b; this.mirrors_=[]; } JSONProtocolSerializer.prototype.serializeReference=function(a){ return this.serialize_(a,true,true); }; JSONProtocolSerializer.prototype.serializeValue=function(a){ var b=this.serialize_(a,false,true); return b; }; JSONProtocolSerializer.prototype.serializeReferencedObjects=function(){ var a=[]; var b=this.mirrors_.length; for(var c=0;c<b;c++){ a.push(this.serialize_(this.mirrors_[c],false,false)); } return a; }; JSONProtocolSerializer.prototype.includeSource_=function(){ return this.options_&&this.options_.includeSource; }; JSONProtocolSerializer.prototype.inlineRefs_=function(){ return this.options_&&this.options_.inlineRefs; }; JSONProtocolSerializer.prototype.maxStringLength_=function(){ if((typeof(this.options_)==='undefined')|| (typeof(this.options_.maxStringLength)==='undefined')){ return kMaxProtocolStringLength; } return this.options_.maxStringLength; }; JSONProtocolSerializer.prototype.add_=function(a){ for(var b=0;b<this.mirrors_.length;b++){ if(this.mirrors_[b]===a){ return; } } this.mirrors_.push(a); }; JSONProtocolSerializer.prototype.serializeReferenceWithDisplayData_= function(a){ var b={}; b.ref=a.handle(); b.type=a.type(); switch(a.type()){ case UNDEFINED_TYPE: case NULL_TYPE: case BOOLEAN_TYPE: case NUMBER_TYPE: b.value=a.value(); break; case STRING_TYPE: b.value=a.getTruncatedValue(this.maxStringLength_()); break; case FUNCTION_TYPE: b.name=a.name(); b.inferredName=a.inferredName(); if(a.script()){ b.scriptId=a.script().id(); } break; case ERROR_TYPE: case REGEXP_TYPE: b.value=a.toText(); break; case OBJECT_TYPE: b.className=a.className(); break; } return b; }; JSONProtocolSerializer.prototype.serialize_=function(mirror,reference, details){ if(reference&& (mirror.isValue()||mirror.isScript()||mirror.isContext())){ if(this.inlineRefs_()&&mirror.isValue()){ return this.serializeReferenceWithDisplayData_(mirror); }else{ this.add_(mirror); return{'ref':mirror.handle()}; } } var a={}; if(mirror.isValue()||mirror.isScript()||mirror.isContext()){ a.handle=mirror.handle(); } a.type=mirror.type(); switch(mirror.type()){ case UNDEFINED_TYPE: case NULL_TYPE: break; case BOOLEAN_TYPE: a.value=mirror.value(); break; case NUMBER_TYPE: a.value=NumberToJSON_(mirror.value()); break; case STRING_TYPE: if(this.maxStringLength_()!=-1&& mirror.length()>this.maxStringLength_()){ var b=mirror.getTruncatedValue(this.maxStringLength_()); a.value=b; a.fromIndex=0; a.toIndex=this.maxStringLength_(); }else{ a.value=mirror.value(); } a.length=mirror.length(); break; case 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;a<mirror.scopeCount();a++){ var b=mirror.scope(a); content.scopes.push({ type:b.scopeType(), index:a }); } } if(mirror.isDate()){ content.value=mirror.value(); } var c=mirror.propertyNames(PropertyKind.Named); var d=mirror.propertyNames(PropertyKind.Indexed); var g=new Array(c.length+d.length); for(var a=0;a<c.length;a++){ var h=mirror.property(c[a]); g[a]=this.serializeProperty_(h); if(details){ this.add_(h.value()); } } for(var a=0;a<d.length;a++){ var h=mirror.property(d[a]); g[c.length+a]=this.serializeProperty_(h); if(details){ this.add_(h.value()); } } content.properties=g; var i=mirror.internalProperties(); if(i.length>0){ var j=[]; for(var a=0;a<i.length;a++){ j.push(this.serializeInternalProperty_(i[a])); } content.internalProperties=j; } }; function serializeLocationFields(a,b){ if(!a){ return; } b.position=a.position; var c=a.line; if(!(typeof(c)==='undefined')){ b.line=c; } var d=a.column; if(!(typeof(d)==='undefined')){ b.column=d; } } JSONProtocolSerializer.prototype.serializeProperty_=function(a){ var b={}; b.name=a.name(); var c=a.value(); if(this.inlineRefs_()&&c.isValue()){ b.value=this.serializeReferenceWithDisplayData_(c); }else{ if(a.attributes()!=PropertyAttribute.None){ b.attributes=a.attributes(); } if(a.propertyType()!=PropertyType.Normal){ b.propertyType=a.propertyType(); } b.ref=c.handle(); } return b; }; JSONProtocolSerializer.prototype.serializeInternalProperty_= function(a){ var b={}; b.name=a.name(); var c=a.value(); if(this.inlineRefs_()&&c.isValue()){ b.value=this.serializeReferenceWithDisplayData_(c); }else{ b.ref=c.handle(); } return b; }; JSONProtocolSerializer.prototype.serializeFrame_=function(a,b){ b.index=a.index(); b.receiver=this.serializeReference(a.receiver()); var c=a.func(); b.func=this.serializeReference(c); if(c.script()){ b.script=this.serializeReference(c.script()); } b.constructCall=a.isConstructCall(); b.atReturn=a.isAtReturn(); if(a.isAtReturn()){ b.returnValue=this.serializeReference(a.returnValue()); } b.debuggerFrame=a.isDebuggerFrame(); var d=new Array(a.argumentCount()); for(var g=0;g<a.argumentCount();g++){ var h={}; var i=a.argumentName(g); if(i){ h.name=i; } h.value=this.serializeReference(a.argumentValue(g)); d[g]=h; } b.arguments=d; var d=new Array(a.localCount()); for(var g=0;g<a.localCount();g++){ var j={}; j.name=a.localName(g); j.value=this.serializeReference(a.localValue(g)); d[g]=j; } b.locals=d; serializeLocationFields(a.sourceLocation(),b); var k=a.sourceLineText(); if(!(typeof(k)==='undefined')){ b.sourceLineText=k; } b.scopes=[]; for(var g=0;g<a.scopeCount();g++){ var l=a.scope(g); b.scopes.push({ type:l.scopeType(), index:g }); } }; JSONProtocolSerializer.prototype.serializeScope_=function(a,b){ b.index=a.scopeIndex(); b.frameIndex=a.frameIndex(); b.type=a.scopeType(); b.object=this.inlineRefs_()? this.serializeValue(a.scopeObject()): this.serializeReference(a.scopeObject()); }; function NumberToJSON_(a){ if(isNaN(a)){ return'NaN'; } if(!(%_IsSmi(%IS_VAR(a))||((a==a)&&(a!=1/0)&&(a!=-1/0)))){ if(a>0){ return'Infinity'; }else{ return'-Infinity'; } } return a; } 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;w<u.children.length;w++){ CollectDamaged(u.children[w]); } } function CollectNew(z){ for(var w=0;w<z.length;w++){ q.push(z[w]); CollectNew(z[w].children); } } if(t.status==a.DAMAGED){ CollectDamaged(t); return; } if(t.status==a.UNCHANGED){ r.push(t); }else if(t.status==a.SOURCE_CHANGED){ r.push(t); }else if(t.status==a.CHANGED){ m.push(t); CollectNew(t.unmatched_new_nodes); } for(var w=0;w<t.children.length;w++){ HarvestTodo(t.children[w]); } } var A={ change_tree:DescribeChangeTree(g), textual_diff:{ old_len:c.length, new_len:new_source.length, chunks:diff_array }, updated:false }; if(preview_only){ return A; } HarvestTodo(g); var B=new Array(); for(var w=0;w<m.length;w++){ var C= m[w].live_shared_function_infos; if(C){ for(var D=0;D<C.length;D++){ B.push(C[D]); } } } var E= CheckStackActivations(B,change_log); A.stack_modified=E!=0; A[b]= A.stack_modified; var G=TemporaryRemoveBreakPoints(script,change_log); var H; if(o.length==0){ %LiveEditReplaceScript(script,new_source,null); H=void 0; }else{ var I=CreateNameForOldScript(script); H=%LiveEditReplaceScript(script,new_source, I); var J=new Array(); change_log.push({linked_to_old_script:J}); for(var w=0;w<o.length;w++){ LinkToOldScript(o[w],H, J); } A.created_script_name=I; } for(var w=0;w<q.length;w++){ %LiveEditFunctionSetScript( q[w].info.shared_function_info,script); } for(var w=0;w<m.length;w++){ PatchFunctionCode(m[w],change_log); } var K=new Array(); change_log.push({position_patched:K}); for(var w=0;w<r.length;w++){ PatchPositions(r[w],diff_array, K); if(r[w].live_shared_function_infos){ r[w].live_shared_function_infos. forEach(function(L){ %LiveEditFunctionSourceUpdated(L.raw_array); }); } } G(h,H); A.updated=true; return A; } this.ApplyPatchMultiChunk=ApplyPatchMultiChunk; function GatherCompileInfo(M,N){ var O=%LiveEditGatherCompileInfo(N,M); var P=new Array(); var Q=new Array(); for(var w=0;w<O.length;w++){ var L=new FunctionCompileInfo(O[w]); %LiveEditFunctionSetScript(L.shared_function_info,void 0); P.push(L); Q.push(w); } for(var w=0;w<P.length;w++){ var R=w; for(var D=w+1;D<P.length;D++){ if(P[R].start_position>P[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<P.length&& P[U].outer_index==X){ var Z=U; P[Z].outer_index=W; if(Y!=-1){ P[Y].next_sibling_index=Z; } Y=Z; U++; ResetIndexes(Z,Q[Z]); } if(Y!=-1){ P[Y].next_sibling_index=-1; } } ResetIndexes(-1,-1); Assert(U==P.length); return P; } function PatchFunctionCode(t,aa){ var ab=t.corresponding_node.info; if(t.live_shared_function_infos){ t.live_shared_function_infos.forEach(function(ac){ %LiveEditReplaceFunctionCode(ab.raw_array, ac.raw_array); for(var w=0;w<t.children.length;w++){ if(t.children[w].corresponding_node){ var ad= t.children[w].corresponding_node.info. shared_function_info; if(t.children[w].live_shared_function_infos){ t.children[w].live_shared_function_infos. forEach(function(ae){ %LiveEditReplaceRefToNestedFunction( ac.info, ad, ae.info); }); } } } }); aa.push({function_patched:ab.function_name}); }else{ aa.push({function_patched:ab.function_name, function_info_not_found:true}); } } function LinkToOldScript(af,H,ag){ if(af.live_shared_function_infos){ af.live_shared_function_infos. forEach(function(L){ %LiveEditFunctionSetScript(L.info,H); }); ag.push({name:af.info.function_name}); }else{ ag.push( {name:af.info.function_name,not_found:true}); } } function TemporaryRemoveBreakPoints(ah,aa){ var ai=GetScriptBreakPoints(ah); var aj=[]; aa.push({break_points_update:aj}); var ak=[]; for(var w=0;w<ai.length;w++){ var al=ai[w]; al.clear(); var am=Debug.findScriptSourcePosition(ah, al.line(),al.column()); var an={ position:am, line:al.line(), column:al.column() }; ak.push(an); } return function(h,ao){ for(var w=0;w<ai.length;w++){ var al=ai[w]; if(ao){ var ap=al.cloneForOtherScript(ao); ap.set(ao); aj.push({ type:"copied_to_old", id:al.number(), new_id:ap.number(), positions:ak[w] }); } var aq=h.Translate( ak[w].position, PosTranslator.ShiftWithTopInsideChunkHandler); var ar= ah.locationFromPosition(aq,false); al.update_positions(ar.line,ar.column); var as={ position:aq, line:ar.line, column:ar.column }; al.set(ah); aj.push({type:"position_changed", id:al.number(), old_positions:ak[w], new_positions:as }); } }; } function Assert(at,au){ if(!at){ if(au){ throw"Assert "+au; }else{ throw"Assert"; } } } function DiffChunk(av,aw,ax,ay){ this.pos1=av; this.pos2=aw; this.len1=ax; this.len2=ay; } function PosTranslator(az){ var aA=new Array(); var aB=0; for(var w=0;w<az.length;w+=3){ var aC=az[w]; var aD=aC+aB; var aE=az[w+1]; var aF=az[w+2]; aA.push(new DiffChunk(aC,aD,aE-aC, aF-aD)); aB=aF-aE; } this.chunks=aA; } PosTranslator.prototype.GetChunks=function(){ return this.chunks; }; PosTranslator.prototype.Translate=function(aG,aH){ var aI=this.chunks; if(aI.length==0||aG<aI[0].pos1){ return aG; } var aJ=0; var aK=aI.length-1; while(aJ<aK){ var aL=Math.floor((aJ+aK)/2); if(aG<aI[aL+1].pos1){ aK=aL; }else{ aJ=aL+1; } } var aM=aI[aJ]; if(aG>=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<aR.length&& aR[aS].outer_index==aT){ aU.push(BuildNode()); } var u=new CodeInfoTreeNode(aR[aT],aU, aT); for(var w=0;w<aU.length;w++){ aU[w].parent=u; } return u; } var aV=BuildNode(); Assert(aS==aR.length); return aV; } function MarkChangedFunctions(aW,aA){ var aX=new function(){ var aY=0; var aZ=0; this.current=function(){return aA[aY];}; this.next=function(){ var aM=aA[aY]; aZ=aM.pos2+aM.len2-(aM.pos1+aM.len1); aY++; }; this.done=function(){return aY>=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<ba.info.end_position){ if(bb<ba.children.length){ var be=ba.children[bb]; if(be.info.end_position<=aX.current().pos1){ ProcessUnchangedChild(be); bb++; continue; }else if(be.info.start_position>= 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(bb<ba.children.length){ var be=ba.children[bb]; ProcessUnchangedChild(be); bb++; } if(bc){ ba.status=a.CHANGED; }else if(bd){ ba.status=a.SOURCE_CHANGED; } ba.new_end_pos= aX.TranslatePos(ba.info.end_position); } function ProcessUnchangedChild(u){ u.new_start_pos=aX.TranslatePos(u.info.start_position); u.new_end_pos=aX.TranslatePos(u.info.end_position); } ProcessInternals(aW); } function FindCorrespondingFunctions(bf,bg){ function ProcessChildren(t,bh){ var bi=t.children; var bj=bh.children; var bk=[]; var bl=[]; var bm=0; var bn=0; while(bm<bi.length){ if(bi[bm].status==a.DAMAGED){ bm++; }else if(bn<bj.length){ if(bj[bn].info.start_position< bi[bm].new_start_pos){ bk.push(bj[bn]); bl.push(bj[bn]); bn++; }else if(bj[bn].info.start_position== bi[bm].new_start_pos){ if(bj[bn].info.end_position== bi[bm].new_end_pos){ bi[bm].corresponding_node= bj[bn]; bi[bm].textual_corresponding_node= bj[bn]; if(bi[bm].status!=a.UNCHANGED){ ProcessChildren(bi[bm], bj[bn]); if(bi[bm].status==a.DAMAGED){ bk.push( bi[bm].corresponding_node); bi[bm].corresponding_node=void 0; t.status=a.CHANGED; } } }else{ bi[bm].status=a.DAMAGED; bi[bm].status_explanation= "No corresponding function in new script found"; t.status=a.CHANGED; bk.push(bj[bn]); bl.push(bj[bn]); } bn++; bm++; }else{ bi[bm].status=a.DAMAGED; bi[bm].status_explanation= "No corresponding function in new script found"; t.status=a.CHANGED; bm++; } }else{ bi[bm].status=a.DAMAGED; bi[bm].status_explanation= "No corresponding function in new script found"; t.status=a.CHANGED; bm++; } } while(bn<bj.length){ bk.push(bj[bn]); bl.push(bj[bn]); bn++; } if(t.status==a.CHANGED){ var bo= WhyFunctionExpectationsDiffer(t.info,bh.info); if(bo){ t.status=a.DAMAGED; t.status_explanation=bo; } } t.unmatched_new_nodes=bk; t.textually_unmatched_new_nodes= bl; } ProcessChildren(bf,bg); bf.corresponding_node=bg; bf.textual_corresponding_node=bg; Assert(bf.status!=a.DAMAGED, "Script became damaged"); } function FindLiveSharedInfos(bf,N){ var bp=%LiveEditFindSharedFunctionInfosForScript(N); var bq=new Array(); for(var w=0;w<bp.length;w++){ bq.push(new SharedInfoWrapper(bp[w])); } function FindFunctionInfos(P){ var br=[]; for(var w=0;w<bq.length;w++){ var bs=bq[w]; if(bs.start_position==P.start_position&& bs.end_position==P.end_position){ br.push(bs); } } if(br.length>0){ return br; } } function TraverseTree(u){ u.live_shared_function_infos=FindFunctionInfos(u.info); for(var w=0;w<u.children.length;w++){ TraverseTree(u.children[w]); } } TraverseTree(bf); } function FunctionCompileInfo(bt){ this.function_name=bt[0]; this.start_position=bt[1]; this.end_position=bt[2]; this.param_num=bt[3]; this.code=bt[4]; this.code_scope_info=bt[5]; this.scope_info=bt[6]; this.outer_index=bt[7]; this.shared_function_info=bt[8]; this.next_sibling_index=null; this.raw_array=bt; } function SharedInfoWrapper(bt){ this.function_name=bt[0]; this.start_position=bt[1]; this.end_position=bt[2]; this.info=bt[3]; this.raw_array=bt; } function PatchPositions(af,az,ag){ if(af.live_shared_function_infos){ af.live_shared_function_infos.forEach(function(L){ %LiveEditPatchFunctionPositions(L.raw_array, az); }); ag.push({name:af.info.function_name}); }else{ ag.push( {name:af.info.function_name,info_not_found:true}); } } function CreateNameForOldScript(N){ return N.name+" (old)"; } function WhyFunctionExpectationsDiffer(bu,bv){ if(bu.param_num!=bv.param_num){ return"Changed parameter number: "+bu.param_num+ " and "+bv.param_num; } var bw=bu.scope_info; var bx=bv.scope_info; var by; var bz; if(bw){ by=bw.toString(); }else{ by=""; } if(bx){ bz=bx.toString(); }else{ bz=""; } if(by!=bz){ return"Incompatible variable maps: ["+by+ "] and ["+bz+"]"; } return; } var bA; function CheckStackActivations(bB,aa){ var bC=new Array(); for(var w=0;w<bB.length;w++){ bC[w]=bB[w].info; } var bD=%LiveEditCheckAndDropActivations(bC,true); if(bD[bC.length]){ throw new Failure(bD[bC.length]); } var bE=new Array(); var bF=new Array(); for(var w=0;w<bC.length;w++){ var bG=bB[w]; if(bD[w]==bA.REPLACED_ON_ACTIVE_STACK){ bF.push({name:bG.function_name}); }else if(bD[w]!=bA.AVAILABLE_FOR_PATCH){ var bH={ name:bG.function_name, start_pos:bG.start_position, end_pos:bG.end_position, replace_problem: bA.SymbolName(bD[w]) }; bE.push(bH); } } if(bF.length>0){ 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;w<u.children.length;w++){ var be=u.children[w]; if(be.status!=a.UNCHANGED){ bV.push(ProcessOldNode(be)); } } var bW=[]; if(u.textually_unmatched_new_nodes){ for(var w=0;w<u.textually_unmatched_new_nodes.length;w++){ var be=u.textually_unmatched_new_nodes[w]; bW.push(ProcessNewNode(be)); } } var bX={ name:u.info.function_name, positions:DescribePositions(u), status:u.status, children:bV, new_children:bW }; if(u.status_explanation){ bX.status_explanation=u.status_explanation; } if(u.textual_corresponding_node){ bX.new_positions=DescribePositions(u.textual_corresponding_node); } return bX; } function ProcessNewNode(u){ var bV=[]; if(false){ for(var w=0;w<u.children.length;w++){ bV.push(ProcessNewNode(u.children[w])); } } var bX={ name:u.info.function_name, positions:DescribePositions(u), children:bV, }; return bX; } function DescribePositions(u){ return{ start_position:u.info.start_position, end_position:u.info.end_position }; } return ProcessOldNode(bf); } function RestartFrame(bY){ var bD=bY.restart(); if((typeof(bD)==='string')){ throw new Failure("Failed to restart frame: "+bD); } var bD={}; bD[b]=true; return bD; } this.RestartFrame=RestartFrame; this.TestApi={ PosTranslator:PosTranslator, CompareStrings:CompareStrings, ApplySingleChunkPatch:ApplySingleChunkPatch }; }; var $Date=global.Date; function ThrowDateTypeError(){ throw new $TypeError('this is not a Date object.'); } var timezone_cache_time=$NaN; var timezone_cache_timezone; function LocalTimezone(a){ if((!%_IsSmi(%IS_VAR(a))&&!(a==a)))return""; if(a==timezone_cache_time){ return timezone_cache_timezone; } var b=%DateLocalTimezone(a); timezone_cache_time=a; timezone_cache_timezone=b; return b; } function UTC(a){ if((!%_IsSmi(%IS_VAR(a))&&!(a==a)))return a; return %DateToUTC(a); } function MakeTime(a,b,c,d){ if(!$isFinite(a))return $NaN; if(!$isFinite(b))return $NaN; if(!$isFinite(c))return $NaN; if(!$isFinite(d))return $NaN; return(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a)))*3600000 +(%_IsSmi(%IS_VAR(b))?b:%NumberToInteger(ToNumber(b)))*60000 +(%_IsSmi(%IS_VAR(c))?c:%NumberToInteger(ToNumber(c)))*1000 +(%_IsSmi(%IS_VAR(d))?d:%NumberToInteger(ToNumber(d))); } function TimeInYear(a){ return DaysInYear(a)*86400000; } function MakeDay(a,b,c){ if(!$isFinite(a)||!$isFinite(b)||!$isFinite(c))return $NaN; a=(%_IsSmi(%IS_VAR(a))?a:%NumberToIntegerMapMinusZero(ToNumber(a))); b=(%_IsSmi(%IS_VAR(b))?b:%NumberToIntegerMapMinusZero(ToNumber(b))); c=(%_IsSmi(%IS_VAR(c))?c:%NumberToIntegerMapMinusZero(ToNumber(c))); if(a<-1000000||a>1000000|| 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<MathPow(10,b-1)?'0'+PadInt(a,b-1):a; } function DateToISOString(){ var a=(%_DateField(this,0)); if((!%_IsSmi(%IS_VAR(a))&&!(a==a)))throw MakeRangeError("invalid_time_value",[]); var b=this.getUTCFullYear(); var c; if(b>=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;h<g;h++){ var i=Revive(d,$String(h),c); d[h]=i; } }else{ for(var j in d){ if(%_CallFunction(d,j,ObjectHasOwnProperty)){ var i=Revive(d,j,c); if((typeof(i)==='undefined')){ delete d[j]; }else{ d[j]=i; } } } } } return %_CallFunction(a,b,d,c); } function JSONParse(a,b){ var c=%ParseJson(((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a))); if((%_ClassOf(b)==='Function')){ return Revive({'':c},'',b); }else{ return c; } } function SerializeArray(a,b,c,d,g){ if(!%PushIfAbsent(c,a)){ throw MakeTypeError('circular_structure',$Array()); } var h=d; d+=g; var i=new InternalArray(); var j=a.length; for(var k=0;k<j;k++){ var l=JSONSerialize($String(k),a,b,c, d,g); if((typeof(l)==='undefined')){ l="null"; } i.push(l); } var m; if(g==""){ m="["+i.join(",")+"]"; }else if(i.length>0){ 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;k<j;k++){ if(%_CallFunction(b,k,ObjectHasOwnProperty)){ var l=b[k]; var m=JSONSerialize(l,a,b,c,d,g); if(!(typeof(m)==='undefined')){ var o=%QuoteJSONString(l)+":"; if(g!="")o+=" "; o+=m; i.push(o); } } } }else{ for(var l in a){ if(%_CallFunction(a,l,ObjectHasOwnProperty)){ var m=JSONSerialize(l,a,b,c,d,g); if(!(typeof(m)==='undefined')){ var o=%QuoteJSONString(l)+":"; if(g!="")o+=" "; o+=m; i.push(o); } } } } var q; if(g==""){ q="{"+i.join(",")+"}"; }else if(i.length>0){ 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<c.length;i++){ var j=%_CallFunction(c,i,StringCharAt); switch(j){ case'g': if(d){ throw MakeSyntaxError("invalid_regexp_flags",[c]); } d=true; break; case'i': if(g){ throw MakeSyntaxError("invalid_regexp_flags",[c]); } g=true; break; case'm': if(h){ throw MakeSyntaxError("invalid_regexp_flags",[c]); } h=true; break; default: throw MakeSyntaxError("invalid_regexp_flags",[c]); } } %RegExpInitializeObject(a,b,d,g,h); %RegExpCompile(a,b,c); } function RegExpConstructor(a,b){ if(%_IsConstructCall()){ DoConstructRegExp(this,a,b); }else{ if((%_IsRegExp(a))&&(typeof(b)==='undefined')){ return a; } return new $RegExp(a,b); } } function RegExpCompile(a,b){ if(this==$RegExp.prototype){ throw MakeTypeError('incompatible_method_receiver', ['RegExp.prototype.compile',this]); } if((typeof(a)==='undefined')&&%_ArgumentsLength()!=0){ DoConstructRegExp(this,'undefined',b); }else{ DoConstructRegExp(this,a,b); } } function DoRegExpExec(a,b,c){ var d=%_RegExpExec(a,b,c,lastMatchInfo); if(d!==null)lastMatchInfoOverride=null; return d; } function BuildResultFromMatchInfo(a,b){ var c=((a)[0])>>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;j<c;j++){ d=a[i++]; if(d!=-1){ g=a[i]; if(d+1==g){ h[j]=%_StringCharAt(b,d); }else{ h[j]=%_SubString(b,d,g); } } i++; } return h; } function RegExpExecNoTests(a,b,c){ var d=%_RegExpExec(a,b,c,lastMatchInfo); if(d!==null){ lastMatchInfoOverride=null; return BuildResultFromMatchInfo(d,b); } a.lastIndex=0; return null; } function RegExpExec(a){ if(!(%_IsRegExp(this))){ throw MakeTypeError('incompatible_method_receiver', ['RegExp.prototype.exec',this]); } a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); var b=this.lastIndex; var c=(%_IsSmi(%IS_VAR(b))?b:%NumberToInteger(ToNumber(b))); var d=this.global; if(d){ if(c<0||c>a.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<lastMatchInfoOverride.length-2){ return((lastMatchInfoOverride)[(a)]); } return''; } var b=a*2; if(b>=((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(); ��������������������������� ����������������������������������������������������������������������������������������������������������������������������������������������FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512��������������zR�x�����������������A�C ������8�����������A�C ������T�������}���A�C B����p�����������A�C ��������������+���A�C ��������������.����A�C ������������������A�C �������������� ����A�C ����.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetBuiltinsCountEv�.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetDebuggerCountEv�.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE17GetRawScriptsSizeEv�.rela.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetScriptsSourceEv�.text�.comment�.bss�.rodata..L.str�.note.GNU-stack�.rela.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE13GetScriptNameEi�.rela.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE18GetRawScriptSourceEi�.rela.eh_frame�.rodata..Lswitch.table�.rela.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE8GetIndexEPKc�.shstrtab�.strtab�.symtab�.data�.rela.data.rel.local._ZN2v88internalL11raw_sourcesE�.rodata._ZN2v88internalL7sourcesE�.rela.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE19SetRawScriptsSourceENS0_6VectorIKcEE�.rodata..L.str9�.rela.data.rel.ro.local..Lswitch.table29�.rodata..L.str19�.rodata..L.str8�.rodata..L.str28�.rodata..L.str18�.rodata..L.str7�.rodata..L.str27�.rodata..L.str17�.rodata..L.str6�.rodata..L.str26�.rodata..L.str16�.rodata..L.str5�.rodata..L.str25�.rodata..L.str15�.rodata..L.str4�.rodata..L.str24�.rodata..L.str14�.rodata..L.str3�.rodata..L.str23�.rodata..L.str13�.rodata..L.str2�.rodata..L.str22�.rodata..L.str12�.rodata..L.str1�.rodata..L.str21�.rodata..L.str11�.rodata..L.str20�.rodata..L.str10�����������������������������������������������������������������S��������������������@�����������������������������������������������������������@��������������������������������������b��������������������@�����������������������������������������������������������@�������������������������������������T���������������������P�������������������������������������`��������������������`�������}�����������������������������[���������������������P�������������9�����������������������������������������������������������������������������������������������������������d����������������������������������������������������������h������9��� ��������������������������������������`������.����������������������������������������������������X������H�������9�������������������������������������������������������������������������������������������������������������������9��� �����������������'��������������������������� ������������������������������"�����������������������������������9��������������������g�����2���������������������������������������������������4�����2��������������������������������������������������������2���������������������� �����������������������������������2���������������������������������������������������������2���������������������� �����������������������������l�����2���������������������������������������������������:�����2��������������������������������������������������������2���������������������������������������������������������2���������������������������������������������������������2���������������������� �����������������������������w�����2��������������������������������������������������U�����2��������������������������������������������������#�����2��������������������������������������������������������2����������������������������������������������������������������������� ������������������������������������������������������������������������9��������������������������2���������������(�����������������������������������������2���������������)�����������������������������������[�����2���������������9�����������������������������������)�����2���������������J�����������������������������������������2���������������]�����������������������������������������2���������������o�����������������������������������f�����2���������������������������������������������������D�����2��������������������������������������������������������2���������������������������������������������������������2���������������������������������������������������������2���������������������������������������������������|�����2���������������������������������������������������J�����2��������������������������������������������������������2���������������������������������������������������������2����������������������������������������������������������������������� ������:�����������������������������D��������������������`������8����������������������������������������������������������p�����������������������������������������������������������P������9���2�����������������Y�����0���������������������J�����������������������������v���������������������Z�������������������������������������:��������������������`�������������������������������������5���������������������8��������������9���6���������������������������������������X����������������������������������������������������������������� ������:���B��������������������������������������������������������������������������������������������������������������������������$�������������������2�������������������z�������������������������������������������������������������������������������;���!����������������:������������ �������B�������������������J������������ �������R�������������������Z�������������������b�������������������j�������������������r������������ �������D�����������������������0���������:��������������������������������������������������������������������������������������������������������������������������������������������������������������������� �������������������������������������������� ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!����������������������"����������������������#����������������������$����������������������%����������������������&����������������������'����������������������(����������������������)����������������������*����������������������+����������������������,����������������������-����������������������.����������������������/����������������������0����������������������1����������������������2����������������������4����������������������5����������������������6�����������������c������������.�������D��������������������������������������������� ���������������������������������������� ���������+������������������ ���������������������}������s���������������������+����������������������/home/vagrant/libv8/vendor/v8/out/x64.release/obj/gen/libraries.cc�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetBuiltinsCountEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetDebuggerCountEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE8GetIndexEPKc�.L.str�strcmp�.L.str1�.L.str2�.L.str3�.L.str4�.L.str5�.L.str6�.L.str7�.L.str8�.L.str9�.L.str10�.L.str11�.L.str12�.L.str13�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE17GetRawScriptsSizeEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE18GetRawScriptSourceEi�.L.str14�_ZN2v88internalL11raw_sourcesE�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE13GetScriptNameEi�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE16GetScriptsSourceEv�_ZN2v88internalL7sourcesE�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE0EE19SetRawScriptsSourceENS0_6VectorIKcEE�_GLOBAL_OFFSET_TABLE_���������������������������������������K�����������$���������������������,����������K�����������@���������� �����������H����������K�����������\���������� �����������d����������K�����������x��������������������������������K��������������������������������������������K���������������������� ����������������������K��������������������������������������������K��������������������������������������������K�����������������������������������������K������������������������������� ���������K�����������0��������������������8���������K�����������H��������������������P���������K�����������`��������������������h���������K��������������������������������.����������,�����������A����������,�����������T����������,�����������g����������,�����������u����������,����������������������,����������������������,����������������������,����������������������,����������������������,����������������������,����������������������,����������� ���������,����������� ���������,���������������������=���������������������>�����������(�������������������������������<���������������������,����������������������<����������������������.���������������������/���������������������0���������������������1����������� ����������2�����������(����������3�����������0����������4�����������8����������5�����������@����������6�����������H����������7�����������P����������8�����������X����������9�����������`����������:�����������h����������;����������� ���������������������<���������������������X���������������������t�������������������������������������������������������������������������������������������������������������/0 0 0 0 100644 18992 ` ELF ���������>���������������������7����������@�����@�"��UH�����]������UH��1�]���������UH��SPH��H�5�����������1���t1H�5����H�������������tH�5����H�����������Ѓ�H��[]������������UH�带0��]������UH���t��u&���H��������]ø��H��������]Å�u���H�����]�1�H�����]����������������UH���t��uH���������]ú���H�����]Ã�uH���������]�H�����1�]����������UH��H�������0��]���������������UH��H�=����]�proxy�collection�object-observe�������������native proxy.js�native collection.js�native object-observe.js���������� "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<a.length;++c){ var d=a[c] var e=this.getOwnPropertyDescriptor(((typeof(%IS_VAR(d))==='string')?d:NonStringToString(d))) if(!(typeof(e)==='undefined')&&e.enumerable){ b[count++]=a[c] } } return b } function DerivedEnumerateTrap(){ var a=this.getPropertyNames() var b=[] for(var c=0,count=0;c<a.length;++c){ var d=a[c] var e=this.getPropertyDescriptor(((typeof(%IS_VAR(d))==='string')?d:NonStringToString(d))) if(!(typeof(e)==='undefined')&&e.enumerable){ b[count++]=a[c] } } return b } function ProxyEnumerate(a){ var b=%GetHandler(a) if((typeof(b.enumerate)==='undefined')){ return %Apply(DerivedEnumerateTrap,b,[],0,0) }else{ return ToStringArray(b.enumerate(),"enumerate") } } "use strict"; var $Set=global.Set; var $Map=global.Map; var $WeakMap=global.WeakMap; var undefined_sentinel={}; function SetConstructor(){ if(%_IsConstructCall()){ %SetInitialize(this); }else{ return new $Set(); } } function SetAdd(a){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError('incompatible_method_receiver', ['Set.prototype.add',this]); } if((typeof(a)==='undefined')){ a=undefined_sentinel; } return %SetAdd(this,a); } function SetHas(a){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError('incompatible_method_receiver', ['Set.prototype.has',this]); } if((typeof(a)==='undefined')){ a=undefined_sentinel; } return %SetHas(this,a); } function SetDelete(a){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError('incompatible_method_receiver', ['Set.prototype.delete',this]); } if((typeof(a)==='undefined')){ a=undefined_sentinel; } if(%SetHas(this,a)){ %SetDelete(this,a); return true; }else{ return false; } } function SetGetSize(){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError('incompatible_method_receiver', ['Set.prototype.size',this]); } return %SetGetSize(this); } function SetClear(){ if(!(%_ClassOf(this)==='Set')){ throw MakeTypeError('incompatible_method_receiver', ['Set.prototype.clear',this]); } %SetInitialize(this); } function MapConstructor(){ if(%_IsConstructCall()){ %MapInitialize(this); }else{ return new $Map(); } } function MapGet(a){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError('incompatible_method_receiver', ['Map.prototype.get',this]); } if((typeof(a)==='undefined')){ a=undefined_sentinel; } return %MapGet(this,a); } function MapSet(a,b){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError('incompatible_method_receiver', ['Map.prototype.set',this]); } if((typeof(a)==='undefined')){ a=undefined_sentinel; } return %MapSet(this,a,b); } function MapHas(a){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError('incompatible_method_receiver', ['Map.prototype.has',this]); } if((typeof(a)==='undefined')){ a=undefined_sentinel; } return %MapHas(this,a); } function MapDelete(a){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError('incompatible_method_receiver', ['Map.prototype.delete',this]); } if((typeof(a)==='undefined')){ a=undefined_sentinel; } return %MapDelete(this,a); } function MapGetSize(){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError('incompatible_method_receiver', ['Map.prototype.size',this]); } return %MapGetSize(this); } function MapClear(){ if(!(%_ClassOf(this)==='Map')){ throw MakeTypeError('incompatible_method_receiver', ['Map.prototype.clear',this]); } %MapInitialize(this); } function WeakMapConstructor(){ if(%_IsConstructCall()){ %WeakMapInitialize(this); }else{ return new $WeakMap(); } } function WeakMapGet(a){ if(!(%_ClassOf(this)==='WeakMap')){ throw MakeTypeError('incompatible_method_receiver', ['WeakMap.prototype.get',this]); } if(!(%_IsSpecObject(a))){ throw %MakeTypeError('invalid_weakmap_key',[this,a]); } return %WeakMapGet(this,a); } function WeakMapSet(a,b){ if(!(%_ClassOf(this)==='WeakMap')){ throw MakeTypeError('incompatible_method_receiver', ['WeakMap.prototype.set',this]); } if(!(%_IsSpecObject(a))){ throw %MakeTypeError('invalid_weakmap_key',[this,a]); } return %WeakMapSet(this,a,b); } function WeakMapHas(a){ if(!(%_ClassOf(this)==='WeakMap')){ throw MakeTypeError('incompatible_method_receiver', ['WeakMap.prototype.has',this]); } if(!(%_IsSpecObject(a))){ throw %MakeTypeError('invalid_weakmap_key',[this,a]); } return %WeakMapHas(this,a); } function WeakMapDelete(a){ if(!(%_ClassOf(this)==='WeakMap')){ throw MakeTypeError('incompatible_method_receiver', ['WeakMap.prototype.delete',this]); } if(!(%_IsSpecObject(a))){ throw %MakeTypeError('invalid_weakmap_key',[this,a]); } return %WeakMapDelete(this,a); } (function(){ %CheckIsBootstrapping(); %SetCode($Set,SetConstructor); %SetCode($Map,MapConstructor); %SetProperty($Set.prototype,"constructor",$Set,2); %SetProperty($Map.prototype,"constructor",$Map,2); InstallGetter($Set.prototype,"size",SetGetSize); InstallFunctions($Set.prototype,2,$Array( "add",SetAdd, "has",SetHas, "delete",SetDelete, "clear",SetClear )); InstallGetter($Map.prototype,"size",MapGetSize); InstallFunctions($Map.prototype,2,$Array( "get",MapGet, "set",MapSet, "has",MapHas, "delete",MapDelete, "clear",MapClear )); %SetCode($WeakMap,WeakMapConstructor); %SetProperty($WeakMap.prototype,"constructor",$WeakMap,2); InstallFunctions($WeakMap.prototype,2,$Array( "get",WeakMapGet, "set",WeakMapSet, "has",WeakMapHas, "delete",WeakMapDelete )); })(); "use strict"; var observationState=%GetObservationState(); if((typeof(observationState.observerInfoMap)==='undefined')){ observationState.observerInfoMap=%ObservationWeakMapCreate(); observationState.objectInfoMap=%ObservationWeakMapCreate(); observationState.notifierTargetMap=%ObservationWeakMapCreate(); observationState.pendingObservers=new InternalArray; observationState.observerPriority=0; } function ObservationWeakMap(a){ this.map_=a; } ObservationWeakMap.prototype={ get:function(a){ a=%UnwrapGlobalProxy(a); if(!(%_IsSpecObject(a)))return void 0; return %WeakMapGet(this.map_,a); }, set:function(a,b){ a=%UnwrapGlobalProxy(a); if(!(%_IsSpecObject(a)))return void 0; %WeakMapSet(this.map_,a,b); }, has:function(a){ return!(typeof(this.get(a))==='undefined'); } }; var observerInfoMap= new ObservationWeakMap(observationState.observerInfoMap); var objectInfoMap=new ObservationWeakMap(observationState.objectInfoMap); var notifierTargetMap= new ObservationWeakMap(observationState.notifierTargetMap); function CreateObjectInfo(a){ var b={ changeObservers:new InternalArray, notifier:null, }; objectInfoMap.set(a,b); return b; } function ObjectObserve(a,b){ if(!(%_IsSpecObject(a))) throw MakeTypeError("observe_non_object",["observe"]); if(!(%_ClassOf(b)==='Function')) throw MakeTypeError("observe_non_function",["observe"]); if(ObjectIsFrozen(b)) throw MakeTypeError("observe_callback_frozen"); if(!observerInfoMap.has(b)){ observerInfoMap.set(b,{ pendingChangeRecords:null, priority:observationState.observerPriority++, }); } var c=objectInfoMap.get(a); if((typeof(c)==='undefined'))c=CreateObjectInfo(a); %SetIsObserved(a,true); var d=c.changeObservers; if(d.indexOf(b)<0)d.push(b); return a; } function ObjectUnobserve(a,b){ if(!(%_IsSpecObject(a))) throw MakeTypeError("observe_non_object",["unobserve"]); if(!(%_ClassOf(b)==='Function')) throw MakeTypeError("observe_non_function",["unobserve"]); var c=objectInfoMap.get(a); if((typeof(c)==='undefined')) return a; var d=c.changeObservers; var e=d.indexOf(b); if(e>=0){ d.splice(e,1); if(d.length===0)%SetIsObserved(a,false); } return a; } function EnqueueChangeRecord(a,b){ for(var c=0;c<b.length;c++){ var d=b[c]; var e=observerInfoMap.get(d); observationState.pendingObservers[e.priority]=d; %SetObserverDeliveryPending(); if((e.pendingChangeRecords===null)){ e.pendingChangeRecords=new InternalArray(a); }else{ e.pendingChangeRecords.push(a); } } } function NotifyChange(a,b,c,d){ var e=objectInfoMap.get(b); var f=(arguments.length<4)? {type:a,object:b,name:c}: {type:a,object:b,name:c,oldValue:d}; ObjectFreeze(f); EnqueueChangeRecord(f,e.changeObservers); } var notifierPrototype={}; function ObjectNotifierNotify(a){ if(!(%_IsSpecObject(this))) throw MakeTypeError("called_on_non_object",["notify"]); var b=notifierTargetMap.get(this); if((typeof(b)==='undefined')) throw MakeTypeError("observe_notify_non_notifier"); if(!(typeof(a.type)==='string')) throw MakeTypeError("observe_type_non_string"); var c=objectInfoMap.get(b); if((typeof(c)==='undefined')||c.changeObservers.length===0) return; var d={object:b}; for(var e in a){ if(e==='object')continue; %DefineOrRedefineDataProperty(d,e,a[e], 1+4); } ObjectFreeze(d); EnqueueChangeRecord(d,c.changeObservers); } function ObjectGetNotifier(a){ if(!(%_IsSpecObject(a))) throw MakeTypeError("observe_non_object",["getNotifier"]); if(ObjectIsFrozen(a))return null; var b=objectInfoMap.get(a); if((typeof(b)==='undefined'))b=CreateObjectInfo(a); if((b.notifier===null)){ b.notifier={__proto__:notifierPrototype}; notifierTargetMap.set(b.notifier,a); } return b.notifier; } function DeliverChangeRecordsForObserver(a){ var b=observerInfoMap.get(a); if((typeof(b)==='undefined')) return false; var c=b.pendingChangeRecords; if((c===null)) return false; b.pendingChangeRecords=null; delete observationState.pendingObservers[b.priority]; var d=[]; %MoveArrayContents(c,d); try{ %Call(void 0,d,a); }catch(ex){} return true; } function ObjectDeliverChangeRecords(a){ if(!(%_ClassOf(a)==='Function')) throw MakeTypeError("observe_non_function",["deliverChangeRecords"]); while(DeliverChangeRecordsForObserver(a)){} } function DeliverChangeRecords(){ while(observationState.pendingObservers.length){ var a=observationState.pendingObservers; observationState.pendingObservers=new InternalArray; for(var b in a){ DeliverChangeRecordsForObserver(a[b]); } } } function SetupObjectObserve(){ %CheckIsBootstrapping(); InstallFunctions($Object,2,$Array( "deliverChangeRecords",ObjectDeliverChangeRecords, "getNotifier",ObjectGetNotifier, "observe",ObjectObserve, "unobserve",ObjectUnobserve )); InstallFunctions(notifierPrototype,2,$Array( "notify",ObjectNotifierNotify )); } SetupObjectObserve(); �FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512��������zR�x�����������������A�C ������8�����������A�C ������T�������U����A�C B����p�����������A�C ��������������Q����A�C ��������������G����A�C ������������������A�C �������������� ����A�C ����.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetBuiltinsCountEv�.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetDebuggerCountEv�.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE17GetRawScriptsSizeEv�.rela.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetScriptsSourceEv�.text�.comment�.bss�.rodata..L.str�.note.GNU-stack�.rela.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE13GetScriptNameEi�.rela.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE18GetRawScriptSourceEi�.rela.eh_frame�.rela.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE8GetIndexEPKc�.shstrtab�.strtab�.symtab�.data�.rela.data.rel.local._ZN2v88internalL11raw_sourcesE�.rodata._ZN2v88internalL7sourcesE�.rela.text._ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE19SetRawScriptsSourceENS0_6VectorIKcEE�.rodata..L.str6�.rodata..L.str5�.rodata..L.str4�.rodata..L.str3�.rodata..L.str2�.rodata..L.str1��������������������������������������������������������������������S��������������������@�����������������������������������������������������������@��������������������������������������b��������������������@�����������������������������������������������������������@�������������������������������������T���������������������P�������������������������������������I��������������������`�������U������������������������������D����������������������G�������������� �������������������������������������������������������������������������������������������������������������Q����������������������������������������������������hH������`������� ��� ��������������������������������������0������G�����������������������������������������������������H������`������� �����������������������������������������������������������������������������������������������������(I������������� ��� �������������������������������������������� ���������������������������������������������������@I������������� ��������������������g�����2���������������������������������������������������������2���������������������������������������������������������2�����������������������������������������������������������������������������������������������������������������������������������XI������������� ��������������������������2���������������������������������������������������������2���������������������������������������������������������2���������������������������������������������������u�����2������������������������������������������������������������������������ �������0�����������������������������Y�����0����������������2������J�����������������������������v���������������������3�������������������������������������:��������������������3�������������������������������������5���������������������pI�������������� ������������������������������������������4����������������������������������������������������������`@������ ������!���"����������������������������������������D������Q���������������������������������������������������������������������������1�������������������?�������������������G��������������������������������������e�������������������m�������������������]�����������������������������������������������������0��������������������������������������������������������������������������������������������������������������������������������������������������������������������� �������������������������������������������� ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������G�������Q�����������������������������������������u��� ����������������O����������������������� ���������Q�������������������� ���������������������U�������;���������������������8����������������������/home/vagrant/libv8/vendor/v8/out/x64.release/obj/gen/experimental-libraries.cc�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetBuiltinsCountEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetDebuggerCountEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE8GetIndexEPKc�.L.str�strcmp�.L.str1�.L.str2�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE17GetRawScriptsSizeEv�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE18GetRawScriptSourceEi�_ZN2v88internalL11raw_sourcesE�.L.str3�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE13GetScriptNameEi�.L.str6�.L.str4�.L.str5�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE16GetScriptsSourceEv�_ZN2v88internalL7sourcesE�_ZN2v88internal17NativesCollectionILNS0_10NativeTypeE1EE19SetRawScriptsSourceENS0_6VectorIKcEE�_GLOBAL_OFFSET_TABLE_���������������������������������������+����������� ���������������������(����������+�����������8���������������������@����������+��������������������������������)���������������������@���������������������K������������������������������������������#���������������������1���������������������?������������������������������������������������������������������������������������� ���������������������<���������������������X���������������������t�������������������������������������������������������������������������������������������������������������/26 0 0 0 100644 5224 ` ELF ���������>��������������������0����������@�����@������������������������������������������������������������������������������������FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512��.text�.comment�.bss�.note.GNU-stack�.shstrtab�.strtab�.symtab�.data�.rodata._ZN2v88internal8Snapshot17context_raw_size_E�.rodata._ZN2v88internal8Snapshot9raw_size_E�.rodata._ZN2v88internal8Snapshot13context_size_E�.rodata._ZN2v88internal8Snapshot5size_E�.rodata._ZN2v88internal8Snapshot23context_new_space_used_E�.rodata._ZN2v88internal8Snapshot15new_space_used_E�.rodata._ZN2v88internal8Snapshot27context_pointer_space_used_E�.rodata._ZN2v88internal8Snapshot19pointer_space_used_E�.rodata._ZN2v88internal8Snapshot23context_map_space_used_E�.rodata._ZN2v88internal8Snapshot15map_space_used_E�.rodata._ZN2v88internal8Snapshot24context_cell_space_used_E�.rodata._ZN2v88internal8Snapshot16cell_space_used_E�.rodata._ZN2v88internal8Snapshot24context_code_space_used_E�.rodata._ZN2v88internal8Snapshot16code_space_used_E�.rodata._ZN2v88internal8Snapshot24context_data_space_used_E�.rodata._ZN2v88internal8Snapshot16data_space_used_E�.bss._ZN2v88internal8Snapshot17context_raw_data_E�.bss._ZN2v88internal8Snapshot9raw_data_E�.rodata._ZN2v88internal8Snapshot13context_data_E�.rodata._ZN2v88internal8Snapshot5data_E���������������������������������������������������������������������������������������@��������������������������������������?���������������������@�����������������������������������������������������������@��������������������������������������-��������������������@����������������������������������������������������������H�����������������������������������������������������������H�������������������������������������z���������������������L����������������������������������������������������������P����������������������������������������������������������X�����������������������������������������������������������X�������������������������������������E���������������������\�������������������������������������:��������������������`����������������������������������������������������������d�������������������������������������m��������������������h����������������������������������������������������������l���������������������������������������������������������p����������������������������������������������������������t�����������������������������������������������������������x�������������������������������������m��������������������|�������������������������������������1��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Q����������������������������������������������������������������0�����������������������J������������������������������������������������������������������������������������������%������������������������������U�����������������������������7����������������������p������h��������������������������/���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ���������������������� ������������������������������������������������������������������ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ������������������������������������N�������������������+���������������������������������������������������������������� ����������������!�������������������y��� ����������������)�������������������W�������������������\���������������������������������������������������������������������������������������������������^��������������������:��������������������~���������������������../src/snapshot-empty.cc�_ZN2v88internal8Snapshot5data_E�_ZN2v88internal8Snapshot9raw_data_E�_ZN2v88internal8Snapshot5size_E�_ZN2v88internal8Snapshot9raw_size_E�_ZN2v88internal8Snapshot13context_data_E�_ZN2v88internal8Snapshot17context_raw_data_E�_ZN2v88internal8Snapshot13context_size_E�_ZN2v88internal8Snapshot17context_raw_size_E�_ZN2v88internal8Snapshot15new_space_used_E�_ZN2v88internal8Snapshot19pointer_space_used_E�_ZN2v88internal8Snapshot16data_space_used_E�_ZN2v88internal8Snapshot16code_space_used_E�_ZN2v88internal8Snapshot15map_space_used_E�_ZN2v88internal8Snapshot16cell_space_used_E�_ZN2v88internal8Snapshot23context_new_space_used_E�_ZN2v88internal8Snapshot27context_pointer_space_used_E�_ZN2v88internal8Snapshot24context_data_space_used_E�_ZN2v88internal8Snapshot24context_code_space_used_E�_ZN2v88internal8Snapshot23context_map_space_used_E�_ZN2v88internal8Snapshot24context_cell_space_used_E�