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 constructor_is_generator: ["Class constructor may not be a generator"], | 9 constructor_is_generator: ["Class constructor may not be a generator"], |
10 constructor_is_accessor: ["Class constructor may not be an accessor"], | 10 constructor_is_accessor: ["Class constructor may not be an accessor"], |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 extends_value_not_a_function: ["Class extends value ", "%0", " is not a funct
ion or null"], | 174 extends_value_not_a_function: ["Class extends value ", "%0", " is not a funct
ion or null"], |
175 prototype_parent_not_an_object: ["Class extends value does not have valid prot
otype property ", "%0"], | 175 prototype_parent_not_an_object: ["Class extends value does not have valid prot
otype property ", "%0"], |
176 duplicate_constructor: ["A class may only have one constructor"], | 176 duplicate_constructor: ["A class may only have one constructor"], |
177 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."], | 177 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."], |
178 duplicate_proto: ["Duplicate __proto__ fields are not allowed in
object literals"], | 178 duplicate_proto: ["Duplicate __proto__ fields are not allowed in
object literals"], |
179 param_after_rest: ["Rest parameter must be last formal parameter"
], | 179 param_after_rest: ["Rest parameter must be last formal parameter"
], |
180 constructor_noncallable: ["Class constructors cannot be invoked without
'new'"], | 180 constructor_noncallable: ["Class constructors cannot be invoked without
'new'"], |
181 array_not_subclassable: ["Subclassing Arrays is not currently supported
."], | 181 array_not_subclassable: ["Subclassing Arrays is not currently supported
."], |
182 for_in_loop_initializer: ["for-in loop variable declaration may not have
an initializer."], | 182 for_in_loop_initializer: ["for-in loop variable declaration may not have
an initializer."], |
183 for_of_loop_initializer: ["for-of loop variable declaration may not have
an initializer."], | 183 for_of_loop_initializer: ["for-of loop variable declaration may not have
an initializer."], |
184 for_inof_loop_multi_bindings: ["Invalid left-hand side in ", "%0", " loop: Mu
st have a single binding."] | 184 for_inof_loop_multi_bindings: ["Invalid left-hand side in ", "%0", " loop: Mu
st have a single binding."], |
| 185 bad_getter_arity: ["Getter must not have any formal parameters."]
, |
| 186 bad_setter_arity: ["Setter must have exactly one formal parameter
."], |
| 187 this_formal_parameter: ["'this' is not a valid formal parameter name"]
, |
| 188 duplicate_arrow_function_formal_parameter: ["Arrow function may not have dupli
cate parameter names"] |
185 }; | 189 }; |
186 | 190 |
187 | 191 |
188 function FormatString(format, args) { | 192 function FormatString(format, args) { |
189 var result = ""; | 193 var result = ""; |
190 var arg_num = 0; | 194 var arg_num = 0; |
191 for (var i = 0; i < format.length; i++) { | 195 for (var i = 0; i < format.length; i++) { |
192 var str = format[i]; | 196 var str = format[i]; |
193 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { | 197 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { |
194 // Two-char string starts with "%". | 198 // Two-char string starts with "%". |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 function SetUpStackOverflowBoilerplate() { | 1279 function SetUpStackOverflowBoilerplate() { |
1276 var boilerplate = MakeRangeError(kStackOverflow); | 1280 var boilerplate = MakeRangeError(kStackOverflow); |
1277 | 1281 |
1278 %DefineAccessorPropertyUnchecked( | 1282 %DefineAccessorPropertyUnchecked( |
1279 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); | 1283 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); |
1280 | 1284 |
1281 return boilerplate; | 1285 return boilerplate; |
1282 } | 1286 } |
1283 | 1287 |
1284 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1288 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
OLD | NEW |