primordials.cjs 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _messages = require("./messages.cjs");
  6. function uncurryThis(target) {
  7. return (thisArg, ...args) => {
  8. return ReflectApply(target, thisArg, args);
  9. };
  10. }
  11. function uncurryThisGetter(target, key) {
  12. return uncurryThis(ReflectGetOwnPropertyDescriptor(target, key).get);
  13. }
  14. const {
  15. apply: ReflectApply,
  16. construct: ReflectConstruct,
  17. defineProperty: ReflectDefineProperty,
  18. get: ReflectGet,
  19. getOwnPropertyDescriptor: ReflectGetOwnPropertyDescriptor,
  20. getPrototypeOf: ReflectGetPrototypeOf,
  21. has: ReflectHas,
  22. ownKeys: ReflectOwnKeys,
  23. set: ReflectSet,
  24. setPrototypeOf: ReflectSetPrototypeOf
  25. } = Reflect;
  26. exports.ReflectSetPrototypeOf = ReflectSetPrototypeOf;
  27. exports.ReflectSet = ReflectSet;
  28. exports.ReflectOwnKeys = ReflectOwnKeys;
  29. exports.ReflectHas = ReflectHas;
  30. exports.ReflectGetPrototypeOf = ReflectGetPrototypeOf;
  31. exports.ReflectGetOwnPropertyDescriptor = ReflectGetOwnPropertyDescriptor;
  32. exports.ReflectGet = ReflectGet;
  33. exports.ReflectDefineProperty = ReflectDefineProperty;
  34. exports.ReflectConstruct = ReflectConstruct;
  35. exports.ReflectApply = ReflectApply;
  36. const NativeProxy = Proxy;
  37. exports.NativeProxy = NativeProxy;
  38. const {
  39. MAX_SAFE_INTEGER,
  40. isFinite: NumberIsFinite,
  41. isNaN: NumberIsNaN
  42. } = Number;
  43. exports.NumberIsNaN = NumberIsNaN;
  44. exports.NumberIsFinite = NumberIsFinite;
  45. exports.MAX_SAFE_INTEGER = MAX_SAFE_INTEGER;
  46. const {
  47. iterator: SymbolIterator,
  48. species: SymbolSpecies,
  49. toStringTag: SymbolToStringTag,
  50. for: SymbolFor
  51. } = Symbol;
  52. exports.SymbolFor = SymbolFor;
  53. exports.SymbolToStringTag = SymbolToStringTag;
  54. exports.SymbolSpecies = SymbolSpecies;
  55. exports.SymbolIterator = SymbolIterator;
  56. const NativeObject = Object;
  57. exports.NativeObject = NativeObject;
  58. const {
  59. create: ObjectCreate,
  60. defineProperty: ObjectDefineProperty,
  61. freeze: ObjectFreeze,
  62. is: ObjectIs
  63. } = NativeObject;
  64. exports.ObjectIs = ObjectIs;
  65. exports.ObjectFreeze = ObjectFreeze;
  66. exports.ObjectDefineProperty = ObjectDefineProperty;
  67. exports.ObjectCreate = ObjectCreate;
  68. const ObjectPrototype = NativeObject.prototype;
  69. const ObjectPrototype__lookupGetter__ = ObjectPrototype.__lookupGetter__ ? uncurryThis(ObjectPrototype.__lookupGetter__) : (object, key) => {
  70. if (object == null) {
  71. throw NativeTypeError(_messages.CANNOT_CONVERT_UNDEFINED_OR_NULL_TO_OBJECT);
  72. }
  73. let target = NativeObject(object);
  74. do {
  75. const descriptor = ReflectGetOwnPropertyDescriptor(target, key);
  76. if (descriptor !== undefined) {
  77. if (ObjectHasOwn(descriptor, "get")) {
  78. return descriptor.get;
  79. }
  80. return;
  81. }
  82. } while ((target = ReflectGetPrototypeOf(target)) !== null);
  83. };
  84. exports.ObjectPrototype__lookupGetter__ = ObjectPrototype__lookupGetter__;
  85. const ObjectHasOwn = NativeObject.hasOwn || uncurryThis(ObjectPrototype.hasOwnProperty);
  86. exports.ObjectHasOwn = ObjectHasOwn;
  87. const NativeArray = Array;
  88. const ArrayIsArray = NativeArray.isArray;
  89. exports.ArrayIsArray = ArrayIsArray;
  90. const ArrayPrototype = NativeArray.prototype;
  91. const ArrayPrototypeJoin = uncurryThis(ArrayPrototype.join);
  92. exports.ArrayPrototypeJoin = ArrayPrototypeJoin;
  93. const ArrayPrototypePush = uncurryThis(ArrayPrototype.push);
  94. exports.ArrayPrototypePush = ArrayPrototypePush;
  95. const ArrayPrototypeToLocaleString = uncurryThis(ArrayPrototype.toLocaleString);
  96. exports.ArrayPrototypeToLocaleString = ArrayPrototypeToLocaleString;
  97. const NativeArrayPrototypeSymbolIterator = ArrayPrototype[SymbolIterator];
  98. exports.NativeArrayPrototypeSymbolIterator = NativeArrayPrototypeSymbolIterator;
  99. const ArrayPrototypeSymbolIterator = uncurryThis(NativeArrayPrototypeSymbolIterator);
  100. exports.ArrayPrototypeSymbolIterator = ArrayPrototypeSymbolIterator;
  101. const MathTrunc = Math.trunc;
  102. exports.MathTrunc = MathTrunc;
  103. const NativeArrayBuffer = ArrayBuffer;
  104. exports.NativeArrayBuffer = NativeArrayBuffer;
  105. const ArrayBufferIsView = NativeArrayBuffer.isView;
  106. exports.ArrayBufferIsView = ArrayBufferIsView;
  107. const ArrayBufferPrototype = NativeArrayBuffer.prototype;
  108. const ArrayBufferPrototypeSlice = uncurryThis(ArrayBufferPrototype.slice);
  109. exports.ArrayBufferPrototypeSlice = ArrayBufferPrototypeSlice;
  110. const ArrayBufferPrototypeGetByteLength = uncurryThisGetter(ArrayBufferPrototype, "byteLength");
  111. exports.ArrayBufferPrototypeGetByteLength = ArrayBufferPrototypeGetByteLength;
  112. const NativeSharedArrayBuffer = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : null;
  113. exports.NativeSharedArrayBuffer = NativeSharedArrayBuffer;
  114. const SharedArrayBufferPrototypeGetByteLength = NativeSharedArrayBuffer && uncurryThisGetter(NativeSharedArrayBuffer.prototype, "byteLength");
  115. exports.SharedArrayBufferPrototypeGetByteLength = SharedArrayBufferPrototypeGetByteLength;
  116. const TypedArray = ReflectGetPrototypeOf(Uint8Array);
  117. exports.TypedArray = TypedArray;
  118. const TypedArrayFrom = TypedArray.from;
  119. const TypedArrayPrototype = TypedArray.prototype;
  120. exports.TypedArrayPrototype = TypedArrayPrototype;
  121. const NativeTypedArrayPrototypeSymbolIterator = TypedArrayPrototype[SymbolIterator];
  122. exports.NativeTypedArrayPrototypeSymbolIterator = NativeTypedArrayPrototypeSymbolIterator;
  123. const TypedArrayPrototypeKeys = uncurryThis(TypedArrayPrototype.keys);
  124. exports.TypedArrayPrototypeKeys = TypedArrayPrototypeKeys;
  125. const TypedArrayPrototypeValues = uncurryThis(TypedArrayPrototype.values);
  126. exports.TypedArrayPrototypeValues = TypedArrayPrototypeValues;
  127. const TypedArrayPrototypeEntries = uncurryThis(TypedArrayPrototype.entries);
  128. exports.TypedArrayPrototypeEntries = TypedArrayPrototypeEntries;
  129. const TypedArrayPrototypeSet = uncurryThis(TypedArrayPrototype.set);
  130. exports.TypedArrayPrototypeSet = TypedArrayPrototypeSet;
  131. const TypedArrayPrototypeReverse = uncurryThis(TypedArrayPrototype.reverse);
  132. exports.TypedArrayPrototypeReverse = TypedArrayPrototypeReverse;
  133. const TypedArrayPrototypeFill = uncurryThis(TypedArrayPrototype.fill);
  134. exports.TypedArrayPrototypeFill = TypedArrayPrototypeFill;
  135. const TypedArrayPrototypeCopyWithin = uncurryThis(TypedArrayPrototype.copyWithin);
  136. exports.TypedArrayPrototypeCopyWithin = TypedArrayPrototypeCopyWithin;
  137. const TypedArrayPrototypeSort = uncurryThis(TypedArrayPrototype.sort);
  138. exports.TypedArrayPrototypeSort = TypedArrayPrototypeSort;
  139. const TypedArrayPrototypeSlice = uncurryThis(TypedArrayPrototype.slice);
  140. exports.TypedArrayPrototypeSlice = TypedArrayPrototypeSlice;
  141. const TypedArrayPrototypeSubarray = uncurryThis(TypedArrayPrototype.subarray);
  142. exports.TypedArrayPrototypeSubarray = TypedArrayPrototypeSubarray;
  143. const TypedArrayPrototypeGetBuffer = uncurryThisGetter(TypedArrayPrototype, "buffer");
  144. exports.TypedArrayPrototypeGetBuffer = TypedArrayPrototypeGetBuffer;
  145. const TypedArrayPrototypeGetByteOffset = uncurryThisGetter(TypedArrayPrototype, "byteOffset");
  146. exports.TypedArrayPrototypeGetByteOffset = TypedArrayPrototypeGetByteOffset;
  147. const TypedArrayPrototypeGetLength = uncurryThisGetter(TypedArrayPrototype, "length");
  148. exports.TypedArrayPrototypeGetLength = TypedArrayPrototypeGetLength;
  149. const TypedArrayPrototypeGetSymbolToStringTag = uncurryThisGetter(TypedArrayPrototype, SymbolToStringTag);
  150. exports.TypedArrayPrototypeGetSymbolToStringTag = TypedArrayPrototypeGetSymbolToStringTag;
  151. const NativeUint16Array = Uint16Array;
  152. exports.NativeUint16Array = NativeUint16Array;
  153. const Uint16ArrayFrom = (...args) => {
  154. return ReflectApply(TypedArrayFrom, NativeUint16Array, args);
  155. };
  156. exports.Uint16ArrayFrom = Uint16ArrayFrom;
  157. const NativeUint32Array = Uint32Array;
  158. exports.NativeUint32Array = NativeUint32Array;
  159. const NativeFloat32Array = Float32Array;
  160. exports.NativeFloat32Array = NativeFloat32Array;
  161. const ArrayIteratorPrototype = ReflectGetPrototypeOf([][SymbolIterator]());
  162. exports.ArrayIteratorPrototype = ArrayIteratorPrototype;
  163. const ArrayIteratorPrototypeNext = uncurryThis(ArrayIteratorPrototype.next);
  164. exports.ArrayIteratorPrototypeNext = ArrayIteratorPrototypeNext;
  165. const GeneratorPrototypeNext = uncurryThis(function* () {}().next);
  166. exports.GeneratorPrototypeNext = GeneratorPrototypeNext;
  167. const IteratorPrototype = ReflectGetPrototypeOf(ArrayIteratorPrototype);
  168. exports.IteratorPrototype = IteratorPrototype;
  169. const DataViewPrototype = DataView.prototype;
  170. const DataViewPrototypeGetUint16 = uncurryThis(DataViewPrototype.getUint16);
  171. exports.DataViewPrototypeGetUint16 = DataViewPrototypeGetUint16;
  172. const DataViewPrototypeSetUint16 = uncurryThis(DataViewPrototype.setUint16);
  173. exports.DataViewPrototypeSetUint16 = DataViewPrototypeSetUint16;
  174. const NativeTypeError = TypeError;
  175. exports.NativeTypeError = NativeTypeError;
  176. const NativeRangeError = RangeError;
  177. exports.NativeRangeError = NativeRangeError;
  178. const NativeWeakSet = WeakSet;
  179. exports.NativeWeakSet = NativeWeakSet;
  180. const WeakSetPrototype = NativeWeakSet.prototype;
  181. const WeakSetPrototypeAdd = uncurryThis(WeakSetPrototype.add);
  182. exports.WeakSetPrototypeAdd = WeakSetPrototypeAdd;
  183. const WeakSetPrototypeHas = uncurryThis(WeakSetPrototype.has);
  184. exports.WeakSetPrototypeHas = WeakSetPrototypeHas;
  185. const NativeWeakMap = WeakMap;
  186. exports.NativeWeakMap = NativeWeakMap;
  187. const WeakMapPrototype = NativeWeakMap.prototype;
  188. const WeakMapPrototypeGet = uncurryThis(WeakMapPrototype.get);
  189. exports.WeakMapPrototypeGet = WeakMapPrototypeGet;
  190. const WeakMapPrototypeHas = uncurryThis(WeakMapPrototype.has);
  191. exports.WeakMapPrototypeHas = WeakMapPrototypeHas;
  192. const WeakMapPrototypeSet = uncurryThis(WeakMapPrototype.set);
  193. exports.WeakMapPrototypeSet = WeakMapPrototypeSet;