| 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(columnNumber, "columnNumber") | 
|---|
| 85 | DEF(message, "message") | 
|---|
| 86 | DEF(cause, "cause") | 
|---|
| 87 | DEF(errors, "errors") | 
|---|
| 88 | DEF(stack, "stack") | 
|---|
| 89 | DEF(name, "name") | 
|---|
| 90 | DEF(toString, "toString") | 
|---|
| 91 | DEF(toLocaleString, "toLocaleString") | 
|---|
| 92 | DEF(valueOf, "valueOf") | 
|---|
| 93 | DEF(eval, "eval") | 
|---|
| 94 | DEF(prototype, "prototype") | 
|---|
| 95 | DEF(constructor, "constructor") | 
|---|
| 96 | DEF(configurable, "configurable") | 
|---|
| 97 | DEF(writable, "writable") | 
|---|
| 98 | DEF(enumerable, "enumerable") | 
|---|
| 99 | DEF(value, "value") | 
|---|
| 100 | DEF(get, "get") | 
|---|
| 101 | DEF(set, "set") | 
|---|
| 102 | DEF(of, "of") | 
|---|
| 103 | DEF(__proto__, "__proto__") | 
|---|
| 104 | DEF(undefined, "undefined") | 
|---|
| 105 | DEF(number, "number") | 
|---|
| 106 | DEF(boolean, "boolean") | 
|---|
| 107 | DEF(string, "string") | 
|---|
| 108 | DEF(object, "object") | 
|---|
| 109 | DEF(symbol, "symbol") | 
|---|
| 110 | DEF(integer, "integer") | 
|---|
| 111 | DEF(unknown, "unknown") | 
|---|
| 112 | DEF(arguments, "arguments") | 
|---|
| 113 | DEF(callee, "callee") | 
|---|
| 114 | DEF(caller, "caller") | 
|---|
| 115 | DEF(_eval_, "<eval>") | 
|---|
| 116 | DEF(_ret_, "<ret>") | 
|---|
| 117 | DEF(_var_, "<var>") | 
|---|
| 118 | DEF(_arg_var_, "<arg_var>") | 
|---|
| 119 | DEF(_with_, "<with>") | 
|---|
| 120 | DEF(lastIndex, "lastIndex") | 
|---|
| 121 | DEF(target, "target") | 
|---|
| 122 | DEF(index, "index") | 
|---|
| 123 | DEF(input, "input") | 
|---|
| 124 | DEF(defineProperties, "defineProperties") | 
|---|
| 125 | DEF(apply, "apply") | 
|---|
| 126 | DEF(join, "join") | 
|---|
| 127 | DEF(concat, "concat") | 
|---|
| 128 | DEF(split, "split") | 
|---|
| 129 | DEF(construct, "construct") | 
|---|
| 130 | DEF(getPrototypeOf, "getPrototypeOf") | 
|---|
| 131 | DEF(setPrototypeOf, "setPrototypeOf") | 
|---|
| 132 | DEF(isExtensible, "isExtensible") | 
|---|
| 133 | DEF(preventExtensions, "preventExtensions") | 
|---|
| 134 | DEF(has, "has") | 
|---|
| 135 | DEF(deleteProperty, "deleteProperty") | 
|---|
| 136 | DEF(defineProperty, "defineProperty") | 
|---|
| 137 | DEF(getOwnPropertyDescriptor, "getOwnPropertyDescriptor") | 
|---|
| 138 | DEF(ownKeys, "ownKeys") | 
|---|
| 139 | DEF(add, "add") | 
|---|
| 140 | DEF(done, "done") | 
|---|
| 141 | DEF(next, "next") | 
|---|
| 142 | DEF(values, "values") | 
|---|
| 143 | DEF(source, "source") | 
|---|
| 144 | DEF(flags, "flags") | 
|---|
| 145 | DEF(global, "global") | 
|---|
| 146 | DEF(unicode, "unicode") | 
|---|
| 147 | DEF(raw, "raw") | 
|---|
| 148 | DEF(new_target, "new.target") | 
|---|
| 149 | DEF(this_active_func, "this.active_func") | 
|---|
| 150 | DEF(home_object, "<home_object>") | 
|---|
| 151 | DEF(computed_field, "<computed_field>") | 
|---|
| 152 | DEF(static_computed_field, "<static_computed_field>") /* must come after computed_fields */ | 
|---|
| 153 | DEF(class_fields_init, "<class_fields_init>") | 
|---|
| 154 | DEF(brand, "<brand>") | 
|---|
| 155 | DEF(hash_constructor, "#constructor") | 
|---|
| 156 | DEF(as, "as") | 
|---|
| 157 | DEF(from, "from") | 
|---|
| 158 | DEF(meta, "meta") | 
|---|
| 159 | DEF(_default_, "*default*") | 
|---|
| 160 | DEF(_star_, "*") | 
|---|
| 161 | DEF(Module, "Module") | 
|---|
| 162 | DEF(then, "then") | 
|---|
| 163 | DEF(resolve, "resolve") | 
|---|
| 164 | DEF(reject, "reject") | 
|---|
| 165 | DEF(promise, "promise") | 
|---|
| 166 | DEF(proxy, "proxy") | 
|---|
| 167 | DEF(revoke, "revoke") | 
|---|
| 168 | DEF(async, "async") | 
|---|
| 169 | DEF(exec, "exec") | 
|---|
| 170 | DEF(groups, "groups") | 
|---|
| 171 | DEF(indices, "indices") | 
|---|
| 172 | DEF(status, "status") | 
|---|
| 173 | DEF(reason, "reason") | 
|---|
| 174 | DEF(globalThis, "globalThis") | 
|---|
| 175 | DEF(bigint, "bigint") | 
|---|
| 176 | DEF(minus_zero, "-0") | 
|---|
| 177 | DEF(Infinity, "Infinity") | 
|---|
| 178 | DEF(minus_Infinity, "-Infinity") | 
|---|
| 179 | DEF(NaN, "NaN") | 
|---|
| 180 | /* the following 3 atoms are only used with CONFIG_ATOMICS */ | 
|---|
| 181 | DEF(not_equal, "not-equal") | 
|---|
| 182 | DEF(timed_out, "timed-out") | 
|---|
| 183 | DEF(ok, "ok") | 
|---|
| 184 | /* */ | 
|---|
| 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 | DEF(BigInt64Array, "BigInt64Array") | 
|---|
| 213 | DEF(BigUint64Array, "BigUint64Array") | 
|---|
| 214 | DEF(Float32Array, "Float32Array") | 
|---|
| 215 | DEF(Float64Array, "Float64Array") | 
|---|
| 216 | DEF(DataView, "DataView") | 
|---|
| 217 | DEF(BigInt, "BigInt") | 
|---|
| 218 | DEF(WeakRef, "WeakRef") | 
|---|
| 219 | DEF(FinalizationRegistry, "FinalizationRegistry") | 
|---|
| 220 | DEF(Map, "Map") | 
|---|
| 221 | DEF(Set, "Set") /* Map + 1 */ | 
|---|
| 222 | DEF(WeakMap, "WeakMap") /* Map + 2 */ | 
|---|
| 223 | DEF(WeakSet, "WeakSet") /* Map + 3 */ | 
|---|
| 224 | DEF(Map_Iterator, "Map Iterator") | 
|---|
| 225 | DEF(Set_Iterator, "Set Iterator") | 
|---|
| 226 | DEF(Array_Iterator, "Array Iterator") | 
|---|
| 227 | DEF(String_Iterator, "String Iterator") | 
|---|
| 228 | DEF(RegExp_String_Iterator, "RegExp String Iterator") | 
|---|
| 229 | DEF(Generator, "Generator") | 
|---|
| 230 | DEF(Proxy, "Proxy") | 
|---|
| 231 | DEF(Promise, "Promise") | 
|---|
| 232 | DEF(PromiseResolveFunction, "PromiseResolveFunction") | 
|---|
| 233 | DEF(PromiseRejectFunction, "PromiseRejectFunction") | 
|---|
| 234 | DEF(AsyncFunction, "AsyncFunction") | 
|---|
| 235 | DEF(AsyncFunctionResolve, "AsyncFunctionResolve") | 
|---|
| 236 | DEF(AsyncFunctionReject, "AsyncFunctionReject") | 
|---|
| 237 | DEF(AsyncGeneratorFunction, "AsyncGeneratorFunction") | 
|---|
| 238 | DEF(AsyncGenerator, "AsyncGenerator") | 
|---|
| 239 | DEF(EvalError, "EvalError") | 
|---|
| 240 | DEF(RangeError, "RangeError") | 
|---|
| 241 | DEF(ReferenceError, "ReferenceError") | 
|---|
| 242 | DEF(SyntaxError, "SyntaxError") | 
|---|
| 243 | DEF(TypeError, "TypeError") | 
|---|
| 244 | DEF(URIError, "URIError") | 
|---|
| 245 | DEF(InternalError, "InternalError") | 
|---|
| 246 | /* private symbols */ | 
|---|
| 247 | DEF(Private_brand, "<brand>") | 
|---|
| 248 | /* symbols */ | 
|---|
| 249 | DEF(Symbol_toPrimitive, "Symbol.toPrimitive") | 
|---|
| 250 | DEF(Symbol_iterator, "Symbol.iterator") | 
|---|
| 251 | DEF(Symbol_match, "Symbol.match") | 
|---|
| 252 | DEF(Symbol_matchAll, "Symbol.matchAll") | 
|---|
| 253 | DEF(Symbol_replace, "Symbol.replace") | 
|---|
| 254 | DEF(Symbol_search, "Symbol.search") | 
|---|
| 255 | DEF(Symbol_split, "Symbol.split") | 
|---|
| 256 | DEF(Symbol_toStringTag, "Symbol.toStringTag") | 
|---|
| 257 | DEF(Symbol_isConcatSpreadable, "Symbol.isConcatSpreadable") | 
|---|
| 258 | DEF(Symbol_hasInstance, "Symbol.hasInstance") | 
|---|
| 259 | DEF(Symbol_species, "Symbol.species") | 
|---|
| 260 | DEF(Symbol_unscopables, "Symbol.unscopables") | 
|---|
| 261 | DEF(Symbol_asyncIterator, "Symbol.asyncIterator") | 
|---|
| 262 |  | 
|---|
| 263 | #endif /* DEF */ | 
|---|
| 264 |  | 
|---|