| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 module_type_error: ["Module '", "%0", "' used improperly"], | 173 module_type_error: ["Module '", "%0", "' used improperly"], |
| 174 module_export_undefined: ["Export '", "%0", "' is not defined in module"
], | 174 module_export_undefined: ["Export '", "%0", "' is not defined in module"
], |
| 175 unexpected_super: ["'super' keyword unexpected here"], | 175 unexpected_super: ["'super' keyword unexpected here"], |
| 176 extends_value_not_a_function: ["Class extends value ", "%0", " is not a funct
ion or null"], | 176 extends_value_not_a_function: ["Class extends value ", "%0", " is not a funct
ion or null"], |
| 177 prototype_parent_not_an_object: ["Class extends value does not have valid prot
otype property ", "%0"], | 177 prototype_parent_not_an_object: ["Class extends value does not have valid prot
otype property ", "%0"], |
| 178 duplicate_constructor: ["A class may only have one constructor"], | 178 duplicate_constructor: ["A class may only have one constructor"], |
| 179 sloppy_lexical: ["Block-scoped declarations (let, const, functi
on, class) not yet supported outside strict mode"], | 179 sloppy_lexical: ["Block-scoped declarations (let, const, functi
on, class) not yet supported outside strict mode"], |
| 180 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."], | 180 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."], |
| 181 duplicate_proto: ["Duplicate __proto__ fields are not allowed in
object literals"], | 181 duplicate_proto: ["Duplicate __proto__ fields are not allowed in
object literals"], |
| 182 param_after_rest: ["Rest parameter must be last formal parameter"
], | 182 param_after_rest: ["Rest parameter must be last formal parameter"
], |
| 183 constructor_noncallable: ["Class constructors cannot be invoked without
'new'"] | 183 constructor_noncallable: ["Class constructors cannot be invoked without
'new'"], |
| 184 |
| 185 spreadcall_intrinsic: ["Spread arguments may not be used to invoke in
trinsics"], |
| 186 spreadcall_construct: ["Spread arguments may not be used to call cons
tructors"] |
| 184 }; | 187 }; |
| 185 | 188 |
| 186 | 189 |
| 187 function FormatString(format, args) { | 190 function FormatString(format, args) { |
| 188 var result = ""; | 191 var result = ""; |
| 189 var arg_num = 0; | 192 var arg_num = 0; |
| 190 for (var i = 0; i < format.length; i++) { | 193 for (var i = 0; i < format.length; i++) { |
| 191 var str = format[i]; | 194 var str = format[i]; |
| 192 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { | 195 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { |
| 193 // Two-char string starts with "%". | 196 // Two-char string starts with "%". |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 function SetUpStackOverflowBoilerplate() { | 1317 function SetUpStackOverflowBoilerplate() { |
| 1315 var boilerplate = MakeRangeError('stack_overflow', []); | 1318 var boilerplate = MakeRangeError('stack_overflow', []); |
| 1316 | 1319 |
| 1317 %DefineAccessorPropertyUnchecked( | 1320 %DefineAccessorPropertyUnchecked( |
| 1318 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); | 1321 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); |
| 1319 | 1322 |
| 1320 return boilerplate; | 1323 return boilerplate; |
| 1321 } | 1324 } |
| 1322 | 1325 |
| 1323 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1326 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
| OLD | NEW |