@jsenv/core 23.8.2 → 23.8.7
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.
- package/dist/jsenv_browser_system.js +46 -39
- package/dist/jsenv_browser_system.js.map +14 -14
- package/dist/jsenv_compile_proxy.js.map +6 -6
- package/dist/jsenv_exploring_index.js.map +5 -5
- package/dist/jsenv_exploring_redirector.js.map +12 -12
- package/dist/jsenv_toolbar.js.map +7 -7
- package/dist/jsenv_toolbar_injector.js.map +5 -5
- package/helpers/babel/.eslintrc.cjs +24 -24
- package/helpers/babel/AsyncGenerator/AsyncGenerator.js +81 -81
- package/helpers/babel/AwaitValue/AwaitValue.js +3 -3
- package/helpers/babel/applyDecoratorDescriptor/applyDecoratorDescriptor.js +33 -33
- package/helpers/babel/arrayLikeToArray/arrayLikeToArray.js +7 -7
- package/helpers/babel/arrayWithHoles/arrayWithHoles.js +4 -4
- package/helpers/babel/arrayWithoutHoles/arrayWithoutHoles.js +6 -6
- package/helpers/babel/assertThisInitialized/assertThisInitialized.js +7 -7
- package/helpers/babel/asyncGeneratorDelegate/asyncGeneratorDelegate.js +40 -40
- package/helpers/babel/asyncIterator/asyncIterator.js +12 -12
- package/helpers/babel/asyncToGenerator/asyncToGenerator.js +34 -34
- package/helpers/babel/awaitAsyncGenerator/awaitAsyncGenerator.js +5 -5
- package/helpers/babel/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +20 -20
- package/helpers/babel/classApplyDescriptorGet/classApplyDescriptorGet.js +6 -6
- package/helpers/babel/classApplyDescriptorSet/classApplyDescriptorSet.js +13 -13
- package/helpers/babel/classCallCheck/classCallCheck.js +5 -5
- package/helpers/babel/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +5 -5
- package/helpers/babel/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +6 -6
- package/helpers/babel/classExtractFieldDescriptor/classExtractFieldDescriptor.js +7 -7
- package/helpers/babel/classNameTDZError/classNameTDZError.js +4 -4
- package/helpers/babel/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +7 -7
- package/helpers/babel/classPrivateFieldGet/classPrivateFieldGet.js +7 -7
- package/helpers/babel/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +6 -6
- package/helpers/babel/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +5 -5
- package/helpers/babel/classPrivateFieldSet/classPrivateFieldSet.js +8 -8
- package/helpers/babel/classPrivateMethodGet/classPrivateMethodGet.js +6 -6
- package/helpers/babel/classPrivateMethodSet/classPrivateMethodSet.js +3 -3
- package/helpers/babel/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +9 -9
- package/helpers/babel/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +15 -15
- package/helpers/babel/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +6 -6
- package/helpers/babel/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +3 -3
- package/helpers/babel/construct/construct.js +16 -16
- package/helpers/babel/createClass/createClass.js +15 -15
- package/helpers/babel/createForOfIteratorHelper/createForOfIteratorHelper.js +60 -60
- package/helpers/babel/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +23 -23
- package/helpers/babel/createRawReactElement/createRawReactElement.js +50 -50
- package/helpers/babel/createSuper/createSuper.js +22 -22
- package/helpers/babel/decorate/decorate.js +403 -403
- package/helpers/babel/defaults/defaults.js +11 -11
- package/helpers/babel/defineEnumerableProperties/defineEnumerableProperties.js +23 -23
- package/helpers/babel/defineProperty/defineProperty.js +18 -18
- package/helpers/babel/extends/extends.js +14 -14
- package/helpers/babel/get/get.js +13 -13
- package/helpers/babel/getPrototypeOf/getPrototypeOf.js +4 -4
- package/helpers/babel/inherits/inherits.js +15 -15
- package/helpers/babel/inheritsLoose/inheritsLoose.js +7 -7
- package/helpers/babel/initializerDefineProperty/initializerDefineProperty.js +10 -10
- package/helpers/babel/initializerWarningHelper/initializerWarningHelper.js +6 -6
- package/helpers/babel/instanceof/instanceof.js +6 -6
- package/helpers/babel/interopRequireDefault/interopRequireDefault.js +3 -3
- package/helpers/babel/interopRequireWildcard/interopRequireWildcard.js +37 -37
- package/helpers/babel/isNativeFunction/isNativeFunction.js +4 -4
- package/helpers/babel/isNativeReflectConstruct/isNativeReflectConstruct.js +21 -21
- package/helpers/babel/iterableToArray/iterableToArray.js +7 -7
- package/helpers/babel/iterableToArrayLimit/iterableToArrayLimit.js +36 -36
- package/helpers/babel/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +10 -10
- package/helpers/babel/jsx/jsx.js +45 -45
- package/helpers/babel/maybeArrayLike/maybeArrayLike.js +10 -10
- package/helpers/babel/newArrowCheck/newArrowCheck.js +5 -5
- package/helpers/babel/nonIterableRest/nonIterableRest.js +5 -5
- package/helpers/babel/nonIterableSpread/nonIterableSpread.js +5 -5
- package/helpers/babel/objectDestructuringEmpty/objectDestructuringEmpty.js +3 -3
- package/helpers/babel/objectSpread/objectSpread.js +23 -23
- package/helpers/babel/objectSpread2/objectSpread2.js +33 -33
- package/helpers/babel/objectWithoutProperties/objectWithoutProperties.js +19 -19
- package/helpers/babel/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +13 -13
- package/helpers/babel/possibleConstructorReturn/possibleConstructorReturn.js +10 -10
- package/helpers/babel/readOnlyError/readOnlyError.js +4 -4
- package/helpers/babel/readme.md +9 -9
- package/helpers/babel/set/set.js +44 -44
- package/helpers/babel/setPrototypeOf/setPrototypeOf.js +6 -6
- package/helpers/babel/skipFirstGeneratorNext/skipFirstGeneratorNext.js +8 -8
- package/helpers/babel/slicedToArray/slicedToArray.js +10 -10
- package/helpers/babel/slicedToArrayLoose/slicedToArrayLoose.js +13 -13
- package/helpers/babel/superPropBase/superPropBase.js +10 -10
- package/helpers/babel/taggedTemplateLiteral/taggedTemplateLiteral.js +10 -10
- package/helpers/babel/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +7 -7
- package/helpers/babel/tdz/tdz.js +4 -4
- package/helpers/babel/temporalRef/temporalRef.js +6 -6
- package/helpers/babel/temporalUndefined/temporalUndefined.js +3 -3
- package/helpers/babel/toArray/toArray.js +10 -10
- package/helpers/babel/toConsumableArray/toConsumableArray.js +10 -10
- package/helpers/babel/toPrimitive/toPrimitive.js +10 -10
- package/helpers/babel/toPropertyKey/toPropertyKey.js +6 -6
- package/helpers/babel/typeof/typeof.js +14 -14
- package/helpers/babel/unsupportedIterableToArray/unsupportedIterableToArray.js +12 -12
- package/helpers/babel/wrapAsyncGenerator/wrapAsyncGenerator.js +8 -8
- package/helpers/babel/wrapNativeSuper/wrapNativeSuper.js +30 -30
- package/helpers/babel/wrapRegExp/wrapRegExp.js +63 -63
- package/helpers/babel/writeOnlyError/writeOnlyError.js +4 -4
- package/helpers/regenerator-runtime/regenerator-runtime.js +748 -748
- package/{LICENSE → license} +21 -21
- package/package.json +2 -2
- package/src/buildProject.js +300 -300
- package/src/execute.js +184 -184
- package/src/internal/browser-launcher/jsenv-browser-system.js +203 -199
- package/src/internal/building/buildUsingRollup.js +2 -10
- package/src/internal/compiling/babel_plugin_import_assertions.js +121 -121
- package/src/internal/compiling/babel_plugin_import_metadata.js +22 -22
- package/src/internal/compiling/babel_plugin_import_visitor.js +84 -84
- package/src/internal/compiling/compile-directory/getOrGenerateCompiledFile.js +268 -268
- package/src/internal/compiling/compile-directory/updateMeta.js +154 -154
- package/src/internal/compiling/compile-directory/validateCache.js +265 -265
- package/src/internal/compiling/compileFile.js +233 -224
- package/src/internal/compiling/compileHtml.js +550 -550
- package/src/internal/compiling/createCompiledFileService.js +291 -291
- package/src/internal/compiling/html_source_file_service.js +403 -404
- package/src/internal/compiling/js-compilation-service/jsenvTransform.js +272 -270
- package/src/internal/compiling/jsenvCompilerForHtml.js +374 -308
- package/src/internal/compiling/jsenvCompilerForJavaScript.js +2 -0
- package/src/internal/compiling/startCompileServer.js +1086 -1048
- package/src/internal/compiling/transformResultToCompilationResult.js +220 -220
- package/src/internal/executing/coverage/babel_plugin_instrument.js +90 -90
- package/src/internal/executing/coverage/reportToCoverage.js +193 -187
- package/src/internal/executing/executePlan.js +183 -183
- package/src/internal/executing/launchAndExecute.js +458 -458
- package/src/internal/generateGroupMap/featuresCompatMap.js +29 -0
- package/src/internal/generateGroupMap/jsenvBabelPluginCompatMap.js +1 -8
- package/src/internal/runtime/createBrowserRuntime/scanBrowserRuntimeFeatures.js +246 -246
- package/src/internal/runtime/createNodeRuntime/scanNodeRuntimeFeatures.js +112 -112
- package/src/internal/runtime/s.js +727 -727
- package/src/internal/toolbar/jsenv-logo.svg +144 -144
- package/src/internal/toolbar/toolbar.main.css +196 -196
- package/src/internal/toolbar/toolbar.main.js +227 -227
- package/src/internal/url_conversion.js +317 -317
- package/src/startExploring.js +309 -309
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default () => {
|
|
2
|
-
throw new TypeError(
|
|
3
|
-
"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
|
|
4
|
-
)
|
|
5
|
-
}
|
|
1
|
+
export default () => {
|
|
2
|
+
throw new TypeError(
|
|
3
|
+
"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
|
|
4
|
+
)
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default () => {
|
|
2
|
-
throw new TypeError(
|
|
3
|
-
"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
|
|
4
|
-
)
|
|
5
|
-
}
|
|
1
|
+
export default () => {
|
|
2
|
+
throw new TypeError(
|
|
3
|
+
"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
|
|
4
|
+
)
|
|
5
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function _objectDestructuringEmpty(obj) {
|
|
2
|
-
if (obj == null) throw new TypeError("Cannot destructure undefined")
|
|
3
|
-
}
|
|
1
|
+
export default function _objectDestructuringEmpty(obj) {
|
|
2
|
+
if (obj == null) throw new TypeError("Cannot destructure undefined")
|
|
3
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import defineProperty from "../defineProperty/defineProperty.js"
|
|
2
|
-
|
|
3
|
-
export default function (target) {
|
|
4
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
5
|
-
// eslint-disable-next-line
|
|
6
|
-
var source = arguments[i] != null ? Object(arguments[i]) : {}
|
|
7
|
-
var ownKeys = Object.keys(source)
|
|
8
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
9
|
-
ownKeys.push.apply(
|
|
10
|
-
ownKeys,
|
|
11
|
-
// eslint-disable-next-line no-loop-func
|
|
12
|
-
Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
13
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable
|
|
14
|
-
}),
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
// eslint-disable-next-line no-loop-func
|
|
18
|
-
ownKeys.forEach(function (key) {
|
|
19
|
-
defineProperty(target, key, source[key])
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
return target
|
|
23
|
-
}
|
|
1
|
+
import defineProperty from "../defineProperty/defineProperty.js"
|
|
2
|
+
|
|
3
|
+
export default function (target) {
|
|
4
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
5
|
+
// eslint-disable-next-line
|
|
6
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {}
|
|
7
|
+
var ownKeys = Object.keys(source)
|
|
8
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
9
|
+
ownKeys.push.apply(
|
|
10
|
+
ownKeys,
|
|
11
|
+
// eslint-disable-next-line no-loop-func
|
|
12
|
+
Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
13
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable
|
|
14
|
+
}),
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
// eslint-disable-next-line no-loop-func
|
|
18
|
+
ownKeys.forEach(function (key) {
|
|
19
|
+
defineProperty(target, key, source[key])
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
return target
|
|
23
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import defineProperty from "../defineProperty/defineProperty.js"
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) {
|
|
4
|
-
var keys = Object.keys(object)
|
|
5
|
-
if (Object.getOwnPropertySymbols) {
|
|
6
|
-
var symbols = Object.getOwnPropertySymbols(object)
|
|
7
|
-
if (enumerableOnly) {
|
|
8
|
-
symbols = symbols.filter(function (sym) {
|
|
9
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable
|
|
10
|
-
})
|
|
11
|
-
}
|
|
12
|
-
keys.push.apply(keys, symbols)
|
|
13
|
-
}
|
|
14
|
-
return keys
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default function _objectSpread2(target) {
|
|
18
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
19
|
-
var source = arguments[i] != null ? arguments[i] : {}
|
|
20
|
-
if (i % 2) {
|
|
21
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
22
|
-
defineProperty(target, key, source[key])
|
|
23
|
-
})
|
|
24
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
25
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source))
|
|
26
|
-
} else {
|
|
27
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
28
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key))
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return target
|
|
33
|
-
}
|
|
1
|
+
import defineProperty from "../defineProperty/defineProperty.js"
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) {
|
|
4
|
+
var keys = Object.keys(object)
|
|
5
|
+
if (Object.getOwnPropertySymbols) {
|
|
6
|
+
var symbols = Object.getOwnPropertySymbols(object)
|
|
7
|
+
if (enumerableOnly) {
|
|
8
|
+
symbols = symbols.filter(function (sym) {
|
|
9
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
keys.push.apply(keys, symbols)
|
|
13
|
+
}
|
|
14
|
+
return keys
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function _objectSpread2(target) {
|
|
18
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
19
|
+
var source = arguments[i] != null ? arguments[i] : {}
|
|
20
|
+
if (i % 2) {
|
|
21
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
22
|
+
defineProperty(target, key, source[key])
|
|
23
|
+
})
|
|
24
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
25
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source))
|
|
26
|
+
} else {
|
|
27
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
28
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key))
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return target
|
|
33
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import objectWithoutPropertiesLoose from "../objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js"
|
|
2
|
-
|
|
3
|
-
export default (source, excluded) => {
|
|
4
|
-
if (source === null) return {}
|
|
5
|
-
|
|
6
|
-
var target = objectWithoutPropertiesLoose(source, excluded)
|
|
7
|
-
var key
|
|
8
|
-
var i
|
|
9
|
-
if (Object.getOwnPropertySymbols) {
|
|
10
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source)
|
|
11
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
12
|
-
key = sourceSymbolKeys[i]
|
|
13
|
-
if (excluded.indexOf(key) >= 0) continue
|
|
14
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue
|
|
15
|
-
target[key] = source[key]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return target
|
|
19
|
-
}
|
|
1
|
+
import objectWithoutPropertiesLoose from "../objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js"
|
|
2
|
+
|
|
3
|
+
export default (source, excluded) => {
|
|
4
|
+
if (source === null) return {}
|
|
5
|
+
|
|
6
|
+
var target = objectWithoutPropertiesLoose(source, excluded)
|
|
7
|
+
var key
|
|
8
|
+
var i
|
|
9
|
+
if (Object.getOwnPropertySymbols) {
|
|
10
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source)
|
|
11
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
12
|
+
key = sourceSymbolKeys[i]
|
|
13
|
+
if (excluded.indexOf(key) >= 0) continue
|
|
14
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue
|
|
15
|
+
target[key] = source[key]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return target
|
|
19
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export default (source, excluded) => {
|
|
2
|
-
if (source === null) return {}
|
|
3
|
-
var target = {}
|
|
4
|
-
var sourceKeys = Object.keys(source)
|
|
5
|
-
var key
|
|
6
|
-
var i
|
|
7
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
8
|
-
key = sourceKeys[i]
|
|
9
|
-
if (excluded.indexOf(key) >= 0) continue
|
|
10
|
-
target[key] = source[key]
|
|
11
|
-
}
|
|
12
|
-
return target
|
|
13
|
-
}
|
|
1
|
+
export default (source, excluded) => {
|
|
2
|
+
if (source === null) return {}
|
|
3
|
+
var target = {}
|
|
4
|
+
var sourceKeys = Object.keys(source)
|
|
5
|
+
var key
|
|
6
|
+
var i
|
|
7
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
8
|
+
key = sourceKeys[i]
|
|
9
|
+
if (excluded.indexOf(key) >= 0) continue
|
|
10
|
+
target[key] = source[key]
|
|
11
|
+
}
|
|
12
|
+
return target
|
|
13
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import assertThisInitialized from "../assertThisInitialized/assertThisInitialized.js"
|
|
2
|
-
|
|
3
|
-
export default (self, call) => {
|
|
4
|
-
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
5
|
-
return call
|
|
6
|
-
} else if (call !== void 0) {
|
|
7
|
-
throw new TypeError("Derived constructors may only return object or undefined")
|
|
8
|
-
}
|
|
9
|
-
return assertThisInitialized(self)
|
|
10
|
-
}
|
|
1
|
+
import assertThisInitialized from "../assertThisInitialized/assertThisInitialized.js"
|
|
2
|
+
|
|
3
|
+
export default (self, call) => {
|
|
4
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
5
|
+
return call
|
|
6
|
+
} else if (call !== void 0) {
|
|
7
|
+
throw new TypeError("Derived constructors may only return object or undefined")
|
|
8
|
+
}
|
|
9
|
+
return assertThisInitialized(self)
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function (name) {
|
|
2
|
-
// eslint-disable-next-line prefer-template
|
|
3
|
-
throw new TypeError(name + " is read-only")
|
|
4
|
-
}
|
|
1
|
+
export default function (name) {
|
|
2
|
+
// eslint-disable-next-line prefer-template
|
|
3
|
+
throw new TypeError(name + " is read-only")
|
|
4
|
+
}
|
package/helpers/babel/readme.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# Babel helpers
|
|
2
|
-
|
|
3
|
-
Babel helpers are copied in there to properly appear in sourcemap.
|
|
4
|
-
|
|
5
|
-
- All thoose file are inlines versions of babel helpers declared in: https://github.com/babel/babel/blob/main/packages/babel-helpers/src/helpers.js
|
|
6
|
-
|
|
7
|
-
- History of the file: https://github.com/babel/babel/commits/main/packages/babel-helpers/src/helpers.js
|
|
8
|
-
|
|
9
|
-
- History of individual helpers: https://github.com/babel/babel/commits/main/packages/babel-helpers/src/helpers
|
|
1
|
+
# Babel helpers
|
|
2
|
+
|
|
3
|
+
Babel helpers are copied in there to properly appear in sourcemap.
|
|
4
|
+
|
|
5
|
+
- All thoose file are inlines versions of babel helpers declared in: https://github.com/babel/babel/blob/main/packages/babel-helpers/src/helpers.js
|
|
6
|
+
|
|
7
|
+
- History of the file: https://github.com/babel/babel/commits/main/packages/babel-helpers/src/helpers.js
|
|
8
|
+
|
|
9
|
+
- History of individual helpers: https://github.com/babel/babel/commits/main/packages/babel-helpers/src/helpers
|
package/helpers/babel/set/set.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import superPropBase from "../superPropBase/superPropBase.js"
|
|
2
|
-
import defineProperty from "../defineProperty/defineProperty.js"
|
|
3
|
-
|
|
4
|
-
function reflectSetPolyfill(target, property, value, receiver) {
|
|
5
|
-
var base = superPropBase(target, property)
|
|
6
|
-
var desc
|
|
7
|
-
if (base) {
|
|
8
|
-
desc = Object.getOwnPropertyDescriptor(base, property)
|
|
9
|
-
if (desc.set) {
|
|
10
|
-
desc.set.call(receiver, value)
|
|
11
|
-
return true
|
|
12
|
-
} else if (!desc.writable) {
|
|
13
|
-
// Both getter and non-writable fall into this.
|
|
14
|
-
return false
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
// Without a super that defines the property, spec boils down to
|
|
18
|
-
// "define on receiver" for some reason.
|
|
19
|
-
desc = Object.getOwnPropertyDescriptor(receiver, property)
|
|
20
|
-
if (desc) {
|
|
21
|
-
if (!desc.writable) {
|
|
22
|
-
// Setter, getter, and non-writable fall into this.
|
|
23
|
-
return false
|
|
24
|
-
}
|
|
25
|
-
desc.value = value
|
|
26
|
-
Object.defineProperty(receiver, property, desc)
|
|
27
|
-
} else {
|
|
28
|
-
// Avoid setters that may be defined on Sub's prototype, but not on
|
|
29
|
-
// the instance.
|
|
30
|
-
defineProperty(receiver, property, value)
|
|
31
|
-
}
|
|
32
|
-
return true
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var reflectSet = typeof Reflect !== "undefined" && Reflect.set ? Reflect.set : reflectSetPolyfill
|
|
36
|
-
|
|
37
|
-
export default (target, property, value, receiver, isStrict) => {
|
|
38
|
-
// eslint-disable-next-line no-obj-calls
|
|
39
|
-
var s = reflectSet(target, property, value, receiver || target)
|
|
40
|
-
if (!s && isStrict) {
|
|
41
|
-
throw new Error("failed to set property")
|
|
42
|
-
}
|
|
43
|
-
return value
|
|
44
|
-
}
|
|
1
|
+
import superPropBase from "../superPropBase/superPropBase.js"
|
|
2
|
+
import defineProperty from "../defineProperty/defineProperty.js"
|
|
3
|
+
|
|
4
|
+
function reflectSetPolyfill(target, property, value, receiver) {
|
|
5
|
+
var base = superPropBase(target, property)
|
|
6
|
+
var desc
|
|
7
|
+
if (base) {
|
|
8
|
+
desc = Object.getOwnPropertyDescriptor(base, property)
|
|
9
|
+
if (desc.set) {
|
|
10
|
+
desc.set.call(receiver, value)
|
|
11
|
+
return true
|
|
12
|
+
} else if (!desc.writable) {
|
|
13
|
+
// Both getter and non-writable fall into this.
|
|
14
|
+
return false
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// Without a super that defines the property, spec boils down to
|
|
18
|
+
// "define on receiver" for some reason.
|
|
19
|
+
desc = Object.getOwnPropertyDescriptor(receiver, property)
|
|
20
|
+
if (desc) {
|
|
21
|
+
if (!desc.writable) {
|
|
22
|
+
// Setter, getter, and non-writable fall into this.
|
|
23
|
+
return false
|
|
24
|
+
}
|
|
25
|
+
desc.value = value
|
|
26
|
+
Object.defineProperty(receiver, property, desc)
|
|
27
|
+
} else {
|
|
28
|
+
// Avoid setters that may be defined on Sub's prototype, but not on
|
|
29
|
+
// the instance.
|
|
30
|
+
defineProperty(receiver, property, value)
|
|
31
|
+
}
|
|
32
|
+
return true
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var reflectSet = typeof Reflect !== "undefined" && Reflect.set ? Reflect.set : reflectSetPolyfill
|
|
36
|
+
|
|
37
|
+
export default (target, property, value, receiver, isStrict) => {
|
|
38
|
+
// eslint-disable-next-line no-obj-calls
|
|
39
|
+
var s = reflectSet(target, property, value, receiver || target)
|
|
40
|
+
if (!s && isStrict) {
|
|
41
|
+
throw new Error("failed to set property")
|
|
42
|
+
}
|
|
43
|
+
return value
|
|
44
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export default Object.setPrototypeOf ||
|
|
2
|
-
((o, p) => {
|
|
3
|
-
// eslint-disable-next-line no-proto
|
|
4
|
-
o.__proto__ = p
|
|
5
|
-
return o
|
|
6
|
-
})
|
|
1
|
+
export default Object.setPrototypeOf ||
|
|
2
|
+
((o, p) => {
|
|
3
|
+
// eslint-disable-next-line no-proto
|
|
4
|
+
o.__proto__ = p
|
|
5
|
+
return o
|
|
6
|
+
})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export default function (fn) {
|
|
2
|
-
return function () {
|
|
3
|
-
// eslint-disable-next-line prefer-rest-params
|
|
4
|
-
var it = fn.apply(this, arguments)
|
|
5
|
-
it.next()
|
|
6
|
-
return it
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
export default function (fn) {
|
|
2
|
+
return function () {
|
|
3
|
+
// eslint-disable-next-line prefer-rest-params
|
|
4
|
+
var it = fn.apply(this, arguments)
|
|
5
|
+
it.next()
|
|
6
|
+
return it
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import arrayWithHoles from "../arrayWithHoles/arrayWithHoles.js"
|
|
2
|
-
import iterableToArrayLimit from "../iterableToArrayLimit/iterableToArrayLimit.js"
|
|
3
|
-
import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
|
|
4
|
-
import nonIterableRest from "../nonIterableRest/nonIterableRest.js"
|
|
5
|
-
|
|
6
|
-
export default (arr, i) =>
|
|
7
|
-
arrayWithHoles(arr) ||
|
|
8
|
-
iterableToArrayLimit(arr, i) ||
|
|
9
|
-
unsupportedIterableToArray(arr, i) ||
|
|
10
|
-
nonIterableRest()
|
|
1
|
+
import arrayWithHoles from "../arrayWithHoles/arrayWithHoles.js"
|
|
2
|
+
import iterableToArrayLimit from "../iterableToArrayLimit/iterableToArrayLimit.js"
|
|
3
|
+
import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
|
|
4
|
+
import nonIterableRest from "../nonIterableRest/nonIterableRest.js"
|
|
5
|
+
|
|
6
|
+
export default (arr, i) =>
|
|
7
|
+
arrayWithHoles(arr) ||
|
|
8
|
+
iterableToArrayLimit(arr, i) ||
|
|
9
|
+
unsupportedIterableToArray(arr, i) ||
|
|
10
|
+
nonIterableRest()
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import arrayWithHoles from "../arrayWithHoles/arrayWithHoles.js"
|
|
2
|
-
import iterableToArrayLimitLoose from "../iterableToArrayLimitLoose/iterableToArrayLimitLoose.js"
|
|
3
|
-
import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
|
|
4
|
-
import nonIterableRest from "../nonIterableRest/nonIterableRest.js"
|
|
5
|
-
|
|
6
|
-
export default function (arr, i) {
|
|
7
|
-
return (
|
|
8
|
-
arrayWithHoles(arr) ||
|
|
9
|
-
iterableToArrayLimitLoose(arr, i) ||
|
|
10
|
-
unsupportedIterableToArray(arr, i) ||
|
|
11
|
-
nonIterableRest()
|
|
12
|
-
)
|
|
13
|
-
}
|
|
1
|
+
import arrayWithHoles from "../arrayWithHoles/arrayWithHoles.js"
|
|
2
|
+
import iterableToArrayLimitLoose from "../iterableToArrayLimitLoose/iterableToArrayLimitLoose.js"
|
|
3
|
+
import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
|
|
4
|
+
import nonIterableRest from "../nonIterableRest/nonIterableRest.js"
|
|
5
|
+
|
|
6
|
+
export default function (arr, i) {
|
|
7
|
+
return (
|
|
8
|
+
arrayWithHoles(arr) ||
|
|
9
|
+
iterableToArrayLimitLoose(arr, i) ||
|
|
10
|
+
unsupportedIterableToArray(arr, i) ||
|
|
11
|
+
nonIterableRest()
|
|
12
|
+
)
|
|
13
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import getPrototypeOf from "../getPrototypeOf/getPrototypeOf.js"
|
|
2
|
-
|
|
3
|
-
export default function (object, property) {
|
|
4
|
-
// Yes, this throws if object is null to being with, that's on purpose.
|
|
5
|
-
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
|
6
|
-
object = getPrototypeOf(object)
|
|
7
|
-
if (object === null) break
|
|
8
|
-
}
|
|
9
|
-
return object
|
|
10
|
-
}
|
|
1
|
+
import getPrototypeOf from "../getPrototypeOf/getPrototypeOf.js"
|
|
2
|
+
|
|
3
|
+
export default function (object, property) {
|
|
4
|
+
// Yes, this throws if object is null to being with, that's on purpose.
|
|
5
|
+
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
|
6
|
+
object = getPrototypeOf(object)
|
|
7
|
+
if (object === null) break
|
|
8
|
+
}
|
|
9
|
+
return object
|
|
10
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export default function (strings, raw) {
|
|
2
|
-
if (!raw) {
|
|
3
|
-
raw = strings.slice(0)
|
|
4
|
-
}
|
|
5
|
-
return Object.freeze(
|
|
6
|
-
Object.defineProperties(strings, {
|
|
7
|
-
raw: { value: Object.freeze(raw) },
|
|
8
|
-
}),
|
|
9
|
-
)
|
|
10
|
-
}
|
|
1
|
+
export default function (strings, raw) {
|
|
2
|
+
if (!raw) {
|
|
3
|
+
raw = strings.slice(0)
|
|
4
|
+
}
|
|
5
|
+
return Object.freeze(
|
|
6
|
+
Object.defineProperties(strings, {
|
|
7
|
+
raw: { value: Object.freeze(raw) },
|
|
8
|
+
}),
|
|
9
|
+
)
|
|
10
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export default function (strings, raw) {
|
|
2
|
-
if (!raw) {
|
|
3
|
-
raw = strings.slice(0)
|
|
4
|
-
}
|
|
5
|
-
strings.raw = raw
|
|
6
|
-
return strings
|
|
7
|
-
}
|
|
1
|
+
export default function (strings, raw) {
|
|
2
|
+
if (!raw) {
|
|
3
|
+
raw = strings.slice(0)
|
|
4
|
+
}
|
|
5
|
+
strings.raw = raw
|
|
6
|
+
return strings
|
|
7
|
+
}
|
package/helpers/babel/tdz/tdz.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function _tdzError(name) {
|
|
2
|
-
// eslint-disable-next-line prefer-template
|
|
3
|
-
throw new ReferenceError(name + " is not defined - temporal dead zone")
|
|
4
|
-
}
|
|
1
|
+
export default function _tdzError(name) {
|
|
2
|
+
// eslint-disable-next-line prefer-template
|
|
3
|
+
throw new ReferenceError(name + " is not defined - temporal dead zone")
|
|
4
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import undef from "../temporalUndefined/temporalUndefined.js"
|
|
2
|
-
import err from "../tdz/tdz.js"
|
|
3
|
-
|
|
4
|
-
export default function (val, name) {
|
|
5
|
-
return val === undef ? err(name) : val
|
|
6
|
-
}
|
|
1
|
+
import undef from "../temporalUndefined/temporalUndefined.js"
|
|
2
|
+
import err from "../tdz/tdz.js"
|
|
3
|
+
|
|
4
|
+
export default function (val, name) {
|
|
5
|
+
return val === undef ? err(name) : val
|
|
6
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// This function isn't mean to be called, but to be used as a reference.
|
|
2
|
-
// We can't use a normal object because it isn't hoisted.
|
|
3
|
-
export default function () {}
|
|
1
|
+
// This function isn't mean to be called, but to be used as a reference.
|
|
2
|
+
// We can't use a normal object because it isn't hoisted.
|
|
3
|
+
export default function () {}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import arrayWithHoles from "../arrayWithHoles/arrayWithHoles.js"
|
|
2
|
-
import iterableToArray from "../iterableToArray/iterableToArray.js"
|
|
3
|
-
import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
|
|
4
|
-
import nonIterableRest from "../nonIterableRest/nonIterableRest.js"
|
|
5
|
-
|
|
6
|
-
export default (arr) =>
|
|
7
|
-
arrayWithHoles(arr) ||
|
|
8
|
-
iterableToArray(arr) ||
|
|
9
|
-
unsupportedIterableToArray(arr) ||
|
|
10
|
-
nonIterableRest()
|
|
1
|
+
import arrayWithHoles from "../arrayWithHoles/arrayWithHoles.js"
|
|
2
|
+
import iterableToArray from "../iterableToArray/iterableToArray.js"
|
|
3
|
+
import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
|
|
4
|
+
import nonIterableRest from "../nonIterableRest/nonIterableRest.js"
|
|
5
|
+
|
|
6
|
+
export default (arr) =>
|
|
7
|
+
arrayWithHoles(arr) ||
|
|
8
|
+
iterableToArray(arr) ||
|
|
9
|
+
unsupportedIterableToArray(arr) ||
|
|
10
|
+
nonIterableRest()
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import arrayWithoutHoles from "../arrayWithoutHoles/arrayWithoutHoles.js"
|
|
2
|
-
import iterableToArray from "../iterableToArray/iterableToArray.js"
|
|
3
|
-
import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
|
|
4
|
-
import nonIterableSpread from "../nonIterableSpread/nonIterableSpread.js"
|
|
5
|
-
|
|
6
|
-
export default (arr) =>
|
|
7
|
-
arrayWithoutHoles(arr) ||
|
|
8
|
-
iterableToArray(arr) ||
|
|
9
|
-
unsupportedIterableToArray(arr) ||
|
|
10
|
-
nonIterableSpread()
|
|
1
|
+
import arrayWithoutHoles from "../arrayWithoutHoles/arrayWithoutHoles.js"
|
|
2
|
+
import iterableToArray from "../iterableToArray/iterableToArray.js"
|
|
3
|
+
import unsupportedIterableToArray from "../unsupportedIterableToArray/unsupportedIterableToArray.js"
|
|
4
|
+
import nonIterableSpread from "../nonIterableSpread/nonIterableSpread.js"
|
|
5
|
+
|
|
6
|
+
export default (arr) =>
|
|
7
|
+
arrayWithoutHoles(arr) ||
|
|
8
|
+
iterableToArray(arr) ||
|
|
9
|
+
unsupportedIterableToArray(arr) ||
|
|
10
|
+
nonIterableSpread()
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export default function (input, hint /* : "default" | "string" | "number" | void */) {
|
|
2
|
-
if (typeof input !== "object" || input === null) return input
|
|
3
|
-
var prim = input[Symbol.toPrimitive]
|
|
4
|
-
if (prim !== undefined) {
|
|
5
|
-
var res = prim.call(input, hint || "default")
|
|
6
|
-
if (typeof res !== "object") return res
|
|
7
|
-
throw new TypeError("@@toPrimitive must return a primitive value.")
|
|
8
|
-
}
|
|
9
|
-
return (hint === "string" ? String : Number)(input)
|
|
10
|
-
}
|
|
1
|
+
export default function (input, hint /* : "default" | "string" | "number" | void */) {
|
|
2
|
+
if (typeof input !== "object" || input === null) return input
|
|
3
|
+
var prim = input[Symbol.toPrimitive]
|
|
4
|
+
if (prim !== undefined) {
|
|
5
|
+
var res = prim.call(input, hint || "default")
|
|
6
|
+
if (typeof res !== "object") return res
|
|
7
|
+
throw new TypeError("@@toPrimitive must return a primitive value.")
|
|
8
|
+
}
|
|
9
|
+
return (hint === "string" ? String : Number)(input)
|
|
10
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import toPrimitive from "../toPrimitive/toPrimitive.js"
|
|
2
|
-
|
|
3
|
-
export default function (arg) {
|
|
4
|
-
var key = toPrimitive(arg, "string")
|
|
5
|
-
return typeof key === "symbol" ? key : String(key)
|
|
6
|
-
}
|
|
1
|
+
import toPrimitive from "../toPrimitive/toPrimitive.js"
|
|
2
|
+
|
|
3
|
+
export default function (arg) {
|
|
4
|
+
var key = toPrimitive(arg, "string")
|
|
5
|
+
return typeof key === "symbol" ? key : String(key)
|
|
6
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const nativeTypeOf = (obj) => typeof obj
|
|
2
|
-
|
|
3
|
-
const customTypeOf = (obj) => {
|
|
4
|
-
return obj &&
|
|
5
|
-
typeof Symbol === "function" &&
|
|
6
|
-
obj.constructor === Symbol &&
|
|
7
|
-
obj !== Symbol.prototype
|
|
8
|
-
? "symbol"
|
|
9
|
-
: typeof obj
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default typeof Symbol === "function" && typeof Symbol.iterator === "symbol"
|
|
13
|
-
? nativeTypeOf
|
|
14
|
-
: customTypeOf
|
|
1
|
+
const nativeTypeOf = (obj) => typeof obj
|
|
2
|
+
|
|
3
|
+
const customTypeOf = (obj) => {
|
|
4
|
+
return obj &&
|
|
5
|
+
typeof Symbol === "function" &&
|
|
6
|
+
obj.constructor === Symbol &&
|
|
7
|
+
obj !== Symbol.prototype
|
|
8
|
+
? "symbol"
|
|
9
|
+
: typeof obj
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default typeof Symbol === "function" && typeof Symbol.iterator === "symbol"
|
|
13
|
+
? nativeTypeOf
|
|
14
|
+
: customTypeOf
|