@jsenv/core 29.1.19 → 29.2.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 +3 -16
- package/dist/babel_helpers/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -5
- package/dist/babel_helpers/applyDecs/applyDecs.js +54 -241
- package/dist/babel_helpers/applyDecs2023/applyDecs2023.js +47 -195
- package/dist/babel_helpers/arrayLikeToArray/arrayLikeToArray.js +0 -2
- package/dist/babel_helpers/arrayWithoutHoles/arrayWithoutHoles.js +2 -1
- package/dist/babel_helpers/assertThisInitialized/assertThisInitialized.js +0 -1
- package/dist/babel_helpers/asyncGeneratorDelegate/asyncGeneratorDelegate.js +4 -14
- package/dist/babel_helpers/asyncIterator/asyncIterator.js +5 -20
- package/dist/babel_helpers/asyncToGenerator/asyncToGenerator.js +2 -8
- package/dist/babel_helpers/awaitAsyncGenerator/awaitAsyncGenerator.js +1 -3
- package/dist/babel_helpers/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -4
- package/dist/babel_helpers/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -1
- package/dist/babel_helpers/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -1
- package/dist/babel_helpers/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -1
- package/dist/babel_helpers/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -1
- package/dist/babel_helpers/classPrivateMethodGet/classPrivateMethodGet.js +0 -1
- package/dist/babel_helpers/construct/construct.js +5 -5
- package/dist/babel_helpers/createClass/createClass.js +0 -1
- package/dist/babel_helpers/createForOfIteratorHelper/createForOfIteratorHelper.js +5 -9
- package/dist/babel_helpers/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +2 -3
- package/dist/babel_helpers/createRawReactElement/createRawReactElement.js +2 -8
- package/dist/babel_helpers/createSuper/createSuper.js +2 -4
- package/dist/babel_helpers/decorate/decorate.js +60 -311
- package/dist/babel_helpers/defaults/defaults.js +0 -3
- package/dist/babel_helpers/defineEnumerableProperties/defineEnumerableProperties.js +2 -5
- package/dist/babel_helpers/defineProperty/defineProperty.js +0 -1
- package/dist/babel_helpers/extends/extends.js +0 -3
- package/dist/babel_helpers/get/get.js +0 -3
- package/dist/babel_helpers/getPrototypeOf/getPrototypeOf.js +2 -1
- package/dist/babel_helpers/inherits/inherits.js +2 -3
- package/dist/babel_helpers/instanceof/instanceof.js +0 -1
- package/dist/babel_helpers/interopRequireWildcard/interopRequireWildcard.js +0 -10
- package/dist/babel_helpers/isNativeReflectConstruct/isNativeReflectConstruct.js +6 -6
- package/dist/babel_helpers/iterableToArrayLimit/iterableToArrayLimit.js +0 -5
- package/dist/babel_helpers/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +2 -5
- package/dist/babel_helpers/jsx/jsx.js +2 -8
- package/dist/babel_helpers/maybeArrayLike/maybeArrayLike.js +2 -3
- package/dist/babel_helpers/objectSpread/objectSpread.js +4 -6
- package/dist/babel_helpers/objectSpread2/objectSpread2.js +3 -8
- package/dist/babel_helpers/objectWithoutProperties/objectWithoutProperties.js +0 -3
- package/dist/babel_helpers/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -2
- package/dist/babel_helpers/possibleConstructorReturn/possibleConstructorReturn.js +0 -1
- package/dist/babel_helpers/set/set.js +2 -12
- package/dist/babel_helpers/superPropBase/superPropBase.js +0 -1
- package/dist/babel_helpers/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -1
- package/dist/babel_helpers/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -1
- package/dist/babel_helpers/toPrimitive/toPrimitive.js +1 -5
- package/dist/babel_helpers/typeof/typeof.js +0 -2
- package/dist/babel_helpers/wrapNativeSuper/wrapNativeSuper.js +0 -7
- package/dist/babel_helpers/wrapRegExp/wrapRegExp.js +5 -19
- package/dist/controllable_child_process.mjs +17 -27
- package/dist/controllable_worker_thread.mjs +4 -16
- package/dist/js/autoreload.js +13 -56
- package/dist/js/execute_using_dynamic_import.js +40 -164
- package/dist/js/global_this.js +2 -10
- package/dist/js/import_meta_hot.js +3 -9
- package/dist/js/new_stylesheet.js +0 -59
- package/dist/js/regenerator_runtime.js +80 -156
- package/dist/js/s.js +25 -113
- package/dist/js/s.js.map +10 -10
- package/dist/js/script_type_module_supervisor.js +4 -13
- package/dist/js/server_events_client.js +10 -38
- package/dist/js/supervisor.js +25 -167
- package/dist/js/v8_coverage.js +29 -92
- package/dist/js/ws.js +226 -704
- package/dist/main.js +761 -4155
- package/package.json +2 -2
- package/src/plugins/import_meta_url/client/import_meta_url_browser.js +1 -2
- package/src/plugins/import_meta_url/client/import_meta_url_commonjs.mjs +1 -1
- package/src/plugins/plugins.js +1 -1
- package/src/plugins/transpilation/as_js_classic/helpers-string.js +1 -0
- package/src/plugins/transpilation/babel/global_this/client/global_this.js +0 -2
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
CLASS = 10; // only used in assertValidReturnValue
|
|
19
19
|
*/
|
|
20
|
+
|
|
20
21
|
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
21
22
|
return function addInitializer(initializer) {
|
|
22
23
|
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
@@ -24,39 +25,24 @@ function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
|
24
25
|
initializers.push(initializer);
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
|
|
28
28
|
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
|
|
29
29
|
var kindStr;
|
|
30
|
-
|
|
31
30
|
switch (kind) {
|
|
32
|
-
case 1
|
|
33
|
-
/* ACCESSOR */
|
|
34
|
-
:
|
|
31
|
+
case 1 /* ACCESSOR */:
|
|
35
32
|
kindStr = "accessor";
|
|
36
33
|
break;
|
|
37
|
-
|
|
38
|
-
case 2
|
|
39
|
-
/* METHOD */
|
|
40
|
-
:
|
|
34
|
+
case 2 /* METHOD */:
|
|
41
35
|
kindStr = "method";
|
|
42
36
|
break;
|
|
43
|
-
|
|
44
|
-
case 3
|
|
45
|
-
/* GETTER */
|
|
46
|
-
:
|
|
37
|
+
case 3 /* GETTER */:
|
|
47
38
|
kindStr = "getter";
|
|
48
39
|
break;
|
|
49
|
-
|
|
50
|
-
case 4
|
|
51
|
-
/* SETTER */
|
|
52
|
-
:
|
|
40
|
+
case 4 /* SETTER */:
|
|
53
41
|
kindStr = "setter";
|
|
54
42
|
break;
|
|
55
|
-
|
|
56
43
|
default:
|
|
57
44
|
kindStr = "field";
|
|
58
45
|
}
|
|
59
|
-
|
|
60
46
|
var ctx = {
|
|
61
47
|
kind: kindStr,
|
|
62
48
|
name: isPrivate ? "#" + name : name,
|
|
@@ -66,18 +52,11 @@ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, val
|
|
|
66
52
|
var decoratorFinishedRef = {
|
|
67
53
|
v: false
|
|
68
54
|
};
|
|
69
|
-
|
|
70
|
-
if (kind !== 0
|
|
71
|
-
/* FIELD */
|
|
72
|
-
) {
|
|
55
|
+
if (kind !== 0 /* FIELD */) {
|
|
73
56
|
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
74
57
|
}
|
|
75
|
-
|
|
76
58
|
var get, set;
|
|
77
|
-
|
|
78
|
-
if (kind === 0
|
|
79
|
-
/* FIELD */
|
|
80
|
-
) {
|
|
59
|
+
if (kind === 0 /* FIELD */) {
|
|
81
60
|
if (isPrivate) {
|
|
82
61
|
get = desc.get;
|
|
83
62
|
set = desc.set;
|
|
@@ -85,40 +64,27 @@ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, val
|
|
|
85
64
|
get = function () {
|
|
86
65
|
return this[name];
|
|
87
66
|
};
|
|
88
|
-
|
|
89
67
|
set = function (v) {
|
|
90
68
|
this[name] = v;
|
|
91
69
|
};
|
|
92
70
|
}
|
|
93
|
-
} else if (kind === 2
|
|
94
|
-
/* METHOD */
|
|
95
|
-
) {
|
|
71
|
+
} else if (kind === 2 /* METHOD */) {
|
|
96
72
|
get = function () {
|
|
97
73
|
return desc.value;
|
|
98
74
|
};
|
|
99
75
|
} else {
|
|
100
76
|
// replace with values that will go through the final getter and setter
|
|
101
|
-
if (kind === 1
|
|
102
|
-
/* ACCESSOR */
|
|
103
|
-
|| kind === 3
|
|
104
|
-
/* GETTER */
|
|
105
|
-
) {
|
|
77
|
+
if (kind === 1 /* ACCESSOR */ || kind === 3 /* GETTER */) {
|
|
106
78
|
get = function () {
|
|
107
79
|
return desc.get.call(this);
|
|
108
80
|
};
|
|
109
81
|
}
|
|
110
|
-
|
|
111
|
-
if (kind === 1
|
|
112
|
-
/* ACCESSOR */
|
|
113
|
-
|| kind === 4
|
|
114
|
-
/* SETTER */
|
|
115
|
-
) {
|
|
82
|
+
if (kind === 1 /* ACCESSOR */ || kind === 4 /* SETTER */) {
|
|
116
83
|
set = function (v) {
|
|
117
84
|
desc.set.call(this, v);
|
|
118
85
|
};
|
|
119
86
|
}
|
|
120
87
|
}
|
|
121
|
-
|
|
122
88
|
ctx.access = get && set ? {
|
|
123
89
|
get: get,
|
|
124
90
|
set: set
|
|
@@ -127,89 +93,63 @@ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, val
|
|
|
127
93
|
} : {
|
|
128
94
|
set: set
|
|
129
95
|
};
|
|
130
|
-
|
|
131
96
|
try {
|
|
132
97
|
return dec(value, ctx);
|
|
133
98
|
} finally {
|
|
134
99
|
decoratorFinishedRef.v = true;
|
|
135
100
|
}
|
|
136
101
|
}
|
|
137
|
-
|
|
138
102
|
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
139
103
|
if (decoratorFinishedRef.v) {
|
|
140
104
|
throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
141
105
|
}
|
|
142
106
|
}
|
|
143
|
-
|
|
144
107
|
function assertCallable(fn, hint) {
|
|
145
108
|
if (typeof fn !== "function") {
|
|
146
109
|
throw new TypeError(hint + " must be a function");
|
|
147
110
|
}
|
|
148
111
|
}
|
|
149
|
-
|
|
150
112
|
function assertValidReturnValue(kind, value) {
|
|
151
113
|
var type = typeof value;
|
|
152
|
-
|
|
153
|
-
if (kind === 1
|
|
154
|
-
/* ACCESSOR */
|
|
155
|
-
) {
|
|
114
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
156
115
|
if (type !== "object" || value === null) {
|
|
157
116
|
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
158
117
|
}
|
|
159
|
-
|
|
160
118
|
if (value.get !== undefined) {
|
|
161
119
|
assertCallable(value.get, "accessor.get");
|
|
162
120
|
}
|
|
163
|
-
|
|
164
121
|
if (value.set !== undefined) {
|
|
165
122
|
assertCallable(value.set, "accessor.set");
|
|
166
123
|
}
|
|
167
|
-
|
|
168
124
|
if (value.init !== undefined) {
|
|
169
125
|
assertCallable(value.init, "accessor.init");
|
|
170
126
|
}
|
|
171
127
|
} else if (type !== "function") {
|
|
172
128
|
var hint;
|
|
173
|
-
|
|
174
|
-
if (kind === 0
|
|
175
|
-
/* FIELD */
|
|
176
|
-
) {
|
|
129
|
+
if (kind === 0 /* FIELD */) {
|
|
177
130
|
hint = "field";
|
|
178
|
-
} else if (kind === 10
|
|
179
|
-
/* CLASS */
|
|
180
|
-
) {
|
|
131
|
+
} else if (kind === 10 /* CLASS */) {
|
|
181
132
|
hint = "class";
|
|
182
133
|
} else {
|
|
183
134
|
hint = "method";
|
|
184
135
|
}
|
|
185
|
-
|
|
186
136
|
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
187
137
|
}
|
|
188
138
|
}
|
|
189
|
-
|
|
190
139
|
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
|
|
191
140
|
var decs = decInfo[0];
|
|
192
141
|
var desc, init, value;
|
|
193
|
-
|
|
194
142
|
if (isPrivate) {
|
|
195
|
-
if (kind === 0
|
|
196
|
-
/* FIELD */
|
|
197
|
-
|| kind === 1
|
|
198
|
-
/* ACCESSOR */
|
|
199
|
-
) {
|
|
143
|
+
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
|
|
200
144
|
desc = {
|
|
201
145
|
get: decInfo[3],
|
|
202
146
|
set: decInfo[4]
|
|
203
147
|
};
|
|
204
|
-
} else if (kind === 3
|
|
205
|
-
/* GETTER */
|
|
206
|
-
) {
|
|
148
|
+
} else if (kind === 3 /* GETTER */) {
|
|
207
149
|
desc = {
|
|
208
150
|
get: decInfo[3]
|
|
209
151
|
};
|
|
210
|
-
} else if (kind === 4
|
|
211
|
-
/* SETTER */
|
|
212
|
-
) {
|
|
152
|
+
} else if (kind === 4 /* SETTER */) {
|
|
213
153
|
desc = {
|
|
214
154
|
set: decInfo[3]
|
|
215
155
|
};
|
|
@@ -218,48 +158,29 @@ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, ini
|
|
|
218
158
|
value: decInfo[3]
|
|
219
159
|
};
|
|
220
160
|
}
|
|
221
|
-
} else if (kind !== 0
|
|
222
|
-
/* FIELD */
|
|
223
|
-
) {
|
|
161
|
+
} else if (kind !== 0 /* FIELD */) {
|
|
224
162
|
desc = Object.getOwnPropertyDescriptor(base, name);
|
|
225
163
|
}
|
|
226
|
-
|
|
227
|
-
if (kind === 1
|
|
228
|
-
/* ACCESSOR */
|
|
229
|
-
) {
|
|
164
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
230
165
|
value = {
|
|
231
166
|
get: desc.get,
|
|
232
167
|
set: desc.set
|
|
233
168
|
};
|
|
234
|
-
} else if (kind === 2
|
|
235
|
-
/* METHOD */
|
|
236
|
-
) {
|
|
169
|
+
} else if (kind === 2 /* METHOD */) {
|
|
237
170
|
value = desc.value;
|
|
238
|
-
} else if (kind === 3
|
|
239
|
-
/* GETTER */
|
|
240
|
-
) {
|
|
171
|
+
} else if (kind === 3 /* GETTER */) {
|
|
241
172
|
value = desc.get;
|
|
242
|
-
} else if (kind === 4
|
|
243
|
-
/* SETTER */
|
|
244
|
-
) {
|
|
173
|
+
} else if (kind === 4 /* SETTER */) {
|
|
245
174
|
value = desc.set;
|
|
246
175
|
}
|
|
247
|
-
|
|
248
176
|
var newValue, get, set;
|
|
249
|
-
|
|
250
177
|
if (typeof decs === "function") {
|
|
251
178
|
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value);
|
|
252
|
-
|
|
253
179
|
if (newValue !== void 0) {
|
|
254
180
|
assertValidReturnValue(kind, newValue);
|
|
255
|
-
|
|
256
|
-
if (kind === 0
|
|
257
|
-
/* FIELD */
|
|
258
|
-
) {
|
|
181
|
+
if (kind === 0 /* FIELD */) {
|
|
259
182
|
init = newValue;
|
|
260
|
-
} else if (kind === 1
|
|
261
|
-
/* ACCESSOR */
|
|
262
|
-
) {
|
|
183
|
+
} else if (kind === 1 /* ACCESSOR */) {
|
|
263
184
|
init = newValue.init;
|
|
264
185
|
get = newValue.get || value.get;
|
|
265
186
|
set = newValue.set || value.set;
|
|
@@ -275,18 +196,12 @@ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, ini
|
|
|
275
196
|
for (var i = decs.length - 1; i >= 0; i--) {
|
|
276
197
|
var dec = decs[i];
|
|
277
198
|
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value);
|
|
278
|
-
|
|
279
199
|
if (newValue !== void 0) {
|
|
280
200
|
assertValidReturnValue(kind, newValue);
|
|
281
201
|
var newInit;
|
|
282
|
-
|
|
283
|
-
if (kind === 0
|
|
284
|
-
/* FIELD */
|
|
285
|
-
) {
|
|
202
|
+
if (kind === 0 /* FIELD */) {
|
|
286
203
|
newInit = newValue;
|
|
287
|
-
} else if (kind === 1
|
|
288
|
-
/* ACCESSOR */
|
|
289
|
-
) {
|
|
204
|
+
} else if (kind === 1 /* ACCESSOR */) {
|
|
290
205
|
newInit = newValue.init;
|
|
291
206
|
get = newValue.get || value.get;
|
|
292
207
|
set = newValue.set || value.set;
|
|
@@ -297,7 +212,6 @@ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, ini
|
|
|
297
212
|
} else {
|
|
298
213
|
value = newValue;
|
|
299
214
|
}
|
|
300
|
-
|
|
301
215
|
if (newInit !== void 0) {
|
|
302
216
|
if (init === void 0) {
|
|
303
217
|
init = newInit;
|
|
@@ -310,12 +224,7 @@ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, ini
|
|
|
310
224
|
}
|
|
311
225
|
}
|
|
312
226
|
}
|
|
313
|
-
|
|
314
|
-
if (kind === 0
|
|
315
|
-
/* FIELD */
|
|
316
|
-
|| kind === 1
|
|
317
|
-
/* ACCESSOR */
|
|
318
|
-
) {
|
|
227
|
+
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
|
|
319
228
|
if (init === void 0) {
|
|
320
229
|
// If the initializer was void 0, sub in a dummy initializer
|
|
321
230
|
init = function (instance, init) {
|
|
@@ -323,62 +232,41 @@ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, ini
|
|
|
323
232
|
};
|
|
324
233
|
} else if (typeof init !== "function") {
|
|
325
234
|
var ownInitializers = init;
|
|
326
|
-
|
|
327
235
|
init = function (instance, init) {
|
|
328
236
|
var value = init;
|
|
329
|
-
|
|
330
237
|
for (var i = 0; i < ownInitializers.length; i++) {
|
|
331
238
|
value = ownInitializers[i].call(instance, value);
|
|
332
239
|
}
|
|
333
|
-
|
|
334
240
|
return value;
|
|
335
241
|
};
|
|
336
242
|
} else {
|
|
337
243
|
var originalInitializer = init;
|
|
338
|
-
|
|
339
244
|
init = function (instance, init) {
|
|
340
245
|
return originalInitializer.call(instance, init);
|
|
341
246
|
};
|
|
342
247
|
}
|
|
343
|
-
|
|
344
248
|
ret.push(init);
|
|
345
249
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
/* FIELD */
|
|
349
|
-
) {
|
|
350
|
-
if (kind === 1
|
|
351
|
-
/* ACCESSOR */
|
|
352
|
-
) {
|
|
250
|
+
if (kind !== 0 /* FIELD */) {
|
|
251
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
353
252
|
desc.get = value.get;
|
|
354
253
|
desc.set = value.set;
|
|
355
|
-
} else if (kind === 2
|
|
356
|
-
/* METHOD */
|
|
357
|
-
) {
|
|
254
|
+
} else if (kind === 2 /* METHOD */) {
|
|
358
255
|
desc.value = value;
|
|
359
|
-
} else if (kind === 3
|
|
360
|
-
/* GETTER */
|
|
361
|
-
) {
|
|
256
|
+
} else if (kind === 3 /* GETTER */) {
|
|
362
257
|
desc.get = value;
|
|
363
|
-
} else if (kind === 4
|
|
364
|
-
/* SETTER */
|
|
365
|
-
) {
|
|
258
|
+
} else if (kind === 4 /* SETTER */) {
|
|
366
259
|
desc.set = value;
|
|
367
260
|
}
|
|
368
|
-
|
|
369
261
|
if (isPrivate) {
|
|
370
|
-
if (kind === 1
|
|
371
|
-
/* ACCESSOR */
|
|
372
|
-
) {
|
|
262
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
373
263
|
ret.push(function (instance, args) {
|
|
374
264
|
return value.get.call(instance, args);
|
|
375
265
|
});
|
|
376
266
|
ret.push(function (instance, args) {
|
|
377
267
|
return value.set.call(instance, args);
|
|
378
268
|
});
|
|
379
|
-
} else if (kind === 2
|
|
380
|
-
/* METHOD */
|
|
381
|
-
) {
|
|
269
|
+
} else if (kind === 2 /* METHOD */) {
|
|
382
270
|
ret.push(value);
|
|
383
271
|
} else {
|
|
384
272
|
ret.push(function (instance, args) {
|
|
@@ -390,104 +278,73 @@ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, ini
|
|
|
390
278
|
}
|
|
391
279
|
}
|
|
392
280
|
}
|
|
393
|
-
|
|
394
281
|
function applyMemberDecs(ret, Class, decInfos) {
|
|
395
282
|
var protoInitializers;
|
|
396
283
|
var staticInitializers;
|
|
397
284
|
var existingProtoNonFields = new Map();
|
|
398
285
|
var existingStaticNonFields = new Map();
|
|
399
|
-
|
|
400
286
|
for (var i = 0; i < decInfos.length; i++) {
|
|
401
|
-
var decInfo = decInfos[i];
|
|
287
|
+
var decInfo = decInfos[i];
|
|
402
288
|
|
|
289
|
+
// skip computed property names
|
|
403
290
|
if (!Array.isArray(decInfo)) continue;
|
|
404
291
|
var kind = decInfo[1];
|
|
405
292
|
var name = decInfo[2];
|
|
406
293
|
var isPrivate = decInfo.length > 3;
|
|
407
|
-
var isStatic = kind >= 5;
|
|
408
|
-
/* STATIC */
|
|
409
|
-
|
|
294
|
+
var isStatic = kind >= 5; /* STATIC */
|
|
410
295
|
var base;
|
|
411
296
|
var initializers;
|
|
412
|
-
|
|
413
297
|
if (isStatic) {
|
|
414
298
|
base = Class;
|
|
415
|
-
kind = kind - 5
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
if (kind !== 0
|
|
420
|
-
/* FIELD */
|
|
421
|
-
) {
|
|
299
|
+
kind = kind - 5 /* STATIC */;
|
|
300
|
+
// initialize staticInitializers when we see a non-field static member
|
|
301
|
+
if (kind !== 0 /* FIELD */) {
|
|
422
302
|
staticInitializers = staticInitializers || [];
|
|
423
303
|
initializers = staticInitializers;
|
|
424
304
|
}
|
|
425
305
|
} else {
|
|
426
|
-
base = Class.prototype;
|
|
427
|
-
|
|
428
|
-
if (kind !== 0
|
|
429
|
-
/* FIELD */
|
|
430
|
-
) {
|
|
306
|
+
base = Class.prototype;
|
|
307
|
+
// initialize protoInitializers when we see a non-field member
|
|
308
|
+
if (kind !== 0 /* FIELD */) {
|
|
431
309
|
protoInitializers = protoInitializers || [];
|
|
432
310
|
initializers = protoInitializers;
|
|
433
311
|
}
|
|
434
312
|
}
|
|
435
|
-
|
|
436
|
-
if (kind !== 0
|
|
437
|
-
/* FIELD */
|
|
438
|
-
&& !isPrivate) {
|
|
313
|
+
if (kind !== 0 /* FIELD */ && !isPrivate) {
|
|
439
314
|
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
440
315
|
var existingKind = existingNonFields.get(name) || 0;
|
|
441
|
-
|
|
442
|
-
if (existingKind === true || existingKind === 3
|
|
443
|
-
/* GETTER */
|
|
444
|
-
&& kind !== 4
|
|
445
|
-
/* SETTER */
|
|
446
|
-
|| existingKind === 4
|
|
447
|
-
/* SETTER */
|
|
448
|
-
&& kind !== 3
|
|
449
|
-
/* GETTER */
|
|
450
|
-
) {
|
|
316
|
+
if (existingKind === true || existingKind === 3 /* GETTER */ && kind !== 4 /* SETTER */ || existingKind === 4 /* SETTER */ && kind !== 3 /* GETTER */) {
|
|
451
317
|
throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
452
|
-
} else if (!existingKind && kind > 2
|
|
453
|
-
/* METHOD */
|
|
454
|
-
) {
|
|
318
|
+
} else if (!existingKind && kind > 2 /* METHOD */) {
|
|
455
319
|
existingNonFields.set(name, kind);
|
|
456
320
|
} else {
|
|
457
321
|
existingNonFields.set(name, true);
|
|
458
322
|
}
|
|
459
323
|
}
|
|
460
|
-
|
|
461
324
|
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
|
|
462
325
|
}
|
|
463
|
-
|
|
464
326
|
pushInitializers(ret, protoInitializers);
|
|
465
327
|
pushInitializers(ret, staticInitializers);
|
|
466
328
|
}
|
|
467
|
-
|
|
468
329
|
function pushInitializers(ret, initializers) {
|
|
469
330
|
if (initializers) {
|
|
470
331
|
ret.push(function (instance) {
|
|
471
332
|
for (var i = 0; i < initializers.length; i++) {
|
|
472
333
|
initializers[i].call(instance);
|
|
473
334
|
}
|
|
474
|
-
|
|
475
335
|
return instance;
|
|
476
336
|
});
|
|
477
337
|
}
|
|
478
338
|
}
|
|
479
|
-
|
|
480
339
|
function applyClassDecs(ret, targetClass, classDecs) {
|
|
481
340
|
if (classDecs.length > 0) {
|
|
482
341
|
var initializers = [];
|
|
483
342
|
var newClass = targetClass;
|
|
484
343
|
var name = targetClass.name;
|
|
485
|
-
|
|
486
344
|
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
487
345
|
var decoratorFinishedRef = {
|
|
488
346
|
v: false
|
|
489
347
|
};
|
|
490
|
-
|
|
491
348
|
try {
|
|
492
349
|
var nextNewClass = classDecs[i](newClass, {
|
|
493
350
|
kind: "class",
|
|
@@ -497,15 +354,11 @@ function applyClassDecs(ret, targetClass, classDecs) {
|
|
|
497
354
|
} finally {
|
|
498
355
|
decoratorFinishedRef.v = true;
|
|
499
356
|
}
|
|
500
|
-
|
|
501
357
|
if (nextNewClass !== undefined) {
|
|
502
|
-
assertValidReturnValue(10
|
|
503
|
-
/* CLASS */
|
|
504
|
-
, nextNewClass);
|
|
358
|
+
assertValidReturnValue(10 /* CLASS */, nextNewClass);
|
|
505
359
|
newClass = nextNewClass;
|
|
506
360
|
}
|
|
507
361
|
}
|
|
508
|
-
|
|
509
362
|
ret.push(newClass, function () {
|
|
510
363
|
for (var i = 0; i < initializers.length; i++) {
|
|
511
364
|
initializers[i].call(newClass);
|
|
@@ -513,6 +366,7 @@ function applyClassDecs(ret, targetClass, classDecs) {
|
|
|
513
366
|
});
|
|
514
367
|
}
|
|
515
368
|
}
|
|
369
|
+
|
|
516
370
|
/**
|
|
517
371
|
Basic usage:
|
|
518
372
|
|
|
@@ -658,8 +512,6 @@ function applyClassDecs(ret, targetClass, classDecs) {
|
|
|
658
512
|
|
|
659
513
|
initializeClass(Class);
|
|
660
514
|
*/
|
|
661
|
-
|
|
662
|
-
|
|
663
515
|
export default function applyDecs2203(targetClass, memberDecs, classDecs) {
|
|
664
516
|
var ret = [];
|
|
665
517
|
applyMemberDecs(ret, targetClass, memberDecs);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import arrayLikeToArray from "../arrayLikeToArray/arrayLikeToArray.js";
|
|
1
|
+
import arrayLikeToArray from "../arrayLikeToArray/arrayLikeToArray.js";
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line consistent-return
|
|
3
4
|
export default (arr => {
|
|
4
5
|
if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
|
5
6
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* @minVersion 7.0.0-beta.0 */
|
|
2
|
+
|
|
2
3
|
import OverloadYield from "../overloadYield/overloadYield.js";
|
|
3
4
|
export default function _asyncGeneratorDelegate(inner) {
|
|
4
5
|
var iter = {},
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// See the comment in AsyncGenerator to understand what this is.
|
|
7
|
+
waiting = false;
|
|
8
8
|
function pump(key, value) {
|
|
9
9
|
waiting = true;
|
|
10
10
|
value = new Promise(function (resolve) {
|
|
@@ -12,46 +12,36 @@ export default function _asyncGeneratorDelegate(inner) {
|
|
|
12
12
|
});
|
|
13
13
|
return {
|
|
14
14
|
done: false,
|
|
15
|
-
value: new OverloadYield(value,
|
|
16
|
-
/* kind: delegate */
|
|
17
|
-
1)
|
|
15
|
+
value: new OverloadYield(value, /* kind: delegate */1)
|
|
18
16
|
};
|
|
19
17
|
}
|
|
20
|
-
|
|
21
18
|
iter[typeof Symbol !== "undefined" && Symbol.iterator || "@@iterator"] = function () {
|
|
22
19
|
return this;
|
|
23
20
|
};
|
|
24
|
-
|
|
25
21
|
iter.next = function (value) {
|
|
26
22
|
if (waiting) {
|
|
27
23
|
waiting = false;
|
|
28
24
|
return value;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
return pump("next", value);
|
|
32
27
|
};
|
|
33
|
-
|
|
34
28
|
if (typeof inner.throw === "function") {
|
|
35
29
|
iter.throw = function (value) {
|
|
36
30
|
if (waiting) {
|
|
37
31
|
waiting = false;
|
|
38
32
|
throw value;
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
return pump("throw", value);
|
|
42
35
|
};
|
|
43
36
|
}
|
|
44
|
-
|
|
45
37
|
if (typeof inner.return === "function") {
|
|
46
38
|
iter.return = function (value) {
|
|
47
39
|
if (waiting) {
|
|
48
40
|
waiting = false;
|
|
49
41
|
return value;
|
|
50
42
|
}
|
|
51
|
-
|
|
52
43
|
return pump("return", value);
|
|
53
44
|
};
|
|
54
45
|
}
|
|
55
|
-
|
|
56
46
|
return iter;
|
|
57
47
|
}
|
|
@@ -1,55 +1,43 @@
|
|
|
1
1
|
export default function _asyncIterator(iterable) {
|
|
2
2
|
var method,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
async,
|
|
4
|
+
sync,
|
|
5
|
+
retry = 2;
|
|
7
6
|
if (typeof Symbol !== "undefined") {
|
|
8
7
|
async = Symbol.asyncIterator;
|
|
9
8
|
sync = Symbol.iterator;
|
|
10
9
|
}
|
|
11
|
-
|
|
12
10
|
while (retry--) {
|
|
13
11
|
if (async && (method = iterable[async]) != null) {
|
|
14
12
|
return method.call(iterable);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
if (sync && (method = iterable[sync]) != null) {
|
|
18
15
|
return new AsyncFromSyncIterator(method.call(iterable));
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
async = "@@asyncIterator";
|
|
22
18
|
sync = "@@iterator";
|
|
23
19
|
}
|
|
24
|
-
|
|
25
20
|
throw new TypeError("Object is not async iterable");
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
function AsyncFromSyncIterator(s) {
|
|
29
23
|
AsyncFromSyncIterator = function (s) {
|
|
30
24
|
this.s = s;
|
|
31
25
|
this.n = s.next;
|
|
32
26
|
};
|
|
33
|
-
|
|
34
27
|
AsyncFromSyncIterator.prototype = {
|
|
35
|
-
/* SyncIterator */
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/* SyncIterator.[[Next]] */
|
|
39
|
-
n: null,
|
|
28
|
+
/* SyncIterator */s: null,
|
|
29
|
+
/* SyncIterator.[[Next]] */n: null,
|
|
40
30
|
next: function () {
|
|
41
31
|
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
42
32
|
},
|
|
43
33
|
return: function (value) {
|
|
44
34
|
var ret = this.s.return;
|
|
45
|
-
|
|
46
35
|
if (ret === undefined) {
|
|
47
36
|
return Promise.resolve({
|
|
48
37
|
value: value,
|
|
49
38
|
done: true
|
|
50
39
|
});
|
|
51
40
|
}
|
|
52
|
-
|
|
53
41
|
return AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
|
|
54
42
|
},
|
|
55
43
|
throw: function (value) {
|
|
@@ -58,13 +46,11 @@ function AsyncFromSyncIterator(s) {
|
|
|
58
46
|
return AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
|
|
59
47
|
}
|
|
60
48
|
};
|
|
61
|
-
|
|
62
49
|
function AsyncFromSyncIteratorContinuation(r) {
|
|
63
50
|
// This step is _before_ calling AsyncFromSyncIteratorContinuation in the spec.
|
|
64
51
|
if (Object(r) !== r) {
|
|
65
52
|
return Promise.reject(new TypeError(r + " is not an object."));
|
|
66
53
|
}
|
|
67
|
-
|
|
68
54
|
var done = r.done;
|
|
69
55
|
return Promise.resolve(r.value).then(function (value) {
|
|
70
56
|
return {
|
|
@@ -73,6 +59,5 @@ function AsyncFromSyncIterator(s) {
|
|
|
73
59
|
};
|
|
74
60
|
});
|
|
75
61
|
}
|
|
76
|
-
|
|
77
62
|
return new AsyncFromSyncIterator(s);
|
|
78
63
|
}
|