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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 return break_point.number(); | 670 return break_point.number(); |
671 } | 671 } |
672 }; | 672 }; |
673 | 673 |
674 | 674 |
675 Debug.setBreakPointByScriptIdAndPosition = function(script_id, position, | 675 Debug.setBreakPointByScriptIdAndPosition = function(script_id, position, |
676 condition, enabled) | 676 condition, enabled) |
677 { | 677 { |
678 break_point = MakeBreakPoint(position); | 678 break_point = MakeBreakPoint(position); |
679 break_point.setCondition(condition); | 679 break_point.setCondition(condition); |
680 if (!enabled) | 680 if (!enabled) { |
681 break_point.disable(); | 681 break_point.disable(); |
| 682 } |
682 var scripts = this.scripts(); | 683 var scripts = this.scripts(); |
683 for (var i = 0; i < scripts.length; i++) { | 684 for (var i = 0; i < scripts.length; i++) { |
684 if (script_id == scripts[i].id) { | 685 if (script_id == scripts[i].id) { |
685 break_point.actual_position = %SetScriptBreakPoint(scripts[i], position, | 686 break_point.actual_position = %SetScriptBreakPoint(scripts[i], position, |
686 break_point); | 687 break_point); |
687 break; | 688 break; |
688 } | 689 } |
689 } | 690 } |
690 return break_point; | 691 return break_point; |
691 }; | 692 }; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 return %GetFrameCount(this.break_id); | 954 return %GetFrameCount(this.break_id); |
954 }; | 955 }; |
955 | 956 |
956 ExecutionState.prototype.threadCount = function() { | 957 ExecutionState.prototype.threadCount = function() { |
957 return %GetThreadCount(this.break_id); | 958 return %GetThreadCount(this.break_id); |
958 }; | 959 }; |
959 | 960 |
960 ExecutionState.prototype.frame = function(opt_index) { | 961 ExecutionState.prototype.frame = function(opt_index) { |
961 // If no index supplied return the selected frame. | 962 // If no index supplied return the selected frame. |
962 if (opt_index == null) opt_index = this.selected_frame; | 963 if (opt_index == null) opt_index = this.selected_frame; |
963 if (opt_index < 0 || opt_index >= this.frameCount()) | 964 if (opt_index < 0 || opt_index >= this.frameCount()) { |
964 throw new Error('Illegal frame index.'); | 965 throw new Error('Illegal frame index.'); |
| 966 } |
965 return new FrameMirror(this.break_id, opt_index); | 967 return new FrameMirror(this.break_id, opt_index); |
966 }; | 968 }; |
967 | 969 |
968 ExecutionState.prototype.setSelectedFrame = function(index) { | 970 ExecutionState.prototype.setSelectedFrame = function(index) { |
969 var i = %ToNumber(index); | 971 var i = %ToNumber(index); |
970 if (i < 0 || i >= this.frameCount()) throw new Error('Illegal frame index.'); | 972 if (i < 0 || i >= this.frameCount()) throw new Error('Illegal frame index.'); |
971 this.selected_frame = i; | 973 this.selected_frame = i; |
972 }; | 974 }; |
973 | 975 |
974 ExecutionState.prototype.selectedFrame = function() { | 976 ExecutionState.prototype.selectedFrame = function() { |
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2591 case 'string': | 2593 case 'string': |
2592 case 'number': | 2594 case 'number': |
2593 json = value; | 2595 json = value; |
2594 break | 2596 break |
2595 | 2597 |
2596 default: | 2598 default: |
2597 json = null; | 2599 json = null; |
2598 } | 2600 } |
2599 return json; | 2601 return json; |
2600 } | 2602 } |
OLD | NEW |