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 // 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 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1502 return this.details_[return_value_offset]; | 1502 return this.details_[return_value_offset]; |
1503 } | 1503 } |
1504 }; | 1504 }; |
1505 | 1505 |
1506 | 1506 |
1507 FrameDetails.prototype.scopeCount = function() { | 1507 FrameDetails.prototype.scopeCount = function() { |
1508 return %GetScopeCount(this.break_id_, this.frameId()); | 1508 return %GetScopeCount(this.break_id_, this.frameId()); |
1509 }; | 1509 }; |
1510 | 1510 |
1511 | 1511 |
1512 FrameDetails.prototype.stepInPositionsImpl = function() { | |
1513 return %GetStepInPositions(this.break_id_, this.frameId()); | |
1514 }; | |
1515 | |
1516 | |
1512 /** | 1517 /** |
1513 * Mirror object for stack frames. | 1518 * Mirror object for stack frames. |
1514 * @param {number} break_id The break id in the VM for which this frame is | 1519 * @param {number} break_id The break id in the VM for which this frame is |
1515 valid | 1520 valid |
1516 * @param {number} index The frame index (top frame is index 0) | 1521 * @param {number} index The frame index (top frame is index 0) |
1517 * @constructor | 1522 * @constructor |
1518 * @extends Mirror | 1523 * @extends Mirror |
1519 */ | 1524 */ |
1520 function FrameMirror(break_id, index) { | 1525 function FrameMirror(break_id, index) { |
1521 %_CallFunction(this, FRAME_TYPE, Mirror); | 1526 %_CallFunction(this, FRAME_TYPE, Mirror); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1662 FrameMirror.prototype.scopeCount = function() { | 1667 FrameMirror.prototype.scopeCount = function() { |
1663 return this.details_.scopeCount(); | 1668 return this.details_.scopeCount(); |
1664 }; | 1669 }; |
1665 | 1670 |
1666 | 1671 |
1667 FrameMirror.prototype.scope = function(index) { | 1672 FrameMirror.prototype.scope = function(index) { |
1668 return new ScopeMirror(this, void 0, index); | 1673 return new ScopeMirror(this, void 0, index); |
1669 }; | 1674 }; |
1670 | 1675 |
1671 | 1676 |
1677 FrameMirror.prototype.stepInPositions = function() { | |
1678 var script = this.func().script(); | |
1679 var funcOffset = this.func().sourcePosition_(); | |
1680 | |
1681 var stepInRaw = this.details_.stepInPositionsImpl(); | |
1682 var result = []; | |
1683 if (stepInRaw) { | |
1684 for (var i = 0; i < stepInRaw.length; i++) { | |
1685 var posStruct = {}; | |
1686 serializeLocationFields(script.locationFromPosition(funcOffset + stepInRaw [i], true), posStruct); | |
Yang
2013/06/14 13:41:12
80 char limit.
Peter.Rybin
2013/06/14 19:48:01
Done.
| |
1687 var item = { | |
1688 position: posStruct | |
1689 }; | |
1690 result.push(item); | |
1691 } | |
1692 } | |
1693 | |
1694 return result; | |
1695 }; | |
1696 | |
1697 | |
1672 FrameMirror.prototype.evaluate = function(source, disable_break, | 1698 FrameMirror.prototype.evaluate = function(source, disable_break, |
1673 opt_context_object) { | 1699 opt_context_object) { |
1674 var result = %DebugEvaluate(this.break_id_, | 1700 var result = %DebugEvaluate(this.break_id_, |
1675 this.details_.frameId(), | 1701 this.details_.frameId(), |
1676 this.details_.inlinedFrameIndex(), | 1702 this.details_.inlinedFrameIndex(), |
1677 source, | 1703 source, |
1678 Boolean(disable_break), | 1704 Boolean(disable_break), |
1679 opt_context_object); | 1705 opt_context_object); |
1680 return MakeMirror(result); | 1706 return MakeMirror(result); |
1681 }; | 1707 }; |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2617 } | 2643 } |
2618 if (!NUMBER_IS_FINITE(value)) { | 2644 if (!NUMBER_IS_FINITE(value)) { |
2619 if (value > 0) { | 2645 if (value > 0) { |
2620 return 'Infinity'; | 2646 return 'Infinity'; |
2621 } else { | 2647 } else { |
2622 return '-Infinity'; | 2648 return '-Infinity'; |
2623 } | 2649 } |
2624 } | 2650 } |
2625 return value; | 2651 return value; |
2626 } | 2652 } |
OLD | NEW |