CommonPropertyNames.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/FlyString.h>
  8. #include <LibJS/Forward.h>
  9. namespace JS {
  10. #define ENUMERATE_STANDARD_PROPERTY_NAMES(P) \
  11. P(__proto__) \
  12. P(__defineGetter__) \
  13. P(__defineSetter__) \
  14. P(__lookupGetter__) \
  15. P(__lookupSetter__) \
  16. P(BYTES_PER_ELEMENT) \
  17. P(BigInt) \
  18. P(Boolean) \
  19. P(E) \
  20. P(EPSILON) \
  21. P(Function) \
  22. P(Infinity) \
  23. P(JSON) \
  24. P(LN10) \
  25. P(LN2) \
  26. P(LOG10E) \
  27. P(LOG2E) \
  28. P(MAX_SAFE_INTEGER) \
  29. P(MAX_VALUE) \
  30. P(MIN_SAFE_INTEGER) \
  31. P(MIN_VALUE) \
  32. P(Math) \
  33. P(NEGATIVE_INFINITY) \
  34. P(NaN) \
  35. P(Number) \
  36. P(PI) \
  37. P(POSITIVE_INFINITY) \
  38. P(Proxy) \
  39. P(Reflect) \
  40. P(RegExp) \
  41. P(SQRT1_2) \
  42. P(SQRT2) \
  43. P(String) \
  44. P(Symbol) \
  45. P(Temporal) \
  46. P(UTC) \
  47. P(abs) \
  48. P(acos) \
  49. P(acosh) \
  50. P(add) \
  51. P(all) \
  52. P(allSettled) \
  53. P(anchor) \
  54. P(any) \
  55. P(apply) \
  56. P(arguments) \
  57. P(asIntN) \
  58. P(asUintN) \
  59. P(asin) \
  60. P(asinh) \
  61. P(assert) \
  62. P(assign) \
  63. P(at) \
  64. P(atan) \
  65. P(atan2) \
  66. P(atanh) \
  67. P(big) \
  68. P(bind) \
  69. P(blink) \
  70. P(bold) \
  71. P(buffer) \
  72. P(byteLength) \
  73. P(byteOffset) \
  74. P(call) \
  75. P(callee) \
  76. P(caller) \
  77. P(cause) \
  78. P(cbrt) \
  79. P(ceil) \
  80. P(charAt) \
  81. P(charCodeAt) \
  82. P(cleanupSome) \
  83. P(clear) \
  84. P(clz32) \
  85. P(codePointAt) \
  86. P(concat) \
  87. P(configurable) \
  88. P(console) \
  89. P(construct) \
  90. P(constructor) \
  91. P(copyWithin) \
  92. P(cos) \
  93. P(cosh) \
  94. P(count) \
  95. P(countReset) \
  96. P(create) \
  97. P(debug) \
  98. P(decodeURI) \
  99. P(decodeURIComponent) \
  100. P(defineProperties) \
  101. P(defineProperty) \
  102. P(deleteProperty) \
  103. P(deref) \
  104. P(description) \
  105. P(done) \
  106. P(dotAll) \
  107. P(encodeURI) \
  108. P(encodeURIComponent) \
  109. P(endsWith) \
  110. P(entries) \
  111. P(enumerable) \
  112. P(epochMicroseconds) \
  113. P(epochMilliseconds) \
  114. P(epochNanoseconds) \
  115. P(epochSeconds) \
  116. P(error) \
  117. P(errors) \
  118. P(escape) \
  119. P(eval) \
  120. P(every) \
  121. P(exec) \
  122. P(exp) \
  123. P(expm1) \
  124. P(fill) \
  125. P(filter) \
  126. P(finally) \
  127. P(find) \
  128. P(findIndex) \
  129. P(fixed) \
  130. P(flags) \
  131. P(flat) \
  132. P(flatMap) \
  133. P(floor) \
  134. P(fontcolor) \
  135. P(fontsize) \
  136. P(forEach) \
  137. P(freeze) \
  138. P(from) \
  139. P(fromCharCode) \
  140. P(fromCodePoint) \
  141. P(fromEntries) \
  142. P(fromEpochMicroseconds) \
  143. P(fromEpochMilliseconds) \
  144. P(fromEpochNanoseconds) \
  145. P(fromEpochSeconds) \
  146. P(fround) \
  147. P(gc) \
  148. P(get) \
  149. P(getBigInt64) \
  150. P(getBigUint64) \
  151. P(getDate) \
  152. P(getDay) \
  153. P(getFloat32) \
  154. P(getFloat64) \
  155. P(getFullYear) \
  156. P(getHours) \
  157. P(getInt8) \
  158. P(getInt16) \
  159. P(getInt32) \
  160. P(getMilliseconds) \
  161. P(getMinutes) \
  162. P(getMonth) \
  163. P(getOwnPropertyDescriptor) \
  164. P(getOwnPropertyDescriptors) \
  165. P(getOwnPropertyNames) \
  166. P(getOwnPropertySymbols) \
  167. P(getPrototypeOf) \
  168. P(getSeconds) \
  169. P(getTime) \
  170. P(getTimezoneOffset) \
  171. P(getUint8) \
  172. P(getUint16) \
  173. P(getUint32) \
  174. P(getUTCDate) \
  175. P(getUTCDay) \
  176. P(getUTCFullYear) \
  177. P(getUTCHours) \
  178. P(getUTCMilliseconds) \
  179. P(getUTCMinutes) \
  180. P(getUTCMonth) \
  181. P(getUTCSeconds) \
  182. P(getYear) \
  183. P(global) \
  184. P(globalThis) \
  185. P(groups) \
  186. P(has) \
  187. P(hasIndices) \
  188. P(hasOwn) \
  189. P(hasOwnProperty) \
  190. P(hypot) \
  191. P(id) \
  192. P(ignoreCase) \
  193. P(imul) \
  194. P(includes) \
  195. P(index) \
  196. P(indexOf) \
  197. P(indices) \
  198. P(info) \
  199. P(input) \
  200. P(instant) \
  201. P(is) \
  202. P(isArray) \
  203. P(isExtensible) \
  204. P(isFinite) \
  205. P(isFrozen) \
  206. P(isInteger) \
  207. P(isNaN) \
  208. P(isPrototypeOf) \
  209. P(isSafeInteger) \
  210. P(isSealed) \
  211. P(isView) \
  212. P(italics) \
  213. P(join) \
  214. P(keyFor) \
  215. P(keys) \
  216. P(lastIndex) \
  217. P(lastIndexOf) \
  218. P(length) \
  219. P(link) \
  220. P(log) \
  221. P(log1p) \
  222. P(log2) \
  223. P(log10) \
  224. P(map) \
  225. P(max) \
  226. P(message) \
  227. P(min) \
  228. P(multiline) \
  229. P(name) \
  230. P(next) \
  231. P(now) \
  232. P(of) \
  233. P(ownKeys) \
  234. P(padEnd) \
  235. P(padStart) \
  236. P(parse) \
  237. P(parseFloat) \
  238. P(parseInt) \
  239. P(pop) \
  240. P(pow) \
  241. P(preventExtensions) \
  242. P(propertyIsEnumerable) \
  243. P(prototype) \
  244. P(proxy) \
  245. P(push) \
  246. P(race) \
  247. P(random) \
  248. P(raw) \
  249. P(reduce) \
  250. P(reduceRight) \
  251. P(reject) \
  252. P(repeat) \
  253. P(resolve) \
  254. P(reverse) \
  255. P(revocable) \
  256. P(revoke) \
  257. P(round) \
  258. P(seal) \
  259. P(set) \
  260. P(setBigInt64) \
  261. P(setBigUint64) \
  262. P(setDate) \
  263. P(setFloat32) \
  264. P(setFloat64) \
  265. P(setFullYear) \
  266. P(setHours) \
  267. P(setInt8) \
  268. P(setInt16) \
  269. P(setInt32) \
  270. P(setMilliseconds) \
  271. P(setMinutes) \
  272. P(setMonth) \
  273. P(setPrototypeOf) \
  274. P(setSeconds) \
  275. P(setTime) \
  276. P(setUint8) \
  277. P(setUint16) \
  278. P(setUint32) \
  279. P(setUTCDate) \
  280. P(setUTCFullYear) \
  281. P(setUTCHours) \
  282. P(setUTCMilliseconds) \
  283. P(setUTCMinutes) \
  284. P(setUTCMonth) \
  285. P(setUTCSeconds) \
  286. P(setYear) \
  287. P(shift) \
  288. P(sign) \
  289. P(sin) \
  290. P(sinh) \
  291. P(size) \
  292. P(slice) \
  293. P(small) \
  294. P(some) \
  295. P(sort) \
  296. P(source) \
  297. P(splice) \
  298. P(sqrt) \
  299. P(startsWith) \
  300. P(sticky) \
  301. P(strike) \
  302. P(stringify) \
  303. P(sub) \
  304. P(subarray) \
  305. P(substr) \
  306. P(substring) \
  307. P(sup) \
  308. P(tan) \
  309. P(tanh) \
  310. P(test) \
  311. P(then) \
  312. P(timeZone) \
  313. P(toDateString) \
  314. P(toFixed) \
  315. P(toGMTString) \
  316. P(toISOString) \
  317. P(toJSON) \
  318. P(toLocaleDateString) \
  319. P(toLocaleString) \
  320. P(toLocaleTimeString) \
  321. P(toLowerCase) \
  322. P(toString) \
  323. P(toTemporalInstant) \
  324. P(toTimeString) \
  325. P(toUpperCase) \
  326. P(toUTCString) \
  327. P(trace) \
  328. P(trim) \
  329. P(trimEnd) \
  330. P(trimLeft) \
  331. P(trimRight) \
  332. P(trimStart) \
  333. P(trunc) \
  334. P(undefined) \
  335. P(unescape) \
  336. P(unicode) \
  337. P(unregister) \
  338. P(unshift) \
  339. P(value) \
  340. P(valueOf) \
  341. P(values) \
  342. P(warn) \
  343. P(writable)
  344. struct CommonPropertyNames {
  345. PropertyName catch_ { "catch", PropertyName::StringMayBeNumber::No };
  346. PropertyName delete_ { "delete", PropertyName::StringMayBeNumber::No };
  347. PropertyName for_ { "for", PropertyName::StringMayBeNumber::No };
  348. PropertyName register_ { "register", PropertyName::StringMayBeNumber::No };
  349. PropertyName return_ { "return", PropertyName::StringMayBeNumber::No };
  350. PropertyName throw_ { "throw", PropertyName::StringMayBeNumber::No };
  351. #define __ENUMERATE(x) PropertyName x { #x, PropertyName::StringMayBeNumber::No };
  352. ENUMERATE_STANDARD_PROPERTY_NAMES(__ENUMERATE)
  353. #undef __ENUMERATE
  354. #define __JS_ENUMERATE(x, a, b, c, t) PropertyName x { #x, PropertyName::StringMayBeNumber::No };
  355. JS_ENUMERATE_BUILTIN_TYPES
  356. #undef __JS_ENUMERATE
  357. #define __JS_ENUMERATE(x, a, b, c) PropertyName x { #x, PropertyName::StringMayBeNumber::No };
  358. JS_ENUMERATE_TEMPORAL_OBJECTS
  359. #undef __JS_ENUMERATE
  360. #define __JS_ENUMERATE(x, a) PropertyName x { #x, PropertyName::StringMayBeNumber::No };
  361. JS_ENUMERATE_WELL_KNOWN_SYMBOLS
  362. #undef __JS_ENUMERATE
  363. };
  364. }