| 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 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 ScriptMirror.prototype.sourceSlice = function (opt_from_line, opt_to_line) { | 1759 ScriptMirror.prototype.sourceSlice = function (opt_from_line, opt_to_line) { |
| 1760 return this.script_.sourceSlice(opt_from_line, opt_to_line); | 1760 return this.script_.sourceSlice(opt_from_line, opt_to_line); |
| 1761 } | 1761 } |
| 1762 | 1762 |
| 1763 | 1763 |
| 1764 ScriptMirror.prototype.context = function() { | 1764 ScriptMirror.prototype.context = function() { |
| 1765 return this.context_; | 1765 return this.context_; |
| 1766 }; | 1766 }; |
| 1767 | 1767 |
| 1768 | 1768 |
| 1769 ScriptMirror.prototype.evalFromFunction = function() { | 1769 ScriptMirror.prototype.evalFromScript = function() { |
| 1770 return MakeMirror(this.script_.eval_from_function); | 1770 return MakeMirror(this.script_.eval_from_script); |
| 1771 }; |
| 1772 |
| 1773 |
| 1774 ScriptMirror.prototype.evalFromFunctionName = function() { |
| 1775 return MakeMirror(this.script_.eval_from_function_name); |
| 1771 }; | 1776 }; |
| 1772 | 1777 |
| 1773 | 1778 |
| 1774 ScriptMirror.prototype.evalFromLocation = function() { | 1779 ScriptMirror.prototype.evalFromLocation = function() { |
| 1775 var eval_from_function = this.evalFromFunction(); | 1780 var eval_from_script = this.evalFromScript(); |
| 1776 if (!eval_from_function.isUndefined()) { | 1781 if (!eval_from_script.isUndefined()) { |
| 1777 var position = this.script_.eval_from_position; | 1782 var position = this.script_.eval_from_script_position; |
| 1778 return eval_from_function.script().locationFromPosition(position, true); | 1783 return eval_from_script.locationFromPosition(position, true); |
| 1779 } | 1784 } |
| 1780 }; | 1785 }; |
| 1781 | 1786 |
| 1782 | 1787 |
| 1783 ScriptMirror.prototype.toText = function() { | 1788 ScriptMirror.prototype.toText = function() { |
| 1784 var result = ''; | 1789 var result = ''; |
| 1785 result += this.name(); | 1790 result += this.name(); |
| 1786 result += ' (lines: '; | 1791 result += ' (lines: '; |
| 1787 if (this.lineOffset() > 0) { | 1792 if (this.lineOffset() > 0) { |
| 1788 result += this.lineOffset(); | 1793 result += this.lineOffset(); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 } else { | 2051 } else { |
| 2047 var sourceStart = mirror.source().substring(0, 80); | 2052 var sourceStart = mirror.source().substring(0, 80); |
| 2048 content.sourceStart = sourceStart; | 2053 content.sourceStart = sourceStart; |
| 2049 } | 2054 } |
| 2050 content.sourceLength = mirror.source().length; | 2055 content.sourceLength = mirror.source().length; |
| 2051 content.scriptType = mirror.scriptType(); | 2056 content.scriptType = mirror.scriptType(); |
| 2052 content.compilationType = mirror.compilationType(); | 2057 content.compilationType = mirror.compilationType(); |
| 2053 // For compilation type eval emit information on the script from which | 2058 // For compilation type eval emit information on the script from which |
| 2054 // eval was called if a script is present. | 2059 // eval was called if a script is present. |
| 2055 if (mirror.compilationType() == 1 && | 2060 if (mirror.compilationType() == 1 && |
| 2056 mirror.evalFromFunction().script()) { | 2061 mirror.evalFromScript()) { |
| 2057 content.evalFromScript = | 2062 content.evalFromScript = |
| 2058 this.serializeReference(mirror.evalFromFunction().script()); | 2063 this.serializeReference(mirror.evalFromScript()); |
| 2059 var evalFromLocation = mirror.evalFromLocation() | 2064 var evalFromLocation = mirror.evalFromLocation() |
| 2060 content.evalFromLocation = { line: evalFromLocation.line, | 2065 content.evalFromLocation = { line: evalFromLocation.line, |
| 2061 column: evalFromLocation.column} | 2066 column: evalFromLocation.column} |
| 2067 if (mirror.evalFromFunctionName()) { |
| 2068 content.evalFromFunctionName = mirror.evalFromFunctionName(); |
| 2069 } |
| 2062 } | 2070 } |
| 2063 if (mirror.context()) { | 2071 if (mirror.context()) { |
| 2064 content.context = this.serializeReference(mirror.context()); | 2072 content.context = this.serializeReference(mirror.context()); |
| 2065 } | 2073 } |
| 2066 break; | 2074 break; |
| 2067 | 2075 |
| 2068 case CONTEXT_TYPE: | 2076 case CONTEXT_TYPE: |
| 2069 content.data = mirror.data(); | 2077 content.data = mirror.data(); |
| 2070 break; | 2078 break; |
| 2071 } | 2079 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2268 } | 2276 } |
| 2269 if (!isFinite(value)) { | 2277 if (!isFinite(value)) { |
| 2270 if (value > 0) { | 2278 if (value > 0) { |
| 2271 return 'Infinity'; | 2279 return 'Infinity'; |
| 2272 } else { | 2280 } else { |
| 2273 return '-Infinity'; | 2281 return '-Infinity'; |
| 2274 } | 2282 } |
| 2275 } | 2283 } |
| 2276 return value; | 2284 return value; |
| 2277 } | 2285 } |
| OLD | NEW |