@nubjs/nub-darwin-x64 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/bin/nub +0 -0
  2. package/bin/nubx +0 -0
  3. package/package.json +2 -3
  4. package/runtime/addons/nub-native.node +0 -0
  5. package/runtime/cache-evict.mjs +0 -69
  6. package/runtime/compile-cache-restore.mjs +0 -21
  7. package/runtime/floor-builtin.mjs +0 -57
  8. package/runtime/navigator-locks.mjs +0 -242
  9. package/runtime/navigator-shim.mjs +0 -144
  10. package/runtime/node_modules/@js-temporal/polyfill/CHANGELOG.md +0 -453
  11. package/runtime/node_modules/@js-temporal/polyfill/LICENSE +0 -13
  12. package/runtime/node_modules/@js-temporal/polyfill/README.md +0 -90
  13. package/runtime/node_modules/@js-temporal/polyfill/dist/index.cjs +0 -2
  14. package/runtime/node_modules/@js-temporal/polyfill/dist/index.cjs.map +0 -1
  15. package/runtime/node_modules/@js-temporal/polyfill/dist/index.esm.js +0 -2
  16. package/runtime/node_modules/@js-temporal/polyfill/dist/index.esm.js.map +0 -1
  17. package/runtime/node_modules/@js-temporal/polyfill/dist/index.umd.js +0 -2
  18. package/runtime/node_modules/@js-temporal/polyfill/dist/index.umd.js.map +0 -1
  19. package/runtime/node_modules/@js-temporal/polyfill/index.d.cts +0 -1215
  20. package/runtime/node_modules/@js-temporal/polyfill/index.d.ts +0 -1215
  21. package/runtime/node_modules/@js-temporal/polyfill/lib/assert.ts +0 -8
  22. package/runtime/node_modules/@js-temporal/polyfill/lib/bigintmath.ts +0 -39
  23. package/runtime/node_modules/@js-temporal/polyfill/lib/calendar.ts +0 -2424
  24. package/runtime/node_modules/@js-temporal/polyfill/lib/debug.ts +0 -7
  25. package/runtime/node_modules/@js-temporal/polyfill/lib/duration.ts +0 -438
  26. package/runtime/node_modules/@js-temporal/polyfill/lib/durationformat.d.ts +0 -93
  27. package/runtime/node_modules/@js-temporal/polyfill/lib/ecmascript.ts +0 -4973
  28. package/runtime/node_modules/@js-temporal/polyfill/lib/index.ts +0 -34
  29. package/runtime/node_modules/@js-temporal/polyfill/lib/init.ts +0 -43
  30. package/runtime/node_modules/@js-temporal/polyfill/lib/instant.ts +0 -138
  31. package/runtime/node_modules/@js-temporal/polyfill/lib/internaltypes.d.ts +0 -242
  32. package/runtime/node_modules/@js-temporal/polyfill/lib/intl.ts +0 -758
  33. package/runtime/node_modules/@js-temporal/polyfill/lib/intrinsicclass.ts +0 -162
  34. package/runtime/node_modules/@js-temporal/polyfill/lib/legacydate.ts +0 -17
  35. package/runtime/node_modules/@js-temporal/polyfill/lib/math.ts +0 -96
  36. package/runtime/node_modules/@js-temporal/polyfill/lib/now.ts +0 -48
  37. package/runtime/node_modules/@js-temporal/polyfill/lib/plaindate.ts +0 -212
  38. package/runtime/node_modules/@js-temporal/polyfill/lib/plaindatetime.ts +0 -274
  39. package/runtime/node_modules/@js-temporal/polyfill/lib/plainmonthday.ts +0 -110
  40. package/runtime/node_modules/@js-temporal/polyfill/lib/plaintime.ts +0 -154
  41. package/runtime/node_modules/@js-temporal/polyfill/lib/plainyearmonth.ts +0 -157
  42. package/runtime/node_modules/@js-temporal/polyfill/lib/regex.ts +0 -59
  43. package/runtime/node_modules/@js-temporal/polyfill/lib/slots.ts +0 -341
  44. package/runtime/node_modules/@js-temporal/polyfill/lib/temporal.ts +0 -10
  45. package/runtime/node_modules/@js-temporal/polyfill/lib/timeduration.ts +0 -149
  46. package/runtime/node_modules/@js-temporal/polyfill/lib/zoneddatetime.ts +0 -492
  47. package/runtime/node_modules/@js-temporal/polyfill/package.json +0 -143
  48. package/runtime/node_modules/@oxc-project/runtime/CHANGELOG.md +0 -88
  49. package/runtime/node_modules/@oxc-project/runtime/LICENSE +0 -22
  50. package/runtime/node_modules/@oxc-project/runtime/README.md +0 -5
  51. package/runtime/node_modules/@oxc-project/runtime/package.json +0 -1066
  52. package/runtime/node_modules/@oxc-project/runtime/src/helpers/AwaitValue.js +0 -4
  53. package/runtime/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js +0 -4
  54. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecoratedDescriptor.js +0 -9
  55. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs.js +0 -236
  56. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2203.js +0 -184
  57. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2203R.js +0 -191
  58. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2301.js +0 -222
  59. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2305.js +0 -133
  60. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2311.js +0 -124
  61. package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayLikeToArray.js +0 -6
  62. package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayWithHoles.js +0 -4
  63. package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayWithoutHoles.js +0 -5
  64. package/runtime/node_modules/@oxc-project/runtime/src/helpers/assertClassBrand.js +0 -5
  65. package/runtime/node_modules/@oxc-project/runtime/src/helpers/assertThisInitialized.js +0 -5
  66. package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js +0 -24
  67. package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js +0 -45
  68. package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncToGenerator.js +0 -26
  69. package/runtime/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js +0 -5
  70. package/runtime/node_modules/@oxc-project/runtime/src/helpers/callSuper.js +0 -7
  71. package/runtime/node_modules/@oxc-project/runtime/src/helpers/checkInRHS.js +0 -6
  72. package/runtime/node_modules/@oxc-project/runtime/src/helpers/checkPrivateRedeclaration.js +0 -4
  73. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorDestructureSet.js +0 -10
  74. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorGet.js +0 -4
  75. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorSet.js +0 -7
  76. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCallCheck.js +0 -4
  77. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCheckPrivateStaticAccess.js +0 -5
  78. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCheckPrivateStaticFieldDescriptor.js +0 -4
  79. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classExtractFieldDescriptor.js +0 -5
  80. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classNameTDZError.js +0 -4
  81. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldDestructureSet.js +0 -7
  82. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldGet.js +0 -7
  83. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldGet2.js +0 -5
  84. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldInitSpec.js +0 -5
  85. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldLooseBase.js +0 -5
  86. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldLooseKey.js +0 -5
  87. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldSet.js +0 -7
  88. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldSet2.js +0 -5
  89. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateGetter.js +0 -5
  90. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodGet.js +0 -5
  91. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodInitSpec.js +0 -5
  92. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodSet.js +0 -4
  93. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateSetter.js +0 -5
  94. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldDestructureSet.js +0 -7
  95. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldSpecGet.js +0 -7
  96. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldSpecSet.js +0 -7
  97. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateMethodGet.js +0 -5
  98. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateMethodSet.js +0 -4
  99. package/runtime/node_modules/@oxc-project/runtime/src/helpers/construct.js +0 -10
  100. package/runtime/node_modules/@oxc-project/runtime/src/helpers/createClass.js +0 -13
  101. package/runtime/node_modules/@oxc-project/runtime/src/helpers/createForOfIteratorHelper.js +0 -50
  102. package/runtime/node_modules/@oxc-project/runtime/src/helpers/createForOfIteratorHelperLoose.js +0 -19
  103. package/runtime/node_modules/@oxc-project/runtime/src/helpers/createSuper.js +0 -16
  104. package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorate.js +0 -23
  105. package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorateMetadata.js +0 -9
  106. package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorateParam.js +0 -11
  107. package/runtime/node_modules/@oxc-project/runtime/src/helpers/defaults.js +0 -9
  108. package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineAccessor.js +0 -8
  109. package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineEnumerableProperties.js +0 -12
  110. package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js +0 -10
  111. package/runtime/node_modules/@oxc-project/runtime/src/helpers/dispose.js +0 -28
  112. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/AwaitValue.js +0 -4
  113. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/OverloadYield.js +0 -4
  114. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecoratedDescriptor.js +0 -9
  115. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs.js +0 -236
  116. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2203.js +0 -184
  117. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2203R.js +0 -191
  118. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2301.js +0 -222
  119. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2305.js +0 -133
  120. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2311.js +0 -124
  121. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayLikeToArray.js +0 -6
  122. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayWithHoles.js +0 -4
  123. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayWithoutHoles.js +0 -5
  124. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/assertClassBrand.js +0 -5
  125. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/assertThisInitialized.js +0 -5
  126. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncGeneratorDelegate.js +0 -24
  127. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncIterator.js +0 -45
  128. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncToGenerator.js +0 -26
  129. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/awaitAsyncGenerator.js +0 -5
  130. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/callSuper.js +0 -7
  131. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/checkInRHS.js +0 -6
  132. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/checkPrivateRedeclaration.js +0 -4
  133. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorDestructureSet.js +0 -10
  134. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorGet.js +0 -4
  135. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorSet.js +0 -7
  136. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCallCheck.js +0 -4
  137. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCheckPrivateStaticAccess.js +0 -5
  138. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +0 -4
  139. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classExtractFieldDescriptor.js +0 -5
  140. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classNameTDZError.js +0 -4
  141. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldDestructureSet.js +0 -7
  142. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldGet.js +0 -7
  143. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldGet2.js +0 -5
  144. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldInitSpec.js +0 -5
  145. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldLooseBase.js +0 -5
  146. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldLooseKey.js +0 -5
  147. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldSet.js +0 -7
  148. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldSet2.js +0 -5
  149. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateGetter.js +0 -5
  150. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodGet.js +0 -5
  151. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodInitSpec.js +0 -5
  152. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodSet.js +0 -4
  153. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateSetter.js +0 -5
  154. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldDestructureSet.js +0 -7
  155. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldSpecGet.js +0 -7
  156. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldSpecSet.js +0 -7
  157. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateMethodGet.js +0 -5
  158. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateMethodSet.js +0 -4
  159. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/construct.js +0 -10
  160. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createClass.js +0 -13
  161. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createForOfIteratorHelper.js +0 -50
  162. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createForOfIteratorHelperLoose.js +0 -19
  163. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createSuper.js +0 -16
  164. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorate.js +0 -21
  165. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorateMetadata.js +0 -7
  166. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorateParam.js +0 -9
  167. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defaults.js +0 -9
  168. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineAccessor.js +0 -8
  169. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineEnumerableProperties.js +0 -12
  170. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineProperty.js +0 -10
  171. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/dispose.js +0 -28
  172. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/extends.js +0 -10
  173. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/get.js +0 -11
  174. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/getPrototypeOf.js +0 -6
  175. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/identity.js +0 -4
  176. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/importDeferProxy.js +0 -27
  177. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/inherits.js +0 -14
  178. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/inheritsLoose.js +0 -5
  179. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/initializerDefineProperty.js +0 -9
  180. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/initializerWarningHelper.js +0 -4
  181. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/instanceof.js +0 -4
  182. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/interopRequireDefault.js +0 -6
  183. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/interopRequireWildcard.js +0 -27
  184. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/isNativeFunction.js +0 -8
  185. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/isNativeReflectConstruct.js +0 -9
  186. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/iterableToArray.js +0 -4
  187. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/iterableToArrayLimit.js +0 -28
  188. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/jsx.js +0 -22
  189. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/maybeArrayLike.js +0 -9
  190. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/newArrowCheck.js +0 -4
  191. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nonIterableRest.js +0 -4
  192. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nonIterableSpread.js +0 -4
  193. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nullishReceiverError.js +0 -4
  194. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectDestructuringEmpty.js +0 -4
  195. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectSpread.js +0 -14
  196. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectSpread2.js +0 -23
  197. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectWithoutProperties.js +0 -13
  198. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectWithoutPropertiesLoose.js +0 -10
  199. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/package.json +0 -3
  200. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/possibleConstructorReturn.js +0 -8
  201. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/readOnlyError.js +0 -4
  202. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/regeneratorRuntime.js +0 -304
  203. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/set.js +0 -22
  204. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/setFunctionName.js +0 -12
  205. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/setPrototypeOf.js +0 -6
  206. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/skipFirstGeneratorNext.js +0 -7
  207. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/slicedToArray.js +0 -8
  208. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropBase.js +0 -6
  209. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropGet.js +0 -9
  210. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropSet.js +0 -6
  211. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/taggedTemplateLiteral.js +0 -8
  212. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/taggedTemplateLiteralLoose.js +0 -4
  213. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/tdz.js +0 -4
  214. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/temporalRef.js +0 -6
  215. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/temporalUndefined.js +0 -2
  216. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toArray.js +0 -8
  217. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toConsumableArray.js +0 -8
  218. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toPrimitive.js +0 -12
  219. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toPropertyKey.js +0 -7
  220. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toSetter.js +0 -10
  221. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/typeof.js +0 -10
  222. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/unsupportedIterableToArray.js +0 -9
  223. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/using.js +0 -12
  224. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/usingCtx.js +0 -59
  225. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapAsyncGenerator.js +0 -69
  226. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapNativeSuper.js +0 -27
  227. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapRegExp.js +0 -51
  228. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/writeOnlyError.js +0 -4
  229. package/runtime/node_modules/@oxc-project/runtime/src/helpers/extends.js +0 -10
  230. package/runtime/node_modules/@oxc-project/runtime/src/helpers/get.js +0 -11
  231. package/runtime/node_modules/@oxc-project/runtime/src/helpers/getPrototypeOf.js +0 -6
  232. package/runtime/node_modules/@oxc-project/runtime/src/helpers/identity.js +0 -4
  233. package/runtime/node_modules/@oxc-project/runtime/src/helpers/importDeferProxy.js +0 -27
  234. package/runtime/node_modules/@oxc-project/runtime/src/helpers/inherits.js +0 -14
  235. package/runtime/node_modules/@oxc-project/runtime/src/helpers/inheritsLoose.js +0 -5
  236. package/runtime/node_modules/@oxc-project/runtime/src/helpers/initializerDefineProperty.js +0 -9
  237. package/runtime/node_modules/@oxc-project/runtime/src/helpers/initializerWarningHelper.js +0 -4
  238. package/runtime/node_modules/@oxc-project/runtime/src/helpers/instanceof.js +0 -4
  239. package/runtime/node_modules/@oxc-project/runtime/src/helpers/interopRequireDefault.js +0 -6
  240. package/runtime/node_modules/@oxc-project/runtime/src/helpers/interopRequireWildcard.js +0 -27
  241. package/runtime/node_modules/@oxc-project/runtime/src/helpers/isNativeFunction.js +0 -8
  242. package/runtime/node_modules/@oxc-project/runtime/src/helpers/isNativeReflectConstruct.js +0 -9
  243. package/runtime/node_modules/@oxc-project/runtime/src/helpers/iterableToArray.js +0 -4
  244. package/runtime/node_modules/@oxc-project/runtime/src/helpers/iterableToArrayLimit.js +0 -28
  245. package/runtime/node_modules/@oxc-project/runtime/src/helpers/jsx.js +0 -22
  246. package/runtime/node_modules/@oxc-project/runtime/src/helpers/maybeArrayLike.js +0 -9
  247. package/runtime/node_modules/@oxc-project/runtime/src/helpers/newArrowCheck.js +0 -4
  248. package/runtime/node_modules/@oxc-project/runtime/src/helpers/nonIterableRest.js +0 -4
  249. package/runtime/node_modules/@oxc-project/runtime/src/helpers/nonIterableSpread.js +0 -4
  250. package/runtime/node_modules/@oxc-project/runtime/src/helpers/nullishReceiverError.js +0 -4
  251. package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectDestructuringEmpty.js +0 -4
  252. package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectSpread.js +0 -14
  253. package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js +0 -23
  254. package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js +0 -13
  255. package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js +0 -10
  256. package/runtime/node_modules/@oxc-project/runtime/src/helpers/possibleConstructorReturn.js +0 -8
  257. package/runtime/node_modules/@oxc-project/runtime/src/helpers/readOnlyError.js +0 -4
  258. package/runtime/node_modules/@oxc-project/runtime/src/helpers/regeneratorRuntime.js +0 -304
  259. package/runtime/node_modules/@oxc-project/runtime/src/helpers/set.js +0 -22
  260. package/runtime/node_modules/@oxc-project/runtime/src/helpers/setFunctionName.js +0 -12
  261. package/runtime/node_modules/@oxc-project/runtime/src/helpers/setPrototypeOf.js +0 -6
  262. package/runtime/node_modules/@oxc-project/runtime/src/helpers/skipFirstGeneratorNext.js +0 -7
  263. package/runtime/node_modules/@oxc-project/runtime/src/helpers/slicedToArray.js +0 -8
  264. package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropBase.js +0 -6
  265. package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropGet.js +0 -9
  266. package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropSet.js +0 -6
  267. package/runtime/node_modules/@oxc-project/runtime/src/helpers/taggedTemplateLiteral.js +0 -8
  268. package/runtime/node_modules/@oxc-project/runtime/src/helpers/taggedTemplateLiteralLoose.js +0 -4
  269. package/runtime/node_modules/@oxc-project/runtime/src/helpers/tdz.js +0 -4
  270. package/runtime/node_modules/@oxc-project/runtime/src/helpers/temporalRef.js +0 -6
  271. package/runtime/node_modules/@oxc-project/runtime/src/helpers/temporalUndefined.js +0 -2
  272. package/runtime/node_modules/@oxc-project/runtime/src/helpers/toArray.js +0 -8
  273. package/runtime/node_modules/@oxc-project/runtime/src/helpers/toConsumableArray.js +0 -8
  274. package/runtime/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js +0 -12
  275. package/runtime/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js +0 -7
  276. package/runtime/node_modules/@oxc-project/runtime/src/helpers/toSetter.js +0 -10
  277. package/runtime/node_modules/@oxc-project/runtime/src/helpers/typeof.js +0 -10
  278. package/runtime/node_modules/@oxc-project/runtime/src/helpers/unsupportedIterableToArray.js +0 -9
  279. package/runtime/node_modules/@oxc-project/runtime/src/helpers/using.js +0 -12
  280. package/runtime/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js +0 -59
  281. package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js +0 -69
  282. package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapNativeSuper.js +0 -27
  283. package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapRegExp.js +0 -51
  284. package/runtime/node_modules/@oxc-project/runtime/src/helpers/writeOnlyError.js +0 -4
  285. package/runtime/node_modules/@petamoriken/float16/LICENSE +0 -21
  286. package/runtime/node_modules/@petamoriken/float16/README.md +0 -413
  287. package/runtime/node_modules/@petamoriken/float16/browser/float16.js +0 -1340
  288. package/runtime/node_modules/@petamoriken/float16/browser/float16.mjs +0 -1325
  289. package/runtime/node_modules/@petamoriken/float16/index.d.ts +0 -546
  290. package/runtime/node_modules/@petamoriken/float16/index.v5.6.d.ts +0 -546
  291. package/runtime/node_modules/@petamoriken/float16/index.v5.7.d.ts +0 -555
  292. package/runtime/node_modules/@petamoriken/float16/inspect/node.cjs +0 -25
  293. package/runtime/node_modules/@petamoriken/float16/inspect/node.mjs +0 -23
  294. package/runtime/node_modules/@petamoriken/float16/lib/DataView.cjs +0 -16
  295. package/runtime/node_modules/@petamoriken/float16/lib/Float16Array.cjs +0 -690
  296. package/runtime/node_modules/@petamoriken/float16/lib/_util/arrayIterator.cjs +0 -52
  297. package/runtime/node_modules/@petamoriken/float16/lib/_util/brand.cjs +0 -27
  298. package/runtime/node_modules/@petamoriken/float16/lib/_util/converter.cjs +0 -111
  299. package/runtime/node_modules/@petamoriken/float16/lib/_util/is.cjs +0 -78
  300. package/runtime/node_modules/@petamoriken/float16/lib/_util/messages.cjs +0 -18
  301. package/runtime/node_modules/@petamoriken/float16/lib/_util/primordials.cjs +0 -150
  302. package/runtime/node_modules/@petamoriken/float16/lib/_util/spec.cjs +0 -84
  303. package/runtime/node_modules/@petamoriken/float16/lib/f16round.cjs +0 -10
  304. package/runtime/node_modules/@petamoriken/float16/lib/index.cjs +0 -16
  305. package/runtime/node_modules/@petamoriken/float16/lib/isTypedArray.cjs +0 -11
  306. package/runtime/node_modules/@petamoriken/float16/package.json +0 -115
  307. package/runtime/node_modules/@petamoriken/float16/src/DataView.mjs +0 -35
  308. package/runtime/node_modules/@petamoriken/float16/src/Float16Array.mjs +0 -1194
  309. package/runtime/node_modules/@petamoriken/float16/src/_util/arrayIterator.mjs +0 -86
  310. package/runtime/node_modules/@petamoriken/float16/src/_util/brand.mjs +0 -31
  311. package/runtime/node_modules/@petamoriken/float16/src/_util/converter.mjs +0 -173
  312. package/runtime/node_modules/@petamoriken/float16/src/_util/is.mjs +0 -151
  313. package/runtime/node_modules/@petamoriken/float16/src/_util/messages.mjs +0 -22
  314. package/runtime/node_modules/@petamoriken/float16/src/_util/primordials.mjs +0 -254
  315. package/runtime/node_modules/@petamoriken/float16/src/_util/spec.mjs +0 -137
  316. package/runtime/node_modules/@petamoriken/float16/src/f16round.mjs +0 -10
  317. package/runtime/node_modules/@petamoriken/float16/src/index.mjs +0 -7
  318. package/runtime/node_modules/@petamoriken/float16/src/isTypedArray.mjs +0 -10
  319. package/runtime/node_modules/jsbi/LICENSE +0 -176
  320. package/runtime/node_modules/jsbi/README.md +0 -173
  321. package/runtime/node_modules/jsbi/dist/jsbi-cjs.js +0 -2
  322. package/runtime/node_modules/jsbi/dist/jsbi-cjs.js.map +0 -1
  323. package/runtime/node_modules/jsbi/dist/jsbi-umd.js +0 -2
  324. package/runtime/node_modules/jsbi/dist/jsbi-umd.js.map +0 -1
  325. package/runtime/node_modules/jsbi/dist/jsbi.mjs +0 -2
  326. package/runtime/node_modules/jsbi/dist/jsbi.mjs.map +0 -1
  327. package/runtime/node_modules/jsbi/jsbi.d.ts +0 -43
  328. package/runtime/node_modules/jsbi/package.json +0 -35
  329. package/runtime/node_modules/urlpattern-polyfill/LICENSE +0 -19
  330. package/runtime/node_modules/urlpattern-polyfill/README.md +0 -242
  331. package/runtime/node_modules/urlpattern-polyfill/dist/index.d.ts +0 -9
  332. package/runtime/node_modules/urlpattern-polyfill/dist/types.d.ts +0 -49
  333. package/runtime/node_modules/urlpattern-polyfill/dist/urlpattern.cjs +0 -1
  334. package/runtime/node_modules/urlpattern-polyfill/dist/urlpattern.js +0 -1
  335. package/runtime/node_modules/urlpattern-polyfill/index.cjs +0 -7
  336. package/runtime/node_modules/urlpattern-polyfill/index.js +0 -7
  337. package/runtime/node_modules/urlpattern-polyfill/package.json +0 -149
  338. package/runtime/pnp-bin-run.cjs +0 -91
  339. package/runtime/pnp-util.cjs +0 -62
  340. package/runtime/polyfills.cjs +0 -816
  341. package/runtime/preload-async-hooks.mjs +0 -110
  342. package/runtime/preload-common.cjs +0 -1096
  343. package/runtime/preload.cjs +0 -313
  344. package/runtime/preload.mjs +0 -149
  345. package/runtime/transform-core.mjs +0 -756
  346. package/runtime/version.mjs +0 -12
  347. package/runtime/worker-blob-url.cjs +0 -116
  348. package/runtime/worker-polyfill.mjs +0 -541
@@ -1,1194 +0,0 @@
1
- import { safeIfNeeded, wrap } from "./_util/arrayIterator.mjs";
2
- import { brand, hasFloat16ArrayBrand } from "./_util/brand.mjs";
3
- import { convertToNumber, roundToFloat16Bits } from "./_util/converter.mjs";
4
- import {
5
- isAnyArrayBuffer,
6
- isCanonicalIntegerIndexString,
7
- isNativeBigIntTypedArray,
8
- isNativeTypedArray,
9
- isObject,
10
- isOrdinaryArray,
11
- isOrdinaryNativeTypedArray,
12
- } from "./_util/is.mjs";
13
- import {
14
- ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER,
15
- CANNOT_CONVERT_UNDEFINED_OR_NULL_TO_OBJECT,
16
- CANNOT_MIX_BIGINT_AND_OTHER_TYPES,
17
- DERIVED_CONSTRUCTOR_CREATED_TYPEDARRAY_OBJECT_WHICH_WAS_TOO_SMALL_LENGTH,
18
- ITERATOR_PROPERTY_IS_NOT_CALLABLE,
19
- OFFSET_IS_OUT_OF_BOUNDS,
20
- REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE,
21
- SPECIES_CONSTRUCTOR_DIDNT_RETURN_TYPEDARRAY_OBJECT,
22
- THE_COMPARISON_FUNCTION_MUST_BE_EITHER_A_FUNCTION_OR_UNDEFINED,
23
- THIS_CONSTRUCTOR_IS_NOT_A_SUBCLASS_OF_FLOAT16ARRAY,
24
- THIS_IS_NOT_A_FLOAT16ARRAY_OBJECT,
25
- } from "./_util/messages.mjs";
26
- import {
27
- ArrayBufferIsView,
28
- ArrayPrototypeJoin,
29
- ArrayPrototypePush,
30
- ArrayPrototypeToLocaleString,
31
- NativeArrayBuffer,
32
- NativeObject,
33
- NativeProxy,
34
- NativeRangeError,
35
- NativeTypeError,
36
- NativeUint16Array,
37
- NativeWeakMap,
38
- NativeWeakSet,
39
- NumberIsNaN,
40
- ObjectDefineProperty,
41
- ObjectFreeze,
42
- ObjectHasOwn,
43
- ObjectPrototype__lookupGetter__,
44
- ReflectApply,
45
- ReflectConstruct,
46
- ReflectDefineProperty,
47
- ReflectGet,
48
- ReflectGetOwnPropertyDescriptor,
49
- ReflectHas,
50
- ReflectOwnKeys,
51
- ReflectSet,
52
- ReflectSetPrototypeOf,
53
- SymbolIterator,
54
- SymbolToStringTag,
55
- TypedArray,
56
- TypedArrayPrototype,
57
- TypedArrayPrototypeCopyWithin,
58
- TypedArrayPrototypeEntries,
59
- TypedArrayPrototypeFill,
60
- TypedArrayPrototypeGetBuffer,
61
- TypedArrayPrototypeGetByteOffset,
62
- TypedArrayPrototypeGetLength,
63
- TypedArrayPrototypeKeys,
64
- TypedArrayPrototypeReverse,
65
- TypedArrayPrototypeSet,
66
- TypedArrayPrototypeSlice,
67
- TypedArrayPrototypeSort,
68
- TypedArrayPrototypeSubarray,
69
- TypedArrayPrototypeValues,
70
- Uint16ArrayFrom,
71
- WeakMapPrototypeGet,
72
- WeakMapPrototypeHas,
73
- WeakMapPrototypeSet,
74
- WeakSetPrototypeAdd,
75
- WeakSetPrototypeHas,
76
- } from "./_util/primordials.mjs";
77
- import {
78
- IsDetachedBuffer,
79
- SpeciesConstructor,
80
- ToIntegerOrInfinity,
81
- ToLength,
82
- defaultCompare,
83
- } from "./_util/spec.mjs";
84
-
85
- const BYTES_PER_ELEMENT = 2;
86
-
87
- /** @typedef {Uint16Array & { __float16bits: never }} Float16BitsArray */
88
-
89
- /** @type {WeakMap<Float16Array, Float16BitsArray>} */
90
- const float16bitsArrays = new NativeWeakMap();
91
-
92
- /**
93
- * @param {unknown} target
94
- * @returns {target is Float16Array}
95
- */
96
- export function isFloat16Array(target) {
97
- return WeakMapPrototypeHas(float16bitsArrays, target) ||
98
- (!ArrayBufferIsView(target) && hasFloat16ArrayBrand(target));
99
- }
100
-
101
- /**
102
- * @param {unknown} target
103
- * @throws {TypeError}
104
- * @returns {asserts target is Float16Array}
105
- */
106
- function assertFloat16Array(target) {
107
- if (!isFloat16Array(target)) {
108
- throw NativeTypeError(THIS_IS_NOT_A_FLOAT16ARRAY_OBJECT);
109
- }
110
- }
111
-
112
- /**
113
- * @param {unknown} target
114
- * @param {number=} count
115
- * @throws {TypeError}
116
- * @returns {asserts target is Uint8Array|Uint8ClampedArray|Uint16Array|Uint32Array|Int8Array|Int16Array|Int32Array|Float16Array|Float32Array|Float64Array}
117
- */
118
- function assertSpeciesTypedArray(target, count) {
119
- const isTargetFloat16Array = isFloat16Array(target);
120
- const isTargetTypedArray = isNativeTypedArray(target);
121
-
122
- if (!isTargetFloat16Array && !isTargetTypedArray) {
123
- throw NativeTypeError(SPECIES_CONSTRUCTOR_DIDNT_RETURN_TYPEDARRAY_OBJECT);
124
- }
125
-
126
- if (typeof count === "number") {
127
- let length;
128
- if (isTargetFloat16Array) {
129
- const float16bitsArray = getFloat16BitsArray(target);
130
- length = TypedArrayPrototypeGetLength(float16bitsArray);
131
- } else {
132
- length = TypedArrayPrototypeGetLength(target);
133
- }
134
-
135
- if (length < count) {
136
- throw NativeTypeError(
137
- DERIVED_CONSTRUCTOR_CREATED_TYPEDARRAY_OBJECT_WHICH_WAS_TOO_SMALL_LENGTH
138
- );
139
- }
140
- }
141
-
142
- if (isNativeBigIntTypedArray(target)) {
143
- throw NativeTypeError(CANNOT_MIX_BIGINT_AND_OTHER_TYPES);
144
- }
145
- }
146
-
147
- /**
148
- * @param {Float16Array} float16
149
- * @throws {TypeError}
150
- * @returns {Float16BitsArray}
151
- */
152
- function getFloat16BitsArray(float16) {
153
- const float16bitsArray = WeakMapPrototypeGet(float16bitsArrays, float16);
154
- if (float16bitsArray !== undefined) {
155
- const buffer = TypedArrayPrototypeGetBuffer(float16bitsArray);
156
-
157
- if (IsDetachedBuffer(buffer)) {
158
- throw NativeTypeError(ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER);
159
- }
160
-
161
- return float16bitsArray;
162
- }
163
-
164
- // from another Float16Array instance (a different version?)
165
- const buffer = /** @type {any} */ (float16).buffer;
166
-
167
- if (IsDetachedBuffer(buffer)) {
168
- throw NativeTypeError(ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER);
169
- }
170
-
171
- const cloned = ReflectConstruct(Float16Array, [
172
- buffer,
173
- /** @type {any} */ (float16).byteOffset,
174
- /** @type {any} */ (float16).length,
175
- ], float16.constructor);
176
- return WeakMapPrototypeGet(float16bitsArrays, cloned);
177
- }
178
-
179
- /**
180
- * @param {Float16BitsArray} float16bitsArray
181
- * @returns {number[]}
182
- */
183
- function copyToArray(float16bitsArray) {
184
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
185
-
186
- const array = [];
187
- for (let i = 0; i < length; ++i) {
188
- array[i] = convertToNumber(float16bitsArray[i]);
189
- }
190
-
191
- return array;
192
- }
193
-
194
- /** @type {WeakSet<Function>} */
195
- const TypedArrayPrototypeGetters = new NativeWeakSet();
196
- for (const key of ReflectOwnKeys(TypedArrayPrototype)) {
197
- // @@toStringTag getter property is defined in Float16Array.prototype
198
- if (key === SymbolToStringTag) {
199
- continue;
200
- }
201
-
202
- const descriptor = ReflectGetOwnPropertyDescriptor(TypedArrayPrototype, key);
203
- if (ObjectHasOwn(descriptor, "get") && typeof descriptor.get === "function") {
204
- WeakSetPrototypeAdd(TypedArrayPrototypeGetters, descriptor.get);
205
- }
206
- }
207
-
208
- const handler = ObjectFreeze(/** @type {ProxyHandler<Float16BitsArray>} */ ({
209
- get(target, key, receiver) {
210
- if (isCanonicalIntegerIndexString(key) && ObjectHasOwn(target, key)) {
211
- return convertToNumber(ReflectGet(target, key));
212
- }
213
-
214
- // %TypedArray%.prototype getter properties cannot called by Proxy receiver
215
- if (WeakSetPrototypeHas(TypedArrayPrototypeGetters, ObjectPrototype__lookupGetter__(target, key))) {
216
- return ReflectGet(target, key);
217
- }
218
-
219
- return ReflectGet(target, key, receiver);
220
- },
221
-
222
- set(target, key, value, receiver) {
223
- if (isCanonicalIntegerIndexString(key) && ObjectHasOwn(target, key)) {
224
- return ReflectSet(target, key, roundToFloat16Bits(value));
225
- }
226
-
227
- return ReflectSet(target, key, value, receiver);
228
- },
229
-
230
- getOwnPropertyDescriptor(target, key) {
231
- if (isCanonicalIntegerIndexString(key) && ObjectHasOwn(target, key)) {
232
- const descriptor = ReflectGetOwnPropertyDescriptor(target, key);
233
- descriptor.value = convertToNumber(descriptor.value);
234
- return descriptor;
235
- }
236
-
237
- return ReflectGetOwnPropertyDescriptor(target, key);
238
- },
239
-
240
- defineProperty(target, key, descriptor) {
241
- if (
242
- isCanonicalIntegerIndexString(key) &&
243
- ObjectHasOwn(target, key) &&
244
- ObjectHasOwn(descriptor, "value")
245
- ) {
246
- descriptor.value = roundToFloat16Bits(descriptor.value);
247
- return ReflectDefineProperty(target, key, descriptor);
248
- }
249
-
250
- return ReflectDefineProperty(target, key, descriptor);
251
- },
252
- }));
253
-
254
- export class Float16Array {
255
- /** @see https://tc39.es/ecma262/#sec-typedarray */
256
- constructor(input, _byteOffset, _length) {
257
- /** @type {Float16BitsArray} */
258
- let float16bitsArray;
259
-
260
- if (isFloat16Array(input)) {
261
- float16bitsArray = ReflectConstruct(NativeUint16Array, [getFloat16BitsArray(input)], new.target);
262
- } else if (isObject(input) && !isAnyArrayBuffer(input)) { // object without ArrayBuffer, SharedArrayBuffer
263
- /** @type {ArrayLike<unknown>} */
264
- let list;
265
- /** @type {number} */
266
- let length;
267
-
268
- if (isNativeTypedArray(input)) { // TypedArray
269
- list = input;
270
- length = TypedArrayPrototypeGetLength(input);
271
-
272
- const buffer = TypedArrayPrototypeGetBuffer(input);
273
-
274
- if (IsDetachedBuffer(buffer)) {
275
- throw NativeTypeError(ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER);
276
- }
277
-
278
- if (isNativeBigIntTypedArray(input)) {
279
- throw NativeTypeError(CANNOT_MIX_BIGINT_AND_OTHER_TYPES);
280
- }
281
-
282
- const data = new NativeArrayBuffer(
283
- length * BYTES_PER_ELEMENT
284
- );
285
- float16bitsArray = ReflectConstruct(NativeUint16Array, [data], new.target);
286
- } else {
287
- const iterator = input[SymbolIterator];
288
- if (iterator != null && typeof iterator !== "function") {
289
- throw NativeTypeError(ITERATOR_PROPERTY_IS_NOT_CALLABLE);
290
- }
291
-
292
- if (iterator != null) { // Iterable (Array)
293
- // for optimization
294
- if (isOrdinaryArray(input)) {
295
- list = input;
296
- length = input.length;
297
- } else {
298
- // eslint-disable-next-line no-restricted-syntax
299
- list = [... /** @type {Iterable<unknown>} */ (input)];
300
- length = list.length;
301
- }
302
- } else { // ArrayLike
303
- list = /** @type {ArrayLike<unknown>} */ (input);
304
- length = ToLength(list.length);
305
- }
306
- float16bitsArray = ReflectConstruct(NativeUint16Array, [length], new.target);
307
- }
308
-
309
- // set values
310
- for (let i = 0; i < length; ++i) {
311
- float16bitsArray[i] = roundToFloat16Bits(list[i]);
312
- }
313
- } else { // primitive, ArrayBuffer, SharedArrayBuffer
314
- float16bitsArray = ReflectConstruct(NativeUint16Array, arguments, new.target);
315
- }
316
-
317
- /** @type {Float16Array} */
318
- const proxy = /** @type {any} */ (new NativeProxy(float16bitsArray, handler));
319
-
320
- // proxy private storage
321
- WeakMapPrototypeSet(float16bitsArrays, proxy, float16bitsArray);
322
-
323
- return proxy;
324
- }
325
-
326
- /**
327
- * limitation: `Object.getOwnPropertyNames(Float16Array)` or `Reflect.ownKeys(Float16Array)` include this key
328
- * @see https://tc39.es/ecma262/#sec-%typedarray%.from
329
- */
330
- static from(src, ...opts) {
331
- const Constructor = this;
332
-
333
- if (!ReflectHas(Constructor, brand)) {
334
- throw NativeTypeError(
335
- THIS_CONSTRUCTOR_IS_NOT_A_SUBCLASS_OF_FLOAT16ARRAY
336
- );
337
- }
338
-
339
- // for optimization
340
- if (Constructor === Float16Array) {
341
- if (isFloat16Array(src) && opts.length === 0) {
342
- const float16bitsArray = getFloat16BitsArray(src);
343
- const uint16 = new NativeUint16Array(
344
- TypedArrayPrototypeGetBuffer(float16bitsArray),
345
- TypedArrayPrototypeGetByteOffset(float16bitsArray),
346
- TypedArrayPrototypeGetLength(float16bitsArray)
347
- );
348
- return new Float16Array(
349
- TypedArrayPrototypeGetBuffer(TypedArrayPrototypeSlice(uint16))
350
- );
351
- }
352
-
353
- if (opts.length === 0) {
354
- return new Float16Array(
355
- TypedArrayPrototypeGetBuffer(
356
- Uint16ArrayFrom(src, roundToFloat16Bits)
357
- )
358
- );
359
- }
360
-
361
- const mapFunc = opts[0];
362
- const thisArg = opts[1];
363
-
364
- return new Float16Array(
365
- TypedArrayPrototypeGetBuffer(
366
- Uint16ArrayFrom(src, function (val, ...args) {
367
- return roundToFloat16Bits(
368
- ReflectApply(mapFunc, this, [val, ...safeIfNeeded(args)])
369
- );
370
- }, thisArg)
371
- )
372
- );
373
- }
374
-
375
- /** @type {ArrayLike<unknown>} */
376
- let list;
377
- /** @type {number} */
378
- let length;
379
-
380
- const iterator = src[SymbolIterator];
381
- if (iterator != null && typeof iterator !== "function") {
382
- throw NativeTypeError(ITERATOR_PROPERTY_IS_NOT_CALLABLE);
383
- }
384
-
385
- if (iterator != null) { // Iterable (TypedArray, Array)
386
- // for optimization
387
- if (isOrdinaryArray(src)) {
388
- list = src;
389
- length = src.length;
390
- } else if (isOrdinaryNativeTypedArray(src)) {
391
- list = src;
392
- length = TypedArrayPrototypeGetLength(src);
393
- } else {
394
- // eslint-disable-next-line no-restricted-syntax
395
- list = [...src];
396
- length = list.length;
397
- }
398
- } else { // ArrayLike
399
- if (src == null) {
400
- throw NativeTypeError(
401
- CANNOT_CONVERT_UNDEFINED_OR_NULL_TO_OBJECT
402
- );
403
- }
404
- list = NativeObject(src);
405
- length = ToLength(list.length);
406
- }
407
-
408
- const array = new Constructor(length);
409
-
410
- if (opts.length === 0) {
411
- for (let i = 0; i < length; ++i) {
412
- array[i] = /** @type {number} */ (list[i]);
413
- }
414
- } else {
415
- const mapFunc = opts[0];
416
- const thisArg = opts[1];
417
- for (let i = 0; i < length; ++i) {
418
- array[i] = ReflectApply(mapFunc, thisArg, [list[i], i]);
419
- }
420
- }
421
-
422
- return array;
423
- }
424
-
425
- /**
426
- * limitation: `Object.getOwnPropertyNames(Float16Array)` or `Reflect.ownKeys(Float16Array)` include this key
427
- * @see https://tc39.es/ecma262/#sec-%typedarray%.of
428
- */
429
- static of(...items) {
430
- const Constructor = this;
431
-
432
- if (!ReflectHas(Constructor, brand)) {
433
- throw NativeTypeError(
434
- THIS_CONSTRUCTOR_IS_NOT_A_SUBCLASS_OF_FLOAT16ARRAY
435
- );
436
- }
437
-
438
- const length = items.length;
439
-
440
- // for optimization
441
- if (Constructor === Float16Array) {
442
- const proxy = new Float16Array(length);
443
- const float16bitsArray = getFloat16BitsArray(proxy);
444
-
445
- for (let i = 0; i < length; ++i) {
446
- float16bitsArray[i] = roundToFloat16Bits(items[i]);
447
- }
448
-
449
- return proxy;
450
- }
451
-
452
- const array = new Constructor(length);
453
-
454
- for (let i = 0; i < length; ++i) {
455
- array[i] = items[i];
456
- }
457
-
458
- return array;
459
- }
460
-
461
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys */
462
- keys() {
463
- assertFloat16Array(this);
464
- const float16bitsArray = getFloat16BitsArray(this);
465
-
466
- return TypedArrayPrototypeKeys(float16bitsArray);
467
- }
468
-
469
- /**
470
- * limitation: returns a object whose prototype is not `%ArrayIteratorPrototype%`
471
- * @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.values
472
- */
473
- values() {
474
- assertFloat16Array(this);
475
- const float16bitsArray = getFloat16BitsArray(this);
476
-
477
- return wrap((function* () {
478
- // eslint-disable-next-line no-restricted-syntax
479
- for (const val of TypedArrayPrototypeValues(float16bitsArray)) {
480
- yield convertToNumber(val);
481
- }
482
- })());
483
- }
484
-
485
- /**
486
- * limitation: returns a object whose prototype is not `%ArrayIteratorPrototype%`
487
- * @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries
488
- */
489
- entries() {
490
- assertFloat16Array(this);
491
- const float16bitsArray = getFloat16BitsArray(this);
492
-
493
- return wrap((function* () {
494
- // eslint-disable-next-line no-restricted-syntax
495
- for (const [i, val] of TypedArrayPrototypeEntries(float16bitsArray)) {
496
- yield /** @type {[number, number]} */ ([i, convertToNumber(val)]);
497
- }
498
- })());
499
- }
500
-
501
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.at */
502
- at(index) {
503
- assertFloat16Array(this);
504
- const float16bitsArray = getFloat16BitsArray(this);
505
-
506
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
507
- const relativeIndex = ToIntegerOrInfinity(index);
508
- const k = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;
509
-
510
- if (k < 0 || k >= length) {
511
- return;
512
- }
513
-
514
- return convertToNumber(float16bitsArray[k]);
515
- }
516
-
517
- /** @see https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with */
518
- with(index, value) {
519
- assertFloat16Array(this);
520
- const float16bitsArray = getFloat16BitsArray(this);
521
-
522
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
523
- const relativeIndex = ToIntegerOrInfinity(index);
524
- const k = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;
525
-
526
- const number = +value;
527
-
528
- if (k < 0 || k >= length) {
529
- throw NativeRangeError(OFFSET_IS_OUT_OF_BOUNDS);
530
- }
531
-
532
- // don't use SpeciesConstructor
533
- const uint16 = new NativeUint16Array(
534
- TypedArrayPrototypeGetBuffer(float16bitsArray),
535
- TypedArrayPrototypeGetByteOffset(float16bitsArray),
536
- TypedArrayPrototypeGetLength(float16bitsArray)
537
- );
538
- const cloned = new Float16Array(
539
- TypedArrayPrototypeGetBuffer(
540
- TypedArrayPrototypeSlice(uint16)
541
- )
542
- );
543
- const array = getFloat16BitsArray(cloned);
544
-
545
- array[k] = roundToFloat16Bits(number);
546
-
547
- return cloned;
548
- }
549
-
550
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.map */
551
- map(callback, ...opts) {
552
- assertFloat16Array(this);
553
- const float16bitsArray = getFloat16BitsArray(this);
554
-
555
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
556
- const thisArg = opts[0];
557
-
558
- const Constructor = SpeciesConstructor(float16bitsArray, Float16Array);
559
-
560
- // for optimization
561
- if (Constructor === Float16Array) {
562
- const proxy = new Float16Array(length);
563
- const array = getFloat16BitsArray(proxy);
564
-
565
- for (let i = 0; i < length; ++i) {
566
- const val = convertToNumber(float16bitsArray[i]);
567
- array[i] = roundToFloat16Bits(
568
- ReflectApply(callback, thisArg, [val, i, this])
569
- );
570
- }
571
-
572
- return proxy;
573
- }
574
-
575
- const array = new Constructor(length);
576
- assertSpeciesTypedArray(array, length);
577
-
578
- for (let i = 0; i < length; ++i) {
579
- const val = convertToNumber(float16bitsArray[i]);
580
- array[i] = ReflectApply(callback, thisArg, [val, i, this]);
581
- }
582
-
583
- return /** @type {any} */ (array);
584
- }
585
-
586
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter */
587
- filter(callback, ...opts) {
588
- assertFloat16Array(this);
589
- const float16bitsArray = getFloat16BitsArray(this);
590
-
591
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
592
- const thisArg = opts[0];
593
-
594
- const kept = [];
595
- for (let i = 0; i < length; ++i) {
596
- const val = convertToNumber(float16bitsArray[i]);
597
- if (ReflectApply(callback, thisArg, [val, i, this])) {
598
- ArrayPrototypePush(kept, val);
599
- }
600
- }
601
-
602
- const Constructor = SpeciesConstructor(float16bitsArray, Float16Array);
603
- const array = new Constructor(kept);
604
- assertSpeciesTypedArray(array);
605
-
606
- return /** @type {any} */ (array);
607
- }
608
-
609
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce */
610
- reduce(callback, ...opts) {
611
- assertFloat16Array(this);
612
- const float16bitsArray = getFloat16BitsArray(this);
613
-
614
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
615
- if (length === 0 && opts.length === 0) {
616
- throw NativeTypeError(REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE);
617
- }
618
-
619
- let accumulator, start;
620
- if (opts.length === 0) {
621
- accumulator = convertToNumber(float16bitsArray[0]);
622
- start = 1;
623
- } else {
624
- accumulator = opts[0];
625
- start = 0;
626
- }
627
-
628
- for (let i = start; i < length; ++i) {
629
- accumulator = callback(
630
- accumulator,
631
- convertToNumber(float16bitsArray[i]),
632
- i,
633
- this
634
- );
635
- }
636
-
637
- return accumulator;
638
- }
639
-
640
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright */
641
- reduceRight(callback, ...opts) {
642
- assertFloat16Array(this);
643
- const float16bitsArray = getFloat16BitsArray(this);
644
-
645
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
646
- if (length === 0 && opts.length === 0) {
647
- throw NativeTypeError(REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE);
648
- }
649
-
650
- let accumulator, start;
651
- if (opts.length === 0) {
652
- accumulator = convertToNumber(float16bitsArray[length - 1]);
653
- start = length - 2;
654
- } else {
655
- accumulator = opts[0];
656
- start = length - 1;
657
- }
658
-
659
- for (let i = start; i >= 0; --i) {
660
- accumulator = callback(
661
- accumulator,
662
- convertToNumber(float16bitsArray[i]),
663
- i,
664
- this
665
- );
666
- }
667
-
668
- return accumulator;
669
- }
670
-
671
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach */
672
- forEach(callback, ...opts) {
673
- assertFloat16Array(this);
674
- const float16bitsArray = getFloat16BitsArray(this);
675
-
676
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
677
- const thisArg = opts[0];
678
-
679
- for (let i = 0; i < length; ++i) {
680
- ReflectApply(callback, thisArg, [
681
- convertToNumber(float16bitsArray[i]),
682
- i,
683
- this,
684
- ]);
685
- }
686
- }
687
-
688
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.find */
689
- find(callback, ...opts) {
690
- assertFloat16Array(this);
691
- const float16bitsArray = getFloat16BitsArray(this);
692
-
693
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
694
- const thisArg = opts[0];
695
-
696
- for (let i = 0; i < length; ++i) {
697
- const value = convertToNumber(float16bitsArray[i]);
698
- if (ReflectApply(callback, thisArg, [value, i, this])) {
699
- return value;
700
- }
701
- }
702
- }
703
-
704
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex */
705
- findIndex(callback, ...opts) {
706
- assertFloat16Array(this);
707
- const float16bitsArray = getFloat16BitsArray(this);
708
-
709
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
710
- const thisArg = opts[0];
711
-
712
- for (let i = 0; i < length; ++i) {
713
- const value = convertToNumber(float16bitsArray[i]);
714
- if (ReflectApply(callback, thisArg, [value, i, this])) {
715
- return i;
716
- }
717
- }
718
-
719
- return -1;
720
- }
721
-
722
- /** @see https://tc39.es/proposal-array-find-from-last/index.html#sec-%typedarray%.prototype.findlast */
723
- findLast(callback, ...opts) {
724
- assertFloat16Array(this);
725
- const float16bitsArray = getFloat16BitsArray(this);
726
-
727
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
728
- const thisArg = opts[0];
729
-
730
- for (let i = length - 1; i >= 0; --i) {
731
- const value = convertToNumber(float16bitsArray[i]);
732
- if (ReflectApply(callback, thisArg, [value, i, this])) {
733
- return value;
734
- }
735
- }
736
- }
737
-
738
- /** @see https://tc39.es/proposal-array-find-from-last/index.html#sec-%typedarray%.prototype.findlastindex */
739
- findLastIndex(callback, ...opts) {
740
- assertFloat16Array(this);
741
- const float16bitsArray = getFloat16BitsArray(this);
742
-
743
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
744
- const thisArg = opts[0];
745
-
746
- for (let i = length - 1; i >= 0; --i) {
747
- const value = convertToNumber(float16bitsArray[i]);
748
- if (ReflectApply(callback, thisArg, [value, i, this])) {
749
- return i;
750
- }
751
- }
752
-
753
- return -1;
754
- }
755
-
756
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.every */
757
- every(callback, ...opts) {
758
- assertFloat16Array(this);
759
- const float16bitsArray = getFloat16BitsArray(this);
760
-
761
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
762
- const thisArg = opts[0];
763
-
764
- for (let i = 0; i < length; ++i) {
765
- if (
766
- !ReflectApply(callback, thisArg, [
767
- convertToNumber(float16bitsArray[i]),
768
- i,
769
- this,
770
- ])
771
- ) {
772
- return false;
773
- }
774
- }
775
-
776
- return true;
777
- }
778
-
779
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.some */
780
- some(callback, ...opts) {
781
- assertFloat16Array(this);
782
- const float16bitsArray = getFloat16BitsArray(this);
783
-
784
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
785
- const thisArg = opts[0];
786
-
787
- for (let i = 0; i < length; ++i) {
788
- if (
789
- ReflectApply(callback, thisArg, [
790
- convertToNumber(float16bitsArray[i]),
791
- i,
792
- this,
793
- ])
794
- ) {
795
- return true;
796
- }
797
- }
798
-
799
- return false;
800
- }
801
-
802
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.set */
803
- set(input, ...opts) {
804
- assertFloat16Array(this);
805
- const float16bitsArray = getFloat16BitsArray(this);
806
-
807
- const targetOffset = ToIntegerOrInfinity(opts[0]);
808
- if (targetOffset < 0) {
809
- throw NativeRangeError(OFFSET_IS_OUT_OF_BOUNDS);
810
- }
811
-
812
- if (input == null) {
813
- throw NativeTypeError(
814
- CANNOT_CONVERT_UNDEFINED_OR_NULL_TO_OBJECT
815
- );
816
- }
817
-
818
- if (isNativeBigIntTypedArray(input)) {
819
- throw NativeTypeError(
820
- CANNOT_MIX_BIGINT_AND_OTHER_TYPES
821
- );
822
- }
823
-
824
- // for optimization
825
- if (isFloat16Array(input)) {
826
- // peel off Proxy
827
- return TypedArrayPrototypeSet(
828
- getFloat16BitsArray(this),
829
- getFloat16BitsArray(input),
830
- targetOffset
831
- );
832
- }
833
-
834
- if (isNativeTypedArray(input)) {
835
- const buffer = TypedArrayPrototypeGetBuffer(input);
836
- if (IsDetachedBuffer(buffer)) {
837
- throw NativeTypeError(ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER);
838
- }
839
- }
840
-
841
- const targetLength = TypedArrayPrototypeGetLength(float16bitsArray);
842
-
843
- const src = NativeObject(input);
844
- const srcLength = ToLength(src.length);
845
-
846
- if (targetOffset === Infinity || srcLength + targetOffset > targetLength) {
847
- throw NativeRangeError(OFFSET_IS_OUT_OF_BOUNDS);
848
- }
849
-
850
- for (let i = 0; i < srcLength; ++i) {
851
- float16bitsArray[i + targetOffset] = roundToFloat16Bits(src[i]);
852
- }
853
- }
854
-
855
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse */
856
- reverse() {
857
- assertFloat16Array(this);
858
- const float16bitsArray = getFloat16BitsArray(this);
859
-
860
- TypedArrayPrototypeReverse(float16bitsArray);
861
-
862
- return this;
863
- }
864
-
865
- /** @see https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed */
866
- toReversed() {
867
- assertFloat16Array(this);
868
- const float16bitsArray = getFloat16BitsArray(this);
869
-
870
- // don't use SpeciesConstructor
871
- const uint16 = new NativeUint16Array(
872
- TypedArrayPrototypeGetBuffer(float16bitsArray),
873
- TypedArrayPrototypeGetByteOffset(float16bitsArray),
874
- TypedArrayPrototypeGetLength(float16bitsArray)
875
- );
876
- const cloned = new Float16Array(
877
- TypedArrayPrototypeGetBuffer(
878
- TypedArrayPrototypeSlice(uint16)
879
- )
880
- );
881
-
882
- const clonedFloat16bitsArray = getFloat16BitsArray(cloned);
883
- TypedArrayPrototypeReverse(clonedFloat16bitsArray);
884
-
885
- return cloned;
886
- }
887
-
888
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill */
889
- fill(value, ...opts) {
890
- assertFloat16Array(this);
891
- const float16bitsArray = getFloat16BitsArray(this);
892
-
893
- TypedArrayPrototypeFill(
894
- float16bitsArray,
895
- roundToFloat16Bits(value),
896
- ...safeIfNeeded(opts)
897
- );
898
-
899
- return this;
900
- }
901
-
902
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin */
903
- copyWithin(target, start, ...opts) {
904
- assertFloat16Array(this);
905
- const float16bitsArray = getFloat16BitsArray(this);
906
-
907
- TypedArrayPrototypeCopyWithin(float16bitsArray, target, start, ...safeIfNeeded(opts));
908
-
909
- return this;
910
- }
911
-
912
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort */
913
- sort(compareFn) {
914
- assertFloat16Array(this);
915
- const float16bitsArray = getFloat16BitsArray(this);
916
-
917
- const sortCompare = compareFn !== undefined ? compareFn : defaultCompare;
918
- TypedArrayPrototypeSort(float16bitsArray, (x, y) => {
919
- return sortCompare(convertToNumber(x), convertToNumber(y));
920
- });
921
-
922
- return this;
923
- }
924
-
925
- /** @see https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSorted */
926
- toSorted(compareFn) {
927
- assertFloat16Array(this);
928
- const float16bitsArray = getFloat16BitsArray(this);
929
-
930
- if (compareFn !== undefined && typeof compareFn !== "function") {
931
- throw new NativeTypeError(THE_COMPARISON_FUNCTION_MUST_BE_EITHER_A_FUNCTION_OR_UNDEFINED);
932
- }
933
- const sortCompare = compareFn !== undefined ? compareFn : defaultCompare;
934
-
935
- // don't use SpeciesConstructor
936
- const uint16 = new NativeUint16Array(
937
- TypedArrayPrototypeGetBuffer(float16bitsArray),
938
- TypedArrayPrototypeGetByteOffset(float16bitsArray),
939
- TypedArrayPrototypeGetLength(float16bitsArray)
940
- );
941
- const cloned = new Float16Array(
942
- TypedArrayPrototypeGetBuffer(
943
- TypedArrayPrototypeSlice(uint16)
944
- )
945
- );
946
-
947
- const clonedFloat16bitsArray = getFloat16BitsArray(cloned);
948
- TypedArrayPrototypeSort(clonedFloat16bitsArray, (x, y) => {
949
- return sortCompare(convertToNumber(x), convertToNumber(y));
950
- });
951
-
952
- return cloned;
953
- }
954
-
955
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice */
956
- slice(start, end) {
957
- assertFloat16Array(this);
958
- const float16bitsArray = getFloat16BitsArray(this);
959
-
960
- const Constructor = SpeciesConstructor(float16bitsArray, Float16Array);
961
-
962
- // for optimization
963
- if (Constructor === Float16Array) {
964
- const uint16 = new NativeUint16Array(
965
- TypedArrayPrototypeGetBuffer(float16bitsArray),
966
- TypedArrayPrototypeGetByteOffset(float16bitsArray),
967
- TypedArrayPrototypeGetLength(float16bitsArray)
968
- );
969
- return new Float16Array(
970
- TypedArrayPrototypeGetBuffer(
971
- TypedArrayPrototypeSlice(uint16, start, end)
972
- )
973
- );
974
- }
975
-
976
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
977
- const relativeStart = ToIntegerOrInfinity(start);
978
- const relativeEnd = end === undefined ? length : ToIntegerOrInfinity(end);
979
-
980
- let k;
981
- if (relativeStart === -Infinity) {
982
- k = 0;
983
- } else if (relativeStart < 0) {
984
- k = length + relativeStart > 0 ? length + relativeStart : 0;
985
- } else {
986
- k = length < relativeStart ? length : relativeStart;
987
- }
988
-
989
- let final;
990
- if (relativeEnd === -Infinity) {
991
- final = 0;
992
- } else if (relativeEnd < 0) {
993
- final = length + relativeEnd > 0 ? length + relativeEnd : 0;
994
- } else {
995
- final = length < relativeEnd ? length : relativeEnd;
996
- }
997
-
998
- const count = final - k > 0 ? final - k : 0;
999
- const array = new Constructor(count);
1000
- assertSpeciesTypedArray(array, count);
1001
-
1002
- if (count === 0) {
1003
- return array;
1004
- }
1005
-
1006
- const buffer = TypedArrayPrototypeGetBuffer(float16bitsArray);
1007
- if (IsDetachedBuffer(buffer)) {
1008
- throw NativeTypeError(ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER);
1009
- }
1010
-
1011
- let n = 0;
1012
- while (k < final) {
1013
- array[n] = convertToNumber(float16bitsArray[k]);
1014
- ++k;
1015
- ++n;
1016
- }
1017
-
1018
- return /** @type {any} */ (array);
1019
- }
1020
-
1021
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray */
1022
- subarray(begin, end) {
1023
- assertFloat16Array(this);
1024
- const float16bitsArray = getFloat16BitsArray(this);
1025
-
1026
- const Constructor = SpeciesConstructor(float16bitsArray, Float16Array);
1027
-
1028
- const uint16 = new NativeUint16Array(
1029
- TypedArrayPrototypeGetBuffer(float16bitsArray),
1030
- TypedArrayPrototypeGetByteOffset(float16bitsArray),
1031
- TypedArrayPrototypeGetLength(float16bitsArray)
1032
- );
1033
- const uint16Subarray = TypedArrayPrototypeSubarray(uint16, begin, end);
1034
-
1035
- const array = new Constructor(
1036
- TypedArrayPrototypeGetBuffer(uint16Subarray),
1037
- TypedArrayPrototypeGetByteOffset(uint16Subarray),
1038
- TypedArrayPrototypeGetLength(uint16Subarray)
1039
- );
1040
- assertSpeciesTypedArray(array);
1041
-
1042
- return /** @type {any} */ (array);
1043
- }
1044
-
1045
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof */
1046
- indexOf(element, ...opts) {
1047
- assertFloat16Array(this);
1048
- const float16bitsArray = getFloat16BitsArray(this);
1049
-
1050
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
1051
-
1052
- let from = ToIntegerOrInfinity(opts[0]);
1053
- if (from === Infinity) {
1054
- return -1;
1055
- }
1056
-
1057
- if (from < 0) {
1058
- from += length;
1059
- if (from < 0) {
1060
- from = 0;
1061
- }
1062
- }
1063
-
1064
- for (let i = from; i < length; ++i) {
1065
- if (
1066
- ObjectHasOwn(float16bitsArray, i) &&
1067
- convertToNumber(float16bitsArray[i]) === element
1068
- ) {
1069
- return i;
1070
- }
1071
- }
1072
-
1073
- return -1;
1074
- }
1075
-
1076
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof */
1077
- lastIndexOf(element, ...opts) {
1078
- assertFloat16Array(this);
1079
- const float16bitsArray = getFloat16BitsArray(this);
1080
-
1081
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
1082
-
1083
- let from = opts.length >= 1 ? ToIntegerOrInfinity(opts[0]) : length - 1;
1084
- if (from === -Infinity) {
1085
- return -1;
1086
- }
1087
-
1088
- if (from >= 0) {
1089
- from = from < length - 1 ? from : length - 1;
1090
- } else {
1091
- from += length;
1092
- }
1093
-
1094
- for (let i = from; i >= 0; --i) {
1095
- if (
1096
- ObjectHasOwn(float16bitsArray, i) &&
1097
- convertToNumber(float16bitsArray[i]) === element
1098
- ) {
1099
- return i;
1100
- }
1101
- }
1102
-
1103
- return -1;
1104
- }
1105
-
1106
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes */
1107
- includes(element, ...opts) {
1108
- assertFloat16Array(this);
1109
- const float16bitsArray = getFloat16BitsArray(this);
1110
-
1111
- const length = TypedArrayPrototypeGetLength(float16bitsArray);
1112
-
1113
- let from = ToIntegerOrInfinity(opts[0]);
1114
- if (from === Infinity) {
1115
- return false;
1116
- }
1117
-
1118
- if (from < 0) {
1119
- from += length;
1120
- if (from < 0) {
1121
- from = 0;
1122
- }
1123
- }
1124
-
1125
- const isNaN = NumberIsNaN(element);
1126
- for (let i = from; i < length; ++i) {
1127
- const value = convertToNumber(float16bitsArray[i]);
1128
-
1129
- if (isNaN && NumberIsNaN(value)) {
1130
- return true;
1131
- }
1132
-
1133
- if (value === element) {
1134
- return true;
1135
- }
1136
- }
1137
-
1138
- return false;
1139
- }
1140
-
1141
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.join */
1142
- join(separator) {
1143
- assertFloat16Array(this);
1144
- const float16bitsArray = getFloat16BitsArray(this);
1145
-
1146
- const array = copyToArray(float16bitsArray);
1147
-
1148
- return ArrayPrototypeJoin(array, separator);
1149
- }
1150
-
1151
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring */
1152
- toLocaleString(...opts) {
1153
- assertFloat16Array(this);
1154
- const float16bitsArray = getFloat16BitsArray(this);
1155
-
1156
- const array = copyToArray(float16bitsArray);
1157
-
1158
- return ArrayPrototypeToLocaleString(array, ...safeIfNeeded(opts));
1159
- }
1160
-
1161
- /** @see https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag */
1162
- get [SymbolToStringTag]() {
1163
- if (isFloat16Array(this)) {
1164
- return /** @type {any} */ ("Float16Array");
1165
- }
1166
- }
1167
- }
1168
-
1169
- /** @see https://tc39.es/ecma262/#sec-typedarray.bytes_per_element */
1170
- ObjectDefineProperty(Float16Array, "BYTES_PER_ELEMENT", {
1171
- value: BYTES_PER_ELEMENT,
1172
- });
1173
-
1174
- // limitation: It is peaked by `Object.getOwnPropertySymbols(Float16Array)` and `Reflect.ownKeys(Float16Array)`
1175
- ObjectDefineProperty(Float16Array, brand, {});
1176
-
1177
- /** @see https://tc39.es/ecma262/#sec-properties-of-the-typedarray-constructors */
1178
- ReflectSetPrototypeOf(Float16Array, TypedArray);
1179
-
1180
- const Float16ArrayPrototype = Float16Array.prototype;
1181
-
1182
- /** @see https://tc39.es/ecma262/#sec-typedarray.prototype.bytes_per_element */
1183
- ObjectDefineProperty(Float16ArrayPrototype, "BYTES_PER_ELEMENT", {
1184
- value: BYTES_PER_ELEMENT,
1185
- });
1186
-
1187
- /** @see https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator */
1188
- ObjectDefineProperty(Float16ArrayPrototype, SymbolIterator, {
1189
- value: Float16ArrayPrototype.values,
1190
- writable: true,
1191
- configurable: true,
1192
- });
1193
-
1194
- ReflectSetPrototypeOf(Float16ArrayPrototype, TypedArrayPrototype);