OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 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 13 matching lines...) Expand all Loading... |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 // ------------------------------------------------------------------- | 28 // ------------------------------------------------------------------- |
29 | 29 |
30 var kMessages = { | 30 var kMessages = { |
31 // Error | 31 // Error |
32 cyclic_proto: ["Cyclic __proto__ value"], | 32 cyclic_proto: ["Cyclic __proto__ value"], |
33 code_gen_from_strings: ["%0"], | 33 code_gen_from_strings: ["%0"], |
| 34 generator_running: ["Generator is already running"], |
| 35 generator_finished: ["Generator has already finished"], |
34 // TypeError | 36 // TypeError |
35 unexpected_token: ["Unexpected token ", "%0"], | 37 unexpected_token: ["Unexpected token ", "%0"], |
36 unexpected_token_number: ["Unexpected number"], | 38 unexpected_token_number: ["Unexpected number"], |
37 unexpected_token_string: ["Unexpected string"], | 39 unexpected_token_string: ["Unexpected string"], |
38 unexpected_token_identifier: ["Unexpected identifier"], | 40 unexpected_token_identifier: ["Unexpected identifier"], |
39 unexpected_reserved: ["Unexpected reserved word"], | 41 unexpected_reserved: ["Unexpected reserved word"], |
40 unexpected_strict_reserved: ["Unexpected strict mode reserved word"], | 42 unexpected_strict_reserved: ["Unexpected strict mode reserved word"], |
41 unexpected_eos: ["Unexpected end of input"], | 43 unexpected_eos: ["Unexpected end of input"], |
42 malformed_regexp: ["Invalid regular expression: /", "%0", "/: ",
"%1"], | 44 malformed_regexp: ["Invalid regular expression: /", "%0", "/: ",
"%1"], |
43 unterminated_regexp: ["Invalid regular expression: missing /"], | 45 unterminated_regexp: ["Invalid regular expression: missing /"], |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 strict_poison_pill: ["'caller', 'callee', and 'arguments' propertie
s may not be accessed on strict mode functions or the arguments objects for call
s to them"], | 153 strict_poison_pill: ["'caller', 'callee', and 'arguments' propertie
s may not be accessed on strict mode functions or the arguments objects for call
s to them"], |
152 strict_caller: ["Illegal access to a strict mode caller functi
on."], | 154 strict_caller: ["Illegal access to a strict mode caller functi
on."], |
153 unprotected_let: ["Illegal let declaration in unprotected statem
ent context."], | 155 unprotected_let: ["Illegal let declaration in unprotected statem
ent context."], |
154 unprotected_const: ["Illegal const declaration in unprotected stat
ement context."], | 156 unprotected_const: ["Illegal const declaration in unprotected stat
ement context."], |
155 cant_prevent_ext_external_array_elements: ["Cannot prevent extension of an obj
ect with external array elements"], | 157 cant_prevent_ext_external_array_elements: ["Cannot prevent extension of an obj
ect with external array elements"], |
156 redef_external_array_element: ["Cannot redefine a property of an object with
external array elements"], | 158 redef_external_array_element: ["Cannot redefine a property of an object with
external array elements"], |
157 harmony_const_assign: ["Assignment to constant variable."], | 159 harmony_const_assign: ["Assignment to constant variable."], |
158 symbol_to_string: ["Conversion from symbol to string"], | 160 symbol_to_string: ["Conversion from symbol to string"], |
159 invalid_module_path: ["Module does not export '", "%0", "', or expor
t is not itself a module"], | 161 invalid_module_path: ["Module does not export '", "%0", "', or expor
t is not itself a module"], |
160 module_type_error: ["Module '", "%0", "' used improperly"], | 162 module_type_error: ["Module '", "%0", "' used improperly"], |
161 module_export_undefined: ["Export '", "%0", "' is not defined in module"
], | 163 module_export_undefined: ["Export '", "%0", "' is not defined in module"
] |
162 }; | 164 }; |
163 | 165 |
164 | 166 |
165 function FormatString(format, args) { | 167 function FormatString(format, args) { |
166 var result = ""; | 168 var result = ""; |
167 var arg_num = 0; | 169 var arg_num = 0; |
168 for (var i = 0; i < format.length; i++) { | 170 for (var i = 0; i < format.length; i++) { |
169 var str = format[i]; | 171 var str = format[i]; |
170 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { | 172 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { |
171 // Two-char string starts with "%". | 173 // Two-char string starts with "%". |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 %SetOverflowedStackTrace(this, void 0); | 1314 %SetOverflowedStackTrace(this, void 0); |
1313 } | 1315 } |
1314 | 1316 |
1315 %DefineOrRedefineAccessorProperty( | 1317 %DefineOrRedefineAccessorProperty( |
1316 boilerplate, 'stack', getter, setter, DONT_ENUM); | 1318 boilerplate, 'stack', getter, setter, DONT_ENUM); |
1317 | 1319 |
1318 return boilerplate; | 1320 return boilerplate; |
1319 } | 1321 } |
1320 | 1322 |
1321 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1323 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
OLD | NEW |