| 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 | 384 |
| 385 execStateScopeType(type) { | 385 execStateScopeType(type) { |
| 386 switch (type) { | 386 switch (type) { |
| 387 case "global": return this.ScopeType.Global; | 387 case "global": return this.ScopeType.Global; |
| 388 case "local": return this.ScopeType.Local; | 388 case "local": return this.ScopeType.Local; |
| 389 case "with": return this.ScopeType.With; | 389 case "with": return this.ScopeType.With; |
| 390 case "closure": return this.ScopeType.Closure; | 390 case "closure": return this.ScopeType.Closure; |
| 391 case "catch": return this.ScopeType.Catch; | 391 case "catch": return this.ScopeType.Catch; |
| 392 case "block": return this.ScopeType.Block; | 392 case "block": return this.ScopeType.Block; |
| 393 case "script": return this.ScopeType.Script; | 393 case "script": return this.ScopeType.Script; |
| 394 case "eval": return this.ScopeType.Eval; |
| 394 default: %AbortJS("Unexpected scope type"); | 395 default: %AbortJS("Unexpected scope type"); |
| 395 } | 396 } |
| 396 } | 397 } |
| 397 | 398 |
| 398 execStateScopeObjectProperty(serialized_scope, prop) { | 399 execStateScopeObjectProperty(serialized_scope, prop) { |
| 399 let found = null; | 400 let found = null; |
| 400 for (let i = 0; i < serialized_scope.length; i++) { | 401 for (let i = 0; i < serialized_scope.length; i++) { |
| 401 const elem = serialized_scope[i]; | 402 const elem = serialized_scope[i]; |
| 402 if (elem.name == prop) { | 403 if (elem.name == prop) { |
| 403 found = elem; | 404 found = elem; |
| 404 break; | 405 break; |
| 405 } | 406 } |
| 406 } | 407 } |
| 407 | 408 |
| 408 if (found == null) return { isUndefined : true } | 409 if (found == null) return { isUndefined : () => true }; |
| 409 | 410 |
| 410 const val = { value : () => found.value.value }; | 411 const val = { value : () => found.value.value }; |
| 411 return { value : () => val, | 412 return { value : () => val, |
| 412 isUndefined : () => found.value.type == "undefined" | 413 isUndefined : () => found.value.type == "undefined" |
| 413 }; | 414 }; |
| 414 } | 415 } |
| 415 | 416 |
| 416 // Returns an array of property descriptors of the scope object. | 417 // Returns an array of property descriptors of the scope object. |
| 417 // This is in contrast to the original API, which simply passed object | 418 // This is in contrast to the original API, which simply passed object |
| 418 // mirrors. | 419 // mirrors. |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 debug.instance = new DebugWrapper(); | 789 debug.instance = new DebugWrapper(); |
| 789 debug.instance.enable(); | 790 debug.instance.enable(); |
| 790 } | 791 } |
| 791 return debug.instance; | 792 return debug.instance; |
| 792 }}); | 793 }}); |
| 793 | 794 |
| 794 Object.defineProperty(debug, 'ScopeType', { get: function() { | 795 Object.defineProperty(debug, 'ScopeType', { get: function() { |
| 795 const instance = debug.Debug; | 796 const instance = debug.Debug; |
| 796 return instance.ScopeType; | 797 return instance.ScopeType; |
| 797 }}); | 798 }}); |
| OLD | NEW |