OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 function inherits(ctor, superCtor) { | 137 function inherits(ctor, superCtor) { |
138 var tempCtor = function(){}; | 138 var tempCtor = function(){}; |
139 tempCtor.prototype = superCtor.prototype; | 139 tempCtor.prototype = superCtor.prototype; |
140 ctor.super_ = superCtor.prototype; | 140 ctor.super_ = superCtor.prototype; |
141 ctor.prototype = new tempCtor(); | 141 ctor.prototype = new tempCtor(); |
142 ctor.prototype.constructor = ctor; | 142 ctor.prototype.constructor = ctor; |
143 } | 143 } |
144 | 144 |
145 | 145 |
146 // Type names of the different mirrors. | 146 // Type names of the different mirrors. |
147 const UNDEFINED_TYPE = 'undefined'; | 147 var UNDEFINED_TYPE = 'undefined'; |
148 const NULL_TYPE = 'null'; | 148 var NULL_TYPE = 'null'; |
149 const BOOLEAN_TYPE = 'boolean'; | 149 var BOOLEAN_TYPE = 'boolean'; |
150 const NUMBER_TYPE = 'number'; | 150 var NUMBER_TYPE = 'number'; |
151 const STRING_TYPE = 'string'; | 151 var STRING_TYPE = 'string'; |
152 const OBJECT_TYPE = 'object'; | 152 var OBJECT_TYPE = 'object'; |
153 const FUNCTION_TYPE = 'function'; | 153 var FUNCTION_TYPE = 'function'; |
154 const REGEXP_TYPE = 'regexp'; | 154 var REGEXP_TYPE = 'regexp'; |
155 const ERROR_TYPE = 'error'; | 155 var ERROR_TYPE = 'error'; |
156 const PROPERTY_TYPE = 'property'; | 156 var PROPERTY_TYPE = 'property'; |
157 const FRAME_TYPE = 'frame'; | 157 var FRAME_TYPE = 'frame'; |
158 const SCRIPT_TYPE = 'script'; | 158 var SCRIPT_TYPE = 'script'; |
159 const CONTEXT_TYPE = 'context'; | 159 var CONTEXT_TYPE = 'context'; |
160 const SCOPE_TYPE = 'scope'; | 160 var SCOPE_TYPE = 'scope'; |
161 | 161 |
162 // Maximum length when sending strings through the JSON protocol. | 162 // Maximum length when sending strings through the JSON protocol. |
163 const kMaxProtocolStringLength = 80; | 163 var kMaxProtocolStringLength = 80; |
164 | 164 |
165 // Different kind of properties. | 165 // Different kind of properties. |
166 PropertyKind = {}; | 166 var PropertyKind = {}; |
167 PropertyKind.Named = 1; | 167 PropertyKind.Named = 1; |
168 PropertyKind.Indexed = 2; | 168 PropertyKind.Indexed = 2; |
169 | 169 |
170 | 170 |
171 // A copy of the PropertyType enum from global.h | 171 // A copy of the PropertyType enum from global.h |
172 PropertyType = {}; | 172 var PropertyType = {}; |
173 PropertyType.Normal = 0; | 173 PropertyType.Normal = 0; |
174 PropertyType.Field = 1; | 174 PropertyType.Field = 1; |
175 PropertyType.ConstantFunction = 2; | 175 PropertyType.ConstantFunction = 2; |
176 PropertyType.Callbacks = 3; | 176 PropertyType.Callbacks = 3; |
177 PropertyType.Handler = 4; | 177 PropertyType.Handler = 4; |
178 PropertyType.Interceptor = 5; | 178 PropertyType.Interceptor = 5; |
179 PropertyType.MapTransition = 6; | 179 PropertyType.MapTransition = 6; |
180 PropertyType.ExternalArrayTransition = 7; | 180 PropertyType.ExternalArrayTransition = 7; |
181 PropertyType.ConstantTransition = 8; | 181 PropertyType.ConstantTransition = 8; |
182 PropertyType.NullDescriptor = 9; | 182 PropertyType.NullDescriptor = 9; |
183 | 183 |
184 | 184 |
185 // Different attributes for a property. | 185 // Different attributes for a property. |
186 PropertyAttribute = {}; | 186 var PropertyAttribute = {}; |
187 PropertyAttribute.None = NONE; | 187 PropertyAttribute.None = NONE; |
188 PropertyAttribute.ReadOnly = READ_ONLY; | 188 PropertyAttribute.ReadOnly = READ_ONLY; |
189 PropertyAttribute.DontEnum = DONT_ENUM; | 189 PropertyAttribute.DontEnum = DONT_ENUM; |
190 PropertyAttribute.DontDelete = DONT_DELETE; | 190 PropertyAttribute.DontDelete = DONT_DELETE; |
191 | 191 |
192 | 192 |
193 // A copy of the scope types from runtime.cc. | 193 // A copy of the scope types from runtime.cc. |
194 ScopeType = { Global: 0, | 194 var ScopeType = { Global: 0, |
195 Local: 1, | 195 Local: 1, |
196 With: 2, | 196 With: 2, |
197 Closure: 3, | 197 Closure: 3, |
198 Catch: 4, | 198 Catch: 4, |
199 Block: 5 }; | 199 Block: 5 }; |
200 | 200 |
201 | 201 |
202 // Mirror hierarchy: | 202 // Mirror hierarchy: |
203 // - Mirror | 203 // - Mirror |
204 // - ValueMirror | 204 // - ValueMirror |
205 // - UndefinedMirror | 205 // - UndefinedMirror |
206 // - NullMirror | 206 // - NullMirror |
207 // - NumberMirror | 207 // - NumberMirror |
208 // - StringMirror | 208 // - StringMirror |
209 // - ObjectMirror | 209 // - ObjectMirror |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 * @return {boolean} True if the property is | 1230 * @return {boolean} True if the property is |
1231 * UndefinedMirror if there is no setter for this property | 1231 * UndefinedMirror if there is no setter for this property |
1232 */ | 1232 */ |
1233 PropertyMirror.prototype.isNative = function() { | 1233 PropertyMirror.prototype.isNative = function() { |
1234 return (this.propertyType() == PropertyType.Interceptor) || | 1234 return (this.propertyType() == PropertyType.Interceptor) || |
1235 ((this.propertyType() == PropertyType.Callbacks) && | 1235 ((this.propertyType() == PropertyType.Callbacks) && |
1236 !this.hasGetter() && !this.hasSetter()); | 1236 !this.hasGetter() && !this.hasSetter()); |
1237 }; | 1237 }; |
1238 | 1238 |
1239 | 1239 |
1240 const kFrameDetailsFrameIdIndex = 0; | 1240 var kFrameDetailsFrameIdIndex = 0; |
1241 const kFrameDetailsReceiverIndex = 1; | 1241 var kFrameDetailsReceiverIndex = 1; |
1242 const kFrameDetailsFunctionIndex = 2; | 1242 var kFrameDetailsFunctionIndex = 2; |
1243 const kFrameDetailsArgumentCountIndex = 3; | 1243 var kFrameDetailsArgumentCountIndex = 3; |
1244 const kFrameDetailsLocalCountIndex = 4; | 1244 var kFrameDetailsLocalCountIndex = 4; |
1245 const kFrameDetailsSourcePositionIndex = 5; | 1245 var kFrameDetailsSourcePositionIndex = 5; |
1246 const kFrameDetailsConstructCallIndex = 6; | 1246 var kFrameDetailsConstructCallIndex = 6; |
1247 const kFrameDetailsAtReturnIndex = 7; | 1247 var kFrameDetailsAtReturnIndex = 7; |
1248 const kFrameDetailsFlagsIndex = 8; | 1248 var kFrameDetailsFlagsIndex = 8; |
1249 const kFrameDetailsFirstDynamicIndex = 9; | 1249 var kFrameDetailsFirstDynamicIndex = 9; |
1250 | 1250 |
1251 const kFrameDetailsNameIndex = 0; | 1251 var kFrameDetailsNameIndex = 0; |
1252 const kFrameDetailsValueIndex = 1; | 1252 var kFrameDetailsValueIndex = 1; |
1253 const kFrameDetailsNameValueSize = 2; | 1253 var kFrameDetailsNameValueSize = 2; |
1254 | 1254 |
1255 const kFrameDetailsFlagDebuggerFrameMask = 1 << 0; | 1255 var kFrameDetailsFlagDebuggerFrameMask = 1 << 0; |
1256 const kFrameDetailsFlagOptimizedFrameMask = 1 << 1; | 1256 var kFrameDetailsFlagOptimizedFrameMask = 1 << 1; |
1257 const kFrameDetailsFlagInlinedFrameIndexMask = 7 << 2; | 1257 var kFrameDetailsFlagInlinedFrameIndexMask = 7 << 2; |
1258 | 1258 |
1259 /** | 1259 /** |
1260 * Wrapper for the frame details information retreived from the VM. The frame | 1260 * Wrapper for the frame details information retreived from the VM. The frame |
1261 * details from the VM is an array with the following content. See runtime.cc | 1261 * details from the VM is an array with the following content. See runtime.cc |
1262 * Runtime_GetFrameDetails. | 1262 * Runtime_GetFrameDetails. |
1263 * 0: Id | 1263 * 0: Id |
1264 * 1: Receiver | 1264 * 1: Receiver |
1265 * 2: Function | 1265 * 2: Function |
1266 * 3: Argument count | 1266 * 3: Argument count |
1267 * 4: Local count | 1267 * 4: Local count |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 result += ' '; | 1725 result += ' '; |
1726 result += this.sourceAndPositionText(); | 1726 result += this.sourceAndPositionText(); |
1727 if (opt_locals) { | 1727 if (opt_locals) { |
1728 result += '\n'; | 1728 result += '\n'; |
1729 result += this.localsText(); | 1729 result += this.localsText(); |
1730 } | 1730 } |
1731 return result; | 1731 return result; |
1732 }; | 1732 }; |
1733 | 1733 |
1734 | 1734 |
1735 const kScopeDetailsTypeIndex = 0; | 1735 var kScopeDetailsTypeIndex = 0; |
1736 const kScopeDetailsObjectIndex = 1; | 1736 var kScopeDetailsObjectIndex = 1; |
1737 | 1737 |
1738 function ScopeDetails(frame, index) { | 1738 function ScopeDetails(frame, index) { |
1739 this.break_id_ = frame.break_id_; | 1739 this.break_id_ = frame.break_id_; |
1740 this.details_ = %GetScopeDetails(frame.break_id_, | 1740 this.details_ = %GetScopeDetails(frame.break_id_, |
1741 frame.details_.frameId(), | 1741 frame.details_.frameId(), |
1742 frame.details_.inlinedFrameIndex(), | 1742 frame.details_.inlinedFrameIndex(), |
1743 index); | 1743 index); |
1744 } | 1744 } |
1745 | 1745 |
1746 | 1746 |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2423 } | 2423 } |
2424 if (!NUMBER_IS_FINITE(value)) { | 2424 if (!NUMBER_IS_FINITE(value)) { |
2425 if (value > 0) { | 2425 if (value > 0) { |
2426 return 'Infinity'; | 2426 return 'Infinity'; |
2427 } else { | 2427 } else { |
2428 return '-Infinity'; | 2428 return '-Infinity'; |
2429 } | 2429 } |
2430 } | 2430 } |
2431 return value; | 2431 return value; |
2432 } | 2432 } |
OLD | NEW |