1 /*
2  * QuickJS atom definitions
3  *
4  * Copyright (c) 2017-2018 Fabrice Bellard
5  * Copyright (c) 2017-2018 Charlie Gordon
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23  * THE SOFTWARE.
24  */
25 
26 #ifdef DEF
27 
28 /* Note: first atoms are considered as keywords in the parser */
29 DEF(null, "null") /* must be first */
30 DEF(false, "false")
31 DEF(true, "true")
32 DEF(if, "if")
33 DEF(else, "else")
34 DEF(return, "return")
35 DEF(var, "var")
36 DEF(this, "this")
37 DEF(delete, "delete")
38 DEF(void, "void")
39 DEF(typeof, "typeof")
40 DEF(new, "new")
41 DEF(in, "in")
42 DEF(instanceof, "instanceof")
43 DEF(do, "do")
44 DEF(while, "while")
45 DEF(for, "for")
46 DEF(break, "break")
47 DEF(continue, "continue")
48 DEF(switch, "switch")
49 DEF(case, "case")
50 DEF(default, "default")
51 DEF(throw, "throw")
52 DEF(try, "try")
53 DEF(catch, "catch")
54 DEF(finally, "finally")
55 DEF(function, "function")
56 DEF(debugger, "debugger")
57 DEF(with, "with")
58 /* FutureReservedWord */
59 DEF(class, "class")
60 DEF(const, "const")
61 DEF(enum, "enum")
62 DEF(export, "export")
63 DEF(extends, "extends")
64 DEF(import, "import")
65 DEF(super, "super")
66 /* FutureReservedWords when parsing strict mode code */
67 DEF(implements, "implements")
68 DEF(interface, "interface")
69 DEF(let, "let")
70 DEF(package, "package")
71 DEF(private, "private")
72 DEF(protected, "protected")
73 DEF(public, "public")
74 DEF(static, "static")
75 DEF(yield, "yield")
76 DEF(await, "await")
77 
78 /* empty string */
79 DEF(empty_string, "")
80 /* identifiers */
81 DEF(length, "length")
82 DEF(fileName, "fileName")
83 DEF(lineNumber, "lineNumber")
84 DEF(message, "message")
85 DEF(stack, "stack")
86 DEF(name, "name")
87 DEF(toString, "toString")
88 DEF(toLocaleString, "toLocaleString")
89 DEF(valueOf, "valueOf")
90 DEF(eval, "eval")
91 DEF(prototype, "prototype")
92 DEF(constructor, "constructor")
93 DEF(configurable, "configurable")
94 DEF(writable, "writable")
95 DEF(enumerable, "enumerable")
96 DEF(value, "value")
97 DEF(get, "get")
98 DEF(set, "set")
99 DEF(of, "of")
100 DEF(__proto__, "__proto__")
101 DEF(undefined, "undefined")
102 DEF(number, "number")
103 DEF(boolean, "boolean")
104 DEF(string, "string")
105 DEF(object, "object")
106 DEF(symbol, "symbol")
107 DEF(integer, "integer")
108 DEF(unknown, "unknown")
109 DEF(arguments, "arguments")
110 DEF(callee, "callee")
111 DEF(caller, "caller")
112 DEF(_eval_, "<eval>")
113 DEF(_ret_, "<ret>")
114 DEF(_var_, "<var>")
115 DEF(_with_, "<with>")
116 DEF(lastIndex, "lastIndex")
117 DEF(target, "target")
118 DEF(index, "index")
119 DEF(input, "input")
120 DEF(defineProperties, "defineProperties")
121 DEF(apply, "apply")
122 DEF(join, "join")
123 DEF(concat, "concat")
124 DEF(split, "split")
125 DEF(construct, "construct")
126 DEF(getPrototypeOf, "getPrototypeOf")
127 DEF(setPrototypeOf, "setPrototypeOf")
128 DEF(isExtensible, "isExtensible")
129 DEF(preventExtensions, "preventExtensions")
130 DEF(has, "has")
131 DEF(deleteProperty, "deleteProperty")
132 DEF(defineProperty, "defineProperty")
133 DEF(getOwnPropertyDescriptor, "getOwnPropertyDescriptor")
134 DEF(ownKeys, "ownKeys")
135 DEF(add, "add")
136 DEF(done, "done")
137 DEF(next, "next")
138 DEF(values, "values")
139 DEF(source, "source")
140 DEF(flags, "flags")
141 DEF(global, "global")
142 DEF(unicode, "unicode")
143 DEF(raw, "raw")
144 DEF(new_target, "new.target")
145 DEF(this_active_func, "this.active_func")
146 DEF(home_object, "<home_object>")
147 DEF(computed_field, "<computed_field>")
148 DEF(static_computed_field, "<static_computed_field>") /* must come after computed_fields */
149 DEF(class_fields_init, "<class_fields_init>")
150 DEF(brand, "<brand>")
151 DEF(hash_constructor, "#constructor")
152 DEF(as, "as")
153 DEF(from, "from")
154 DEF(meta, "meta")
155 DEF(_default_, "*default*")
156 DEF(_star_, "*")
157 DEF(Module, "Module")
158 DEF(then, "then")
159 DEF(resolve, "resolve")
160 DEF(reject, "reject")
161 DEF(promise, "promise")
162 DEF(proxy, "proxy")
163 DEF(revoke, "revoke")
164 DEF(async, "async")
165 DEF(exec, "exec")
166 DEF(groups, "groups")
167 DEF(status, "status")
168 DEF(reason, "reason")
169 DEF(globalThis, "globalThis")
170 #ifdef CONFIG_BIGNUM
171 DEF(bigint, "bigint")
172 DEF(bigfloat, "bigfloat")
173 DEF(bigdecimal, "bigdecimal")
174 DEF(roundingMode, "roundingMode")
175 DEF(maximumSignificantDigits, "maximumSignificantDigits")
176 DEF(maximumFractionDigits, "maximumFractionDigits")
177 #endif
178 #ifdef CONFIG_ATOMICS
179 DEF(not_equal, "not-equal")
180 DEF(timed_out, "timed-out")
181 DEF(ok, "ok")
182 #endif
183 DEF(toJSON, "toJSON")
184 /* class names */
185 DEF(Object, "Object")
186 DEF(Array, "Array")
187 DEF(Error, "Error")
188 DEF(Number, "Number")
189 DEF(String, "String")
190 DEF(Boolean, "Boolean")
191 DEF(Symbol, "Symbol")
192 DEF(Arguments, "Arguments")
193 DEF(Math, "Math")
194 DEF(JSON, "JSON")
195 DEF(Date, "Date")
196 DEF(Function, "Function")
197 DEF(GeneratorFunction, "GeneratorFunction")
198 DEF(ForInIterator, "ForInIterator")
199 DEF(RegExp, "RegExp")
200 DEF(ArrayBuffer, "ArrayBuffer")
201 DEF(SharedArrayBuffer, "SharedArrayBuffer")
202 /* must keep same order as class IDs for typed arrays */
203 DEF(Uint8ClampedArray, "Uint8ClampedArray")
204 DEF(Int8Array, "Int8Array")
205 DEF(Uint8Array, "Uint8Array")
206 DEF(Int16Array, "Int16Array")
207 DEF(Uint16Array, "Uint16Array")
208 DEF(Int32Array, "Int32Array")
209 DEF(Uint32Array, "Uint32Array")
210 #ifdef CONFIG_BIGNUM
211 DEF(BigInt64Array, "BigInt64Array")
212 DEF(BigUint64Array, "BigUint64Array")
213 #endif
214 DEF(Float32Array, "Float32Array")
215 DEF(Float64Array, "Float64Array")
216 DEF(DataView, "DataView")
217 #ifdef CONFIG_BIGNUM
218 DEF(BigInt, "BigInt")
219 DEF(BigFloat, "BigFloat")
220 DEF(BigFloatEnv, "BigFloatEnv")
221 DEF(BigDecimal, "BigDecimal")
222 #endif
223 DEF(Map, "Map")
224 DEF(Set, "Set") /* Map + 1 */
225 DEF(WeakMap, "WeakMap") /* Map + 2 */
226 DEF(WeakSet, "WeakSet") /* Map + 3 */
227 DEF(Map_Iterator, "Map Iterator")
228 DEF(Set_Iterator, "Set Iterator")
229 DEF(Array_Iterator, "Array Iterator")
230 DEF(String_Iterator, "String Iterator")
231 DEF(RegExp_String_Iterator, "RegExp String Iterator")
232 DEF(Generator, "Generator")
233 DEF(Proxy, "Proxy")
234 DEF(Promise, "Promise")
235 DEF(PromiseResolveFunction, "PromiseResolveFunction")
236 DEF(PromiseRejectFunction, "PromiseRejectFunction")
237 DEF(AsyncFunction, "AsyncFunction")
238 DEF(AsyncFunctionResolve, "AsyncFunctionResolve")
239 DEF(AsyncFunctionReject, "AsyncFunctionReject")
240 DEF(AsyncGeneratorFunction, "AsyncGeneratorFunction")
241 DEF(AsyncGenerator, "AsyncGenerator")
242 DEF(EvalError, "EvalError")
243 DEF(RangeError, "RangeError")
244 DEF(ReferenceError, "ReferenceError")
245 DEF(SyntaxError, "SyntaxError")
246 DEF(TypeError, "TypeError")
247 DEF(URIError, "URIError")
248 DEF(InternalError, "InternalError")
249 /* private symbols */
250 DEF(Private_brand, "<brand>")
251 /* symbols */
252 DEF(Symbol_toPrimitive, "Symbol.toPrimitive")
253 DEF(Symbol_iterator, "Symbol.iterator")
254 DEF(Symbol_match, "Symbol.match")
255 DEF(Symbol_matchAll, "Symbol.matchAll")
256 DEF(Symbol_replace, "Symbol.replace")
257 DEF(Symbol_search, "Symbol.search")
258 DEF(Symbol_split, "Symbol.split")
259 DEF(Symbol_toStringTag, "Symbol.toStringTag")
260 DEF(Symbol_isConcatSpreadable, "Symbol.isConcatSpreadable")
261 DEF(Symbol_hasInstance, "Symbol.hasInstance")
262 DEF(Symbol_species, "Symbol.species")
263 DEF(Symbol_unscopables, "Symbol.unscopables")
264 DEF(Symbol_asyncIterator, "Symbol.asyncIterator")
265 #ifdef CONFIG_BIGNUM
266 DEF(Symbol_operatorOrder, "Symbol.operatorOrder")
267 DEF(Symbol_operatorAdd, "Symbol.operatorAdd")
268 DEF(Symbol_operatorSub, "Symbol.operatorSub")
269 DEF(Symbol_operatorMul, "Symbol.operatorMul")
270 DEF(Symbol_operatorDiv, "Symbol.operatorDiv")
271 DEF(Symbol_operatorMod, "Symbol.operatorMod")
272 DEF(Symbol_operatorPow, "Symbol.operatorPow")
273 DEF(Symbol_operatorShl, "Symbol.operatorShl")
274 DEF(Symbol_operatorShr, "Symbol.operatorShr")
275 DEF(Symbol_operatorAnd, "Symbol.operatorAnd")
276 DEF(Symbol_operatorOr, "Symbol.operatorOr")
277 DEF(Symbol_operatorXor, "Symbol.operatorXor")
278 DEF(Symbol_operatorCmpLT, "Symbol.operatorCmpLT")
279 DEF(Symbol_operatorCmpLE, "Symbol.operatorCmpLE")
280 DEF(Symbol_operatorCmpEQ, "Symbol.operatorCmpEQ")
281 DEF(Symbol_operatorPlus, "Symbol.operatorPlus")
282 DEF(Symbol_operatorNeg, "Symbol.operatorNeg")
283 DEF(Symbol_operatorNot, "Symbol.operatorNot")
284 DEF(Symbol_operatorInc, "Symbol.operatorInc")
285 DEF(Symbol_operatorDec, "Symbol.operatorDec")
286 DEF(Symbol_operatorMathMod, "Symbol.operatorMathMod")
287 #endif
288 
289 #endif /* DEF */
290