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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 return %GetFrameCount(this.break_id); | 771 return %GetFrameCount(this.break_id); |
772 }; | 772 }; |
773 | 773 |
774 ExecutionState.prototype.threadCount = function() { | 774 ExecutionState.prototype.threadCount = function() { |
775 return %GetThreadCount(this.break_id); | 775 return %GetThreadCount(this.break_id); |
776 }; | 776 }; |
777 | 777 |
778 ExecutionState.prototype.frame = function(opt_index) { | 778 ExecutionState.prototype.frame = function(opt_index) { |
779 // If no index supplied return the selected frame. | 779 // If no index supplied return the selected frame. |
780 if (opt_index == null) opt_index = this.selected_frame; | 780 if (opt_index == null) opt_index = this.selected_frame; |
| 781 if (opt_index < 0 || opt_index >= this.frameCount()) |
| 782 throw new Error('Illegal frame index.'); |
781 return new FrameMirror(this.break_id, opt_index); | 783 return new FrameMirror(this.break_id, opt_index); |
782 }; | 784 }; |
783 | 785 |
784 ExecutionState.prototype.cframesValue = function(opt_from_index, opt_to_index) { | 786 ExecutionState.prototype.cframesValue = function(opt_from_index, opt_to_index) { |
785 return %GetCFrames(this.break_id); | 787 return %GetCFrames(this.break_id); |
786 }; | 788 }; |
787 | 789 |
788 ExecutionState.prototype.setSelectedFrame = function(index) { | 790 ExecutionState.prototype.setSelectedFrame = function(index) { |
789 var i = %ToNumber(index); | 791 var i = %ToNumber(index); |
790 if (i < 0 || i >= this.frameCount()) throw new Error('Illegal frame index.'); | 792 if (i < 0 || i >= this.frameCount()) throw new Error('Illegal frame index.'); |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 case 'string': | 2123 case 'string': |
2122 case 'number': | 2124 case 'number': |
2123 json = value; | 2125 json = value; |
2124 break | 2126 break |
2125 | 2127 |
2126 default: | 2128 default: |
2127 json = null; | 2129 json = null; |
2128 } | 2130 } |
2129 return json; | 2131 return json; |
2130 } | 2132 } |
OLD | NEW |