aboutsummaryrefslogtreecommitdiff
path: root/jerry-core/ecma/base/ecma-errors.c
blob: 27189eaf1e17b1b682ecc5a7b30ce7e608085e2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/* Copyright JS Foundation and other contributors, http://js.foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
  */

#include "ecma-errors.h"

#if JERRY_ERROR_MESSAGES

/**
 * Error message, if an argument is has an error flag
 */
const char * const ecma_error_value_msg_p = "Argument cannot be marked as error";

/**
 * Error message, if an argument has a wrong type
 */
const char * const ecma_error_wrong_args_msg_p = "This type of argument is not allowed";

#if !JERRY_PARSER
/**
 * Error message, if parsing is disabled
 */
const char * const ecma_error_parser_not_supported_p = "Source code parsing is disabled";
#endif /* !JERRY_PARSER  */

#if !JERRY_BUILTIN_JSON
/**
 * Error message, if JSON support is disabled
 */
const char * const ecma_error_json_not_supported_p = "JSON support is disabled";
#endif /* !JERRY_BUILTIN_JSON  */

#if !JERRY_ESNEXT
/**
 * Error message, if Symbol support is disabled
 */
const char * const ecma_error_symbol_not_supported_p = "Symbol support is disabled";
/**
 * Error message, if Promise support is disabled
 */
const char * const ecma_error_promise_not_supported_p = "Promise support is disabled";
#endif /* !JERRY_ESNEXT  */

#if !JERRY_BUILTIN_TYPEDARRAY
/**
 * Error message, if TypedArray support is disabled
 */
const char * const ecma_error_typed_array_not_supported_p = "TypedArray support is disabled";
#endif /* !JERRY_BUILTIN_TYPEDARRAY  */

#if !JERRY_BUILTIN_SHAREDARRAYBUFFER
/**
 * Error message, if SharedArrayBuffer support is disabled
 */
const char * const ecma_error_shared_arraybuffer_not_supported_p = "SharedArrayBuffer support is disabled";
#endif /* !JERRY_BUILTIN_SHAREDARRAYBUFFER  */

#if !JERRY_BUILTIN_DATAVIEW
/**
 * Error message, if DataView support is disabled
 */
const char * const ecma_error_data_view_not_supported_p = "DataView support is disabled";
#endif /* !JERRY_BUILTIN_DATAVIEW  */

#if !JERRY_BUILTIN_BIGINT
/**
 * Error message, if BigInt support is disabled
 */
const char * const ecma_error_bigint_not_supported_p = "BigInt support is disabled";
#endif /* !JERRY_BUILTIN_BIGINT  */

#if !JERRY_BUILTIN_CONTAINER
/**
 * Error message, if Container support is disabled
 */
const char * const ecma_error_container_not_supported_p = "Container support is disabled";
#endif /* JERRY_BUILTIN_CONTAINER  */

#if JERRY_MODULE_SYSTEM
/**
 * Error message, if argument is not a module
 */
const char * const ecma_error_not_module_p = "Argument is not a module";

/**
 * Error message, if a native module export is not found
 */
const char * const ecma_error_unknown_export_p = "Native module export not found";
#else /* !JERRY_MODULE_SYSTEM */
/**
 * Error message, if Module support is disabled
 */
const char * const ecma_error_module_not_supported_p = "Module support is disabled";
#endif /* JERRY_MODULE_SYSTEM */

/**
   * Error message, if callback function is not callable
   */
const char * const ecma_error_callback_is_not_callable = "Callback function is not callable";

/**
 * Error message, if arrayBuffer is detached
 */
const char * const ecma_error_arraybuffer_is_detached = "ArrayBuffer has been detached";

/**
 * Error message, cannot convert undefined or null to object
 */
const char * const ecma_error_cannot_convert_to_object = "Cannot convert undefined or null to object";

/**
 * Error message, prototype property of a class is non-configurable
 */
const char * const ecma_error_class_is_non_configurable = "Prototype property of a class is non-configurable";

/**
 * Error message, argument is not an object
 */
const char * const ecma_error_argument_is_not_an_object = "Argument is not an object";

/**
 * Error message length of 'ecma_error_argument_is_not_an_object'
 */
const int ecma_error_argument_is_not_an_object_length = 25;

/**
 * Error message, argument is not a Proxy object
 */
const char * const ecma_error_argument_is_not_a_proxy = "Argument is not a Proxy object";

/**
 * Error message, target is not a constructor
 */
const char * const ecma_error_target_is_not_a_constructor = "Target is not a constructor";

/**
 * Error message, argument is not an regexp
 */
const char * const ecma_error_argument_is_not_an_regexp = "Argument 'this' is not a RegExp object";

/**
 * Error message, invalid array length
 */
const char * const ecma_error_invalid_array_length = "Invalid Array length";

/**
 * Error message, local variable is redeclared
 */
const char * const ecma_error_local_variable_is_redeclared = "Local variable is redeclared";

/**
 * Error message, expected a function
 */
const char * const ecma_error_expected_a_function = "Expected a function";

#if JERRY_ESNEXT

/**
 * Error message, class constructor invoked without new keyword
 */
const char * const ecma_error_class_constructor_new = "Class constructor cannot be invoked without 'new'";

/**
 * Error message, variables declared by let/const must be initialized before reading their value
 */
const char * const ecma_error_let_const_not_initialized = ("Variables declared by let/const must be"
                                                           " initialized before reading their value");

#endif /* JERRY_ESNEXT */

#endif /* JERRY_ERROR_MESSAGES */

#if JERRY_SNAPSHOT_SAVE || JERRY_SNAPSHOT_EXEC

/**
 * Error message, maximum snapshot size reached
 */
const char * const ecma_error_maximum_snapshot_size = "Maximum snapshot size reached";

/**
 * Error message, regular expressions literals are not supported
 */
const char * const ecma_error_regular_expression_not_supported = "Regular expression literals are not supported";

/**
 * Error message, snapshot buffer too small
 */
const char * const ecma_error_snapshot_buffer_small = "Snapshot buffer too small";

/**
 * Error message, Unsupported generate snapshot flags specified
 */
const char * const ecma_error_snapshot_flag_not_supported = "Unsupported generate snapshot flags specified";

/**
 * Error message, Cannot allocate memory for literals
 */
const char * const ecma_error_cannot_allocate_memory_literals = "Cannot allocate memory for literals";

/**
 * Error message, Unsupported feature: tagged template literals
 */
const char * const ecma_error_tagged_template_literals = "Unsupported feature: tagged template literals";

#endif /* JERRY_SNAPSHOT_SAVE || JERRY_SNAPSHOT_EXEC */