CommonPropertyNames.h 14 KB

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