OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // ------------------------------------------------------------------- | 5 // ------------------------------------------------------------------- |
6 | 6 |
7 var kMessages = { | 7 var kMessages = { |
8 // Error | 8 // Error |
9 cyclic_proto: ["Cyclic __proto__ value"], | 9 cyclic_proto: ["Cyclic __proto__ value"], |
10 code_gen_from_strings: ["%0"], | 10 code_gen_from_strings: ["%0"], |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 illegal_access: ["Illegal access"], | 148 illegal_access: ["Illegal access"], |
149 static_prototype: ["Classes may not have static property named pr
ototype"], | 149 static_prototype: ["Classes may not have static property named pr
ototype"], |
150 strict_mode_with: ["Strict mode code may not include a with state
ment"], | 150 strict_mode_with: ["Strict mode code may not include a with state
ment"], |
151 strict_eval_arguments: ["Unexpected eval or arguments in strict mode"]
, | 151 strict_eval_arguments: ["Unexpected eval or arguments in strict mode"]
, |
152 too_many_arguments: ["Too many arguments in function call (only 655
35 allowed)"], | 152 too_many_arguments: ["Too many arguments in function call (only 655
35 allowed)"], |
153 too_many_parameters: ["Too many parameters in function definition (o
nly 65535 allowed)"], | 153 too_many_parameters: ["Too many parameters in function definition (o
nly 65535 allowed)"], |
154 too_many_variables: ["Too many variables declared (only 4194303 all
owed)"], | 154 too_many_variables: ["Too many variables declared (only 4194303 all
owed)"], |
155 strict_param_dupe: ["Strict mode function may not have duplicate p
arameter names"], | 155 strict_param_dupe: ["Strict mode function may not have duplicate p
arameter names"], |
156 strict_octal_literal: ["Octal literals are not allowed in strict mode
."], | 156 strict_octal_literal: ["Octal literals are not allowed in strict mode
."], |
157 template_octal_literal: ["Octal literals are not allowed in template st
rings."], | 157 template_octal_literal: ["Octal literals are not allowed in template st
rings."], |
158 strict_duplicate_property: ["Duplicate data property in object literal not
allowed in strict mode"], | |
159 accessor_data_property: ["Object literal may not have data and accessor
property with the same name"], | |
160 accessor_get_set: ["Object literal may not have multiple get/set
accessors with the same name"], | |
161 strict_delete: ["Delete of an unqualified identifier in strict
mode."], | 158 strict_delete: ["Delete of an unqualified identifier in strict
mode."], |
162 strict_delete_property: ["Cannot delete property '", "%0", "' of ", "%1
"], | 159 strict_delete_property: ["Cannot delete property '", "%0", "' of ", "%1
"], |
163 strict_const: ["Use of const in strict mode."], | 160 strict_const: ["Use of const in strict mode."], |
164 strict_function: ["In strict mode code, functions can only be de
clared at top level or immediately within another function." ], | 161 strict_function: ["In strict mode code, functions can only be de
clared at top level or immediately within another function." ], |
165 strict_read_only_property: ["Cannot assign to read only property '", "%0",
"' of ", "%1"], | 162 strict_read_only_property: ["Cannot assign to read only property '", "%0",
"' of ", "%1"], |
166 strict_cannot_assign: ["Cannot assign to read only '", "%0", "' in st
rict mode"], | 163 strict_cannot_assign: ["Cannot assign to read only '", "%0", "' in st
rict mode"], |
167 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"], | 164 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"], |
168 strict_caller: ["Illegal access to a strict mode caller functi
on."], | 165 strict_caller: ["Illegal access to a strict mode caller functi
on."], |
169 malformed_arrow_function_parameter_list: ["Malformed arrow function parameter
list"], | 166 malformed_arrow_function_parameter_list: ["Malformed arrow function parameter
list"], |
170 generator_poison_pill: ["'caller' and 'arguments' properties may not b
e accessed on generator functions."], | 167 generator_poison_pill: ["'caller' and 'arguments' properties may not b
e accessed on generator functions."], |
171 unprotected_let: ["Illegal let declaration in unprotected statem
ent context."], | 168 unprotected_let: ["Illegal let declaration in unprotected statem
ent context."], |
172 unprotected_const: ["Illegal const declaration in unprotected stat
ement context."], | 169 unprotected_const: ["Illegal const declaration in unprotected stat
ement context."], |
173 cant_prevent_ext_external_array_elements: ["Cannot prevent extension of an obj
ect with external array elements"], | 170 cant_prevent_ext_external_array_elements: ["Cannot prevent extension of an obj
ect with external array elements"], |
174 redef_external_array_element: ["Cannot redefine a property of an object with
external array elements"], | 171 redef_external_array_element: ["Cannot redefine a property of an object with
external array elements"], |
175 harmony_const_assign: ["Assignment to constant variable."], | 172 harmony_const_assign: ["Assignment to constant variable."], |
176 symbol_to_string: ["Cannot convert a Symbol value to a string"], | 173 symbol_to_string: ["Cannot convert a Symbol value to a string"], |
177 symbol_to_primitive: ["Cannot convert a Symbol wrapper object to a p
rimitive value"], | 174 symbol_to_primitive: ["Cannot convert a Symbol wrapper object to a p
rimitive value"], |
178 symbol_to_number: ["Cannot convert a Symbol value to a number"], | 175 symbol_to_number: ["Cannot convert a Symbol value to a number"], |
179 invalid_module_path: ["Module does not export '", "%0", "', or expor
t is not itself a module"], | 176 invalid_module_path: ["Module does not export '", "%0", "', or expor
t is not itself a module"], |
180 module_type_error: ["Module '", "%0", "' used improperly"], | 177 module_type_error: ["Module '", "%0", "' used improperly"], |
181 module_export_undefined: ["Export '", "%0", "' is not defined in module"
], | 178 module_export_undefined: ["Export '", "%0", "' is not defined in module"
], |
182 unexpected_super: ["'super' keyword unexpected here"], | 179 unexpected_super: ["'super' keyword unexpected here"], |
183 extends_value_not_a_function: ["Class extends value ", "%0", " is not a funct
ion or null"], | 180 extends_value_not_a_function: ["Class extends value ", "%0", " is not a funct
ion or null"], |
184 prototype_parent_not_an_object: ["Class extends value does not have valid prot
otype property ", "%0"], | 181 prototype_parent_not_an_object: ["Class extends value does not have valid prot
otype property ", "%0"], |
185 duplicate_constructor: ["A class may only have one constructor"], | 182 duplicate_constructor: ["A class may only have one constructor"], |
186 sloppy_lexical: ["Block-scoped declarations (let, const, functi
on, class) not yet supported outside strict mode"], | 183 sloppy_lexical: ["Block-scoped declarations (let, const, functi
on, class) not yet supported outside strict mode"], |
187 super_constructor_call: ["A 'super' constructor call may only appear as
the first statement of a function, and its arguments may not access 'this'. Oth
er forms are not yet supported."] | 184 super_constructor_call: ["A 'super' constructor call may only appear as
the first statement of a function, and its arguments may not access 'this'. Oth
er forms are not yet supported."], |
| 185 duplicate_proto: ["Duplicate __proto__ fields are not allowed in
object literals"] |
188 }; | 186 }; |
189 | 187 |
190 | 188 |
191 function FormatString(format, args) { | 189 function FormatString(format, args) { |
192 var result = ""; | 190 var result = ""; |
193 var arg_num = 0; | 191 var arg_num = 0; |
194 for (var i = 0; i < format.length; i++) { | 192 for (var i = 0; i < format.length; i++) { |
195 var str = format[i]; | 193 var str = format[i]; |
196 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { | 194 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { |
197 // Two-char string starts with "%". | 195 // Two-char string starts with "%". |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 function SetUpStackOverflowBoilerplate() { | 1316 function SetUpStackOverflowBoilerplate() { |
1319 var boilerplate = MakeRangeError('stack_overflow', []); | 1317 var boilerplate = MakeRangeError('stack_overflow', []); |
1320 | 1318 |
1321 %DefineAccessorPropertyUnchecked( | 1319 %DefineAccessorPropertyUnchecked( |
1322 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); | 1320 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); |
1323 | 1321 |
1324 return boilerplate; | 1322 return boilerplate; |
1325 } | 1323 } |
1326 | 1324 |
1327 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1325 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
OLD | NEW |