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 |
(...skipping 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2226 result += ' '; | 2226 result += ' '; |
2227 result += this.sourceAndPositionText(); | 2227 result += this.sourceAndPositionText(); |
2228 if (opt_locals) { | 2228 if (opt_locals) { |
2229 result += '\n'; | 2229 result += '\n'; |
2230 result += this.localsText(); | 2230 result += this.localsText(); |
2231 } | 2231 } |
2232 return result; | 2232 return result; |
2233 }; | 2233 }; |
2234 | 2234 |
2235 | 2235 |
| 2236 // This indexes correspond definitions in debug-scopes.h. |
2236 var kScopeDetailsTypeIndex = 0; | 2237 var kScopeDetailsTypeIndex = 0; |
2237 var kScopeDetailsObjectIndex = 1; | 2238 var kScopeDetailsObjectIndex = 1; |
| 2239 var kScopeDetailsNameIndex = 2; |
2238 | 2240 |
2239 function ScopeDetails(frame, fun, index, opt_details) { | 2241 function ScopeDetails(frame, fun, index, opt_details) { |
2240 if (frame) { | 2242 if (frame) { |
2241 this.break_id_ = frame.break_id_; | 2243 this.break_id_ = frame.break_id_; |
2242 this.details_ = opt_details || | 2244 this.details_ = opt_details || |
2243 %GetScopeDetails(frame.break_id_, | 2245 %GetScopeDetails(frame.break_id_, |
2244 frame.details_.frameId(), | 2246 frame.details_.frameId(), |
2245 frame.details_.inlinedFrameIndex(), | 2247 frame.details_.inlinedFrameIndex(), |
2246 index); | 2248 index); |
2247 this.frame_id_ = frame.details_.frameId(); | 2249 this.frame_id_ = frame.details_.frameId(); |
(...skipping 16 matching lines...) Expand all Loading... |
2264 | 2266 |
2265 | 2267 |
2266 ScopeDetails.prototype.object = function() { | 2268 ScopeDetails.prototype.object = function() { |
2267 if (!IS_UNDEFINED(this.break_id_)) { | 2269 if (!IS_UNDEFINED(this.break_id_)) { |
2268 %CheckExecutionState(this.break_id_); | 2270 %CheckExecutionState(this.break_id_); |
2269 } | 2271 } |
2270 return this.details_[kScopeDetailsObjectIndex]; | 2272 return this.details_[kScopeDetailsObjectIndex]; |
2271 }; | 2273 }; |
2272 | 2274 |
2273 | 2275 |
| 2276 ScopeDetails.prototype.name = function() { |
| 2277 if (!IS_UNDEFINED(this.break_id_)) { |
| 2278 %CheckExecutionState(this.break_id_); |
| 2279 } |
| 2280 return this.details_[kScopeDetailsNameIndex]; |
| 2281 }; |
| 2282 |
| 2283 |
2274 ScopeDetails.prototype.setVariableValueImpl = function(name, new_value) { | 2284 ScopeDetails.prototype.setVariableValueImpl = function(name, new_value) { |
2275 var raw_res; | 2285 var raw_res; |
2276 if (!IS_UNDEFINED(this.break_id_)) { | 2286 if (!IS_UNDEFINED(this.break_id_)) { |
2277 %CheckExecutionState(this.break_id_); | 2287 %CheckExecutionState(this.break_id_); |
2278 raw_res = %SetScopeVariableValue(this.break_id_, this.frame_id_, | 2288 raw_res = %SetScopeVariableValue(this.break_id_, this.frame_id_, |
2279 this.inlined_frame_id_, this.index_, name, new_value); | 2289 this.inlined_frame_id_, this.index_, name, new_value); |
2280 } else { | 2290 } else { |
2281 raw_res = %SetScopeVariableValue(this.fun_value_, null, null, this.index_, | 2291 raw_res = %SetScopeVariableValue(this.fun_value_, null, null, this.index_, |
2282 name, new_value); | 2292 name, new_value); |
2283 } | 2293 } |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3104 // Functions needed by the debugger runtime. | 3114 // Functions needed by the debugger runtime. |
3105 utils.InstallFunctions(utils, DONT_ENUM, [ | 3115 utils.InstallFunctions(utils, DONT_ENUM, [ |
3106 "ClearMirrorCache", ClearMirrorCache | 3116 "ClearMirrorCache", ClearMirrorCache |
3107 ]); | 3117 ]); |
3108 | 3118 |
3109 // Export to debug.js | 3119 // Export to debug.js |
3110 utils.Export(function(to) { | 3120 utils.Export(function(to) { |
3111 to.MirrorType = MirrorType; | 3121 to.MirrorType = MirrorType; |
3112 }); | 3122 }); |
3113 }) | 3123 }) |
OLD | NEW |