OLD | NEW |
1 // Copyright 2006-2012 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 "use strict"; | 6 "use strict"; |
7 | 7 |
8 // ---------------------------------------------------------------------------- | 8 // ---------------------------------------------------------------------------- |
9 // Imports | 9 // Imports |
10 | 10 |
11 var FunctionSourceString; | 11 var FunctionSourceString; |
12 var GlobalArray = global.Array; | 12 var GlobalArray = global.Array; |
13 var IsNaN = global.isNaN; | 13 var IsNaN = global.isNaN; |
14 var JSONStringify = global.JSON.stringify; | 14 var JSONStringify = global.JSON.stringify; |
15 var MathMin = global.Math.min; | 15 var MathMin = global.Math.min; |
16 var promiseStatusSymbol = utils.ImportNow("promise_status_symbol"); | 16 var promiseStatusSymbol = utils.ImportNow("promise_status_symbol"); |
17 var promiseValueSymbol = utils.ImportNow("promise_value_symbol"); | 17 var promiseValueSymbol = utils.ImportNow("promise_value_symbol"); |
18 var SymbolToString; | 18 var SymbolToString; |
19 var ToBoolean; | 19 var ToBoolean; |
20 var ToString; | |
21 | 20 |
22 utils.Import(function(from) { | 21 utils.Import(function(from) { |
23 FunctionSourceString = from.FunctionSourceString; | 22 FunctionSourceString = from.FunctionSourceString; |
24 SymbolToString = from.SymbolToString; | 23 SymbolToString = from.SymbolToString; |
25 ToBoolean = from.ToBoolean; | 24 ToBoolean = from.ToBoolean; |
26 ToString = from.ToString; | |
27 }); | 25 }); |
28 | 26 |
29 // ---------------------------------------------------------------------------- | 27 // ---------------------------------------------------------------------------- |
30 | 28 |
31 // Mirror hierarchy: | 29 // Mirror hierarchy: |
32 // - Mirror | 30 // - Mirror |
33 // - ValueMirror | 31 // - ValueMirror |
34 // - UndefinedMirror | 32 // - UndefinedMirror |
35 // - NullMirror | 33 // - NullMirror |
36 // - BooleanMirror | 34 // - BooleanMirror |
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 }; | 1165 }; |
1168 | 1166 |
1169 | 1167 |
1170 ArrayMirror.prototype.indexedPropertiesFromRange = function(opt_from_index, | 1168 ArrayMirror.prototype.indexedPropertiesFromRange = function(opt_from_index, |
1171 opt_to_index) { | 1169 opt_to_index) { |
1172 var from_index = opt_from_index || 0; | 1170 var from_index = opt_from_index || 0; |
1173 var to_index = opt_to_index || this.length() - 1; | 1171 var to_index = opt_to_index || this.length() - 1; |
1174 if (from_index > to_index) return new GlobalArray(); | 1172 if (from_index > to_index) return new GlobalArray(); |
1175 var values = new GlobalArray(to_index - from_index + 1); | 1173 var values = new GlobalArray(to_index - from_index + 1); |
1176 for (var i = from_index; i <= to_index; i++) { | 1174 for (var i = from_index; i <= to_index; i++) { |
1177 var details = %DebugGetPropertyDetails(this.value_, ToString(i)); | 1175 var details = %DebugGetPropertyDetails(this.value_, TO_STRING(i)); |
1178 var value; | 1176 var value; |
1179 if (details) { | 1177 if (details) { |
1180 value = new PropertyMirror(this, i, details); | 1178 value = new PropertyMirror(this, i, details); |
1181 } else { | 1179 } else { |
1182 value = GetUndefinedMirror(); | 1180 value = GetUndefinedMirror(); |
1183 } | 1181 } |
1184 values[i - from_index] = value; | 1182 values[i - from_index] = value; |
1185 } | 1183 } |
1186 return values; | 1184 return values; |
1187 }; | 1185 }; |
(...skipping 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3114 // Functions needed by the debugger runtime. | 3112 // Functions needed by the debugger runtime. |
3115 utils.InstallFunctions(utils, DONT_ENUM, [ | 3113 utils.InstallFunctions(utils, DONT_ENUM, [ |
3116 "ClearMirrorCache", ClearMirrorCache | 3114 "ClearMirrorCache", ClearMirrorCache |
3117 ]); | 3115 ]); |
3118 | 3116 |
3119 // Export to debug.js | 3117 // Export to debug.js |
3120 utils.Export(function(to) { | 3118 utils.Export(function(to) { |
3121 to.MirrorType = MirrorType; | 3119 to.MirrorType = MirrorType; |
3122 }); | 3120 }); |
3123 }) | 3121 }) |
OLD | NEW |