OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 "use strict"; | 5 "use strict"; |
6 | 6 |
7 // If true, prints all messages sent and received by inspector. | 7 // If true, prints all messages sent and received by inspector. |
8 const printProtocolMessages = false; | 8 const printProtocolMessages = false; |
9 | 9 |
10 // The active wrapper instance. | 10 // The active wrapper instance. |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 execStateScopeType(type) { | 384 execStateScopeType(type) { |
385 switch (type) { | 385 switch (type) { |
386 case "global": return this.ScopeType.Global; | 386 case "global": return this.ScopeType.Global; |
387 case "local": return this.ScopeType.Local; | 387 case "local": return this.ScopeType.Local; |
388 case "with": return this.ScopeType.With; | 388 case "with": return this.ScopeType.With; |
389 case "closure": return this.ScopeType.Closure; | 389 case "closure": return this.ScopeType.Closure; |
390 case "catch": return this.ScopeType.Catch; | 390 case "catch": return this.ScopeType.Catch; |
391 case "block": return this.ScopeType.Block; | 391 case "block": return this.ScopeType.Block; |
392 case "script": return this.ScopeType.Script; | 392 case "script": return this.ScopeType.Script; |
| 393 case "eval": return this.ScopeType.Eval; |
393 default: %AbortJS("Unexpected scope type"); | 394 default: %AbortJS("Unexpected scope type"); |
394 } | 395 } |
395 } | 396 } |
396 | 397 |
397 execStateScopeObjectProperty(serialized_scope, prop) { | 398 execStateScopeObjectProperty(serialized_scope, prop) { |
398 let found = null; | 399 let found = null; |
399 for (let i = 0; i < serialized_scope.length; i++) { | 400 for (let i = 0; i < serialized_scope.length; i++) { |
400 const elem = serialized_scope[i]; | 401 const elem = serialized_scope[i]; |
401 if (elem.name == prop) { | 402 if (elem.name == prop) { |
402 found = elem; | 403 found = elem; |
403 break; | 404 break; |
404 } | 405 } |
405 } | 406 } |
406 | 407 |
407 if (found == null) return { isUndefined : true } | 408 if (found == null) return { isUndefined : () => true }; |
408 | 409 |
409 const val = { value : () => found.value.value }; | 410 const val = { value : () => found.value.value }; |
410 return { value : () => val, | 411 return { value : () => val, |
411 isUndefined : () => found.value.type == "undefined" | 412 isUndefined : () => found.value.type == "undefined" |
412 }; | 413 }; |
413 } | 414 } |
414 | 415 |
415 // Returns an array of property descriptors of the scope object. | 416 // Returns an array of property descriptors of the scope object. |
416 // This is in contrast to the original API, which simply passed object | 417 // This is in contrast to the original API, which simply passed object |
417 // mirrors. | 418 // mirrors. |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 debug.instance = new DebugWrapper(); | 765 debug.instance = new DebugWrapper(); |
765 debug.instance.enable(); | 766 debug.instance.enable(); |
766 } | 767 } |
767 return debug.instance; | 768 return debug.instance; |
768 }}); | 769 }}); |
769 | 770 |
770 Object.defineProperty(debug, 'ScopeType', { get: function() { | 771 Object.defineProperty(debug, 'ScopeType', { get: function() { |
771 const instance = debug.Debug; | 772 const instance = debug.Debug; |
772 return instance.ScopeType; | 773 return instance.ScopeType; |
773 }}); | 774 }}); |
OLD | NEW |