| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // SyntaxError | 107 // SyntaxError |
| 108 unable_to_parse: "Parse error", | 108 unable_to_parse: "Parse error", |
| 109 duplicate_regexp_flag: "Duplicate RegExp flag %0", | 109 duplicate_regexp_flag: "Duplicate RegExp flag %0", |
| 110 unrecognized_regexp_flag: "Unrecognized RegExp flag %0", | 110 unrecognized_regexp_flag: "Unrecognized RegExp flag %0", |
| 111 invalid_regexp: "Invalid RegExp pattern /%0/", | 111 invalid_regexp: "Invalid RegExp pattern /%0/", |
| 112 illegal_break: "Illegal break statement", | 112 illegal_break: "Illegal break statement", |
| 113 illegal_continue: "Illegal continue statement", | 113 illegal_continue: "Illegal continue statement", |
| 114 illegal_return: "Illegal return statement", | 114 illegal_return: "Illegal return statement", |
| 115 error_loading_debugger: "Error loading debugger %0", | 115 error_loading_debugger: "Error loading debugger %0", |
| 116 no_input_to_regexp: "No input to %0", | 116 no_input_to_regexp: "No input to %0", |
| 117 result_not_primitive: "Result of %0 must be a primitive, was %1", |
| 118 invalid_json: "String '%0' is not valid JSON", |
| 119 circular_structure: "Converting circular structure to JSON" |
| 117 }; | 120 }; |
| 118 | 121 |
| 119 | 122 |
| 120 function FormatString(format, args) { | 123 function FormatString(format, args) { |
| 121 var result = format; | 124 var result = format; |
| 122 for (var i = 0; i < args.length; i++) { | 125 for (var i = 0; i < args.length; i++) { |
| 123 var str; | 126 var str; |
| 124 try { str = ToDetailString(args[i]); } | 127 try { str = ToDetailString(args[i]); } |
| 125 catch (e) { str = "#<error>"; } | 128 catch (e) { str = "#<error>"; } |
| 126 result = result.split("%" + i).join(str); | 129 result = result.split("%" + i).join(str); |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 return this.name + ": " + FormatMessage({ type: type, args: this.arguments }
); | 681 return this.name + ": " + FormatMessage({ type: type, args: this.arguments }
); |
| 679 } | 682 } |
| 680 var message = this.message; | 683 var message = this.message; |
| 681 return this.name + (message ? (": " + message) : ""); | 684 return this.name + (message ? (": " + message) : ""); |
| 682 }, DONT_ENUM); | 685 }, DONT_ENUM); |
| 683 | 686 |
| 684 | 687 |
| 685 // Boilerplate for exceptions for stack overflows. Used from | 688 // Boilerplate for exceptions for stack overflows. Used from |
| 686 // Top::StackOverflow(). | 689 // Top::StackOverflow(). |
| 687 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); | 690 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); |
| OLD | NEW |