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(errors, "errors")
86 DEF(stack, "stack")
87 DEF(name, "name")
88 DEF(toString, "toString")
89 DEF(toLocaleString, "toLocaleString")
90 DEF(valueOf, "valueOf")
91 DEF(eval, "eval")
92 DEF(prototype, "prototype")
93 DEF(constructor, "constructor")
94 DEF(configurable, "configurable")
95 DEF(writable, "writable")
96 DEF(enumerable, "enumerable")
97 DEF(value, "value")
98 DEF(get, "get")
99 DEF(set, "set")
100 DEF(of, "of")
101 DEF(__proto__, "__proto__")
102 DEF(undefined, "undefined")
103 DEF(number, "number")
104 DEF(boolean, "boolean")
105 DEF(string, "string")
106 DEF(object, "object")
107 DEF(symbol, "symbol")
108 DEF(integer, "integer")
109 DEF(unknown, "unknown")
110 DEF(arguments, "arguments")
111 DEF(callee, "callee")
112 DEF(caller, "caller")
113 DEF(_eval_, "<eval>")
114 DEF(_ret_, "<ret>")
115 DEF(_var_, "<var>")
116 DEF(_arg_var_, "<arg_var>")
117 DEF(_with_, "<with>")
118 DEF(lastIndex, "lastIndex")
119 DEF(target, "target")
120 DEF(index, "index")
121 DEF(input, "input")
122 DEF(defineProperties, "defineProperties")
123 DEF(apply, "apply")
124 DEF(join, "join")
125 DEF(concat, "concat")
126 DEF(split, "split")
127 DEF(construct, "construct")
128 DEF(getPrototypeOf, "getPrototypeOf")
129 DEF(setPrototypeOf, "setPrototypeOf")
130 DEF(isExtensible, "isExtensible")
131 DEF(preventExtensions, "preventExtensions")
132 DEF(has, "has")
133 DEF(deleteProperty, "deleteProperty")
134 DEF(defineProperty, "defineProperty")
135 DEF(getOwnPropertyDescriptor, "getOwnPropertyDescriptor")
136 DEF(ownKeys, "ownKeys")
137 DEF(add, "add")
138 DEF(done, "done")
139 DEF(next, "next")
140 DEF(values, "values")
141 DEF(source, "source")
142 DEF(flags, "flags")
143 DEF(global, "global")
144 DEF(unicode, "unicode")
145 DEF(raw, "raw")
146 DEF(new_target, "new.target")
147 DEF(this_active_func, "this.active_func")
148 DEF(home_object, "<home_object>")
149 DEF(computed_field, "<computed_field>")
150 DEF(static_computed_field, "<static_computed_field>") /* must come after computed_fields */
151 DEF(class_fields_init, "<class_fields_init>")
152 DEF(brand, "<brand>")
153 DEF(hash_constructor, "#constructor")
154 DEF(as, "as")
155 DEF(from, "from")
156 DEF(meta, "meta")
157 DEF(_default_, "*default*")
158 DEF(_star_, "*")
159 DEF(Module, "Module")
160 DEF(then, "then")
161 DEF(resolve, "resolve")
162 DEF(reject, "reject")
163 DEF(promise, "promise")
164 DEF(proxy, "proxy")
165 DEF(revoke, "revoke")
166 DEF(async, "async")
167 DEF(exec, "exec")
168 DEF(groups, "groups")
169 DEF(status, "status")
170 DEF(reason, "reason")
171 DEF(globalThis, "globalThis")
172 #ifdef CONFIG_BIGNUM
173 DEF(bigint, "bigint")
174 DEF(bigfloat, "bigfloat")
175 DEF(bigdecimal, "bigdecimal")
176 DEF(roundingMode, "roundingMode")
177 DEF(maximumSignificantDigits, "maximumSignificantDigits")
178 DEF(maximumFractionDigits, "maximumFractionDigits")
179 #endif
180 #ifdef CONFIG_ATOMICS
181 DEF(not_equal, "not-equal")
182 DEF(timed_out, "timed-out")
183 DEF(ok, "ok")
184 #endif
185 DEF(toJSON, "toJSON")
186 /* class names */
187 DEF(Object, "Object")
188 DEF(Array, "Array")
189 DEF(Error, "Error")
190 DEF(Number, "Number")
191 DEF(String, "String")
192 DEF(Boolean, "Boolean")
193 DEF(Symbol, "Symbol")
194 DEF(Arguments, "Arguments")
195 DEF(Math, "Math")
196 DEF(JSON, "JSON")
197 DEF(Date, "Date")
198 DEF(Function, "Function")
199 DEF(GeneratorFunction, "GeneratorFunction")
200 DEF(ForInIterator, "ForInIterator")
201 DEF(RegExp, "RegExp")
202 DEF(ArrayBuffer, "ArrayBuffer")
203 DEF(SharedArrayBuffer, "SharedArrayBuffer")
204 /* must keep same order as class IDs for typed arrays */
205 DEF(Uint8ClampedArray, "Uint8ClampedArray")
206 DEF(Int8Array, "Int8Array")
207 DEF(Uint8Array, "Uint8Array")
208 DEF(Int16Array, "Int16Array")
209 DEF(Uint16Array, "Uint16Array")
210 DEF(Int32Array, "Int32Array")
211 DEF(Uint32Array, "Uint32Array")
212 #ifdef CONFIG_BIGNUM
213 DEF(BigInt64Array, "BigInt64Array")
214 DEF(BigUint64Array, "BigUint64Array")
215 #endif
216 DEF(Float32Array, "Float32Array")
217 DEF(Float64Array, "Float64Array")
218 DEF(DataView, "DataView")
219 #ifdef CONFIG_BIGNUM
220 DEF(BigInt, "BigInt")
221 DEF(BigFloat, "BigFloat")
222 DEF(BigFloatEnv, "BigFloatEnv")
223 DEF(BigDecimal, "BigDecimal")
224 DEF(OperatorSet, "OperatorSet")
225 DEF(Operators, "Operators")
226 #endif
227 DEF(Map, "Map")
228 DEF(Set, "Set") /* Map + 1 */
229 DEF(WeakMap, "WeakMap") /* Map + 2 */
230 DEF(WeakSet, "WeakSet") /* Map + 3 */
231 DEF(Map_Iterator, "Map Iterator")
232 DEF(Set_Iterator, "Set Iterator")
233 DEF(Array_Iterator, "Array Iterator")
234 DEF(String_Iterator, "String Iterator")
235 DEF(RegExp_String_Iterator, "RegExp String Iterator")
236 DEF(Generator, "Generator")
237 DEF(Proxy, "Proxy")
238 DEF(Promise, "Promise")
239 DEF(PromiseResolveFunction, "PromiseResolveFunction")
240 DEF(PromiseRejectFunction, "PromiseRejectFunction")
241 DEF(AsyncFunction, "AsyncFunction")
242 DEF(AsyncFunctionResolve, "AsyncFunctionResolve")
243 DEF(AsyncFunctionReject, "AsyncFunctionReject")
244 DEF(AsyncGeneratorFunction, "AsyncGeneratorFunction")
245 DEF(AsyncGenerator, "AsyncGenerator")
246 DEF(EvalError, "EvalError")
247 DEF(RangeError, "RangeError")
248 DEF(ReferenceError, "ReferenceError")
249 DEF(SyntaxError, "SyntaxError")
250 DEF(TypeError, "TypeError")
251 DEF(URIError, "URIError")
252 DEF(InternalError, "InternalError")
253 /* private symbols */
254 DEF(Private_brand, "<brand>")
255 /* symbols */
256 DEF(Symbol_toPrimitive, "Symbol.toPrimitive")
257 DEF(Symbol_iterator, "Symbol.iterator")
258 DEF(Symbol_match, "Symbol.match")
259 DEF(Symbol_matchAll, "Symbol.matchAll")
260 DEF(Symbol_replace, "Symbol.replace")
261 DEF(Symbol_search, "Symbol.search")
262 DEF(Symbol_split, "Symbol.split")
263 DEF(Symbol_toStringTag, "Symbol.toStringTag")
264 DEF(Symbol_isConcatSpreadable, "Symbol.isConcatSpreadable")
265 DEF(Symbol_hasInstance, "Symbol.hasInstance")
266 DEF(Symbol_species, "Symbol.species")
267 DEF(Symbol_unscopables, "Symbol.unscopables")
268 DEF(Symbol_asyncIterator, "Symbol.asyncIterator")
269 #ifdef CONFIG_BIGNUM
270 DEF(Symbol_operatorSet, "Symbol.operatorSet")
271 #endif
272 
273 #endif /* DEF */
274