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 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 result.push(item); | 1692 result.push(item); |
1693 } | 1693 } |
1694 } | 1694 } |
1695 | 1695 |
1696 return result; | 1696 return result; |
1697 }; | 1697 }; |
1698 | 1698 |
1699 | 1699 |
1700 FrameMirror.prototype.evaluate = function(source, disable_break, | 1700 FrameMirror.prototype.evaluate = function(source, disable_break, |
1701 opt_context_object) { | 1701 opt_context_object) { |
1702 var result_array = %DebugEvaluate(this.break_id_, | 1702 return MakeMirror(%DebugEvaluate(this.break_id_, |
1703 this.details_.frameId(), | 1703 this.details_.frameId(), |
1704 this.details_.inlinedFrameIndex(), | 1704 this.details_.inlinedFrameIndex(), |
1705 source, | 1705 source, |
1706 Boolean(disable_break), | 1706 Boolean(disable_break), |
1707 opt_context_object); | 1707 opt_context_object)); |
1708 // Silently ignore local variables changes if the frame is optimized. | |
1709 if (!this.isOptimizedFrame()) { | |
1710 var local_scope_on_stack = result_array[1]; | |
1711 var local_scope_modifed = result_array[2]; | |
1712 for (var n in local_scope_modifed) { | |
1713 var value_on_stack = local_scope_on_stack[n]; | |
1714 var value_modifed = local_scope_modifed[n]; | |
1715 if (value_on_stack !== value_modifed) { | |
1716 %SetScopeVariableValue(this.break_id_, | |
1717 this.details_.frameId(), | |
1718 this.details_.inlinedFrameIndex(), | |
1719 0, | |
1720 n, | |
1721 value_modifed); | |
1722 } | |
1723 } | |
1724 } | |
1725 return MakeMirror(result_array[0]); | |
1726 }; | 1708 }; |
1727 | 1709 |
1728 | 1710 |
1729 FrameMirror.prototype.invocationText = function() { | 1711 FrameMirror.prototype.invocationText = function() { |
1730 // Format frame invoaction (receiver, function and arguments). | 1712 // Format frame invoaction (receiver, function and arguments). |
1731 var result = ''; | 1713 var result = ''; |
1732 var func = this.func(); | 1714 var func = this.func(); |
1733 var receiver = this.receiver(); | 1715 var receiver = this.receiver(); |
1734 if (this.isConstructCall()) { | 1716 if (this.isConstructCall()) { |
1735 // For constructor frames display new followed by the function name. | 1717 // For constructor frames display new followed by the function name. |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2662 } | 2644 } |
2663 if (!NUMBER_IS_FINITE(value)) { | 2645 if (!NUMBER_IS_FINITE(value)) { |
2664 if (value > 0) { | 2646 if (value > 0) { |
2665 return 'Infinity'; | 2647 return 'Infinity'; |
2666 } else { | 2648 } else { |
2667 return '-Infinity'; | 2649 return '-Infinity'; |
2668 } | 2650 } |
2669 } | 2651 } |
2670 return value; | 2652 return value; |
2671 } | 2653 } |
OLD | NEW |