• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright JS Foundation and other contributors, http://js.foundation
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /*
17  * Global built-in description
18  */
19 
20 #include "ecma-builtin-helpers-macro-defines.inc.h"
21 
22 /* Simple value properties:
23  * (property name, simple value, writable, enumerable, configurable) */
24 
25 /* ECMA-262 v5, 15.1.1.3 */
26 SIMPLE_VALUE (LIT_MAGIC_STRING_UNDEFINED,
27               ECMA_VALUE_UNDEFINED,
28               ECMA_PROPERTY_FIXED)
29 
30 /* Number properties:
31  *  (property name, number value, writable, enumerable, configurable) */
32 
33 /* ECMA-262 v5, 15.1.1.1 */
34 NUMBER_VALUE (LIT_MAGIC_STRING_NAN,
35               ECMA_BUILTIN_NUMBER_NAN,
36               ECMA_PROPERTY_FIXED)
37 
38 /* ECMA-262 v5, 15.1.1.2 */
39 NUMBER_VALUE (LIT_MAGIC_STRING_INFINITY_UL,
40               ECMA_BUILTIN_NUMBER_POSITIVE_INFINITY,
41               ECMA_PROPERTY_FIXED)
42 
43 /* Object properties:
44  *  (property name, object pointer getter) */
45 
46 /* ECMA-262 v5, 15.1.4.1 */
47 OBJECT_VALUE (LIT_MAGIC_STRING_OBJECT_UL,
48               ECMA_BUILTIN_ID_OBJECT,
49               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
50 
51 /* ECMA-262 v5, 15.1.4.2 */
52 OBJECT_VALUE (LIT_MAGIC_STRING_FUNCTION_UL,
53               ECMA_BUILTIN_ID_FUNCTION,
54               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
55 
56 /* ECMA-262 v5, 15.1.4.3 */
57 #if ENABLED (JERRY_BUILTIN_ARRAY)
58 OBJECT_VALUE (LIT_MAGIC_STRING_ARRAY_UL,
59               ECMA_BUILTIN_ID_ARRAY,
60               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
61 #endif /* ENABLED (JERRY_BUILTIN_ARRAY) */
62 
63 #if ENABLED (JERRY_BUILTIN_STRING)
64 /* ECMA-262 v5, 15.1.4.4 */
65 OBJECT_VALUE (LIT_MAGIC_STRING_STRING_UL,
66               ECMA_BUILTIN_ID_STRING,
67               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
68 #endif /* ENABLED (JERRY_BUILTIN_STRING) */
69 
70 #if ENABLED (JERRY_BUILTIN_BOOLEAN)
71 /* ECMA-262 v5, 15.1.4.5 */
72 OBJECT_VALUE (LIT_MAGIC_STRING_BOOLEAN_UL,
73               ECMA_BUILTIN_ID_BOOLEAN,
74               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
75 #endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */
76 
77 #if ENABLED (JERRY_BUILTIN_NUMBER)
78 /* ECMA-262 v5, 15.1.4.6 */
79 OBJECT_VALUE (LIT_MAGIC_STRING_NUMBER_UL,
80               ECMA_BUILTIN_ID_NUMBER,
81               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
82 #endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
83 
84 #if ENABLED (JERRY_BUILTIN_DATE)
85 /* ECMA-262 v5, 15.1.4.7 */
86 OBJECT_VALUE (LIT_MAGIC_STRING_DATE_UL,
87               ECMA_BUILTIN_ID_DATE,
88               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
89 #endif /* ENABLED (JERRY_BUILTIN_DATE) */
90 
91 #if ENABLED (JERRY_BUILTIN_REGEXP)
92 /* ECMA-262 v5, 15.1.4.8 */
93 OBJECT_VALUE (LIT_MAGIC_STRING_REGEXP_UL,
94               ECMA_BUILTIN_ID_REGEXP,
95               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
96 #endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
97 
98 /* ECMA-262 v5, 15.1.4.9 */
99 OBJECT_VALUE (LIT_MAGIC_STRING_ERROR_UL,
100               ECMA_BUILTIN_ID_ERROR,
101               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
102 
103 #if ENABLED (JERRY_BUILTIN_ERRORS)
104 
105 /* ECMA-262 v5, 15.1.4.10 */
106 OBJECT_VALUE (LIT_MAGIC_STRING_EVAL_ERROR_UL,
107               ECMA_BUILTIN_ID_EVAL_ERROR,
108               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
109 
110 /* ECMA-262 v5, 15.1.4.11 */
111 OBJECT_VALUE (LIT_MAGIC_STRING_RANGE_ERROR_UL,
112               ECMA_BUILTIN_ID_RANGE_ERROR,
113               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
114 
115 /* ECMA-262 v5, 15.1.4.12 */
116 OBJECT_VALUE (LIT_MAGIC_STRING_REFERENCE_ERROR_UL,
117               ECMA_BUILTIN_ID_REFERENCE_ERROR,
118               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
119 
120 /* ECMA-262 v5, 15.1.4.13 */
121 OBJECT_VALUE (LIT_MAGIC_STRING_SYNTAX_ERROR_UL,
122               ECMA_BUILTIN_ID_SYNTAX_ERROR,
123               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
124 
125 /* ECMA-262 v5, 15.1.4.14 */
126 OBJECT_VALUE (LIT_MAGIC_STRING_TYPE_ERROR_UL,
127               ECMA_BUILTIN_ID_TYPE_ERROR,
128               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
129 
130 /* ECMA-262 v5, 15.1.4.15 */
131 OBJECT_VALUE (LIT_MAGIC_STRING_URI_ERROR_UL,
132               ECMA_BUILTIN_ID_URI_ERROR,
133               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
134 #endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
135 
136 #if ENABLED (JERRY_BUILTIN_MATH)
137 /* ECMA-262 v5, 15.1.5.1 */
138 OBJECT_VALUE (LIT_MAGIC_STRING_MATH_UL,
139               ECMA_BUILTIN_ID_MATH,
140               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
141 #endif /* ENABLED (JERRY_BUILTIN_MATH) */
142 #if ENABLED (JERRY_ES2015_BUILTIN_REFLECT)
143 /* ECMA-262 v6, 26.1 */
144 OBJECT_VALUE (LIT_MAGIC_STRING_REFLECT_UL,
145               ECMA_BUILTIN_ID_REFLECT,
146               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
147 #endif /* ENABLED (JERRY_ES2015_BUILTIN_REFLECT) */
148 
149 #if ENABLED (JERRY_BUILTIN_JSON)
150 /* ECMA-262 v5, 15.1.5.2 */
151 OBJECT_VALUE (LIT_MAGIC_STRING_JSON_U,
152               ECMA_BUILTIN_ID_JSON,
153               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
154 #endif /* ENABLED (JERRY_BUILTIN_JSON) */
155 
156 #if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
157 OBJECT_VALUE (LIT_MAGIC_STRING_ARRAY_BUFFER_UL,
158               ECMA_BUILTIN_ID_ARRAYBUFFER,
159               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
160 
161 OBJECT_VALUE (LIT_MAGIC_STRING_INT8_ARRAY_UL,
162               ECMA_BUILTIN_ID_INT8ARRAY,
163               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
164 
165 OBJECT_VALUE (LIT_MAGIC_STRING_UINT8_ARRAY_UL,
166               ECMA_BUILTIN_ID_UINT8ARRAY,
167               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
168 
169 OBJECT_VALUE (LIT_MAGIC_STRING_INT16_ARRAY_UL,
170               ECMA_BUILTIN_ID_INT16ARRAY,
171               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
172 
173 OBJECT_VALUE (LIT_MAGIC_STRING_UINT16_ARRAY_UL,
174               ECMA_BUILTIN_ID_UINT16ARRAY,
175               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
176 
177 OBJECT_VALUE (LIT_MAGIC_STRING_INT32_ARRAY_UL,
178               ECMA_BUILTIN_ID_INT32ARRAY,
179               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
180 
181 OBJECT_VALUE (LIT_MAGIC_STRING_UINT32_ARRAY_UL,
182               ECMA_BUILTIN_ID_UINT32ARRAY,
183               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
184 
185 OBJECT_VALUE (LIT_MAGIC_STRING_FLOAT32_ARRAY_UL,
186               ECMA_BUILTIN_ID_FLOAT32ARRAY,
187               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
188 
189 #if ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
190 OBJECT_VALUE (LIT_MAGIC_STRING_FLOAT64_ARRAY_UL,
191               ECMA_BUILTIN_ID_FLOAT64ARRAY,
192               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
193 #endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
194 
195 OBJECT_VALUE (LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL,
196               ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY,
197               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
198 
199 #endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
200 
201 #if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
202 OBJECT_VALUE (LIT_MAGIC_STRING_PROMISE_UL,
203               ECMA_BUILTIN_ID_PROMISE,
204               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
205 #endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
206 
207 #if ENABLED (JERRY_ES2015_BUILTIN_MAP)
208 /* ECMA-262 v6, 23.1.1.1 */
209 OBJECT_VALUE (LIT_MAGIC_STRING_MAP_UL,
210               ECMA_BUILTIN_ID_MAP,
211               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
212 #endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
213 
214 #if ENABLED (JERRY_ES2015_BUILTIN_SET)
215 /* ECMA-262 v6, 23.1.1.1 */
216 OBJECT_VALUE (LIT_MAGIC_STRING_SET_UL,
217               ECMA_BUILTIN_ID_SET,
218               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
219 #endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
220 
221 #if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
222 /* ECMA-262 v6, 23.1.1.1 */
223 OBJECT_VALUE (LIT_MAGIC_STRING_WEAKMAP_UL,
224               ECMA_BUILTIN_ID_WEAKMAP,
225               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
226 #endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
227 
228 #if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
229 /* ECMA-262 v6, 23.1.1.1 */
230 OBJECT_VALUE (LIT_MAGIC_STRING_WEAKSET_UL,
231               ECMA_BUILTIN_ID_WEAKSET,
232               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
233 #endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
234 
235 #if ENABLED (JERRY_ES2015)
236 /* ECMA-262 v6, 19.4.1.1 */
237 OBJECT_VALUE (LIT_MAGIC_STRING_SYMBOL_UL,
238               ECMA_BUILTIN_ID_SYMBOL,
239               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
240 #endif /* ENABLED (JERRY_ES2015) */
241 
242 #if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
243 /* ECMA-262 v6, 23.1.1.1 */
244 OBJECT_VALUE (LIT_MAGIC_STRING_DATAVIEW_UL,
245               ECMA_BUILTIN_ID_DATAVIEW,
246               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
247 #endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
248 
249 #if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
250 /* ECMA-262 v6, 26.2.1 */
251 OBJECT_VALUE (LIT_MAGIC_STRING_PROXY_UL,
252               ECMA_BUILTIN_ID_PROXY,
253               ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
254 #endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
255 
256 /* Routine properties:
257  *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
258 
259 ROUTINE (LIT_MAGIC_STRING_EVAL, ECMA_GLOBAL_EVAL, 1, 1)
260 ROUTINE (LIT_MAGIC_STRING_IS_NAN, ECMA_GLOBAL_IS_NAN, 1, 1)
261 ROUTINE (LIT_MAGIC_STRING_IS_FINITE, ECMA_GLOBAL_IS_FINITE, 1, 1)
262 ROUTINE (LIT_MAGIC_STRING_DECODE_URI, ECMA_GLOBAL_DECODE_URI, 1, 1)
263 ROUTINE (LIT_MAGIC_STRING_DECODE_URI_COMPONENT, ECMA_GLOBAL_DECODE_URI_COMPONENT, 1, 1)
264 ROUTINE (LIT_MAGIC_STRING_ENCODE_URI, ECMA_GLOBAL_ENCODE_URI, 1, 1)
265 ROUTINE (LIT_MAGIC_STRING_ENCODE_URI_COMPONENT, ECMA_GLOBAL_ENCODE_URI_COMPONENT, 1, 1)
266 #if ENABLED (JERRY_ES2015)
267 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_FLOAT, LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
268 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_INT, LIT_MAGIC_STRING_PARSE_INT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
269 
270 #else /* !ENABLED (JERRY_ES2015) */
271 ROUTINE (LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_GLOBAL_PARSE_FLOAT, 1, 1)
272 ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ECMA_GLOBAL_PARSE_INT, 2, 2)
273 #endif /* ENABLED (JERRY_ES2015) */
274 #if ENABLED (JERRY_BUILTIN_ANNEXB)
275 ROUTINE (LIT_MAGIC_STRING_ESCAPE, ECMA_GLOBAL_ESCAPE, 1, 1)
276 ROUTINE (LIT_MAGIC_STRING_UNESCAPE, ECMA_GLOBAL_UNESCAPE, 1, 1)
277 #endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
278 
279 #include "ecma-builtin-helpers-macro-undefs.inc.h"
280