@jsenv/core 23.6.2 → 23.8.1

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 (135) hide show
  1. package/{license → LICENSE} +21 -21
  2. package/dist/jsenv_browser_system.js +35 -35
  3. package/dist/jsenv_browser_system.js.map +14 -14
  4. package/dist/jsenv_compile_proxy.js +47 -128
  5. package/dist/jsenv_compile_proxy.js.map +25 -62
  6. package/dist/jsenv_exploring_index.js.map +5 -5
  7. package/dist/jsenv_exploring_redirector.js +47 -54
  8. package/dist/jsenv_exploring_redirector.js.map +17 -19
  9. package/dist/jsenv_toolbar.js +47 -130
  10. package/dist/jsenv_toolbar.js.map +13 -48
  11. package/dist/jsenv_toolbar_injector.js.map +5 -5
  12. package/helpers/babel/.eslintrc.cjs +24 -24
  13. package/helpers/babel/AsyncGenerator/AsyncGenerator.js +81 -81
  14. package/helpers/babel/AwaitValue/AwaitValue.js +3 -3
  15. package/helpers/babel/applyDecoratorDescriptor/applyDecoratorDescriptor.js +33 -33
  16. package/helpers/babel/arrayLikeToArray/arrayLikeToArray.js +7 -7
  17. package/helpers/babel/arrayWithHoles/arrayWithHoles.js +4 -4
  18. package/helpers/babel/arrayWithoutHoles/arrayWithoutHoles.js +6 -6
  19. package/helpers/babel/assertThisInitialized/assertThisInitialized.js +7 -7
  20. package/helpers/babel/asyncGeneratorDelegate/asyncGeneratorDelegate.js +40 -40
  21. package/helpers/babel/asyncIterator/asyncIterator.js +12 -12
  22. package/helpers/babel/asyncToGenerator/asyncToGenerator.js +34 -34
  23. package/helpers/babel/awaitAsyncGenerator/awaitAsyncGenerator.js +5 -5
  24. package/helpers/babel/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +20 -20
  25. package/helpers/babel/classApplyDescriptorGet/classApplyDescriptorGet.js +6 -6
  26. package/helpers/babel/classApplyDescriptorSet/classApplyDescriptorSet.js +13 -13
  27. package/helpers/babel/classCallCheck/classCallCheck.js +5 -5
  28. package/helpers/babel/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +5 -5
  29. package/helpers/babel/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +6 -6
  30. package/helpers/babel/classExtractFieldDescriptor/classExtractFieldDescriptor.js +7 -7
  31. package/helpers/babel/classNameTDZError/classNameTDZError.js +4 -4
  32. package/helpers/babel/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +7 -7
  33. package/helpers/babel/classPrivateFieldGet/classPrivateFieldGet.js +7 -7
  34. package/helpers/babel/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +6 -6
  35. package/helpers/babel/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +5 -5
  36. package/helpers/babel/classPrivateFieldSet/classPrivateFieldSet.js +8 -8
  37. package/helpers/babel/classPrivateMethodGet/classPrivateMethodGet.js +6 -6
  38. package/helpers/babel/classPrivateMethodSet/classPrivateMethodSet.js +3 -3
  39. package/helpers/babel/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +9 -9
  40. package/helpers/babel/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +15 -15
  41. package/helpers/babel/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +6 -6
  42. package/helpers/babel/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +3 -3
  43. package/helpers/babel/construct/construct.js +16 -16
  44. package/helpers/babel/createClass/createClass.js +15 -15
  45. package/helpers/babel/createForOfIteratorHelper/createForOfIteratorHelper.js +60 -60
  46. package/helpers/babel/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +23 -23
  47. package/helpers/babel/createRawReactElement/createRawReactElement.js +50 -50
  48. package/helpers/babel/createSuper/createSuper.js +22 -22
  49. package/helpers/babel/decorate/decorate.js +403 -403
  50. package/helpers/babel/defaults/defaults.js +11 -11
  51. package/helpers/babel/defineEnumerableProperties/defineEnumerableProperties.js +23 -23
  52. package/helpers/babel/defineProperty/defineProperty.js +18 -18
  53. package/helpers/babel/extends/extends.js +14 -14
  54. package/helpers/babel/get/get.js +13 -13
  55. package/helpers/babel/getPrototypeOf/getPrototypeOf.js +4 -4
  56. package/helpers/babel/inherits/inherits.js +15 -15
  57. package/helpers/babel/inheritsLoose/inheritsLoose.js +7 -7
  58. package/helpers/babel/initializerDefineProperty/initializerDefineProperty.js +10 -10
  59. package/helpers/babel/initializerWarningHelper/initializerWarningHelper.js +6 -6
  60. package/helpers/babel/instanceof/instanceof.js +6 -6
  61. package/helpers/babel/interopRequireDefault/interopRequireDefault.js +3 -3
  62. package/helpers/babel/interopRequireWildcard/interopRequireWildcard.js +37 -37
  63. package/helpers/babel/isNativeFunction/isNativeFunction.js +4 -4
  64. package/helpers/babel/isNativeReflectConstruct/isNativeReflectConstruct.js +21 -21
  65. package/helpers/babel/iterableToArray/iterableToArray.js +7 -7
  66. package/helpers/babel/iterableToArrayLimit/iterableToArrayLimit.js +36 -36
  67. package/helpers/babel/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +10 -10
  68. package/helpers/babel/jsx/jsx.js +45 -45
  69. package/helpers/babel/maybeArrayLike/maybeArrayLike.js +10 -10
  70. package/helpers/babel/newArrowCheck/newArrowCheck.js +5 -5
  71. package/helpers/babel/nonIterableRest/nonIterableRest.js +5 -5
  72. package/helpers/babel/nonIterableSpread/nonIterableSpread.js +5 -5
  73. package/helpers/babel/objectDestructuringEmpty/objectDestructuringEmpty.js +3 -3
  74. package/helpers/babel/objectSpread/objectSpread.js +23 -23
  75. package/helpers/babel/objectSpread2/objectSpread2.js +33 -33
  76. package/helpers/babel/objectWithoutProperties/objectWithoutProperties.js +19 -19
  77. package/helpers/babel/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +13 -13
  78. package/helpers/babel/possibleConstructorReturn/possibleConstructorReturn.js +10 -10
  79. package/helpers/babel/readOnlyError/readOnlyError.js +4 -4
  80. package/helpers/babel/readme.md +9 -9
  81. package/helpers/babel/set/set.js +44 -44
  82. package/helpers/babel/setPrototypeOf/setPrototypeOf.js +6 -6
  83. package/helpers/babel/skipFirstGeneratorNext/skipFirstGeneratorNext.js +8 -8
  84. package/helpers/babel/slicedToArray/slicedToArray.js +10 -10
  85. package/helpers/babel/slicedToArrayLoose/slicedToArrayLoose.js +13 -13
  86. package/helpers/babel/superPropBase/superPropBase.js +10 -10
  87. package/helpers/babel/taggedTemplateLiteral/taggedTemplateLiteral.js +10 -10
  88. package/helpers/babel/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +7 -7
  89. package/helpers/babel/tdz/tdz.js +4 -4
  90. package/helpers/babel/temporalRef/temporalRef.js +6 -6
  91. package/helpers/babel/temporalUndefined/temporalUndefined.js +3 -3
  92. package/helpers/babel/toArray/toArray.js +10 -10
  93. package/helpers/babel/toConsumableArray/toConsumableArray.js +10 -10
  94. package/helpers/babel/toPrimitive/toPrimitive.js +10 -10
  95. package/helpers/babel/toPropertyKey/toPropertyKey.js +6 -6
  96. package/helpers/babel/typeof/typeof.js +14 -14
  97. package/helpers/babel/unsupportedIterableToArray/unsupportedIterableToArray.js +12 -12
  98. package/helpers/babel/wrapAsyncGenerator/wrapAsyncGenerator.js +8 -8
  99. package/helpers/babel/wrapNativeSuper/wrapNativeSuper.js +30 -30
  100. package/helpers/babel/wrapRegExp/wrapRegExp.js +63 -63
  101. package/helpers/babel/writeOnlyError/writeOnlyError.js +4 -4
  102. package/helpers/regenerator-runtime/regenerator-runtime.js +748 -748
  103. package/package.json +5 -3
  104. package/src/buildProject.js +300 -300
  105. package/src/execute.js +184 -184
  106. package/src/internal/browser-launcher/jsenv-browser-system.js +199 -199
  107. package/src/internal/compiling/babel_plugin_import_assertions.js +121 -100
  108. package/src/internal/compiling/babel_plugin_import_metadata.js +22 -0
  109. package/src/internal/compiling/babel_plugin_import_visitor.js +84 -0
  110. package/src/internal/compiling/compile-directory/getOrGenerateCompiledFile.js +268 -265
  111. package/src/internal/compiling/compile-directory/updateMeta.js +154 -150
  112. package/src/internal/compiling/compile-directory/validateCache.js +265 -265
  113. package/src/internal/compiling/compileFile.js +224 -194
  114. package/src/internal/compiling/compileHtml.js +550 -494
  115. package/src/internal/compiling/createCompiledFileService.js +291 -290
  116. package/src/internal/compiling/html_source_file_service.js +403 -379
  117. package/src/internal/compiling/js-compilation-service/jsenvTransform.js +270 -269
  118. package/src/internal/compiling/jsenvCompilerForHtml.js +300 -293
  119. package/src/internal/compiling/startCompileServer.js +1048 -1131
  120. package/src/internal/compiling/transformResultToCompilationResult.js +220 -217
  121. package/src/internal/executing/coverage/babel_plugin_instrument.js +90 -90
  122. package/src/internal/executing/coverage/reportToCoverage.js +187 -187
  123. package/src/internal/executing/executePlan.js +183 -183
  124. package/src/internal/executing/launchAndExecute.js +458 -450
  125. package/src/internal/runtime/createBrowserRuntime/scanBrowserRuntimeFeatures.js +246 -250
  126. package/src/internal/runtime/createNodeRuntime/scanNodeRuntimeFeatures.js +112 -115
  127. package/src/internal/runtime/s.js +727 -727
  128. package/src/internal/toolbar/jsenv-logo.svg +144 -144
  129. package/src/internal/toolbar/toolbar.main.css +196 -188
  130. package/src/internal/toolbar/toolbar.main.js +227 -228
  131. package/src/internal/url_conversion.js +317 -317
  132. package/src/startExploring.js +309 -309
  133. package/src/internal/compiling/babel_plugin_transform_import_specifier.js +0 -86
  134. package/src/internal/toolbar/animation/animation.css +0 -5
  135. package/src/internal/toolbar/variant/variant.css +0 -3
@@ -1,13 +1,13 @@
1
- export default function _classApplyDescriptorSet(receiver, descriptor, value) {
2
- if (descriptor.set) {
3
- descriptor.set.call(receiver, value)
4
- } else {
5
- if (!descriptor.writable) {
6
- // This should only throw in strict mode, but class bodies are
7
- // always strict and private fields can only be used inside
8
- // class bodies.
9
- throw new TypeError("attempted to set read only private field")
10
- }
11
- descriptor.value = value
12
- }
13
- }
1
+ export default function _classApplyDescriptorSet(receiver, descriptor, value) {
2
+ if (descriptor.set) {
3
+ descriptor.set.call(receiver, value)
4
+ } else {
5
+ if (!descriptor.writable) {
6
+ // This should only throw in strict mode, but class bodies are
7
+ // always strict and private fields can only be used inside
8
+ // class bodies.
9
+ throw new TypeError("attempted to set read only private field")
10
+ }
11
+ descriptor.value = value
12
+ }
13
+ }
@@ -1,5 +1,5 @@
1
- export default function _classCallCheck(instance, Constructor) {
2
- if (!(instance instanceof Constructor)) {
3
- throw new TypeError("Cannot call a class as a function")
4
- }
5
- }
1
+ export default function _classCallCheck(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function")
4
+ }
5
+ }
@@ -1,5 +1,5 @@
1
- export default function _classCheckPrivateStaticAccess(receiver, classConstructor) {
2
- if (receiver !== classConstructor) {
3
- throw new TypeError("Private static access of wrong provenance")
4
- }
5
- }
1
+ export default function _classCheckPrivateStaticAccess(receiver, classConstructor) {
2
+ if (receiver !== classConstructor) {
3
+ throw new TypeError("Private static access of wrong provenance")
4
+ }
5
+ }
@@ -1,6 +1,6 @@
1
- export default function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
2
- if (descriptor === undefined) {
3
- // eslint-disable-next-line prefer-template
4
- throw new TypeError("attempted to " + action + " private static field before its declaration")
5
- }
6
- }
1
+ export default function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
2
+ if (descriptor === undefined) {
3
+ // eslint-disable-next-line prefer-template
4
+ throw new TypeError("attempted to " + action + " private static field before its declaration")
5
+ }
6
+ }
@@ -1,7 +1,7 @@
1
- export default function _classExtractFieldDescriptor(receiver, privateMap, action) {
2
- if (!privateMap.has(receiver)) {
3
- // eslint-disable-next-line prefer-template
4
- throw new TypeError("attempted to " + action + " private field on non-instance")
5
- }
6
- return privateMap.get(receiver)
7
- }
1
+ export default function _classExtractFieldDescriptor(receiver, privateMap, action) {
2
+ if (!privateMap.has(receiver)) {
3
+ // eslint-disable-next-line prefer-template
4
+ throw new TypeError("attempted to " + action + " private field on non-instance")
5
+ }
6
+ return privateMap.get(receiver)
7
+ }
@@ -1,4 +1,4 @@
1
- export default function _classNameTDZError(name) {
2
- // eslint-disable-next-line prefer-template
3
- throw new Error("Class " + name + "cannot be referenced in computed property keys.")
4
- }
1
+ export default function _classNameTDZError(name) {
2
+ // eslint-disable-next-line prefer-template
3
+ throw new Error("Class " + name + "cannot be referenced in computed property keys.")
4
+ }
@@ -1,7 +1,7 @@
1
- import classApplyDescriptorDestructureSet from "../classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js"
2
- import classExtractFieldDescriptor from "../classExtractFieldDescriptor/classExtractFieldDescriptor.js"
3
-
4
- export default function (receiver, privateMap) {
5
- var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set")
6
- return classApplyDescriptorDestructureSet(receiver, descriptor)
7
- }
1
+ import classApplyDescriptorDestructureSet from "../classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js"
2
+ import classExtractFieldDescriptor from "../classExtractFieldDescriptor/classExtractFieldDescriptor.js"
3
+
4
+ export default function (receiver, privateMap) {
5
+ var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set")
6
+ return classApplyDescriptorDestructureSet(receiver, descriptor)
7
+ }
@@ -1,7 +1,7 @@
1
- import classApplyDescriptorGet from "../classApplyDescriptorGet/classApplyDescriptorGet.js"
2
- import classExtractFieldDescriptor from "../classExtractFieldDescriptor/classExtractFieldDescriptor.js"
3
-
4
- export default function (receiver, privateMap) {
5
- var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get")
6
- return classApplyDescriptorGet(receiver, descriptor)
7
- }
1
+ import classApplyDescriptorGet from "../classApplyDescriptorGet/classApplyDescriptorGet.js"
2
+ import classExtractFieldDescriptor from "../classExtractFieldDescriptor/classExtractFieldDescriptor.js"
3
+
4
+ export default function (receiver, privateMap) {
5
+ var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get")
6
+ return classApplyDescriptorGet(receiver, descriptor)
7
+ }
@@ -1,6 +1,6 @@
1
- export default function (receiver, privateKey) {
2
- if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
3
- throw new TypeError("attempted to use private field on non-instance")
4
- }
5
- return receiver
6
- }
1
+ export default function (receiver, privateKey) {
2
+ if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
3
+ throw new TypeError("attempted to use private field on non-instance")
4
+ }
5
+ return receiver
6
+ }
@@ -1,5 +1,5 @@
1
- var id = 0
2
- export default function (name) {
3
- // eslint-disable-next-line prefer-template
4
- return "__private_" + id++ + "_" + name
5
- }
1
+ var id = 0
2
+ export default function (name) {
3
+ // eslint-disable-next-line prefer-template
4
+ return "__private_" + id++ + "_" + name
5
+ }
@@ -1,8 +1,8 @@
1
- import classApplyDescriptorSet from "../classApplyDescriptorSet/classApplyDescriptorSet.js"
2
- import classExtractFieldDescriptor from "../classExtractFieldDescriptor/classExtractFieldDescriptor.js"
3
-
4
- export default function (receiver, privateMap, value) {
5
- var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set")
6
- classApplyDescriptorSet(receiver, descriptor, value)
7
- return value
8
- }
1
+ import classApplyDescriptorSet from "../classApplyDescriptorSet/classApplyDescriptorSet.js"
2
+ import classExtractFieldDescriptor from "../classExtractFieldDescriptor/classExtractFieldDescriptor.js"
3
+
4
+ export default function (receiver, privateMap, value) {
5
+ var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set")
6
+ classApplyDescriptorSet(receiver, descriptor, value)
7
+ return value
8
+ }
@@ -1,6 +1,6 @@
1
- export default function _classPrivateMethodGet(receiver, privateSet, fn) {
2
- if (!privateSet.has(receiver)) {
3
- throw new TypeError("attempted to get private field on non-instance")
4
- }
5
- return fn
6
- }
1
+ export default function _classPrivateMethodGet(receiver, privateSet, fn) {
2
+ if (!privateSet.has(receiver)) {
3
+ throw new TypeError("attempted to get private field on non-instance")
4
+ }
5
+ return fn
6
+ }
@@ -1,3 +1,3 @@
1
- export default function _classStaticPrivateMethodSet() {
2
- throw new TypeError("attempted to set read only static private field")
3
- }
1
+ export default function _classStaticPrivateMethodSet() {
2
+ throw new TypeError("attempted to set read only static private field")
3
+ }
@@ -1,9 +1,9 @@
1
- import classApplyDescriptorGet from "../classApplyDescriptorGet/classApplyDescriptorGet.js"
2
- import classCheckPrivateStaticAccess from "../classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js"
3
- import classCheckPrivateStaticFieldDescriptor from "../classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js"
4
-
5
- export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
6
- classCheckPrivateStaticAccess(receiver, classConstructor)
7
- classCheckPrivateStaticFieldDescriptor(descriptor, "get")
8
- return classApplyDescriptorGet(receiver, descriptor)
9
- }
1
+ import classApplyDescriptorGet from "../classApplyDescriptorGet/classApplyDescriptorGet.js"
2
+ import classCheckPrivateStaticAccess from "../classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js"
3
+ import classCheckPrivateStaticFieldDescriptor from "../classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js"
4
+
5
+ export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
6
+ classCheckPrivateStaticAccess(receiver, classConstructor)
7
+ classCheckPrivateStaticFieldDescriptor(descriptor, "get")
8
+ return classApplyDescriptorGet(receiver, descriptor)
9
+ }
@@ -1,15 +1,15 @@
1
- import classApplyDescriptorSet from "../classApplyDescriptorSet/classApplyDescriptorSet.js"
2
- import classCheckPrivateStaticAccess from "../classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js"
3
- import classCheckPrivateStaticFieldDescriptor from "../classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js"
4
-
5
- export default function _classStaticPrivateFieldSpecSet(
6
- receiver,
7
- classConstructor,
8
- descriptor,
9
- value,
10
- ) {
11
- classCheckPrivateStaticAccess(receiver, classConstructor)
12
- classCheckPrivateStaticFieldDescriptor(descriptor, "set")
13
- classApplyDescriptorSet(receiver, descriptor, value)
14
- return value
15
- }
1
+ import classApplyDescriptorSet from "../classApplyDescriptorSet/classApplyDescriptorSet.js"
2
+ import classCheckPrivateStaticAccess from "../classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js"
3
+ import classCheckPrivateStaticFieldDescriptor from "../classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js"
4
+
5
+ export default function _classStaticPrivateFieldSpecSet(
6
+ receiver,
7
+ classConstructor,
8
+ descriptor,
9
+ value,
10
+ ) {
11
+ classCheckPrivateStaticAccess(receiver, classConstructor)
12
+ classCheckPrivateStaticFieldDescriptor(descriptor, "set")
13
+ classApplyDescriptorSet(receiver, descriptor, value)
14
+ return value
15
+ }
@@ -1,6 +1,6 @@
1
- import classCheckPrivateStaticAccess from "../classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js"
2
-
3
- export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) {
4
- classCheckPrivateStaticAccess(receiver, classConstructor)
5
- return method
6
- }
1
+ import classCheckPrivateStaticAccess from "../classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js"
2
+
3
+ export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) {
4
+ classCheckPrivateStaticAccess(receiver, classConstructor)
5
+ return method
6
+ }
@@ -1,3 +1,3 @@
1
- export default function _classStaticPrivateMethodSet() {
2
- throw new TypeError("attempted to set read only static private field")
3
- }
1
+ export default function _classStaticPrivateMethodSet() {
2
+ throw new TypeError("attempted to set read only static private field")
3
+ }
@@ -1,16 +1,16 @@
1
- import setPrototypeOf from "../setPrototypeOf/setPrototypeOf.js"
2
- import isNativeReflectConstruct from "../isNativeReflectConstruct/isNativeReflectConstruct.js"
3
-
4
- // NOTE: If Parent !== Class, the correct __proto__ is set *after*
5
- // calling the constructor.
6
- function reflectConstruct(Parent, args, Class) {
7
- var a = [null]
8
- // eslint-disable-next-line prefer-spread
9
- a.push.apply(a, args)
10
- var Constructor = Function.bind.apply(Parent, a)
11
- var instance = new Constructor()
12
- if (Class) setPrototypeOf(instance, Class.prototype)
13
- return instance
14
- }
15
-
16
- export default isNativeReflectConstruct() ? Reflect.construct : reflectConstruct
1
+ import setPrototypeOf from "../setPrototypeOf/setPrototypeOf.js"
2
+ import isNativeReflectConstruct from "../isNativeReflectConstruct/isNativeReflectConstruct.js"
3
+
4
+ // NOTE: If Parent !== Class, the correct __proto__ is set *after*
5
+ // calling the constructor.
6
+ function reflectConstruct(Parent, args, Class) {
7
+ var a = [null]
8
+ // eslint-disable-next-line prefer-spread
9
+ a.push.apply(a, args)
10
+ var Constructor = Function.bind.apply(Parent, a)
11
+ var instance = new Constructor()
12
+ if (Class) setPrototypeOf(instance, Class.prototype)
13
+ return instance
14
+ }
15
+
16
+ export default isNativeReflectConstruct() ? Reflect.construct : reflectConstruct
@@ -1,15 +1,15 @@
1
- export default (Constructor, protoProps, staticProps) => {
2
- if (protoProps) defineProperties(Constructor.prototype, protoProps)
3
- if (staticProps) defineProperties(Constructor, staticProps)
4
- return Constructor
5
- }
6
-
7
- function defineProperties(target, props) {
8
- for (var i = 0; i < props.length; i++) {
9
- var descriptor = props[i]
10
- descriptor.enumerable = descriptor.enumerable || false
11
- descriptor.configurable = true
12
- if ("value" in descriptor) descriptor.writable = true
13
- Object.defineProperty(target, descriptor.key, descriptor)
14
- }
15
- }
1
+ export default (Constructor, protoProps, staticProps) => {
2
+ if (protoProps) defineProperties(Constructor.prototype, protoProps)
3
+ if (staticProps) defineProperties(Constructor, staticProps)
4
+ return Constructor
5
+ }
6
+
7
+ function defineProperties(target, props) {
8
+ for (var i = 0; i < props.length; i++) {
9
+ var descriptor = props[i]
10
+ descriptor.enumerable = descriptor.enumerable || false
11
+ descriptor.configurable = true
12
+ if ("value" in descriptor) descriptor.writable = true
13
+ Object.defineProperty(target, descriptor.key, descriptor)
14
+ }
15
+ }
@@ -1,60 +1,60 @@
1
- /* eslint-disable eqeqeq, no-eq-null */
2
- import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
3
-
4
- // s: start (create the iterator)
5
- // n: next
6
- // e: error (called whenever something throws)
7
- // f: finish (always called at the end)
8
- export default function _createForOfIteratorHelper(o, allowArrayLike) {
9
- var it = (typeof Symbol !== "undefined" && o[Symbol.iterator]) || o["@@iterator"]
10
- if (!it) {
11
- // Fallback for engines without symbol support
12
- if (
13
- Array.isArray(o) ||
14
- (it = unsupportedIterableToArray(o)) ||
15
- (allowArrayLike && o && typeof o.length === "number")
16
- ) {
17
- if (it) o = it
18
- var i = 0
19
- var F = function () {}
20
- return {
21
- s: F,
22
- n: function () {
23
- if (i >= o.length) return { done: true }
24
- return { done: false, value: o[i++] }
25
- },
26
- e: function (e) {
27
- throw e
28
- },
29
- f: F,
30
- }
31
- }
32
- throw new TypeError(
33
- "Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
34
- )
35
- }
36
- var normalCompletion = true,
37
- didErr = false,
38
- err
39
- return {
40
- s: function () {
41
- it = it.call(o)
42
- },
43
- n: function () {
44
- var step = it.next()
45
- normalCompletion = step.done
46
- return step
47
- },
48
- e: function (e) {
49
- didErr = true
50
- err = e
51
- },
52
- f: function () {
53
- try {
54
- if (!normalCompletion && it.return != null) it.return()
55
- } finally {
56
- if (didErr) throw err
57
- }
58
- },
59
- }
60
- }
1
+ /* eslint-disable eqeqeq, no-eq-null */
2
+ import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
3
+
4
+ // s: start (create the iterator)
5
+ // n: next
6
+ // e: error (called whenever something throws)
7
+ // f: finish (always called at the end)
8
+ export default function _createForOfIteratorHelper(o, allowArrayLike) {
9
+ var it = (typeof Symbol !== "undefined" && o[Symbol.iterator]) || o["@@iterator"]
10
+ if (!it) {
11
+ // Fallback for engines without symbol support
12
+ if (
13
+ Array.isArray(o) ||
14
+ (it = unsupportedIterableToArray(o)) ||
15
+ (allowArrayLike && o && typeof o.length === "number")
16
+ ) {
17
+ if (it) o = it
18
+ var i = 0
19
+ var F = function () {}
20
+ return {
21
+ s: F,
22
+ n: function () {
23
+ if (i >= o.length) return { done: true }
24
+ return { done: false, value: o[i++] }
25
+ },
26
+ e: function (e) {
27
+ throw e
28
+ },
29
+ f: F,
30
+ }
31
+ }
32
+ throw new TypeError(
33
+ "Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
34
+ )
35
+ }
36
+ var normalCompletion = true,
37
+ didErr = false,
38
+ err
39
+ return {
40
+ s: function () {
41
+ it = it.call(o)
42
+ },
43
+ n: function () {
44
+ var step = it.next()
45
+ normalCompletion = step.done
46
+ return step
47
+ },
48
+ e: function (e) {
49
+ didErr = true
50
+ err = e
51
+ },
52
+ f: function () {
53
+ try {
54
+ if (!normalCompletion && it.return != null) it.return()
55
+ } finally {
56
+ if (didErr) throw err
57
+ }
58
+ },
59
+ }
60
+ }
@@ -1,23 +1,23 @@
1
- /* eslint-disable eqeqeq, no-eq-null */
2
- import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
3
-
4
- export default function _createForOfIteratorHelperLoose(o, allowArrayLike) {
5
- var it = (typeof Symbol !== "undefined" && o[Symbol.iterator]) || o["@@iterator"]
6
- if (it) return (it = it.call(o)).next.bind(it)
7
- // Fallback for engines without symbol support
8
- if (
9
- Array.isArray(o) ||
10
- (it = unsupportedIterableToArray(o)) ||
11
- (allowArrayLike && o && typeof o.length === "number")
12
- ) {
13
- if (it) o = it
14
- var i = 0
15
- return function () {
16
- if (i >= o.length) return { done: true }
17
- return { done: false, value: o[i++] }
18
- }
19
- }
20
- throw new TypeError(
21
- "Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
22
- )
23
- }
1
+ /* eslint-disable eqeqeq, no-eq-null */
2
+ import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
3
+
4
+ export default function _createForOfIteratorHelperLoose(o, allowArrayLike) {
5
+ var it = (typeof Symbol !== "undefined" && o[Symbol.iterator]) || o["@@iterator"]
6
+ if (it) return (it = it.call(o)).next.bind(it)
7
+ // Fallback for engines without symbol support
8
+ if (
9
+ Array.isArray(o) ||
10
+ (it = unsupportedIterableToArray(o)) ||
11
+ (allowArrayLike && o && typeof o.length === "number")
12
+ ) {
13
+ if (it) o = it
14
+ var i = 0
15
+ return function () {
16
+ if (i >= o.length) return { done: true }
17
+ return { done: false, value: o[i++] }
18
+ }
19
+ }
20
+ throw new TypeError(
21
+ "Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
22
+ )
23
+ }
@@ -1,50 +1,50 @@
1
- /* globals REACT_ELEMENT_TYPE */
2
- export default function _createRawReactElement(type, props, key, children) {
3
- if (!REACT_ELEMENT_TYPE) {
4
- // eslint-disable-next-line no-native-reassign
5
- REACT_ELEMENT_TYPE =
6
- (typeof Symbol === "function" &&
7
- // "for" is a reserved keyword in ES3 so escaping it here for backward compatibility
8
- Symbol["for"] &&
9
- Symbol["for"]("react.element")) ||
10
- 0xeac7
11
- }
12
-
13
- var defaultProps = type && type.defaultProps
14
- var childrenLength = arguments.length - 3
15
-
16
- if (!props && childrenLength !== 0) {
17
- // If we're going to assign props.children, we create a new object now
18
- // to avoid mutating defaultProps.
19
- props = { children: void 0 }
20
- }
21
-
22
- if (childrenLength === 1) {
23
- props.children = children
24
- } else if (childrenLength > 1) {
25
- var childArray = new Array(childrenLength)
26
- for (var i = 0; i < childrenLength; i++) {
27
- childArray[i] = arguments[i + 3]
28
- }
29
- props.children = childArray
30
- }
31
-
32
- if (props && defaultProps) {
33
- for (var propName in defaultProps) {
34
- if (props[propName] === void 0) {
35
- props[propName] = defaultProps[propName]
36
- }
37
- }
38
- } else if (!props) {
39
- props = defaultProps || {}
40
- }
41
-
42
- return {
43
- $$typeof: REACT_ELEMENT_TYPE,
44
- type: type,
45
- key: key === undefined ? null : "" + key,
46
- ref: null,
47
- props: props,
48
- _owner: null,
49
- }
50
- }
1
+ /* globals REACT_ELEMENT_TYPE */
2
+ export default function _createRawReactElement(type, props, key, children) {
3
+ if (!REACT_ELEMENT_TYPE) {
4
+ // eslint-disable-next-line no-native-reassign
5
+ REACT_ELEMENT_TYPE =
6
+ (typeof Symbol === "function" &&
7
+ // "for" is a reserved keyword in ES3 so escaping it here for backward compatibility
8
+ Symbol["for"] &&
9
+ Symbol["for"]("react.element")) ||
10
+ 0xeac7
11
+ }
12
+
13
+ var defaultProps = type && type.defaultProps
14
+ var childrenLength = arguments.length - 3
15
+
16
+ if (!props && childrenLength !== 0) {
17
+ // If we're going to assign props.children, we create a new object now
18
+ // to avoid mutating defaultProps.
19
+ props = { children: void 0 }
20
+ }
21
+
22
+ if (childrenLength === 1) {
23
+ props.children = children
24
+ } else if (childrenLength > 1) {
25
+ var childArray = new Array(childrenLength)
26
+ for (var i = 0; i < childrenLength; i++) {
27
+ childArray[i] = arguments[i + 3]
28
+ }
29
+ props.children = childArray
30
+ }
31
+
32
+ if (props && defaultProps) {
33
+ for (var propName in defaultProps) {
34
+ if (props[propName] === void 0) {
35
+ props[propName] = defaultProps[propName]
36
+ }
37
+ }
38
+ } else if (!props) {
39
+ props = defaultProps || {}
40
+ }
41
+
42
+ return {
43
+ $$typeof: REACT_ELEMENT_TYPE,
44
+ type: type,
45
+ key: key === undefined ? null : "" + key,
46
+ ref: null,
47
+ props: props,
48
+ _owner: null,
49
+ }
50
+ }
@@ -1,22 +1,22 @@
1
- import getPrototypeOf from "../getPrototypeOf/getPrototypeOf.js"
2
- import isNativeReflectConstruct from "../isNativeReflectConstruct/isNativeReflectConstruct.js"
3
- import possibleConstructorReturn from "../possibleConstructorReturn/possibleConstructorReturn.js"
4
-
5
- export default function _createSuper(Derived) {
6
- var hasNativeReflectConstruct = isNativeReflectConstruct()
7
-
8
- return function _createSuperInternal() {
9
- var Super = getPrototypeOf(Derived)
10
- var result
11
- if (hasNativeReflectConstruct) {
12
- // NOTE: This doesn't work if this.__proto__.constructor has been modified.
13
- var NewTarget = getPrototypeOf(this).constructor
14
- // eslint-disable-next-line prefer-rest-params
15
- result = Reflect.construct(Super, arguments, NewTarget)
16
- } else {
17
- // eslint-disable-next-line prefer-rest-params
18
- result = Super.apply(this, arguments)
19
- }
20
- return possibleConstructorReturn(this, result)
21
- }
22
- }
1
+ import getPrototypeOf from "../getPrototypeOf/getPrototypeOf.js"
2
+ import isNativeReflectConstruct from "../isNativeReflectConstruct/isNativeReflectConstruct.js"
3
+ import possibleConstructorReturn from "../possibleConstructorReturn/possibleConstructorReturn.js"
4
+
5
+ export default function _createSuper(Derived) {
6
+ var hasNativeReflectConstruct = isNativeReflectConstruct()
7
+
8
+ return function _createSuperInternal() {
9
+ var Super = getPrototypeOf(Derived)
10
+ var result
11
+ if (hasNativeReflectConstruct) {
12
+ // NOTE: This doesn't work if this.__proto__.constructor has been modified.
13
+ var NewTarget = getPrototypeOf(this).constructor
14
+ // eslint-disable-next-line prefer-rest-params
15
+ result = Reflect.construct(Super, arguments, NewTarget)
16
+ } else {
17
+ // eslint-disable-next-line prefer-rest-params
18
+ result = Super.apply(this, arguments)
19
+ }
20
+ return possibleConstructorReturn(this, result)
21
+ }
22
+ }