Forward.h 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright notice, this
  9. * list of conditions and the following disclaimer.
  10. *
  11. * 2. Redistributions in binary form must reproduce the above copyright notice,
  12. * this list of conditions and the following disclaimer in the documentation
  13. * and/or other materials provided with the distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  16. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  19. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  21. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  22. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  23. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  24. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. #pragma once
  27. #define JS_ENUMERATE_NATIVE_OBJECTS \
  28. __JS_ENUMERATE(Array, array, ArrayPrototype, ArrayConstructor) \
  29. __JS_ENUMERATE(BigIntObject, bigint, BigIntPrototype, BigIntConstructor) \
  30. __JS_ENUMERATE(BooleanObject, boolean, BooleanPrototype, BooleanConstructor) \
  31. __JS_ENUMERATE(Date, date, DatePrototype, DateConstructor) \
  32. __JS_ENUMERATE(Error, error, ErrorPrototype, ErrorConstructor) \
  33. __JS_ENUMERATE(Function, function, FunctionPrototype, FunctionConstructor) \
  34. __JS_ENUMERATE(NumberObject, number, NumberPrototype, NumberConstructor) \
  35. __JS_ENUMERATE(Object, object, ObjectPrototype, ObjectConstructor) \
  36. __JS_ENUMERATE(ProxyObject, proxy, ProxyPrototype, ProxyConstructor) \
  37. __JS_ENUMERATE(RegExpObject, regexp, RegExpPrototype, RegExpConstructor) \
  38. __JS_ENUMERATE(StringObject, string, StringPrototype, StringConstructor) \
  39. __JS_ENUMERATE(SymbolObject, symbol, SymbolPrototype, SymbolConstructor)
  40. #define JS_ENUMERATE_ERROR_SUBCLASSES \
  41. __JS_ENUMERATE(EvalError, eval_error, EvalErrorPrototype, EvalErrorConstructor) \
  42. __JS_ENUMERATE(InternalError, internal_error, InternalErrorPrototype, InternalErrorConstructor) \
  43. __JS_ENUMERATE(RangeError, range_error, RangeErrorPrototype, RangeErrorConstructor) \
  44. __JS_ENUMERATE(ReferenceError, reference_error, ReferenceErrorPrototype, ReferenceErrorConstructor) \
  45. __JS_ENUMERATE(SyntaxError, syntax_error, SyntaxErrorPrototype, SyntaxErrorConstructor) \
  46. __JS_ENUMERATE(TypeError, type_error, TypeErrorPrototype, TypeErrorConstructor) \
  47. __JS_ENUMERATE(URIError, uri_error, URIErrorPrototype, URIErrorConstructor)
  48. #define JS_ENUMERATE_BUILTIN_TYPES \
  49. JS_ENUMERATE_NATIVE_OBJECTS \
  50. JS_ENUMERATE_ERROR_SUBCLASSES
  51. namespace JS {
  52. class ASTNode;
  53. class BigInt;
  54. class BoundFunction;
  55. class Cell;
  56. class DeferGC;
  57. class Error;
  58. class Exception;
  59. class Expression;
  60. class Accessor;
  61. class GlobalObject;
  62. class HandleImpl;
  63. class Heap;
  64. class HeapBlock;
  65. class Interpreter;
  66. class LexicalEnvironment;
  67. class MarkedValueList;
  68. class PrimitiveString;
  69. class Reference;
  70. class ScopeNode;
  71. class Shape;
  72. class Statement;
  73. class Symbol;
  74. class Token;
  75. class Uint8ClampedArray;
  76. class Value;
  77. enum class DeclarationKind;
  78. #define __JS_ENUMERATE(ClassName, snake_name, ConstructorName, PrototypeName) \
  79. class ClassName; \
  80. class ConstructorName; \
  81. class PrototypeName;
  82. JS_ENUMERATE_BUILTIN_TYPES
  83. #undef __JS_ENUMERATE
  84. struct Argument;
  85. template<class T>
  86. class Handle;
  87. }