@jsenv/plugin-transpilation 1.0.0 → 1.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/package.json +26 -26
- package/src/as_js_module/jsenv_plugin_as_js_module.js +14 -28
- package/src/babel/babel_helper_directory/README.md +1 -1
- package/src/babel/babel_helper_directory/babel_helpers/applyDecs2301/applyDecs2301.js +547 -528
- package/src/babel/babel_helper_directory/babel_helpers/applyDecs2305/applyDecs2305.js +681 -0
- package/src/babel/babel_plugin_structure.js +1 -1
- package/src/babel/jsenv_plugin_babel.js +91 -19
- package/src/babel/new_stylesheet/babel_plugin_new_stylesheet_injector.js +11 -135
- package/src/babel/new_stylesheet/constructable_stylesheet_usage.js +114 -0
- package/src/babel/new_stylesheet/new_stylesheet_client_file_url.js +4 -0
- package/src/babel/regenerator_runtime/babel_plugin_regenerator_runtime_injector.js +11 -35
- package/src/babel/regenerator_runtime/regenerator_runtime_client_file_url.js +4 -0
- package/src/babel/regenerator_runtime/regenerator_runtime_usage.js +23 -0
- package/src/babel/{polyfill_injection_in_babel_ast.js → side_effect_injection_in_babel_ast.js} +8 -8
- package/src/css/jsenv_plugin_css_transpilation.js +2 -2
- package/src/import_assertions/jsenv_plugin_import_assertions.js +39 -78
- package/src/import_meta_resolve/jsenv_plugin_import_meta_resolve.js +17 -13
- package/src/js_module_fallback/jsenv_plugin_js_module_conversion.js +56 -48
- package/src/js_module_fallback/jsenv_plugin_js_module_fallback.js +3 -38
- package/src/js_module_fallback/jsenv_plugin_js_module_fallback_inside_html.js +63 -122
- package/src/js_module_fallback/jsenv_plugin_js_module_fallback_on_workers.js +15 -6
- package/src/babel/apply_js_transpilation.js +0 -74
- package/src/babel/global_this/babel_plugin_global_this_injector.js +0 -56
- package/src/babel/global_this/client/global_this_js_classic.js +0 -25
- package/src/babel/global_this/client/global_this_js_module.js +0 -21
|
@@ -20,274 +20,248 @@ import checkInRHS from "../checkInRHS/checkInRHS.js";
|
|
|
20
20
|
CLASS = 10; // only used in assertValidReturnValue
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function assertInstanceIfPrivate(has, target) {
|
|
32
|
-
if (!has(target)) {
|
|
33
|
-
throw new TypeError("Attempted to access private element on non-instance");
|
|
23
|
+
function applyDecs2301Factory() {
|
|
24
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
25
|
+
return function addInitializer(initializer) {
|
|
26
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
27
|
+
assertCallable(initializer, "An initializer");
|
|
28
|
+
initializers.push(initializer);
|
|
29
|
+
};
|
|
34
30
|
}
|
|
35
|
-
}
|
|
36
31
|
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
isStatic,
|
|
44
|
-
isPrivate,
|
|
45
|
-
value,
|
|
46
|
-
hasPrivateBrand
|
|
47
|
-
) {
|
|
48
|
-
var kindStr;
|
|
49
|
-
|
|
50
|
-
switch (kind) {
|
|
51
|
-
case 1 /* ACCESSOR */:
|
|
52
|
-
kindStr = "accessor";
|
|
53
|
-
break;
|
|
54
|
-
case 2 /* METHOD */:
|
|
55
|
-
kindStr = "method";
|
|
56
|
-
break;
|
|
57
|
-
case 3 /* GETTER */:
|
|
58
|
-
kindStr = "getter";
|
|
59
|
-
break;
|
|
60
|
-
case 4 /* SETTER */:
|
|
61
|
-
kindStr = "setter";
|
|
62
|
-
break;
|
|
63
|
-
default:
|
|
64
|
-
kindStr = "field";
|
|
32
|
+
function assertInstanceIfPrivate(has, target) {
|
|
33
|
+
if (!has(target)) {
|
|
34
|
+
throw new TypeError(
|
|
35
|
+
"Attempted to access private element on non-instance"
|
|
36
|
+
);
|
|
37
|
+
}
|
|
65
38
|
}
|
|
66
39
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
name
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
40
|
+
function memberDec(
|
|
41
|
+
dec,
|
|
42
|
+
name,
|
|
43
|
+
desc,
|
|
44
|
+
initializers,
|
|
45
|
+
kind,
|
|
46
|
+
isStatic,
|
|
47
|
+
isPrivate,
|
|
48
|
+
value,
|
|
49
|
+
hasPrivateBrand
|
|
50
|
+
) {
|
|
51
|
+
var kindStr;
|
|
52
|
+
|
|
53
|
+
switch (kind) {
|
|
54
|
+
case 1 /* ACCESSOR */:
|
|
55
|
+
kindStr = "accessor";
|
|
56
|
+
break;
|
|
57
|
+
case 2 /* METHOD */:
|
|
58
|
+
kindStr = "method";
|
|
59
|
+
break;
|
|
60
|
+
case 3 /* GETTER */:
|
|
61
|
+
kindStr = "getter";
|
|
62
|
+
break;
|
|
63
|
+
case 4 /* SETTER */:
|
|
64
|
+
kindStr = "setter";
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
kindStr = "field";
|
|
68
|
+
}
|
|
73
69
|
|
|
74
|
-
|
|
70
|
+
var ctx = {
|
|
71
|
+
kind: kindStr,
|
|
72
|
+
name: isPrivate ? "#" + name : name,
|
|
73
|
+
static: isStatic,
|
|
74
|
+
private: isPrivate,
|
|
75
|
+
};
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
ctx.addInitializer = createAddInitializerMethod(
|
|
78
|
-
initializers,
|
|
79
|
-
decoratorFinishedRef
|
|
80
|
-
);
|
|
81
|
-
}
|
|
77
|
+
var decoratorFinishedRef = { v: false };
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (kind === 0 /* FIELD */) {
|
|
89
|
-
set = function (target, v) {
|
|
90
|
-
target[name] = v;
|
|
91
|
-
};
|
|
79
|
+
if (kind !== 0 /* FIELD */) {
|
|
80
|
+
ctx.addInitializer = createAddInitializerMethod(
|
|
81
|
+
initializers,
|
|
82
|
+
decoratorFinishedRef
|
|
83
|
+
);
|
|
92
84
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (t || kind === 3 /* GETTER */) {
|
|
103
|
-
if (isPrivate) {
|
|
104
|
-
get = function (target) {
|
|
105
|
-
assertInstanceIfPrivate(hasPrivateBrand, target);
|
|
106
|
-
return desc.get.call(target);
|
|
107
|
-
};
|
|
108
|
-
} else {
|
|
109
|
-
get = function (target) {
|
|
110
|
-
return desc.get.call(target);
|
|
85
|
+
|
|
86
|
+
var get, set;
|
|
87
|
+
if (!isPrivate && (kind === 0 /* FIELD */ || kind === 2) /* METHOD */) {
|
|
88
|
+
get = function (target) {
|
|
89
|
+
return target[name];
|
|
90
|
+
};
|
|
91
|
+
if (kind === 0 /* FIELD */) {
|
|
92
|
+
set = function (target, v) {
|
|
93
|
+
target[name] = v;
|
|
111
94
|
};
|
|
112
95
|
}
|
|
96
|
+
} else if (kind === 2 /* METHOD */) {
|
|
97
|
+
// Assert: isPrivate is true.
|
|
98
|
+
get = function (target) {
|
|
99
|
+
assertInstanceIfPrivate(hasPrivateBrand, target);
|
|
100
|
+
return desc.value;
|
|
101
|
+
};
|
|
102
|
+
} else {
|
|
103
|
+
// Assert: If kind === 0, then isPrivate is true.
|
|
104
|
+
var t = kind === 0 /* FIELD */ || kind === 1; /* ACCESSOR */
|
|
105
|
+
if (t || kind === 3 /* GETTER */) {
|
|
106
|
+
if (isPrivate) {
|
|
107
|
+
get = function (target) {
|
|
108
|
+
assertInstanceIfPrivate(hasPrivateBrand, target);
|
|
109
|
+
return desc.get.call(target);
|
|
110
|
+
};
|
|
111
|
+
} else {
|
|
112
|
+
get = function (target) {
|
|
113
|
+
return desc.get.call(target);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (t || kind === 4 /* SETTER */) {
|
|
118
|
+
if (isPrivate) {
|
|
119
|
+
set = function (target, value) {
|
|
120
|
+
assertInstanceIfPrivate(hasPrivateBrand, target);
|
|
121
|
+
desc.set.call(target, value);
|
|
122
|
+
};
|
|
123
|
+
} else {
|
|
124
|
+
set = function (target, value) {
|
|
125
|
+
desc.set.call(target, value);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
113
129
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
desc.set.call(target, value);
|
|
119
|
-
};
|
|
120
|
-
} else {
|
|
121
|
-
set = function (target, value) {
|
|
122
|
-
desc.set.call(target, value);
|
|
130
|
+
var has = isPrivate
|
|
131
|
+
? hasPrivateBrand.bind()
|
|
132
|
+
: function (target) {
|
|
133
|
+
return name in target;
|
|
123
134
|
};
|
|
124
|
-
|
|
135
|
+
ctx.access =
|
|
136
|
+
get && set
|
|
137
|
+
? { get: get, set: set, has: has }
|
|
138
|
+
: get
|
|
139
|
+
? { get: get, has: has }
|
|
140
|
+
: { set: set, has: has };
|
|
141
|
+
|
|
142
|
+
try {
|
|
143
|
+
return dec(value, ctx);
|
|
144
|
+
} finally {
|
|
145
|
+
decoratorFinishedRef.v = true;
|
|
125
146
|
}
|
|
126
147
|
}
|
|
127
|
-
var has = isPrivate
|
|
128
|
-
? hasPrivateBrand.bind()
|
|
129
|
-
: function (target) {
|
|
130
|
-
return name in target;
|
|
131
|
-
};
|
|
132
|
-
ctx.access =
|
|
133
|
-
get && set
|
|
134
|
-
? { get: get, set: set, has: has }
|
|
135
|
-
: get
|
|
136
|
-
? { get: get, has: has }
|
|
137
|
-
: { set: set, has: has };
|
|
138
|
-
|
|
139
|
-
try {
|
|
140
|
-
return dec(value, ctx);
|
|
141
|
-
} finally {
|
|
142
|
-
decoratorFinishedRef.v = true;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
148
|
|
|
146
|
-
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
150
|
+
if (decoratorFinishedRef.v) {
|
|
151
|
+
throw new Error(
|
|
152
|
+
"attempted to call " + fnName + " after decoration was finished"
|
|
153
|
+
);
|
|
154
|
+
}
|
|
151
155
|
}
|
|
152
|
-
}
|
|
153
156
|
|
|
154
|
-
function assertCallable(fn, hint) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
+
function assertCallable(fn, hint) {
|
|
158
|
+
if (typeof fn !== "function") {
|
|
159
|
+
throw new TypeError(hint + " must be a function");
|
|
160
|
+
}
|
|
157
161
|
}
|
|
158
|
-
}
|
|
159
162
|
|
|
160
|
-
function assertValidReturnValue(kind, value) {
|
|
161
|
-
|
|
163
|
+
function assertValidReturnValue(kind, value) {
|
|
164
|
+
var type = typeof value;
|
|
162
165
|
|
|
163
|
-
|
|
164
|
-
|
|
166
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
167
|
+
if (type !== "object" || value === null) {
|
|
168
|
+
throw new TypeError(
|
|
169
|
+
"accessor decorators must return an object with get, set, or init properties or void 0"
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
if (value.get !== undefined) {
|
|
173
|
+
assertCallable(value.get, "accessor.get");
|
|
174
|
+
}
|
|
175
|
+
if (value.set !== undefined) {
|
|
176
|
+
assertCallable(value.set, "accessor.set");
|
|
177
|
+
}
|
|
178
|
+
if (value.init !== undefined) {
|
|
179
|
+
assertCallable(value.init, "accessor.init");
|
|
180
|
+
}
|
|
181
|
+
} else if (type !== "function") {
|
|
182
|
+
var hint;
|
|
183
|
+
if (kind === 0 /* FIELD */) {
|
|
184
|
+
hint = "field";
|
|
185
|
+
} else if (kind === 10 /* CLASS */) {
|
|
186
|
+
hint = "class";
|
|
187
|
+
} else {
|
|
188
|
+
hint = "method";
|
|
189
|
+
}
|
|
165
190
|
throw new TypeError(
|
|
166
|
-
"
|
|
191
|
+
hint + " decorators must return a function or void 0"
|
|
167
192
|
);
|
|
168
193
|
}
|
|
169
|
-
if (value.get !== undefined) {
|
|
170
|
-
assertCallable(value.get, "accessor.get");
|
|
171
|
-
}
|
|
172
|
-
if (value.set !== undefined) {
|
|
173
|
-
assertCallable(value.set, "accessor.set");
|
|
174
|
-
}
|
|
175
|
-
if (value.init !== undefined) {
|
|
176
|
-
assertCallable(value.init, "accessor.init");
|
|
177
|
-
}
|
|
178
|
-
} else if (type !== "function") {
|
|
179
|
-
var hint;
|
|
180
|
-
if (kind === 0 /* FIELD */) {
|
|
181
|
-
hint = "field";
|
|
182
|
-
} else if (kind === 10 /* CLASS */) {
|
|
183
|
-
hint = "class";
|
|
184
|
-
} else {
|
|
185
|
-
hint = "method";
|
|
186
|
-
}
|
|
187
|
-
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
188
194
|
}
|
|
189
|
-
}
|
|
190
195
|
|
|
191
|
-
function curryThis1(fn) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
function curryThis2(fn) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function applyMemberDec(
|
|
203
|
-
ret,
|
|
204
|
-
base,
|
|
205
|
-
decInfo,
|
|
206
|
-
name,
|
|
207
|
-
kind,
|
|
208
|
-
isStatic,
|
|
209
|
-
isPrivate,
|
|
210
|
-
initializers,
|
|
211
|
-
hasPrivateBrand
|
|
212
|
-
) {
|
|
213
|
-
var decs = decInfo[0];
|
|
196
|
+
function curryThis1(fn) {
|
|
197
|
+
return function () {
|
|
198
|
+
return fn(this);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function curryThis2(fn) {
|
|
202
|
+
return function (value) {
|
|
203
|
+
fn(this, value);
|
|
204
|
+
};
|
|
205
|
+
}
|
|
214
206
|
|
|
215
|
-
|
|
207
|
+
function applyMemberDec(
|
|
208
|
+
ret,
|
|
209
|
+
base,
|
|
210
|
+
decInfo,
|
|
211
|
+
name,
|
|
212
|
+
kind,
|
|
213
|
+
isStatic,
|
|
214
|
+
isPrivate,
|
|
215
|
+
initializers,
|
|
216
|
+
hasPrivateBrand
|
|
217
|
+
) {
|
|
218
|
+
var decs = decInfo[0];
|
|
219
|
+
|
|
220
|
+
var desc, init, value;
|
|
216
221
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
desc = {
|
|
220
|
-
get: curryThis1(decInfo[3]),
|
|
221
|
-
set: curryThis2(decInfo[4]),
|
|
222
|
-
};
|
|
223
|
-
} else {
|
|
224
|
-
if (kind === 3 /* GETTER */) {
|
|
225
|
-
desc = {
|
|
226
|
-
get: decInfo[3],
|
|
227
|
-
};
|
|
228
|
-
} else if (kind === 4 /* SETTER */) {
|
|
222
|
+
if (isPrivate) {
|
|
223
|
+
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
|
|
229
224
|
desc = {
|
|
230
|
-
|
|
225
|
+
get: curryThis1(decInfo[3]),
|
|
226
|
+
set: curryThis2(decInfo[4]),
|
|
231
227
|
};
|
|
232
228
|
} else {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
229
|
+
if (kind === 3 /* GETTER */) {
|
|
230
|
+
desc = {
|
|
231
|
+
get: decInfo[3],
|
|
232
|
+
};
|
|
233
|
+
} else if (kind === 4 /* SETTER */) {
|
|
234
|
+
desc = {
|
|
235
|
+
set: decInfo[3],
|
|
236
|
+
};
|
|
237
|
+
} else {
|
|
238
|
+
desc = {
|
|
239
|
+
value: decInfo[3],
|
|
240
|
+
};
|
|
241
|
+
}
|
|
236
242
|
}
|
|
243
|
+
} else if (kind !== 0 /* FIELD */) {
|
|
244
|
+
desc = Object.getOwnPropertyDescriptor(base, name);
|
|
237
245
|
}
|
|
238
|
-
} else if (kind !== 0 /* FIELD */) {
|
|
239
|
-
desc = Object.getOwnPropertyDescriptor(base, name);
|
|
240
|
-
}
|
|
241
246
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
var newValue, get, set;
|
|
256
|
-
|
|
257
|
-
if (typeof decs === "function") {
|
|
258
|
-
newValue = memberDec(
|
|
259
|
-
decs,
|
|
260
|
-
name,
|
|
261
|
-
desc,
|
|
262
|
-
initializers,
|
|
263
|
-
kind,
|
|
264
|
-
isStatic,
|
|
265
|
-
isPrivate,
|
|
266
|
-
value,
|
|
267
|
-
hasPrivateBrand
|
|
268
|
-
);
|
|
269
|
-
|
|
270
|
-
if (newValue !== void 0) {
|
|
271
|
-
assertValidReturnValue(kind, newValue);
|
|
272
|
-
|
|
273
|
-
if (kind === 0 /* FIELD */) {
|
|
274
|
-
init = newValue;
|
|
275
|
-
} else if (kind === 1 /* ACCESSOR */) {
|
|
276
|
-
init = newValue.init;
|
|
277
|
-
get = newValue.get || value.get;
|
|
278
|
-
set = newValue.set || value.set;
|
|
279
|
-
|
|
280
|
-
value = { get: get, set: set };
|
|
281
|
-
} else {
|
|
282
|
-
value = newValue;
|
|
283
|
-
}
|
|
247
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
248
|
+
value = {
|
|
249
|
+
get: desc.get,
|
|
250
|
+
set: desc.set,
|
|
251
|
+
};
|
|
252
|
+
} else if (kind === 2 /* METHOD */) {
|
|
253
|
+
value = desc.value;
|
|
254
|
+
} else if (kind === 3 /* GETTER */) {
|
|
255
|
+
value = desc.get;
|
|
256
|
+
} else if (kind === 4 /* SETTER */) {
|
|
257
|
+
value = desc.set;
|
|
284
258
|
}
|
|
285
|
-
} else {
|
|
286
|
-
for (var i = decs.length - 1; i >= 0; i--) {
|
|
287
|
-
var dec = decs[i];
|
|
288
259
|
|
|
260
|
+
var newValue, get, set;
|
|
261
|
+
|
|
262
|
+
if (typeof decs === "function") {
|
|
289
263
|
newValue = memberDec(
|
|
290
|
-
|
|
264
|
+
decs,
|
|
291
265
|
name,
|
|
292
266
|
desc,
|
|
293
267
|
initializers,
|
|
@@ -300,12 +274,11 @@ function applyMemberDec(
|
|
|
300
274
|
|
|
301
275
|
if (newValue !== void 0) {
|
|
302
276
|
assertValidReturnValue(kind, newValue);
|
|
303
|
-
var newInit;
|
|
304
277
|
|
|
305
278
|
if (kind === 0 /* FIELD */) {
|
|
306
|
-
|
|
279
|
+
init = newValue;
|
|
307
280
|
} else if (kind === 1 /* ACCESSOR */) {
|
|
308
|
-
|
|
281
|
+
init = newValue.init;
|
|
309
282
|
get = newValue.get || value.get;
|
|
310
283
|
set = newValue.set || value.set;
|
|
311
284
|
|
|
@@ -313,367 +286,414 @@ function applyMemberDec(
|
|
|
313
286
|
} else {
|
|
314
287
|
value = newValue;
|
|
315
288
|
}
|
|
289
|
+
}
|
|
290
|
+
} else {
|
|
291
|
+
for (var i = decs.length - 1; i >= 0; i--) {
|
|
292
|
+
var dec = decs[i];
|
|
293
|
+
|
|
294
|
+
newValue = memberDec(
|
|
295
|
+
dec,
|
|
296
|
+
name,
|
|
297
|
+
desc,
|
|
298
|
+
initializers,
|
|
299
|
+
kind,
|
|
300
|
+
isStatic,
|
|
301
|
+
isPrivate,
|
|
302
|
+
value,
|
|
303
|
+
hasPrivateBrand
|
|
304
|
+
);
|
|
316
305
|
|
|
317
|
-
if (
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
306
|
+
if (newValue !== void 0) {
|
|
307
|
+
assertValidReturnValue(kind, newValue);
|
|
308
|
+
var newInit;
|
|
309
|
+
|
|
310
|
+
if (kind === 0 /* FIELD */) {
|
|
311
|
+
newInit = newValue;
|
|
312
|
+
} else if (kind === 1 /* ACCESSOR */) {
|
|
313
|
+
newInit = newValue.init;
|
|
314
|
+
get = newValue.get || value.get;
|
|
315
|
+
set = newValue.set || value.set;
|
|
316
|
+
|
|
317
|
+
value = { get: get, set: set };
|
|
322
318
|
} else {
|
|
323
|
-
|
|
319
|
+
value = newValue;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (newInit !== void 0) {
|
|
323
|
+
if (init === void 0) {
|
|
324
|
+
init = newInit;
|
|
325
|
+
} else if (typeof init === "function") {
|
|
326
|
+
init = [init, newInit];
|
|
327
|
+
} else {
|
|
328
|
+
init.push(newInit);
|
|
329
|
+
}
|
|
324
330
|
}
|
|
325
331
|
}
|
|
326
332
|
}
|
|
327
333
|
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
|
|
331
|
-
if (init === void 0) {
|
|
332
|
-
// If the initializer was void 0, sub in a dummy initializer
|
|
333
|
-
init = function (instance, init) {
|
|
334
|
-
return init;
|
|
335
|
-
};
|
|
336
|
-
} else if (typeof init !== "function") {
|
|
337
|
-
var ownInitializers = init;
|
|
338
334
|
|
|
339
|
-
|
|
340
|
-
|
|
335
|
+
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
|
|
336
|
+
if (init === void 0) {
|
|
337
|
+
// If the initializer was void 0, sub in a dummy initializer
|
|
338
|
+
init = function (instance, init) {
|
|
339
|
+
return init;
|
|
340
|
+
};
|
|
341
|
+
} else if (typeof init !== "function") {
|
|
342
|
+
var ownInitializers = init;
|
|
341
343
|
|
|
342
|
-
|
|
343
|
-
value =
|
|
344
|
-
}
|
|
344
|
+
init = function (instance, init) {
|
|
345
|
+
var value = init;
|
|
345
346
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
var originalInitializer = init;
|
|
347
|
+
for (var i = 0; i < ownInitializers.length; i++) {
|
|
348
|
+
value = ownInitializers[i].call(instance, value);
|
|
349
|
+
}
|
|
350
350
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
|
|
351
|
+
return value;
|
|
352
|
+
};
|
|
353
|
+
} else {
|
|
354
|
+
var originalInitializer = init;
|
|
355
355
|
|
|
356
|
-
|
|
357
|
-
|
|
356
|
+
init = function (instance, init) {
|
|
357
|
+
return originalInitializer.call(instance, init);
|
|
358
|
+
};
|
|
359
|
+
}
|
|
358
360
|
|
|
359
|
-
|
|
360
|
-
if (kind === 1 /* ACCESSOR */) {
|
|
361
|
-
desc.get = value.get;
|
|
362
|
-
desc.set = value.set;
|
|
363
|
-
} else if (kind === 2 /* METHOD */) {
|
|
364
|
-
desc.value = value;
|
|
365
|
-
} else if (kind === 3 /* GETTER */) {
|
|
366
|
-
desc.get = value;
|
|
367
|
-
} else if (kind === 4 /* SETTER */) {
|
|
368
|
-
desc.set = value;
|
|
361
|
+
ret.push(init);
|
|
369
362
|
}
|
|
370
363
|
|
|
371
|
-
if (
|
|
364
|
+
if (kind !== 0 /* FIELD */) {
|
|
372
365
|
if (kind === 1 /* ACCESSOR */) {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
});
|
|
376
|
-
ret.push(function (instance, args) {
|
|
377
|
-
return value.set.call(instance, args);
|
|
378
|
-
});
|
|
366
|
+
desc.get = value.get;
|
|
367
|
+
desc.set = value.set;
|
|
379
368
|
} else if (kind === 2 /* METHOD */) {
|
|
380
|
-
|
|
369
|
+
desc.value = value;
|
|
370
|
+
} else if (kind === 3 /* GETTER */) {
|
|
371
|
+
desc.get = value;
|
|
372
|
+
} else if (kind === 4 /* SETTER */) {
|
|
373
|
+
desc.set = value;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
if (isPrivate) {
|
|
377
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
378
|
+
ret.push(function (instance, args) {
|
|
379
|
+
return value.get.call(instance, args);
|
|
380
|
+
});
|
|
381
|
+
ret.push(function (instance, args) {
|
|
382
|
+
return value.set.call(instance, args);
|
|
383
|
+
});
|
|
384
|
+
} else if (kind === 2 /* METHOD */) {
|
|
385
|
+
ret.push(value);
|
|
386
|
+
} else {
|
|
387
|
+
ret.push(function (instance, args) {
|
|
388
|
+
return value.call(instance, args);
|
|
389
|
+
});
|
|
390
|
+
}
|
|
381
391
|
} else {
|
|
382
|
-
|
|
383
|
-
return value.call(instance, args);
|
|
384
|
-
});
|
|
392
|
+
Object.defineProperty(base, name, desc);
|
|
385
393
|
}
|
|
386
|
-
} else {
|
|
387
|
-
Object.defineProperty(base, name, desc);
|
|
388
394
|
}
|
|
389
395
|
}
|
|
390
|
-
}
|
|
391
396
|
|
|
392
|
-
function applyMemberDecs(Class, decInfos, instanceBrand) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
397
|
+
function applyMemberDecs(Class, decInfos, instanceBrand) {
|
|
398
|
+
var ret = [];
|
|
399
|
+
var protoInitializers;
|
|
400
|
+
var staticInitializers;
|
|
401
|
+
var staticBrand;
|
|
402
|
+
|
|
403
|
+
var existingProtoNonFields = new Map();
|
|
404
|
+
var existingStaticNonFields = new Map();
|
|
405
|
+
|
|
406
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
407
|
+
var decInfo = decInfos[i];
|
|
408
|
+
|
|
409
|
+
// skip computed property names
|
|
410
|
+
if (!Array.isArray(decInfo)) continue;
|
|
411
|
+
|
|
412
|
+
var kind = decInfo[1];
|
|
413
|
+
var name = decInfo[2];
|
|
414
|
+
var isPrivate = decInfo.length > 3;
|
|
415
|
+
|
|
416
|
+
var isStatic = kind >= 5; /* STATIC */
|
|
417
|
+
var base;
|
|
418
|
+
var initializers;
|
|
419
|
+
var hasPrivateBrand = instanceBrand;
|
|
420
|
+
|
|
421
|
+
if (isStatic) {
|
|
422
|
+
base = Class;
|
|
423
|
+
kind = kind - 5 /* STATIC */;
|
|
424
|
+
// initialize staticInitializers when we see a non-field static member
|
|
425
|
+
if (kind !== 0 /* FIELD */) {
|
|
426
|
+
staticInitializers = staticInitializers || [];
|
|
427
|
+
initializers = staticInitializers;
|
|
428
|
+
}
|
|
429
|
+
if (isPrivate && !staticBrand) {
|
|
430
|
+
staticBrand = function (_) {
|
|
431
|
+
return checkInRHS(_) === Class;
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
hasPrivateBrand = staticBrand;
|
|
435
|
+
} else {
|
|
436
|
+
base = Class.prototype;
|
|
437
|
+
// initialize protoInitializers when we see a non-field member
|
|
438
|
+
if (kind !== 0 /* FIELD */) {
|
|
439
|
+
protoInitializers = protoInitializers || [];
|
|
440
|
+
initializers = protoInitializers;
|
|
441
|
+
}
|
|
436
442
|
}
|
|
437
|
-
}
|
|
438
443
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
444
|
+
if (kind !== 0 /* FIELD */ && !isPrivate) {
|
|
445
|
+
var existingNonFields = isStatic
|
|
446
|
+
? existingStaticNonFields
|
|
447
|
+
: existingProtoNonFields;
|
|
448
|
+
|
|
449
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
450
|
+
|
|
451
|
+
if (
|
|
452
|
+
existingKind === true ||
|
|
453
|
+
(existingKind === 3 /* GETTER */ && kind !== 4) /* SETTER */ ||
|
|
454
|
+
(existingKind === 4 /* SETTER */ && kind !== 3) /* GETTER */
|
|
455
|
+
) {
|
|
456
|
+
throw new Error(
|
|
457
|
+
"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: " +
|
|
458
|
+
name
|
|
459
|
+
);
|
|
460
|
+
} else if (!existingKind && kind > 2 /* METHOD */) {
|
|
461
|
+
existingNonFields.set(name, kind);
|
|
462
|
+
} else {
|
|
463
|
+
existingNonFields.set(name, true);
|
|
464
|
+
}
|
|
459
465
|
}
|
|
466
|
+
|
|
467
|
+
applyMemberDec(
|
|
468
|
+
ret,
|
|
469
|
+
base,
|
|
470
|
+
decInfo,
|
|
471
|
+
name,
|
|
472
|
+
kind,
|
|
473
|
+
isStatic,
|
|
474
|
+
isPrivate,
|
|
475
|
+
initializers,
|
|
476
|
+
hasPrivateBrand
|
|
477
|
+
);
|
|
460
478
|
}
|
|
461
479
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
decInfo,
|
|
466
|
-
name,
|
|
467
|
-
kind,
|
|
468
|
-
isStatic,
|
|
469
|
-
isPrivate,
|
|
470
|
-
initializers,
|
|
471
|
-
hasPrivateBrand
|
|
472
|
-
);
|
|
480
|
+
pushInitializers(ret, protoInitializers);
|
|
481
|
+
pushInitializers(ret, staticInitializers);
|
|
482
|
+
return ret;
|
|
473
483
|
}
|
|
474
484
|
|
|
475
|
-
pushInitializers(ret,
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
initializers[i].call(instance);
|
|
485
|
-
}
|
|
486
|
-
return instance;
|
|
487
|
-
});
|
|
485
|
+
function pushInitializers(ret, initializers) {
|
|
486
|
+
if (initializers) {
|
|
487
|
+
ret.push(function (instance) {
|
|
488
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
489
|
+
initializers[i].call(instance);
|
|
490
|
+
}
|
|
491
|
+
return instance;
|
|
492
|
+
});
|
|
493
|
+
}
|
|
488
494
|
}
|
|
489
|
-
}
|
|
490
495
|
|
|
491
|
-
function applyClassDecs(targetClass, classDecs) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
496
|
+
function applyClassDecs(targetClass, classDecs) {
|
|
497
|
+
if (classDecs.length > 0) {
|
|
498
|
+
var initializers = [];
|
|
499
|
+
var newClass = targetClass;
|
|
500
|
+
var name = targetClass.name;
|
|
501
|
+
|
|
502
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
503
|
+
var decoratorFinishedRef = { v: false };
|
|
504
|
+
|
|
505
|
+
try {
|
|
506
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
507
|
+
kind: "class",
|
|
508
|
+
name: name,
|
|
509
|
+
addInitializer: createAddInitializerMethod(
|
|
510
|
+
initializers,
|
|
511
|
+
decoratorFinishedRef
|
|
512
|
+
),
|
|
513
|
+
});
|
|
514
|
+
} finally {
|
|
515
|
+
decoratorFinishedRef.v = true;
|
|
516
|
+
}
|
|
512
517
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
518
|
+
if (nextNewClass !== undefined) {
|
|
519
|
+
assertValidReturnValue(10 /* CLASS */, nextNewClass);
|
|
520
|
+
newClass = nextNewClass;
|
|
521
|
+
}
|
|
516
522
|
}
|
|
517
|
-
}
|
|
518
523
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
524
|
+
return [
|
|
525
|
+
newClass,
|
|
526
|
+
function () {
|
|
527
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
528
|
+
initializers[i].call(newClass);
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
];
|
|
532
|
+
}
|
|
533
|
+
// The transformer will not emit assignment when there are no class decorators,
|
|
534
|
+
// so we don't have to return an empty array here.
|
|
527
535
|
}
|
|
528
|
-
// The transformer will not emit assignment when there are no class decorators,
|
|
529
|
-
// so we don't have to return an empty array here.
|
|
530
|
-
}
|
|
531
536
|
|
|
532
|
-
/**
|
|
533
|
-
|
|
537
|
+
/**
|
|
538
|
+
Basic usage:
|
|
534
539
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
540
|
+
applyDecs(
|
|
541
|
+
Class,
|
|
542
|
+
[
|
|
543
|
+
// member decorators
|
|
544
|
+
[
|
|
545
|
+
dec, // dec or array of decs
|
|
546
|
+
0, // kind of value being decorated
|
|
547
|
+
'prop', // name of public prop on class containing the value being decorated,
|
|
548
|
+
'#p', // the name of the private property (if is private, void 0 otherwise),
|
|
549
|
+
]
|
|
550
|
+
],
|
|
539
551
|
[
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
'prop', // name of public prop on class containing the value being decorated,
|
|
543
|
-
'#p', // the name of the private property (if is private, void 0 otherwise),
|
|
552
|
+
// class decorators
|
|
553
|
+
dec1, dec2
|
|
544
554
|
]
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
// class decorators
|
|
548
|
-
dec1, dec2
|
|
549
|
-
]
|
|
550
|
-
)
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
Fully transpiled example:
|
|
554
|
-
|
|
555
|
-
```js
|
|
556
|
-
@dec
|
|
557
|
-
class Class {
|
|
558
|
-
@dec
|
|
559
|
-
a = 123;
|
|
555
|
+
)
|
|
556
|
+
```
|
|
560
557
|
|
|
561
|
-
|
|
562
|
-
#a = 123;
|
|
558
|
+
Fully transpiled example:
|
|
563
559
|
|
|
560
|
+
```js
|
|
564
561
|
@dec
|
|
565
|
-
|
|
566
|
-
|
|
562
|
+
class Class {
|
|
563
|
+
@dec
|
|
564
|
+
a = 123;
|
|
567
565
|
|
|
568
|
-
|
|
569
|
-
|
|
566
|
+
@dec
|
|
567
|
+
#a = 123;
|
|
570
568
|
|
|
571
|
-
|
|
572
|
-
|
|
569
|
+
@dec
|
|
570
|
+
@dec2
|
|
571
|
+
accessor b = 123;
|
|
573
572
|
|
|
574
|
-
|
|
575
|
-
|
|
573
|
+
@dec
|
|
574
|
+
accessor #b = 123;
|
|
576
575
|
|
|
577
|
-
|
|
578
|
-
|
|
576
|
+
@dec
|
|
577
|
+
c() { console.log('c'); }
|
|
579
578
|
|
|
580
|
-
|
|
581
|
-
|
|
579
|
+
@dec
|
|
580
|
+
#c() { console.log('privC'); }
|
|
582
581
|
|
|
583
|
-
|
|
584
|
-
|
|
582
|
+
@dec
|
|
583
|
+
get d() { console.log('d'); }
|
|
585
584
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
}
|
|
585
|
+
@dec
|
|
586
|
+
get #d() { console.log('privD'); }
|
|
589
587
|
|
|
588
|
+
@dec
|
|
589
|
+
set e(v) { console.log('e'); }
|
|
590
590
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
591
|
+
@dec
|
|
592
|
+
set #e(v) { console.log('privE'); }
|
|
593
|
+
}
|
|
594
594
|
|
|
595
|
-
let initA;
|
|
596
|
-
let initPrivA;
|
|
597
595
|
|
|
598
|
-
|
|
599
|
-
|
|
596
|
+
// becomes
|
|
597
|
+
let initializeInstance;
|
|
598
|
+
let initializeClass;
|
|
600
599
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
let privE;
|
|
600
|
+
let initA;
|
|
601
|
+
let initPrivA;
|
|
604
602
|
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
static {
|
|
608
|
-
let ret = applyDecs(
|
|
609
|
-
this,
|
|
610
|
-
[
|
|
611
|
-
[dec, 0, 'a'],
|
|
612
|
-
[dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],
|
|
613
|
-
[[dec, dec2], 1, 'b'],
|
|
614
|
-
[dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],
|
|
615
|
-
[dec, 2, 'c'],
|
|
616
|
-
[dec, 2, 'c', () => console.log('privC')],
|
|
617
|
-
[dec, 3, 'd'],
|
|
618
|
-
[dec, 3, 'd', () => console.log('privD')],
|
|
619
|
-
[dec, 4, 'e'],
|
|
620
|
-
[dec, 4, 'e', () => console.log('privE')],
|
|
621
|
-
],
|
|
622
|
-
[
|
|
623
|
-
dec
|
|
624
|
-
]
|
|
625
|
-
)
|
|
603
|
+
let initB;
|
|
604
|
+
let initPrivB, getPrivB, setPrivB;
|
|
626
605
|
|
|
627
|
-
|
|
606
|
+
let privC;
|
|
607
|
+
let privD;
|
|
608
|
+
let privE;
|
|
628
609
|
|
|
629
|
-
|
|
610
|
+
let Class;
|
|
611
|
+
class _Class {
|
|
612
|
+
static {
|
|
613
|
+
let ret = applyDecs(
|
|
614
|
+
this,
|
|
615
|
+
[
|
|
616
|
+
[dec, 0, 'a'],
|
|
617
|
+
[dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],
|
|
618
|
+
[[dec, dec2], 1, 'b'],
|
|
619
|
+
[dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],
|
|
620
|
+
[dec, 2, 'c'],
|
|
621
|
+
[dec, 2, 'c', () => console.log('privC')],
|
|
622
|
+
[dec, 3, 'd'],
|
|
623
|
+
[dec, 3, 'd', () => console.log('privD')],
|
|
624
|
+
[dec, 4, 'e'],
|
|
625
|
+
[dec, 4, 'e', () => console.log('privE')],
|
|
626
|
+
],
|
|
627
|
+
[
|
|
628
|
+
dec
|
|
629
|
+
]
|
|
630
|
+
)
|
|
630
631
|
|
|
631
|
-
|
|
632
|
+
initA = ret[0];
|
|
632
633
|
|
|
633
|
-
|
|
634
|
-
getPrivB = ret[4];
|
|
635
|
-
setPrivB = ret[5];
|
|
634
|
+
initPrivA = ret[1];
|
|
636
635
|
|
|
637
|
-
|
|
636
|
+
initB = ret[2];
|
|
638
637
|
|
|
639
|
-
|
|
638
|
+
initPrivB = ret[3];
|
|
639
|
+
getPrivB = ret[4];
|
|
640
|
+
setPrivB = ret[5];
|
|
640
641
|
|
|
641
|
-
|
|
642
|
+
privC = ret[6];
|
|
642
643
|
|
|
643
|
-
|
|
644
|
+
privD = ret[7];
|
|
644
645
|
|
|
645
|
-
|
|
646
|
+
privE = ret[8];
|
|
646
647
|
|
|
647
|
-
|
|
648
|
-
|
|
648
|
+
initializeInstance = ret[9];
|
|
649
|
+
|
|
650
|
+
Class = ret[10]
|
|
649
651
|
|
|
650
|
-
|
|
652
|
+
initializeClass = ret[11];
|
|
653
|
+
}
|
|
651
654
|
|
|
652
|
-
|
|
655
|
+
a = (initializeInstance(this), initA(this, 123));
|
|
653
656
|
|
|
654
|
-
|
|
655
|
-
get b() { return this.#bData }
|
|
656
|
-
set b(v) { this.#bData = v }
|
|
657
|
+
#a = initPrivA(this, 123);
|
|
657
658
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
659
|
+
#bData = initB(this, 123);
|
|
660
|
+
get b() { return this.#bData }
|
|
661
|
+
set b(v) { this.#bData = v }
|
|
661
662
|
|
|
662
|
-
|
|
663
|
+
#privBData = initPrivB(this, 123);
|
|
664
|
+
get #b() { return getPrivB(this); }
|
|
665
|
+
set #b(v) { setPrivB(this, v); }
|
|
663
666
|
|
|
664
|
-
|
|
667
|
+
c() { console.log('c'); }
|
|
665
668
|
|
|
666
|
-
|
|
669
|
+
#c(...args) { return privC(this, ...args) }
|
|
667
670
|
|
|
668
|
-
|
|
671
|
+
get d() { console.log('d'); }
|
|
669
672
|
|
|
670
|
-
|
|
673
|
+
get #d() { return privD(this); }
|
|
671
674
|
|
|
672
|
-
|
|
673
|
-
|
|
675
|
+
set e(v) { console.log('e'); }
|
|
676
|
+
|
|
677
|
+
set #e(v) { privE(this, v); }
|
|
678
|
+
}
|
|
674
679
|
|
|
675
|
-
|
|
676
|
-
|
|
680
|
+
initializeClass(Class);
|
|
681
|
+
*/
|
|
682
|
+
return function applyDecs2301(
|
|
683
|
+
targetClass,
|
|
684
|
+
memberDecs,
|
|
685
|
+
classDecs,
|
|
686
|
+
instanceBrand
|
|
687
|
+
) {
|
|
688
|
+
return {
|
|
689
|
+
e: applyMemberDecs(targetClass, memberDecs, instanceBrand),
|
|
690
|
+
// Lazily apply class decorations so that member init locals can be properly bound.
|
|
691
|
+
get c() {
|
|
692
|
+
return applyClassDecs(targetClass, classDecs);
|
|
693
|
+
},
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
}
|
|
677
697
|
|
|
678
698
|
export default function applyDecs2301(
|
|
679
699
|
targetClass,
|
|
@@ -681,11 +701,10 @@ export default function applyDecs2301(
|
|
|
681
701
|
classDecs,
|
|
682
702
|
instanceBrand
|
|
683
703
|
) {
|
|
684
|
-
return
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
};
|
|
704
|
+
return (applyDecs2301 = applyDecs2301Factory())(
|
|
705
|
+
targetClass,
|
|
706
|
+
memberDecs,
|
|
707
|
+
classDecs,
|
|
708
|
+
instanceBrand
|
|
709
|
+
);
|
|
691
710
|
}
|