@jsenv/core 36.2.1 → 36.3.0
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/babel_helpers/AsyncGenerator/AsyncGenerator.js +45 -35
- package/dist/babel_helpers/AwaitValue/AwaitValue.js +3 -3
- package/dist/babel_helpers/applyDecoratedDescriptor/applyDecoratedDescriptor.js +13 -13
- package/dist/babel_helpers/applyDecs/applyDecs.js +227 -42
- package/dist/babel_helpers/applyDecs2203/applyDecs2203.js +559 -418
- package/dist/babel_helpers/applyDecs2203R/applyDecs2203R.js +235 -87
- package/dist/babel_helpers/applyDecs2301/applyDecs2301.js +591 -456
- package/dist/babel_helpers/applyDecs2305/applyDecs2305.js +681 -0
- package/dist/babel_helpers/arrayLikeToArray/arrayLikeToArray.js +5 -5
- package/dist/babel_helpers/arrayWithHoles/arrayWithHoles.js +3 -3
- package/dist/babel_helpers/arrayWithoutHoles/arrayWithoutHoles.js +4 -4
- package/dist/babel_helpers/assertThisInitialized/assertThisInitialized.js +4 -4
- package/dist/babel_helpers/asyncGeneratorDelegate/asyncGeneratorDelegate.js +12 -4
- package/dist/babel_helpers/asyncIterator/asyncIterator.js +13 -11
- package/dist/babel_helpers/asyncToGenerator/asyncToGenerator.js +18 -17
- package/dist/babel_helpers/awaitAsyncGenerator/awaitAsyncGenerator.js +2 -1
- package/dist/babel_helpers/checkInRHS/checkInRHS.js +8 -5
- package/dist/babel_helpers/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +7 -7
- package/dist/babel_helpers/classApplyDescriptorGet/classApplyDescriptorGet.js +3 -3
- package/dist/babel_helpers/classApplyDescriptorSet/classApplyDescriptorSet.js +4 -4
- package/dist/babel_helpers/classCallCheck/classCallCheck.js +2 -2
- package/dist/babel_helpers/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +2 -2
- package/dist/babel_helpers/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +2 -2
- package/dist/babel_helpers/classExtractFieldDescriptor/classExtractFieldDescriptor.js +3 -3
- package/dist/babel_helpers/classNameTDZError/classNameTDZError.js +2 -2
- package/dist/babel_helpers/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +6 -5
- package/dist/babel_helpers/classPrivateFieldGet/classPrivateFieldGet.js +6 -5
- package/dist/babel_helpers/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +3 -3
- package/dist/babel_helpers/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +3 -3
- package/dist/babel_helpers/classPrivateFieldSet/classPrivateFieldSet.js +7 -6
- package/dist/babel_helpers/classPrivateMethodGet/classPrivateMethodGet.js +3 -3
- package/dist/babel_helpers/classPrivateMethodSet/classPrivateMethodSet.js +2 -2
- package/dist/babel_helpers/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +8 -7
- package/dist/babel_helpers/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +15 -9
- package/dist/babel_helpers/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +5 -4
- package/dist/babel_helpers/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +2 -2
- package/dist/babel_helpers/construct/construct.js +10 -9
- package/dist/babel_helpers/createClass/createClass.js +2 -3
- package/dist/babel_helpers/createForOfIteratorHelper/createForOfIteratorHelper.js +30 -29
- package/dist/babel_helpers/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +18 -16
- package/dist/babel_helpers/createRawReactElement/createRawReactElement.js +23 -17
- package/dist/babel_helpers/createSuper/createSuper.js +14 -12
- package/dist/babel_helpers/decorate/decorate.js +242 -210
- package/dist/babel_helpers/defaults/defaults.js +6 -6
- package/dist/babel_helpers/defineAccessor/defineAccessor.js +1 -4
- package/dist/babel_helpers/defineEnumerableProperties/defineEnumerableProperties.js +12 -12
- package/dist/babel_helpers/defineProperty/defineProperty.js +7 -6
- package/dist/babel_helpers/extends/extends.js +5 -4
- package/dist/babel_helpers/get/get.js +2 -1
- package/dist/babel_helpers/getPrototypeOf/getPrototypeOf.js +4 -3
- package/dist/babel_helpers/inherits/inherits.js +3 -4
- package/dist/babel_helpers/inheritsLoose/inheritsLoose.js +6 -5
- package/dist/babel_helpers/initializerDefineProperty/initializerDefineProperty.js +4 -4
- package/dist/babel_helpers/initializerWarningHelper/initializerWarningHelper.js +5 -2
- package/dist/babel_helpers/instanceof/instanceof.js +3 -3
- package/dist/babel_helpers/interopRequireDefault/interopRequireDefault.js +2 -4
- package/dist/babel_helpers/interopRequireWildcard/interopRequireWildcard.js +19 -21
- package/dist/babel_helpers/isNativeFunction/isNativeFunction.js +2 -2
- package/dist/babel_helpers/isNativeReflectConstruct/isNativeReflectConstruct.js +7 -7
- package/dist/babel_helpers/iterableToArray/iterableToArray.js +6 -2
- package/dist/babel_helpers/iterableToArrayLimit/iterableToArrayLimit.js +6 -1
- package/dist/babel_helpers/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +6 -2
- package/dist/babel_helpers/jsx/jsx.js +14 -7
- package/dist/babel_helpers/maybeArrayLike/maybeArrayLike.js +6 -5
- package/dist/babel_helpers/newArrowCheck/newArrowCheck.js +2 -2
- package/dist/babel_helpers/nonIterableRest/nonIterableRest.js +5 -3
- package/dist/babel_helpers/nonIterableSpread/nonIterableSpread.js +5 -3
- package/dist/babel_helpers/objectDestructuringEmpty/objectDestructuringEmpty.js +2 -2
- package/dist/babel_helpers/objectSpread/objectSpread.js +15 -12
- package/dist/babel_helpers/objectSpread2/objectSpread2.js +7 -2
- package/dist/babel_helpers/objectWithoutProperties/objectWithoutProperties.js +15 -13
- package/dist/babel_helpers/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +11 -11
- package/dist/babel_helpers/possibleConstructorReturn/possibleConstructorReturn.js +7 -6
- package/dist/babel_helpers/readOnlyError/readOnlyError.js +2 -2
- package/dist/babel_helpers/regeneratorRuntime/regeneratorRuntime.js +124 -73
- package/dist/babel_helpers/set/set.js +23 -20
- package/dist/babel_helpers/setPrototypeOf/setPrototypeOf.js +6 -5
- package/dist/babel_helpers/skipFirstGeneratorNext/skipFirstGeneratorNext.js +5 -5
- package/dist/babel_helpers/slicedToArray/slicedToArray.js +10 -5
- package/dist/babel_helpers/slicedToArrayLoose/slicedToArrayLoose.js +12 -6
- package/dist/babel_helpers/superPropBase/superPropBase.js +6 -5
- package/dist/babel_helpers/taggedTemplateLiteral/taggedTemplateLiteral.js +7 -7
- package/dist/babel_helpers/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +4 -4
- package/dist/babel_helpers/tdz/tdz.js +2 -2
- package/dist/babel_helpers/temporalRef/temporalRef.js +5 -4
- package/dist/babel_helpers/temporalUndefined/temporalUndefined.js +1 -1
- package/dist/babel_helpers/toArray/toArray.js +10 -5
- package/dist/babel_helpers/toConsumableArray/toConsumableArray.js +10 -5
- package/dist/babel_helpers/toPrimitive/toPrimitive.js +7 -7
- package/dist/babel_helpers/toPropertyKey/toPropertyKey.js +5 -4
- package/dist/babel_helpers/typeof/typeof.js +14 -5
- package/dist/babel_helpers/unsupportedIterableToArray/unsupportedIterableToArray.js +10 -8
- package/dist/babel_helpers/wrapAsyncGenerator/wrapAsyncGenerator.js +5 -4
- package/dist/babel_helpers/wrapNativeSuper/wrapNativeSuper.js +17 -15
- package/dist/babel_helpers/wrapRegExp/wrapRegExp.js +19 -8
- package/dist/babel_helpers/writeOnlyError/writeOnlyError.js +2 -2
- package/dist/js/autoreload.js +148 -133
- package/dist/js/import_meta_hot.js +19 -13
- package/dist/js/inline_content.js +1 -3
- package/dist/js/new_stylesheet.js +119 -60
- package/dist/js/regenerator_runtime.js +204 -102
- package/dist/js/ribbon.js +11 -6
- package/dist/js/server_events_client.js +122 -98
- package/dist/js/ws.js +968 -265
- package/dist/jsenv_core.js +8513 -6162
- package/package.json +9 -9
- package/src/build/build.js +497 -486
- package/src/build/version_mappings_injection.js +21 -44
- package/src/kitchen/errors.js +2 -2
- package/src/kitchen/fetched_content_compliance.js +6 -2
- package/src/kitchen/kitchen.js +285 -80
- package/src/kitchen/prepend_content.js +135 -0
- package/src/kitchen/url_graph/url_graph_visitor.js +99 -0
- package/src/kitchen/url_graph/url_info_transformations.js +140 -21
- package/src/kitchen/url_graph.js +59 -29
- package/src/plugins/autoreload/jsenv_plugin_hmr.js +1 -2
- package/src/plugins/import_meta_hot/jsenv_plugin_import_meta_hot.js +2 -2
- package/src/plugins/importmap/jsenv_plugin_importmap.js +2 -2
- package/src/plugins/inlining/jsenv_plugin_inlining_as_data_url.js +1 -1
- package/src/plugins/reference_analysis/html/jsenv_plugin_html_reference_analysis.js +44 -23
- package/src/plugins/reference_analysis/js/jsenv_plugin_js_reference_analysis.js +2 -1
- package/dist/js/global_this_js_classic.js +0 -24
- package/dist/js/global_this_js_module.js +0 -20
- package/src/build/graph_utils.js +0 -34
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/* @minVersion 7.0.0-beta.0 */
|
|
2
2
|
|
|
3
3
|
import OverloadYield from "../overloadYield/overloadYield.js";
|
|
4
|
+
|
|
4
5
|
export default function AsyncGenerator(gen) {
|
|
5
6
|
var front, back;
|
|
7
|
+
|
|
6
8
|
function send(key, arg) {
|
|
7
9
|
return new Promise(function (resolve, reject) {
|
|
8
10
|
var request = {
|
|
@@ -10,8 +12,9 @@ export default function AsyncGenerator(gen) {
|
|
|
10
12
|
arg: arg,
|
|
11
13
|
resolve: resolve,
|
|
12
14
|
reject: reject,
|
|
13
|
-
next: null
|
|
15
|
+
next: null,
|
|
14
16
|
};
|
|
17
|
+
|
|
15
18
|
if (back) {
|
|
16
19
|
back = back.next = request;
|
|
17
20
|
} else {
|
|
@@ -20,60 +23,62 @@ export default function AsyncGenerator(gen) {
|
|
|
20
23
|
}
|
|
21
24
|
});
|
|
22
25
|
}
|
|
26
|
+
|
|
23
27
|
function resume(key, arg) {
|
|
24
28
|
try {
|
|
25
29
|
var result = gen[key](arg);
|
|
26
30
|
var value = result.value;
|
|
27
31
|
var overloaded = value instanceof OverloadYield;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
|
|
33
|
+
Promise.resolve(overloaded ? value.v : value).then(
|
|
34
|
+
function (arg) {
|
|
35
|
+
if (overloaded) {
|
|
36
|
+
// Overloaded yield requires calling into the generator twice:
|
|
37
|
+
// - first we get the iterator result wrapped in a promise
|
|
38
|
+
// (the gen[key](arg) call above)
|
|
39
|
+
// - then we await it (the Promise.resolve call above)
|
|
40
|
+
// - then we give the result back to the iterator, so that it can:
|
|
41
|
+
// * if it was an await, use its result
|
|
42
|
+
// * if it was a yield*, possibly return the `done: true` signal
|
|
43
|
+
// so that yield* knows that the iterator is finished.
|
|
44
|
+
// This needs to happen in the second call, because in the
|
|
45
|
+
// first one `done: true` was hidden in the promise and thus
|
|
46
|
+
// not visible to the (sync) yield*.
|
|
47
|
+
// The other part of this implementation is in asyncGeneratorDelegate.
|
|
48
|
+
var nextKey = key === "return" ? "return" : "next";
|
|
49
|
+
if (!value.k || arg.done) {
|
|
50
|
+
// await or end of yield*
|
|
51
|
+
return resume(nextKey, arg);
|
|
52
|
+
} else {
|
|
53
|
+
// yield*, not done
|
|
54
|
+
arg = gen[nextKey](arg).value;
|
|
55
|
+
}
|
|
49
56
|
}
|
|
57
|
+
|
|
58
|
+
settle(result.done ? "return" : "normal", arg);
|
|
59
|
+
},
|
|
60
|
+
function (err) {
|
|
61
|
+
resume("throw", err);
|
|
50
62
|
}
|
|
51
|
-
|
|
52
|
-
}, function (err) {
|
|
53
|
-
resume("throw", err);
|
|
54
|
-
});
|
|
63
|
+
);
|
|
55
64
|
} catch (err) {
|
|
56
65
|
settle("throw", err);
|
|
57
66
|
}
|
|
58
67
|
}
|
|
68
|
+
|
|
59
69
|
function settle(type, value) {
|
|
60
70
|
switch (type) {
|
|
61
71
|
case "return":
|
|
62
|
-
front.resolve({
|
|
63
|
-
value: value,
|
|
64
|
-
done: true
|
|
65
|
-
});
|
|
72
|
+
front.resolve({ value: value, done: true });
|
|
66
73
|
break;
|
|
67
74
|
case "throw":
|
|
68
75
|
front.reject(value);
|
|
69
76
|
break;
|
|
70
77
|
default:
|
|
71
|
-
front.resolve({
|
|
72
|
-
value: value,
|
|
73
|
-
done: false
|
|
74
|
-
});
|
|
78
|
+
front.resolve({ value: value, done: false });
|
|
75
79
|
break;
|
|
76
80
|
}
|
|
81
|
+
|
|
77
82
|
front = front.next;
|
|
78
83
|
if (front) {
|
|
79
84
|
resume(front.key, front.arg);
|
|
@@ -81,6 +86,7 @@ export default function AsyncGenerator(gen) {
|
|
|
81
86
|
back = null;
|
|
82
87
|
}
|
|
83
88
|
}
|
|
89
|
+
|
|
84
90
|
this._invoke = send;
|
|
85
91
|
|
|
86
92
|
// Hide "return" method if generator return is not supported
|
|
@@ -88,9 +94,13 @@ export default function AsyncGenerator(gen) {
|
|
|
88
94
|
this.return = undefined;
|
|
89
95
|
}
|
|
90
96
|
}
|
|
91
|
-
|
|
97
|
+
|
|
98
|
+
AsyncGenerator.prototype[
|
|
99
|
+
(typeof Symbol === "function" && Symbol.asyncIterator) || "@@asyncIterator"
|
|
100
|
+
] = function () {
|
|
92
101
|
return this;
|
|
93
102
|
};
|
|
103
|
+
|
|
94
104
|
AsyncGenerator.prototype.next = function (arg) {
|
|
95
105
|
return this._invoke("next", arg);
|
|
96
106
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function _AwaitValue(value) {
|
|
2
|
-
this.wrapped = value
|
|
3
|
-
}
|
|
1
|
+
export default function _AwaitValue (value) {
|
|
2
|
+
this.wrapped = value
|
|
3
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context)
|
|
1
|
+
export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context){
|
|
2
2
|
var desc = {};
|
|
3
|
-
Object.keys(descriptor).forEach(function
|
|
4
|
-
|
|
3
|
+
Object.keys(descriptor).forEach(function(key){
|
|
4
|
+
desc[key] = descriptor[key];
|
|
5
5
|
});
|
|
6
6
|
desc.enumerable = !!desc.enumerable;
|
|
7
7
|
desc.configurable = !!desc.configurable;
|
|
8
|
-
if ('value' in desc || desc.initializer)
|
|
9
|
-
|
|
8
|
+
if ('value' in desc || desc.initializer){
|
|
9
|
+
desc.writable = true;
|
|
10
10
|
}
|
|
11
|
-
desc = decorators.slice().reverse().reduce(function
|
|
12
|
-
|
|
11
|
+
desc = decorators.slice().reverse().reduce(function(desc, decorator){
|
|
12
|
+
return decorator(target, property, desc) || desc;
|
|
13
13
|
}, desc);
|
|
14
|
-
if (context && desc.initializer !== void 0)
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
if (context && desc.initializer !== void 0){
|
|
15
|
+
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
|
16
|
+
desc.initializer = undefined;
|
|
17
17
|
}
|
|
18
|
-
if (desc.initializer === void 0)
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
if (desc.initializer === void 0){
|
|
19
|
+
Object.defineProperty(target, property, desc);
|
|
20
|
+
desc = null;
|
|
21
21
|
}
|
|
22
22
|
return desc;
|
|
23
23
|
}
|