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 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1786 ScriptMirror.prototype.sourceSlice = function (opt_from_line, opt_to_line) { | 1786 ScriptMirror.prototype.sourceSlice = function (opt_from_line, opt_to_line) { |
1787 return this.script_.sourceSlice(opt_from_line, opt_to_line); | 1787 return this.script_.sourceSlice(opt_from_line, opt_to_line); |
1788 } | 1788 } |
1789 | 1789 |
1790 | 1790 |
1791 ScriptMirror.prototype.context = function() { | 1791 ScriptMirror.prototype.context = function() { |
1792 return this.context_; | 1792 return this.context_; |
1793 }; | 1793 }; |
1794 | 1794 |
1795 | 1795 |
1796 ScriptMirror.prototype.evalFromFunction = function() { | 1796 ScriptMirror.prototype.evalFromScript = function() { |
1797 return MakeMirror(this.script_.eval_from_function); | 1797 return MakeMirror(this.script_.eval_from_script); |
| 1798 }; |
| 1799 |
| 1800 |
| 1801 ScriptMirror.prototype.evalFromFunctionName = function() { |
| 1802 return MakeMirror(this.script_.eval_from_function_name); |
1798 }; | 1803 }; |
1799 | 1804 |
1800 | 1805 |
1801 ScriptMirror.prototype.evalFromLocation = function() { | 1806 ScriptMirror.prototype.evalFromLocation = function() { |
1802 var eval_from_function = this.evalFromFunction(); | 1807 var eval_from_script = this.evalFromScript(); |
1803 if (!eval_from_function.isUndefined()) { | 1808 if (!eval_from_script.isUndefined()) { |
1804 var position = this.script_.eval_from_position; | 1809 var position = this.script_.eval_from_script_position; |
1805 return eval_from_function.script().locationFromPosition(position, true); | 1810 return eval_from_script.locationFromPosition(position, true); |
1806 } | 1811 } |
1807 }; | 1812 }; |
1808 | 1813 |
1809 | 1814 |
1810 ScriptMirror.prototype.toText = function() { | 1815 ScriptMirror.prototype.toText = function() { |
1811 var result = ''; | 1816 var result = ''; |
1812 result += this.name(); | 1817 result += this.name(); |
1813 result += ' (lines: '; | 1818 result += ' (lines: '; |
1814 if (this.lineOffset() > 0) { | 1819 if (this.lineOffset() > 0) { |
1815 result += this.lineOffset(); | 1820 result += this.lineOffset(); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2073 } else { | 2078 } else { |
2074 var sourceStart = mirror.source().substring(0, 80); | 2079 var sourceStart = mirror.source().substring(0, 80); |
2075 content.sourceStart = sourceStart; | 2080 content.sourceStart = sourceStart; |
2076 } | 2081 } |
2077 content.sourceLength = mirror.source().length; | 2082 content.sourceLength = mirror.source().length; |
2078 content.scriptType = mirror.scriptType(); | 2083 content.scriptType = mirror.scriptType(); |
2079 content.compilationType = mirror.compilationType(); | 2084 content.compilationType = mirror.compilationType(); |
2080 // For compilation type eval emit information on the script from which | 2085 // For compilation type eval emit information on the script from which |
2081 // eval was called if a script is present. | 2086 // eval was called if a script is present. |
2082 if (mirror.compilationType() == 1 && | 2087 if (mirror.compilationType() == 1 && |
2083 mirror.evalFromFunction().script()) { | 2088 mirror.evalFromScript()) { |
2084 content.evalFromScript = | 2089 content.evalFromScript = |
2085 this.serializeReference(mirror.evalFromFunction().script()); | 2090 this.serializeReference(mirror.evalFromScript()); |
2086 var evalFromLocation = mirror.evalFromLocation() | 2091 var evalFromLocation = mirror.evalFromLocation() |
2087 content.evalFromLocation = { line: evalFromLocation.line, | 2092 content.evalFromLocation = { line: evalFromLocation.line, |
2088 column: evalFromLocation.column} | 2093 column: evalFromLocation.column} |
| 2094 if (mirror.evalFromFunctionName()) { |
| 2095 content.evalFromFunctionName = mirror.evalFromFunctionName(); |
| 2096 } |
2089 } | 2097 } |
2090 if (mirror.context()) { | 2098 if (mirror.context()) { |
2091 content.context = this.serializeReference(mirror.context()); | 2099 content.context = this.serializeReference(mirror.context()); |
2092 } | 2100 } |
2093 break; | 2101 break; |
2094 | 2102 |
2095 case CONTEXT_TYPE: | 2103 case CONTEXT_TYPE: |
2096 content.data = mirror.data(); | 2104 content.data = mirror.data(); |
2097 break; | 2105 break; |
2098 } | 2106 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2315 } | 2323 } |
2316 if (!isFinite(value)) { | 2324 if (!isFinite(value)) { |
2317 if (value > 0) { | 2325 if (value > 0) { |
2318 return 'Infinity'; | 2326 return 'Infinity'; |
2319 } else { | 2327 } else { |
2320 return '-Infinity'; | 2328 return '-Infinity'; |
2321 } | 2329 } |
2322 } | 2330 } |
2323 return value; | 2331 return value; |
2324 } | 2332 } |
OLD | NEW |