OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 return eval_origin; | 950 return eval_origin; |
951 }; | 951 }; |
952 | 952 |
953 function FormatSourcePosition(frame) { | 953 function FormatSourcePosition(frame) { |
954 var fileName; | 954 var fileName; |
955 var fileLocation = ""; | 955 var fileLocation = ""; |
956 if (frame.isNative()) { | 956 if (frame.isNative()) { |
957 fileLocation = "native"; | 957 fileLocation = "native"; |
958 } else if (frame.isEval()) { | 958 } else if (frame.isEval()) { |
959 fileName = frame.getScriptNameOrSourceURL(); | 959 fileName = frame.getScriptNameOrSourceURL(); |
960 if (!fileName) | 960 if (!fileName) { |
961 fileLocation = frame.getEvalOrigin(); | 961 fileLocation = frame.getEvalOrigin(); |
| 962 } |
962 } else { | 963 } else { |
963 fileName = frame.getFileName(); | 964 fileName = frame.getFileName(); |
964 } | 965 } |
965 | 966 |
966 if (fileName) { | 967 if (fileName) { |
967 fileLocation += fileName; | 968 fileLocation += fileName; |
968 var lineNumber = frame.getLineNumber(); | 969 var lineNumber = frame.getLineNumber(); |
969 if (lineNumber != null) { | 970 if (lineNumber != null) { |
970 fileLocation += ":" + lineNumber; | 971 fileLocation += ":" + lineNumber; |
971 var columnNumber = frame.getColumnNumber(); | 972 var columnNumber = frame.getColumnNumber(); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 throw e; | 1191 throw e; |
1191 } | 1192 } |
1192 } | 1193 } |
1193 | 1194 |
1194 | 1195 |
1195 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', ErrorToString]); | 1196 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', ErrorToString]); |
1196 | 1197 |
1197 // Boilerplate for exceptions for stack overflows. Used from | 1198 // Boilerplate for exceptions for stack overflows. Used from |
1198 // Isolate::StackOverflow(). | 1199 // Isolate::StackOverflow(). |
1199 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); | 1200 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); |
OLD | NEW |