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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 symbol_to_number: ["Cannot convert a Symbol value to a number"], | 180 symbol_to_number: ["Cannot convert a Symbol value to a number"], |
181 module_export_undefined: ["Export '", "%0", "' is not defined in module"
], | 181 module_export_undefined: ["Export '", "%0", "' is not defined in module"
], |
182 duplicate_export: ["Duplicate export of '", "%0", "'"], | 182 duplicate_export: ["Duplicate export of '", "%0", "'"], |
183 unexpected_super: ["'super' keyword unexpected here"], | 183 unexpected_super: ["'super' keyword unexpected here"], |
184 extends_value_not_a_function: ["Class extends value ", "%0", " is not a funct
ion or null"], | 184 extends_value_not_a_function: ["Class extends value ", "%0", " is not a funct
ion or null"], |
185 prototype_parent_not_an_object: ["Class extends value does not have valid prot
otype property ", "%0"], | 185 prototype_parent_not_an_object: ["Class extends value does not have valid prot
otype property ", "%0"], |
186 duplicate_constructor: ["A class may only have one constructor"], | 186 duplicate_constructor: ["A class may only have one constructor"], |
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."], | 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."], |
188 duplicate_proto: ["Duplicate __proto__ fields are not allowed in
object literals"], | 188 duplicate_proto: ["Duplicate __proto__ fields are not allowed in
object literals"], |
189 param_after_rest: ["Rest parameter must be last formal parameter"
], | 189 param_after_rest: ["Rest parameter must be last formal parameter"
], |
190 constructor_noncallable: ["Class constructors cannot be invoked without
'new'"] | 190 constructor_noncallable: ["Class constructors cannot be invoked without
'new'"], |
| 191 array_not_subclassable: ["Subclassing Arrays is not currently supported
."] |
191 }; | 192 }; |
192 | 193 |
193 | 194 |
194 function FormatString(format, args) { | 195 function FormatString(format, args) { |
195 var result = ""; | 196 var result = ""; |
196 var arg_num = 0; | 197 var arg_num = 0; |
197 for (var i = 0; i < format.length; i++) { | 198 for (var i = 0; i < format.length; i++) { |
198 var str = format[i]; | 199 var str = format[i]; |
199 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { | 200 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { |
200 // Two-char string starts with "%". | 201 // Two-char string starts with "%". |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 function SetUpStackOverflowBoilerplate() { | 1322 function SetUpStackOverflowBoilerplate() { |
1322 var boilerplate = MakeRangeError('stack_overflow', []); | 1323 var boilerplate = MakeRangeError('stack_overflow', []); |
1323 | 1324 |
1324 %DefineAccessorPropertyUnchecked( | 1325 %DefineAccessorPropertyUnchecked( |
1325 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); | 1326 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); |
1326 | 1327 |
1327 return boilerplate; | 1328 return boilerplate; |
1328 } | 1329 } |
1329 | 1330 |
1330 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1331 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
OLD | NEW |