EngineInterfaceObjectBuiltIns.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
  4. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  5. //-------------------------------------------------------------------------------------------------------
  6. // shim out common fallbacks
  7. #ifndef GlobalBuiltInConstructor
  8. #define GlobalBuiltInConstructor(Ctor)
  9. #endif
  10. #ifndef GlobalMathBuiltIn
  11. #define GlobalMathBuiltIn(method)
  12. #endif
  13. #ifndef GlobalBuiltIn
  14. #define GlobalBuiltIn(class, method)
  15. #endif
  16. #ifndef BuiltInRaiseException
  17. #define BuiltInRaiseException(T, id)
  18. #endif
  19. #ifndef BuiltInRaiseException1
  20. #define BuiltInRaiseException1(T, id) BuiltInRaiseException(T, id)
  21. #endif
  22. #ifndef BuiltInRaiseException1
  23. #define BuiltInRaiseException1(T, id) BuiltInRaiseException(T, id)
  24. #endif
  25. #ifndef BuiltInRaiseException2
  26. #define BuiltInRaiseException2(T, id) BuiltInRaiseException(T, id)
  27. #endif
  28. #ifndef BuiltInRaiseException3
  29. #define BuiltInRaiseException3(T, id) BuiltInRaiseException(T, id##_3)
  30. #endif
  31. #ifndef EngineInterfaceBuiltIn2
  32. #define EngineInterfaceBuiltIn2(propID, method)
  33. #endif
  34. #ifndef EngineInterfaceBuiltIn
  35. #define EngineInterfaceBuiltIn(name) EngineInterfaceBuiltIn2(builtIn##name, name)
  36. #endif
  37. GlobalBuiltInConstructor(Boolean)
  38. GlobalBuiltInConstructor(Object)
  39. GlobalBuiltInConstructor(Number)
  40. GlobalBuiltInConstructor(RegExp)
  41. GlobalBuiltInConstructor(String)
  42. GlobalBuiltInConstructor(Date)
  43. GlobalBuiltInConstructor(Error) // TODO(jahorto): consider deleting (currently used by WinRT Promises)
  44. GlobalBuiltInConstructor(Map) // TODO(jahorto): consider deleting (when do we need a Map over an object?)
  45. GlobalBuiltInConstructor(Symbol)
  46. GlobalMathBuiltIn(Abs)
  47. GlobalMathBuiltIn(Floor)
  48. GlobalMathBuiltIn(Pow)
  49. GlobalBuiltIn(JavascriptObject, DefineProperty)
  50. GlobalBuiltIn(JavascriptObject, GetPrototypeOf)
  51. GlobalBuiltIn(JavascriptObject, IsExtensible)
  52. GlobalBuiltIn(JavascriptObject, GetOwnPropertyNames)
  53. GlobalBuiltIn(JavascriptObject, HasOwnProperty)
  54. GlobalBuiltIn(JavascriptObject, Keys)
  55. GlobalBuiltIn(JavascriptObject, Create)
  56. GlobalBuiltIn(JavascriptObject, GetOwnPropertyDescriptor)
  57. GlobalBuiltIn(JavascriptObject, PreventExtensions)
  58. GlobalBuiltIn(JavascriptArray, Join)
  59. GlobalBuiltIn(JavascriptArray, Map)
  60. GlobalBuiltIn(JavascriptArray, Slice)
  61. GlobalBuiltIn(JavascriptArray, Concat)
  62. GlobalBuiltIn(JavascriptFunction, Bind)
  63. GlobalBuiltIn(JavascriptFunction, Apply)
  64. GlobalBuiltIn(JavascriptDate, GetDate)
  65. GlobalBuiltIn(JavascriptDate, Now)
  66. GlobalBuiltIn(JavascriptString, Replace)
  67. GlobalBuiltIn(JavascriptString, ToLowerCase)
  68. GlobalBuiltIn(JavascriptString, ToUpperCase)
  69. GlobalBuiltIn(JavascriptString, Split)
  70. GlobalBuiltIn(JavascriptString, Substring)
  71. GlobalBuiltIn(JavascriptString, Repeat)
  72. GlobalBuiltIn(JavascriptString, IndexOf)
  73. GlobalBuiltIn(GlobalObject, IsFinite) // TODO(jahorto): consider switching to Number.isFinite
  74. GlobalBuiltIn(GlobalObject, IsNaN) // TODO(jahorto): consider switching to Number.isNaN
  75. GlobalBuiltIn(GlobalObject, Eval) // TODO(jahorto): consider deleting (currently used by WinRT Promises)
  76. BuiltInRaiseException(TypeError, NeedObject)
  77. BuiltInRaiseException2(TypeError, ObjectIsAlreadyInitialized)
  78. BuiltInRaiseException3(RangeError, OptionValueOutOfRange)
  79. BuiltInRaiseException(RangeError, OptionValueOutOfRange)
  80. BuiltInRaiseException1(TypeError, NeedObjectOrString)
  81. BuiltInRaiseException1(RangeError, LocaleNotWellFormed)
  82. BuiltInRaiseException1(TypeError, This_NullOrUndefined)
  83. BuiltInRaiseException1(TypeError, NotAConstructor)
  84. BuiltInRaiseException1(TypeError, ObjectIsNonExtensible)
  85. BuiltInRaiseException1(TypeError, LengthIsTooBig)
  86. BuiltInRaiseException1(TypeError, NonObjectFromIterable)
  87. BuiltInRaiseException1(TypeError, EmptyArrayAndInitValueNotPresent)
  88. BuiltInRaiseException2(TypeError, NeedObjectOfType)
  89. BuiltInRaiseException1(RangeError, InvalidCurrencyCode)
  90. BuiltInRaiseException(TypeError, MissingCurrencyCode)
  91. BuiltInRaiseException(RangeError, InvalidDate)
  92. BuiltInRaiseException1(TypeError, FunctionArgument_NeedFunction)
  93. EngineInterfaceBuiltIn2(getErrorMessage, GetErrorMessage)
  94. EngineInterfaceBuiltIn2(logDebugMessage, LogDebugMessage)
  95. EngineInterfaceBuiltIn2(tagPublicLibraryCode, TagPublicLibraryCode)
  96. EngineInterfaceBuiltIn(SetPrototype)
  97. EngineInterfaceBuiltIn(GetArrayLength)
  98. EngineInterfaceBuiltIn(RegexMatch)
  99. #undef GlobalBuiltInConstructor
  100. #undef GlobalMathBuiltIn
  101. #undef GlobalBuiltIn
  102. #undef BuiltInRaiseException
  103. #undef BuiltInRaiseException1
  104. #undef BuiltInRaiseException1
  105. #undef BuiltInRaiseException2
  106. #undef BuiltInRaiseException3
  107. #undef EngineInterfaceBuiltIn2
  108. #undef EngineInterfaceBuiltIn