Ajout de promotion et de commande
This commit is contained in:
+1440
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+11
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _AwaitValue;
|
||||
function _AwaitValue(value) {
|
||||
this.wrapped = value;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=AwaitValue.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_AwaitValue","value","wrapped"],"sources":["../../src/helpers/AwaitValue.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n/* @onlyBabel7 */\n\nexport default function _AwaitValue(value) {\n this.wrapped = value;\n}\n"],"mappings":";;;;;;AAGe,SAASA,WAAWA,CAACC,KAAK,EAAE;EACzC,IAAI,CAACC,OAAO,GAAGD,KAAK;AACtB","ignoreList":[]}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _OverloadYield;
|
||||
function _OverloadYield(value, kind) {
|
||||
this.v = value;
|
||||
this.k = kind;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=OverloadYield.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_OverloadYield","value","kind","v","k"],"sources":["../../src/helpers/OverloadYield.ts"],"sourcesContent":["/* @minVersion 7.18.14 */\n\nconst enum Kind {\n // This yield was an await expression\n Await = 0,\n // This yield comes from yield*\n Delegate = 1,\n}\n\n// _OverloadYield is actually a class\ndeclare class _OverloadYield<T = any> {\n constructor(value: T, /** 0: await 1: delegate */ kind: 0 | 1);\n\n v: T;\n k: Kind;\n}\n\n// The actual implementation of _OverloadYield starts here\nfunction _OverloadYield<T>(this: _OverloadYield<T>, value: T, kind: Kind) {\n this.v = value;\n this.k = kind;\n}\n\nexport { _OverloadYield as default };\n"],"mappings":";;;;;;AAkBA,SAASA,cAAcA,CAA6BC,KAAQ,EAAEC,IAAU,EAAE;EACxE,IAAI,CAACC,CAAC,GAAGF,KAAK;EACd,IAAI,CAACG,CAAC,GAAGF,IAAI;AACf","ignoreList":[]}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _applyDecoratedDescriptor;
|
||||
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
|
||||
var desc = {};
|
||||
Object.keys(descriptor).forEach(function (key) {
|
||||
desc[key] = descriptor[key];
|
||||
});
|
||||
desc.enumerable = !!desc.enumerable;
|
||||
desc.configurable = !!desc.configurable;
|
||||
if ("value" in desc || desc.initializer) {
|
||||
desc.writable = true;
|
||||
}
|
||||
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
|
||||
return decorator(target, property, desc) || desc;
|
||||
}, desc);
|
||||
if (context && desc.initializer !== void 0) {
|
||||
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
||||
desc.initializer = void 0;
|
||||
}
|
||||
if (desc.initializer === void 0) {
|
||||
Object.defineProperty(target, property, desc);
|
||||
return null;
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=applyDecoratedDescriptor.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+459
@@ -0,0 +1,459 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyDecs;
|
||||
var _setFunctionName = require("setFunctionName");
|
||||
var _toPropertyKey = require("toPropertyKey");
|
||||
function old_createMetadataMethodsForProperty(metadataMap, kind, property, decoratorFinishedRef) {
|
||||
return {
|
||||
getMetadata: function (key) {
|
||||
old_assertNotFinished(decoratorFinishedRef, "getMetadata");
|
||||
old_assertMetadataKey(key);
|
||||
var metadataForKey = metadataMap[key];
|
||||
if (metadataForKey === void 0) return void 0;
|
||||
if (kind === 1) {
|
||||
var pub = metadataForKey.public;
|
||||
if (pub !== void 0) {
|
||||
return pub[property];
|
||||
}
|
||||
} else if (kind === 2) {
|
||||
var priv = metadataForKey.private;
|
||||
if (priv !== void 0) {
|
||||
return priv.get(property);
|
||||
}
|
||||
} else if (Object.hasOwnProperty.call(metadataForKey, "constructor")) {
|
||||
return metadataForKey.constructor;
|
||||
}
|
||||
},
|
||||
setMetadata: function (key, value) {
|
||||
old_assertNotFinished(decoratorFinishedRef, "setMetadata");
|
||||
old_assertMetadataKey(key);
|
||||
var metadataForKey = metadataMap[key];
|
||||
if (metadataForKey === void 0) {
|
||||
metadataForKey = metadataMap[key] = {};
|
||||
}
|
||||
if (kind === 1) {
|
||||
var pub = metadataForKey.public;
|
||||
if (pub === void 0) {
|
||||
pub = metadataForKey.public = {};
|
||||
}
|
||||
pub[property] = value;
|
||||
} else if (kind === 2) {
|
||||
var priv = metadataForKey.priv;
|
||||
if (priv === void 0) {
|
||||
priv = metadataForKey.private = new Map();
|
||||
}
|
||||
priv.set(property, value);
|
||||
} else {
|
||||
metadataForKey.constructor = value;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function old_convertMetadataMapToFinal(obj, metadataMap) {
|
||||
var parentMetadataMap = obj[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
||||
var metadataKeys = Object.getOwnPropertySymbols(metadataMap);
|
||||
if (metadataKeys.length === 0) return;
|
||||
for (var i = 0; i < metadataKeys.length; i++) {
|
||||
var key = metadataKeys[i];
|
||||
var metaForKey = metadataMap[key];
|
||||
var parentMetaForKey = parentMetadataMap ? parentMetadataMap[key] : null;
|
||||
var pub = metaForKey.public;
|
||||
var parentPub = parentMetaForKey ? parentMetaForKey.public : null;
|
||||
if (pub && parentPub) {
|
||||
Object.setPrototypeOf(pub, parentPub);
|
||||
}
|
||||
var priv = metaForKey.private;
|
||||
if (priv) {
|
||||
var privArr = Array.from(priv.values());
|
||||
var parentPriv = parentMetaForKey ? parentMetaForKey.private : null;
|
||||
if (parentPriv) {
|
||||
privArr = privArr.concat(parentPriv);
|
||||
}
|
||||
metaForKey.private = privArr;
|
||||
}
|
||||
if (parentMetaForKey) {
|
||||
Object.setPrototypeOf(metaForKey, parentMetaForKey);
|
||||
}
|
||||
}
|
||||
if (parentMetadataMap) {
|
||||
Object.setPrototypeOf(metadataMap, parentMetadataMap);
|
||||
}
|
||||
obj[Symbol.metadata || Symbol.for("Symbol.metadata")] = metadataMap;
|
||||
}
|
||||
function old_createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function addInitializer(initializer) {
|
||||
old_assertNotFinished(decoratorFinishedRef, "addInitializer");
|
||||
old_assertCallable(initializer, "An initializer");
|
||||
initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function old_memberDec(dec, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : _toPropertyKey(name),
|
||||
isStatic: isStatic,
|
||||
isPrivate: isPrivate
|
||||
};
|
||||
var decoratorFinishedRef = {
|
||||
v: false
|
||||
};
|
||||
if (kind !== 0) {
|
||||
ctx.addInitializer = old_createAddInitializerMethod(initializers, decoratorFinishedRef);
|
||||
}
|
||||
var metadataKind, metadataName;
|
||||
if (isPrivate) {
|
||||
metadataKind = 2;
|
||||
metadataName = Symbol(name);
|
||||
var access = {};
|
||||
if (kind === 0) {
|
||||
access.get = desc.get;
|
||||
access.set = desc.set;
|
||||
} else if (kind === 2) {
|
||||
access.get = function () {
|
||||
return desc.value;
|
||||
};
|
||||
} else {
|
||||
if (kind === 1 || kind === 3) {
|
||||
access.get = function () {
|
||||
return desc.get.call(this);
|
||||
};
|
||||
}
|
||||
if (kind === 1 || kind === 4) {
|
||||
access.set = function (v) {
|
||||
desc.set.call(this, v);
|
||||
};
|
||||
}
|
||||
}
|
||||
ctx.access = access;
|
||||
} else {
|
||||
metadataKind = 1;
|
||||
metadataName = name;
|
||||
}
|
||||
try {
|
||||
return dec(value, Object.assign(ctx, old_createMetadataMethodsForProperty(metadataMap, metadataKind, metadataName, decoratorFinishedRef)));
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
}
|
||||
function old_assertNotFinished(decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) {
|
||||
throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}
|
||||
}
|
||||
function old_assertMetadataKey(key) {
|
||||
if (typeof key !== "symbol") {
|
||||
throw new TypeError("Metadata keys must be symbols, received: " + key);
|
||||
}
|
||||
}
|
||||
function old_assertCallable(fn, hint) {
|
||||
if (typeof fn !== "function") {
|
||||
throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
}
|
||||
function old_assertValidReturnValue(kind, value) {
|
||||
var type = typeof value;
|
||||
if (kind === 1) {
|
||||
if (type !== "object" || value === null) {
|
||||
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
}
|
||||
if (value.get !== undefined) {
|
||||
old_assertCallable(value.get, "accessor.get");
|
||||
}
|
||||
if (value.set !== undefined) {
|
||||
old_assertCallable(value.set, "accessor.set");
|
||||
}
|
||||
if (value.init !== undefined) {
|
||||
old_assertCallable(value.init, "accessor.init");
|
||||
}
|
||||
if (value.initializer !== undefined) {
|
||||
old_assertCallable(value.initializer, "accessor.initializer");
|
||||
}
|
||||
} else if (type !== "function") {
|
||||
var hint;
|
||||
if (kind === 0) {
|
||||
hint = "field";
|
||||
} else if (kind === 10) {
|
||||
hint = "class";
|
||||
} else {
|
||||
hint = "method";
|
||||
}
|
||||
throw new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function old_getInit(desc) {
|
||||
var initializer;
|
||||
if ((initializer = desc.init) == null && (initializer = desc.initializer) && typeof console !== "undefined") {
|
||||
console.warn(".initializer has been renamed to .init as of March 2022");
|
||||
}
|
||||
return initializer;
|
||||
}
|
||||
function old_applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, metadataMap, initializers) {
|
||||
var decs = decInfo[0];
|
||||
var desc, initializer, prefix, value;
|
||||
if (isPrivate) {
|
||||
if (kind === 0 || kind === 1) {
|
||||
desc = {
|
||||
get: decInfo[3],
|
||||
set: decInfo[4]
|
||||
};
|
||||
prefix = "get";
|
||||
} else if (kind === 3) {
|
||||
desc = {
|
||||
get: decInfo[3]
|
||||
};
|
||||
prefix = "get";
|
||||
} else if (kind === 4) {
|
||||
desc = {
|
||||
set: decInfo[3]
|
||||
};
|
||||
prefix = "set";
|
||||
} else {
|
||||
desc = {
|
||||
value: decInfo[3]
|
||||
};
|
||||
}
|
||||
if (kind !== 0) {
|
||||
if (kind === 1) {
|
||||
_setFunctionName(decInfo[4], "#" + name, "set");
|
||||
}
|
||||
_setFunctionName(decInfo[3], "#" + name, prefix);
|
||||
}
|
||||
} else if (kind !== 0) {
|
||||
desc = Object.getOwnPropertyDescriptor(base, name);
|
||||
}
|
||||
if (kind === 1) {
|
||||
value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
};
|
||||
} else if (kind === 2) {
|
||||
value = desc.value;
|
||||
} else if (kind === 3) {
|
||||
value = desc.get;
|
||||
} else if (kind === 4) {
|
||||
value = desc.set;
|
||||
}
|
||||
var newValue, get, set;
|
||||
if (typeof decs === "function") {
|
||||
newValue = old_memberDec(decs, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value);
|
||||
if (newValue !== void 0) {
|
||||
old_assertValidReturnValue(kind, newValue);
|
||||
if (kind === 0) {
|
||||
initializer = newValue;
|
||||
} else if (kind === 1) {
|
||||
initializer = old_getInit(newValue);
|
||||
get = newValue.get || value.get;
|
||||
set = newValue.set || value.set;
|
||||
value = {
|
||||
get: get,
|
||||
set: set
|
||||
};
|
||||
} else {
|
||||
value = newValue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var dec = decs[i];
|
||||
newValue = old_memberDec(dec, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value);
|
||||
if (newValue !== void 0) {
|
||||
old_assertValidReturnValue(kind, newValue);
|
||||
var newInit;
|
||||
if (kind === 0) {
|
||||
newInit = newValue;
|
||||
} else if (kind === 1) {
|
||||
newInit = old_getInit(newValue);
|
||||
get = newValue.get || value.get;
|
||||
set = newValue.set || value.set;
|
||||
value = {
|
||||
get: get,
|
||||
set: set
|
||||
};
|
||||
} else {
|
||||
value = newValue;
|
||||
}
|
||||
if (newInit !== void 0) {
|
||||
if (initializer === void 0) {
|
||||
initializer = newInit;
|
||||
} else if (typeof initializer === "function") {
|
||||
initializer = [initializer, newInit];
|
||||
} else {
|
||||
initializer.push(newInit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (kind === 0 || kind === 1) {
|
||||
if (initializer === void 0) {
|
||||
initializer = function (instance, init) {
|
||||
return init;
|
||||
};
|
||||
} else if (typeof initializer !== "function") {
|
||||
var ownInitializers = initializer;
|
||||
initializer = function (instance, init) {
|
||||
var value = init;
|
||||
for (var i = 0; i < ownInitializers.length; i++) {
|
||||
value = ownInitializers[i].call(instance, value);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = initializer;
|
||||
initializer = function (instance, init) {
|
||||
return originalInitializer.call(instance, init);
|
||||
};
|
||||
}
|
||||
ret.push(initializer);
|
||||
}
|
||||
if (kind !== 0) {
|
||||
if (kind === 1) {
|
||||
desc.get = value.get;
|
||||
desc.set = value.set;
|
||||
} else if (kind === 2) {
|
||||
desc.value = value;
|
||||
} else if (kind === 3) {
|
||||
desc.get = value;
|
||||
} else if (kind === 4) {
|
||||
desc.set = value;
|
||||
}
|
||||
if (isPrivate) {
|
||||
if (kind === 1) {
|
||||
ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
});
|
||||
ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
});
|
||||
} else if (kind === 2) {
|
||||
ret.push(value);
|
||||
} else {
|
||||
ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Object.defineProperty(base, name, desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
function old_applyMemberDecs(ret, Class, protoMetadataMap, staticMetadataMap, decInfos) {
|
||||
var protoInitializers;
|
||||
var staticInitializers;
|
||||
var existingProtoNonFields = new Map();
|
||||
var existingStaticNonFields = new Map();
|
||||
for (var i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (!Array.isArray(decInfo)) continue;
|
||||
var kind = decInfo[1];
|
||||
var name = decInfo[2];
|
||||
var isPrivate = decInfo.length > 3;
|
||||
var isStatic = kind >= 5;
|
||||
var base;
|
||||
var metadataMap;
|
||||
var initializers;
|
||||
if (isStatic) {
|
||||
base = Class;
|
||||
metadataMap = staticMetadataMap;
|
||||
kind = kind - 5;
|
||||
if (kind !== 0) {
|
||||
staticInitializers = staticInitializers || [];
|
||||
initializers = staticInitializers;
|
||||
}
|
||||
} else {
|
||||
base = Class.prototype;
|
||||
metadataMap = protoMetadataMap;
|
||||
if (kind !== 0) {
|
||||
protoInitializers = protoInitializers || [];
|
||||
initializers = protoInitializers;
|
||||
}
|
||||
}
|
||||
if (kind !== 0 && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
||||
var existingKind = existingNonFields.get(name) || 0;
|
||||
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
|
||||
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);
|
||||
} else if (!existingKind && kind > 2) {
|
||||
existingNonFields.set(name, kind);
|
||||
} else {
|
||||
existingNonFields.set(name, true);
|
||||
}
|
||||
}
|
||||
old_applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, metadataMap, initializers);
|
||||
}
|
||||
old_pushInitializers(ret, protoInitializers);
|
||||
old_pushInitializers(ret, staticInitializers);
|
||||
}
|
||||
function old_pushInitializers(ret, initializers) {
|
||||
if (initializers) {
|
||||
ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(instance);
|
||||
}
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
}
|
||||
function old_applyClassDecs(ret, targetClass, metadataMap, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
var initializers = [];
|
||||
var newClass = targetClass;
|
||||
var name = targetClass.name;
|
||||
for (var i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: false
|
||||
};
|
||||
try {
|
||||
var ctx = Object.assign({
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: old_createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
}, old_createMetadataMethodsForProperty(metadataMap, 0, name, decoratorFinishedRef));
|
||||
var nextNewClass = classDecs[i](newClass, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
if (nextNewClass !== undefined) {
|
||||
old_assertValidReturnValue(10, nextNewClass);
|
||||
newClass = nextNewClass;
|
||||
}
|
||||
}
|
||||
ret.push(newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(newClass);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function applyDecs(targetClass, memberDecs, classDecs) {
|
||||
var ret = [];
|
||||
var staticMetadataMap = {};
|
||||
var protoMetadataMap = {};
|
||||
old_applyMemberDecs(ret, targetClass, protoMetadataMap, staticMetadataMap, memberDecs);
|
||||
old_convertMetadataMapToFinal(targetClass.prototype, protoMetadataMap);
|
||||
old_applyClassDecs(ret, targetClass, staticMetadataMap, classDecs);
|
||||
old_convertMetadataMapToFinal(targetClass, staticMetadataMap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=applyDecs.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+363
@@ -0,0 +1,363 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyDecs2203;
|
||||
function applyDecs2203Factory() {
|
||||
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function addInitializer(initializer) {
|
||||
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
||||
assertCallable(initializer, "An initializer");
|
||||
initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : name,
|
||||
static: isStatic,
|
||||
private: isPrivate
|
||||
};
|
||||
var decoratorFinishedRef = {
|
||||
v: false
|
||||
};
|
||||
if (kind !== 0) {
|
||||
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
||||
}
|
||||
var get, set;
|
||||
if (kind === 0) {
|
||||
if (isPrivate) {
|
||||
get = desc.get;
|
||||
set = desc.set;
|
||||
} else {
|
||||
get = function () {
|
||||
return this[name];
|
||||
};
|
||||
set = function (v) {
|
||||
this[name] = v;
|
||||
};
|
||||
}
|
||||
} else if (kind === 2) {
|
||||
get = function () {
|
||||
return desc.value;
|
||||
};
|
||||
} else {
|
||||
if (kind === 1 || kind === 3) {
|
||||
get = function () {
|
||||
return desc.get.call(this);
|
||||
};
|
||||
}
|
||||
if (kind === 1 || kind === 4) {
|
||||
set = function (v) {
|
||||
desc.set.call(this, v);
|
||||
};
|
||||
}
|
||||
}
|
||||
ctx.access = get && set ? {
|
||||
get: get,
|
||||
set: set
|
||||
} : get ? {
|
||||
get: get
|
||||
} : {
|
||||
set: set
|
||||
};
|
||||
try {
|
||||
return dec(value, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
}
|
||||
function assertNotFinished(decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) {
|
||||
throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}
|
||||
}
|
||||
function assertCallable(fn, hint) {
|
||||
if (typeof fn !== "function") {
|
||||
throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
}
|
||||
function assertValidReturnValue(kind, value) {
|
||||
var type = typeof value;
|
||||
if (kind === 1) {
|
||||
if (type !== "object" || value === null) {
|
||||
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
}
|
||||
if (value.get !== undefined) {
|
||||
assertCallable(value.get, "accessor.get");
|
||||
}
|
||||
if (value.set !== undefined) {
|
||||
assertCallable(value.set, "accessor.set");
|
||||
}
|
||||
if (value.init !== undefined) {
|
||||
assertCallable(value.init, "accessor.init");
|
||||
}
|
||||
} else if (type !== "function") {
|
||||
var hint;
|
||||
if (kind === 0) {
|
||||
hint = "field";
|
||||
} else if (kind === 10) {
|
||||
hint = "class";
|
||||
} else {
|
||||
hint = "method";
|
||||
}
|
||||
throw new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
|
||||
var decs = decInfo[0];
|
||||
var desc, init, value;
|
||||
if (isPrivate) {
|
||||
if (kind === 0 || kind === 1) {
|
||||
desc = {
|
||||
get: decInfo[3],
|
||||
set: decInfo[4]
|
||||
};
|
||||
} else if (kind === 3) {
|
||||
desc = {
|
||||
get: decInfo[3]
|
||||
};
|
||||
} else if (kind === 4) {
|
||||
desc = {
|
||||
set: decInfo[3]
|
||||
};
|
||||
} else {
|
||||
desc = {
|
||||
value: decInfo[3]
|
||||
};
|
||||
}
|
||||
} else if (kind !== 0) {
|
||||
desc = Object.getOwnPropertyDescriptor(base, name);
|
||||
}
|
||||
if (kind === 1) {
|
||||
value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
};
|
||||
} else if (kind === 2) {
|
||||
value = desc.value;
|
||||
} else if (kind === 3) {
|
||||
value = desc.get;
|
||||
} else if (kind === 4) {
|
||||
value = desc.set;
|
||||
}
|
||||
var newValue, get, set;
|
||||
if (typeof decs === "function") {
|
||||
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value);
|
||||
if (newValue !== void 0) {
|
||||
assertValidReturnValue(kind, newValue);
|
||||
if (kind === 0) {
|
||||
init = newValue;
|
||||
} else if (kind === 1) {
|
||||
init = newValue.init;
|
||||
get = newValue.get || value.get;
|
||||
set = newValue.set || value.set;
|
||||
value = {
|
||||
get: get,
|
||||
set: set
|
||||
};
|
||||
} else {
|
||||
value = newValue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var dec = decs[i];
|
||||
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value);
|
||||
if (newValue !== void 0) {
|
||||
assertValidReturnValue(kind, newValue);
|
||||
var newInit;
|
||||
if (kind === 0) {
|
||||
newInit = newValue;
|
||||
} else if (kind === 1) {
|
||||
newInit = newValue.init;
|
||||
get = newValue.get || value.get;
|
||||
set = newValue.set || value.set;
|
||||
value = {
|
||||
get: get,
|
||||
set: set
|
||||
};
|
||||
} else {
|
||||
value = newValue;
|
||||
}
|
||||
if (newInit !== void 0) {
|
||||
if (init === void 0) {
|
||||
init = newInit;
|
||||
} else if (typeof init === "function") {
|
||||
init = [init, newInit];
|
||||
} else {
|
||||
init.push(newInit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (kind === 0 || kind === 1) {
|
||||
if (init === void 0) {
|
||||
init = function (instance, init) {
|
||||
return init;
|
||||
};
|
||||
} else if (typeof init !== "function") {
|
||||
var ownInitializers = init;
|
||||
init = function (instance, init) {
|
||||
var value = init;
|
||||
for (var i = 0; i < ownInitializers.length; i++) {
|
||||
value = ownInitializers[i].call(instance, value);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = init;
|
||||
init = function (instance, init) {
|
||||
return originalInitializer.call(instance, init);
|
||||
};
|
||||
}
|
||||
ret.push(init);
|
||||
}
|
||||
if (kind !== 0) {
|
||||
if (kind === 1) {
|
||||
desc.get = value.get;
|
||||
desc.set = value.set;
|
||||
} else if (kind === 2) {
|
||||
desc.value = value;
|
||||
} else if (kind === 3) {
|
||||
desc.get = value;
|
||||
} else if (kind === 4) {
|
||||
desc.set = value;
|
||||
}
|
||||
if (isPrivate) {
|
||||
if (kind === 1) {
|
||||
ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
});
|
||||
ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
});
|
||||
} else if (kind === 2) {
|
||||
ret.push(value);
|
||||
} else {
|
||||
ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Object.defineProperty(base, name, desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
function applyMemberDecs(ret, Class, decInfos) {
|
||||
var protoInitializers;
|
||||
var staticInitializers;
|
||||
var existingProtoNonFields = new Map();
|
||||
var existingStaticNonFields = new Map();
|
||||
for (var i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (!Array.isArray(decInfo)) continue;
|
||||
var kind = decInfo[1];
|
||||
var name = decInfo[2];
|
||||
var isPrivate = decInfo.length > 3;
|
||||
var isStatic = kind >= 5;
|
||||
var base;
|
||||
var initializers;
|
||||
if (isStatic) {
|
||||
base = Class;
|
||||
kind = kind - 5;
|
||||
if (kind !== 0) {
|
||||
staticInitializers = staticInitializers || [];
|
||||
initializers = staticInitializers;
|
||||
}
|
||||
} else {
|
||||
base = Class.prototype;
|
||||
if (kind !== 0) {
|
||||
protoInitializers = protoInitializers || [];
|
||||
initializers = protoInitializers;
|
||||
}
|
||||
}
|
||||
if (kind !== 0 && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
||||
var existingKind = existingNonFields.get(name) || 0;
|
||||
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
|
||||
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);
|
||||
} else if (!existingKind && kind > 2) {
|
||||
existingNonFields.set(name, kind);
|
||||
} else {
|
||||
existingNonFields.set(name, true);
|
||||
}
|
||||
}
|
||||
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
|
||||
}
|
||||
pushInitializers(ret, protoInitializers);
|
||||
pushInitializers(ret, staticInitializers);
|
||||
}
|
||||
function pushInitializers(ret, initializers) {
|
||||
if (initializers) {
|
||||
ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(instance);
|
||||
}
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
}
|
||||
function applyClassDecs(ret, targetClass, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
var initializers = [];
|
||||
var newClass = targetClass;
|
||||
var name = targetClass.name;
|
||||
for (var i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: false
|
||||
};
|
||||
try {
|
||||
var nextNewClass = classDecs[i](newClass, {
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
});
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
if (nextNewClass !== undefined) {
|
||||
assertValidReturnValue(10, nextNewClass);
|
||||
newClass = nextNewClass;
|
||||
}
|
||||
}
|
||||
ret.push(newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(newClass);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return function applyDecs2203Impl(targetClass, memberDecs, classDecs) {
|
||||
var ret = [];
|
||||
applyMemberDecs(ret, targetClass, memberDecs);
|
||||
applyClassDecs(ret, targetClass, classDecs);
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
var applyDecs2203Impl;
|
||||
function applyDecs2203(targetClass, memberDecs, classDecs) {
|
||||
applyDecs2203Impl = applyDecs2203Impl || applyDecs2203Factory();
|
||||
return applyDecs2203Impl(targetClass, memberDecs, classDecs);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=applyDecs2203.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+376
@@ -0,0 +1,376 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyDecs2203R;
|
||||
var _setFunctionName = require("setFunctionName");
|
||||
var _toPropertyKey = require("toPropertyKey");
|
||||
function applyDecs2203RFactory() {
|
||||
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function addInitializer(initializer) {
|
||||
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
||||
assertCallable(initializer, "An initializer");
|
||||
initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : _toPropertyKey(name),
|
||||
static: isStatic,
|
||||
private: isPrivate
|
||||
};
|
||||
var decoratorFinishedRef = {
|
||||
v: false
|
||||
};
|
||||
if (kind !== 0) {
|
||||
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
||||
}
|
||||
var get, set;
|
||||
if (kind === 0) {
|
||||
if (isPrivate) {
|
||||
get = desc.get;
|
||||
set = desc.set;
|
||||
} else {
|
||||
get = function () {
|
||||
return this[name];
|
||||
};
|
||||
set = function (v) {
|
||||
this[name] = v;
|
||||
};
|
||||
}
|
||||
} else if (kind === 2) {
|
||||
get = function () {
|
||||
return desc.value;
|
||||
};
|
||||
} else {
|
||||
if (kind === 1 || kind === 3) {
|
||||
get = function () {
|
||||
return desc.get.call(this);
|
||||
};
|
||||
}
|
||||
if (kind === 1 || kind === 4) {
|
||||
set = function (v) {
|
||||
desc.set.call(this, v);
|
||||
};
|
||||
}
|
||||
}
|
||||
ctx.access = get && set ? {
|
||||
get: get,
|
||||
set: set
|
||||
} : get ? {
|
||||
get: get
|
||||
} : {
|
||||
set: set
|
||||
};
|
||||
try {
|
||||
return dec(value, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
}
|
||||
function assertNotFinished(decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) {
|
||||
throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}
|
||||
}
|
||||
function assertCallable(fn, hint) {
|
||||
if (typeof fn !== "function") {
|
||||
throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
}
|
||||
function assertValidReturnValue(kind, value) {
|
||||
var type = typeof value;
|
||||
if (kind === 1) {
|
||||
if (type !== "object" || value === null) {
|
||||
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
}
|
||||
if (value.get !== undefined) {
|
||||
assertCallable(value.get, "accessor.get");
|
||||
}
|
||||
if (value.set !== undefined) {
|
||||
assertCallable(value.set, "accessor.set");
|
||||
}
|
||||
if (value.init !== undefined) {
|
||||
assertCallable(value.init, "accessor.init");
|
||||
}
|
||||
} else if (type !== "function") {
|
||||
var hint;
|
||||
if (kind === 0) {
|
||||
hint = "field";
|
||||
} else if (kind === 10) {
|
||||
hint = "class";
|
||||
} else {
|
||||
hint = "method";
|
||||
}
|
||||
throw new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
|
||||
var decs = decInfo[0];
|
||||
var desc, init, prefix, value;
|
||||
if (isPrivate) {
|
||||
if (kind === 0 || kind === 1) {
|
||||
desc = {
|
||||
get: decInfo[3],
|
||||
set: decInfo[4]
|
||||
};
|
||||
prefix = "get";
|
||||
} else if (kind === 3) {
|
||||
desc = {
|
||||
get: decInfo[3]
|
||||
};
|
||||
prefix = "get";
|
||||
} else if (kind === 4) {
|
||||
desc = {
|
||||
set: decInfo[3]
|
||||
};
|
||||
prefix = "set";
|
||||
} else {
|
||||
desc = {
|
||||
value: decInfo[3]
|
||||
};
|
||||
}
|
||||
if (kind !== 0) {
|
||||
if (kind === 1) {
|
||||
_setFunctionName(decInfo[4], "#" + name, "set");
|
||||
}
|
||||
_setFunctionName(decInfo[3], "#" + name, prefix);
|
||||
}
|
||||
} else if (kind !== 0) {
|
||||
desc = Object.getOwnPropertyDescriptor(base, name);
|
||||
}
|
||||
if (kind === 1) {
|
||||
value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
};
|
||||
} else if (kind === 2) {
|
||||
value = desc.value;
|
||||
} else if (kind === 3) {
|
||||
value = desc.get;
|
||||
} else if (kind === 4) {
|
||||
value = desc.set;
|
||||
}
|
||||
var newValue, get, set;
|
||||
if (typeof decs === "function") {
|
||||
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value);
|
||||
if (newValue !== void 0) {
|
||||
assertValidReturnValue(kind, newValue);
|
||||
if (kind === 0) {
|
||||
init = newValue;
|
||||
} else if (kind === 1) {
|
||||
init = newValue.init;
|
||||
get = newValue.get || value.get;
|
||||
set = newValue.set || value.set;
|
||||
value = {
|
||||
get: get,
|
||||
set: set
|
||||
};
|
||||
} else {
|
||||
value = newValue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var dec = decs[i];
|
||||
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value);
|
||||
if (newValue !== void 0) {
|
||||
assertValidReturnValue(kind, newValue);
|
||||
var newInit;
|
||||
if (kind === 0) {
|
||||
newInit = newValue;
|
||||
} else if (kind === 1) {
|
||||
newInit = newValue.init;
|
||||
get = newValue.get || value.get;
|
||||
set = newValue.set || value.set;
|
||||
value = {
|
||||
get: get,
|
||||
set: set
|
||||
};
|
||||
} else {
|
||||
value = newValue;
|
||||
}
|
||||
if (newInit !== void 0) {
|
||||
if (init === void 0) {
|
||||
init = newInit;
|
||||
} else if (typeof init === "function") {
|
||||
init = [init, newInit];
|
||||
} else {
|
||||
init.push(newInit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (kind === 0 || kind === 1) {
|
||||
if (init === void 0) {
|
||||
init = function (instance, init) {
|
||||
return init;
|
||||
};
|
||||
} else if (typeof init !== "function") {
|
||||
var ownInitializers = init;
|
||||
init = function (instance, init) {
|
||||
var value = init;
|
||||
for (var i = 0; i < ownInitializers.length; i++) {
|
||||
value = ownInitializers[i].call(instance, value);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = init;
|
||||
init = function (instance, init) {
|
||||
return originalInitializer.call(instance, init);
|
||||
};
|
||||
}
|
||||
ret.push(init);
|
||||
}
|
||||
if (kind !== 0) {
|
||||
if (kind === 1) {
|
||||
desc.get = value.get;
|
||||
desc.set = value.set;
|
||||
} else if (kind === 2) {
|
||||
desc.value = value;
|
||||
} else if (kind === 3) {
|
||||
desc.get = value;
|
||||
} else if (kind === 4) {
|
||||
desc.set = value;
|
||||
}
|
||||
if (isPrivate) {
|
||||
if (kind === 1) {
|
||||
ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
});
|
||||
ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
});
|
||||
} else if (kind === 2) {
|
||||
ret.push(value);
|
||||
} else {
|
||||
ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Object.defineProperty(base, name, desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
function applyMemberDecs(Class, decInfos) {
|
||||
var ret = [];
|
||||
var protoInitializers;
|
||||
var staticInitializers;
|
||||
var existingProtoNonFields = new Map();
|
||||
var existingStaticNonFields = new Map();
|
||||
for (var i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (!Array.isArray(decInfo)) continue;
|
||||
var kind = decInfo[1];
|
||||
var name = decInfo[2];
|
||||
var isPrivate = decInfo.length > 3;
|
||||
var isStatic = kind >= 5;
|
||||
var base;
|
||||
var initializers;
|
||||
if (isStatic) {
|
||||
base = Class;
|
||||
kind = kind - 5;
|
||||
if (kind !== 0) {
|
||||
staticInitializers = staticInitializers || [];
|
||||
initializers = staticInitializers;
|
||||
}
|
||||
} else {
|
||||
base = Class.prototype;
|
||||
if (kind !== 0) {
|
||||
protoInitializers = protoInitializers || [];
|
||||
initializers = protoInitializers;
|
||||
}
|
||||
}
|
||||
if (kind !== 0 && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
||||
var existingKind = existingNonFields.get(name) || 0;
|
||||
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
|
||||
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);
|
||||
} else if (!existingKind && kind > 2) {
|
||||
existingNonFields.set(name, kind);
|
||||
} else {
|
||||
existingNonFields.set(name, true);
|
||||
}
|
||||
}
|
||||
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
|
||||
}
|
||||
pushInitializers(ret, protoInitializers);
|
||||
pushInitializers(ret, staticInitializers);
|
||||
return ret;
|
||||
}
|
||||
function pushInitializers(ret, initializers) {
|
||||
if (initializers) {
|
||||
ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(instance);
|
||||
}
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
}
|
||||
function applyClassDecs(targetClass, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
var initializers = [];
|
||||
var newClass = targetClass;
|
||||
var name = targetClass.name;
|
||||
for (var i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: false
|
||||
};
|
||||
try {
|
||||
var nextNewClass = classDecs[i](newClass, {
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
});
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
if (nextNewClass !== undefined) {
|
||||
assertValidReturnValue(10, nextNewClass);
|
||||
newClass = nextNewClass;
|
||||
}
|
||||
}
|
||||
return [newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(newClass);
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
return function applyDecs2203R(targetClass, memberDecs, classDecs) {
|
||||
return {
|
||||
e: applyMemberDecs(targetClass, memberDecs),
|
||||
get c() {
|
||||
return applyClassDecs(targetClass, classDecs);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
function applyDecs2203R(targetClass, memberDecs, classDecs) {
|
||||
return (exports.default = applyDecs2203R = applyDecs2203RFactory())(targetClass, memberDecs, classDecs);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=applyDecs2203R.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+421
@@ -0,0 +1,421 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyDecs2301;
|
||||
var _checkInRHS = require("checkInRHS");
|
||||
var _setFunctionName = require("setFunctionName");
|
||||
var _toPropertyKey = require("toPropertyKey");
|
||||
function applyDecs2301Factory() {
|
||||
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function addInitializer(initializer) {
|
||||
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
||||
assertCallable(initializer, "An initializer");
|
||||
initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function assertInstanceIfPrivate(has, target) {
|
||||
if (!has(target)) {
|
||||
throw new TypeError("Attempted to access private element on non-instance");
|
||||
}
|
||||
}
|
||||
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : _toPropertyKey(name),
|
||||
static: isStatic,
|
||||
private: isPrivate
|
||||
};
|
||||
var decoratorFinishedRef = {
|
||||
v: false
|
||||
};
|
||||
if (kind !== 0) {
|
||||
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
||||
}
|
||||
var get, set;
|
||||
if (!isPrivate && (kind === 0 || kind === 2)) {
|
||||
get = function (target) {
|
||||
return target[name];
|
||||
};
|
||||
if (kind === 0) {
|
||||
set = function (target, v) {
|
||||
target[name] = v;
|
||||
};
|
||||
}
|
||||
} else if (kind === 2) {
|
||||
get = function (target) {
|
||||
assertInstanceIfPrivate(hasPrivateBrand, target);
|
||||
return desc.value;
|
||||
};
|
||||
} else {
|
||||
var t = kind === 0 || kind === 1;
|
||||
if (t || kind === 3) {
|
||||
if (isPrivate) {
|
||||
get = function (target) {
|
||||
assertInstanceIfPrivate(hasPrivateBrand, target);
|
||||
return desc.get.call(target);
|
||||
};
|
||||
} else {
|
||||
get = function (target) {
|
||||
return desc.get.call(target);
|
||||
};
|
||||
}
|
||||
}
|
||||
if (t || kind === 4) {
|
||||
if (isPrivate) {
|
||||
set = function (target, value) {
|
||||
assertInstanceIfPrivate(hasPrivateBrand, target);
|
||||
desc.set.call(target, value);
|
||||
};
|
||||
} else {
|
||||
set = function (target, value) {
|
||||
desc.set.call(target, value);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
var has = isPrivate ? hasPrivateBrand.bind() : function (target) {
|
||||
return name in target;
|
||||
};
|
||||
ctx.access = get && set ? {
|
||||
get: get,
|
||||
set: set,
|
||||
has: has
|
||||
} : get ? {
|
||||
get: get,
|
||||
has: has
|
||||
} : {
|
||||
set: set,
|
||||
has: has
|
||||
};
|
||||
try {
|
||||
return dec(value, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
}
|
||||
function assertNotFinished(decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) {
|
||||
throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}
|
||||
}
|
||||
function assertCallable(fn, hint) {
|
||||
if (typeof fn !== "function") {
|
||||
throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
}
|
||||
function assertValidReturnValue(kind, value) {
|
||||
var type = typeof value;
|
||||
if (kind === 1) {
|
||||
if (type !== "object" || value === null) {
|
||||
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
}
|
||||
if (value.get !== undefined) {
|
||||
assertCallable(value.get, "accessor.get");
|
||||
}
|
||||
if (value.set !== undefined) {
|
||||
assertCallable(value.set, "accessor.set");
|
||||
}
|
||||
if (value.init !== undefined) {
|
||||
assertCallable(value.init, "accessor.init");
|
||||
}
|
||||
} else if (type !== "function") {
|
||||
var hint;
|
||||
if (kind === 0) {
|
||||
hint = "field";
|
||||
} else if (kind === 10) {
|
||||
hint = "class";
|
||||
} else {
|
||||
hint = "method";
|
||||
}
|
||||
throw new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function curryThis1(fn) {
|
||||
return function () {
|
||||
return fn(this);
|
||||
};
|
||||
}
|
||||
function curryThis2(fn) {
|
||||
return function (value) {
|
||||
fn(this, value);
|
||||
};
|
||||
}
|
||||
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand) {
|
||||
var decs = decInfo[0];
|
||||
var desc, init, prefix, value;
|
||||
if (isPrivate) {
|
||||
if (kind === 0 || kind === 1) {
|
||||
desc = {
|
||||
get: curryThis1(decInfo[3]),
|
||||
set: curryThis2(decInfo[4])
|
||||
};
|
||||
prefix = "get";
|
||||
} else {
|
||||
if (kind === 3) {
|
||||
desc = {
|
||||
get: decInfo[3]
|
||||
};
|
||||
prefix = "get";
|
||||
} else if (kind === 4) {
|
||||
desc = {
|
||||
set: decInfo[3]
|
||||
};
|
||||
prefix = "set";
|
||||
} else {
|
||||
desc = {
|
||||
value: decInfo[3]
|
||||
};
|
||||
}
|
||||
}
|
||||
if (kind !== 0) {
|
||||
if (kind === 1) {
|
||||
_setFunctionName(desc.set, "#" + name, "set");
|
||||
}
|
||||
_setFunctionName(desc[prefix || "value"], "#" + name, prefix);
|
||||
}
|
||||
} else if (kind !== 0) {
|
||||
desc = Object.getOwnPropertyDescriptor(base, name);
|
||||
}
|
||||
if (kind === 1) {
|
||||
value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
};
|
||||
} else if (kind === 2) {
|
||||
value = desc.value;
|
||||
} else if (kind === 3) {
|
||||
value = desc.get;
|
||||
} else if (kind === 4) {
|
||||
value = desc.set;
|
||||
}
|
||||
var newValue, get, set;
|
||||
if (typeof decs === "function") {
|
||||
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand);
|
||||
if (newValue !== void 0) {
|
||||
assertValidReturnValue(kind, newValue);
|
||||
if (kind === 0) {
|
||||
init = newValue;
|
||||
} else if (kind === 1) {
|
||||
init = newValue.init;
|
||||
get = newValue.get || value.get;
|
||||
set = newValue.set || value.set;
|
||||
value = {
|
||||
get: get,
|
||||
set: set
|
||||
};
|
||||
} else {
|
||||
value = newValue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var dec = decs[i];
|
||||
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand);
|
||||
if (newValue !== void 0) {
|
||||
assertValidReturnValue(kind, newValue);
|
||||
var newInit;
|
||||
if (kind === 0) {
|
||||
newInit = newValue;
|
||||
} else if (kind === 1) {
|
||||
newInit = newValue.init;
|
||||
get = newValue.get || value.get;
|
||||
set = newValue.set || value.set;
|
||||
value = {
|
||||
get: get,
|
||||
set: set
|
||||
};
|
||||
} else {
|
||||
value = newValue;
|
||||
}
|
||||
if (newInit !== void 0) {
|
||||
if (init === void 0) {
|
||||
init = newInit;
|
||||
} else if (typeof init === "function") {
|
||||
init = [init, newInit];
|
||||
} else {
|
||||
init.push(newInit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (kind === 0 || kind === 1) {
|
||||
if (init === void 0) {
|
||||
init = function (instance, init) {
|
||||
return init;
|
||||
};
|
||||
} else if (typeof init !== "function") {
|
||||
var ownInitializers = init;
|
||||
init = function (instance, init) {
|
||||
var value = init;
|
||||
for (var i = 0; i < ownInitializers.length; i++) {
|
||||
value = ownInitializers[i].call(instance, value);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = init;
|
||||
init = function (instance, init) {
|
||||
return originalInitializer.call(instance, init);
|
||||
};
|
||||
}
|
||||
ret.push(init);
|
||||
}
|
||||
if (kind !== 0) {
|
||||
if (kind === 1) {
|
||||
desc.get = value.get;
|
||||
desc.set = value.set;
|
||||
} else if (kind === 2) {
|
||||
desc.value = value;
|
||||
} else if (kind === 3) {
|
||||
desc.get = value;
|
||||
} else if (kind === 4) {
|
||||
desc.set = value;
|
||||
}
|
||||
if (isPrivate) {
|
||||
if (kind === 1) {
|
||||
ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
});
|
||||
ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
});
|
||||
} else if (kind === 2) {
|
||||
ret.push(value);
|
||||
} else {
|
||||
ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Object.defineProperty(base, name, desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
function applyMemberDecs(Class, decInfos, instanceBrand) {
|
||||
var ret = [];
|
||||
var protoInitializers;
|
||||
var staticInitializers;
|
||||
var staticBrand;
|
||||
var existingProtoNonFields = new Map();
|
||||
var existingStaticNonFields = new Map();
|
||||
for (var i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (!Array.isArray(decInfo)) continue;
|
||||
var kind = decInfo[1];
|
||||
var name = decInfo[2];
|
||||
var isPrivate = decInfo.length > 3;
|
||||
var isStatic = kind >= 5;
|
||||
var base;
|
||||
var initializers;
|
||||
var hasPrivateBrand = instanceBrand;
|
||||
if (isStatic) {
|
||||
base = Class;
|
||||
kind = kind - 5;
|
||||
if (kind !== 0) {
|
||||
staticInitializers = staticInitializers || [];
|
||||
initializers = staticInitializers;
|
||||
}
|
||||
if (isPrivate && !staticBrand) {
|
||||
staticBrand = function (_) {
|
||||
return _checkInRHS(_) === Class;
|
||||
};
|
||||
}
|
||||
hasPrivateBrand = staticBrand;
|
||||
} else {
|
||||
base = Class.prototype;
|
||||
if (kind !== 0) {
|
||||
protoInitializers = protoInitializers || [];
|
||||
initializers = protoInitializers;
|
||||
}
|
||||
}
|
||||
if (kind !== 0 && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
||||
var existingKind = existingNonFields.get(name) || 0;
|
||||
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
|
||||
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);
|
||||
} else if (!existingKind && kind > 2) {
|
||||
existingNonFields.set(name, kind);
|
||||
} else {
|
||||
existingNonFields.set(name, true);
|
||||
}
|
||||
}
|
||||
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand);
|
||||
}
|
||||
pushInitializers(ret, protoInitializers);
|
||||
pushInitializers(ret, staticInitializers);
|
||||
return ret;
|
||||
}
|
||||
function pushInitializers(ret, initializers) {
|
||||
if (initializers) {
|
||||
ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(instance);
|
||||
}
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
}
|
||||
function applyClassDecs(targetClass, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
var initializers = [];
|
||||
var newClass = targetClass;
|
||||
var name = targetClass.name;
|
||||
for (var i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: false
|
||||
};
|
||||
try {
|
||||
var nextNewClass = classDecs[i](newClass, {
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
});
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
if (nextNewClass !== undefined) {
|
||||
assertValidReturnValue(10, nextNewClass);
|
||||
newClass = nextNewClass;
|
||||
}
|
||||
}
|
||||
return [newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(newClass);
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
return function applyDecs2301(targetClass, memberDecs, classDecs, instanceBrand) {
|
||||
return {
|
||||
e: applyMemberDecs(targetClass, memberDecs, instanceBrand),
|
||||
get c() {
|
||||
return applyClassDecs(targetClass, classDecs);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
function applyDecs2301(targetClass, memberDecs, classDecs, instanceBrand) {
|
||||
return (exports.default = applyDecs2301 = applyDecs2301Factory())(targetClass, memberDecs, classDecs, instanceBrand);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=applyDecs2301.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+235
@@ -0,0 +1,235 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyDecs2305;
|
||||
var _checkInRHS = require("./checkInRHS.js");
|
||||
var _setFunctionName = require("./setFunctionName.js");
|
||||
var _toPropertyKey = require("./toPropertyKey.js");
|
||||
function applyDecs2305(targetClass, memberDecs, classDecs, classDecsHaveThis, instanceBrand, parentClass) {
|
||||
function _bindPropCall(obj, name, before) {
|
||||
return function (_this, value) {
|
||||
if (before) {
|
||||
before(_this);
|
||||
}
|
||||
return obj[name].call(_this, value);
|
||||
};
|
||||
}
|
||||
function runInitializers(initializers, value) {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function assertCallable(fn, hint1, hint2, throwUndefined) {
|
||||
if (typeof fn !== "function") {
|
||||
if (throwUndefined || fn !== void 0) {
|
||||
throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
|
||||
}
|
||||
}
|
||||
return fn;
|
||||
}
|
||||
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, metadata, initializers, ret, isStatic, isPrivate, isField, isAccessor, hasPrivateBrand) {
|
||||
function assertInstanceIfPrivate(target) {
|
||||
if (!hasPrivateBrand(target)) {
|
||||
throw new TypeError("Attempted to access private element on non-instance");
|
||||
}
|
||||
}
|
||||
var decs = decInfo[0],
|
||||
decVal = decInfo[3],
|
||||
_,
|
||||
isClass = !ret;
|
||||
if (!isClass) {
|
||||
if (!decoratorsHaveThis && !Array.isArray(decs)) {
|
||||
decs = [decs];
|
||||
}
|
||||
var desc = {},
|
||||
init = [],
|
||||
key = kind === 3 ? "get" : kind === 4 || isAccessor ? "set" : "value";
|
||||
if (isPrivate) {
|
||||
if (isField || isAccessor) {
|
||||
desc = {
|
||||
get: (0, _setFunctionName.default)(function () {
|
||||
return decVal(this);
|
||||
}, name, "get"),
|
||||
set: function (value) {
|
||||
decInfo[4](this, value);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
desc[key] = decVal;
|
||||
}
|
||||
if (!isField) {
|
||||
(0, _setFunctionName.default)(desc[key], name, kind === 2 ? "" : key);
|
||||
}
|
||||
} else if (!isField) {
|
||||
desc = Object.getOwnPropertyDescriptor(Class, name);
|
||||
}
|
||||
}
|
||||
var newValue = Class;
|
||||
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
|
||||
var dec = decs[i],
|
||||
decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
|
||||
var decoratorFinishedRef = {};
|
||||
var ctx = {
|
||||
kind: ["field", "accessor", "method", "getter", "setter", "class"][kind],
|
||||
name: name,
|
||||
metadata: metadata,
|
||||
addInitializer: function (decoratorFinishedRef, initializer) {
|
||||
if (decoratorFinishedRef.v) {
|
||||
throw new Error("attempted to call addInitializer after decoration was finished");
|
||||
}
|
||||
assertCallable(initializer, "An initializer", "be", true);
|
||||
initializers.push(initializer);
|
||||
}.bind(null, decoratorFinishedRef)
|
||||
};
|
||||
try {
|
||||
if (isClass) {
|
||||
if (_ = assertCallable(dec.call(decThis, newValue, ctx), "class decorators", "return")) {
|
||||
newValue = _;
|
||||
}
|
||||
} else {
|
||||
ctx["static"] = isStatic;
|
||||
ctx["private"] = isPrivate;
|
||||
var get, set;
|
||||
if (!isPrivate) {
|
||||
get = function (target) {
|
||||
return target[name];
|
||||
};
|
||||
if (kind < 2 || kind === 4) {
|
||||
set = function (target, v) {
|
||||
target[name] = v;
|
||||
};
|
||||
}
|
||||
} else if (kind === 2) {
|
||||
get = function (_this) {
|
||||
assertInstanceIfPrivate(_this);
|
||||
return desc.value;
|
||||
};
|
||||
} else {
|
||||
if (kind < 4) {
|
||||
get = _bindPropCall(desc, "get", assertInstanceIfPrivate);
|
||||
}
|
||||
if (kind !== 3) {
|
||||
set = _bindPropCall(desc, "set", assertInstanceIfPrivate);
|
||||
}
|
||||
}
|
||||
var access = ctx.access = {
|
||||
has: isPrivate ? hasPrivateBrand.bind() : function (target) {
|
||||
return name in target;
|
||||
}
|
||||
};
|
||||
if (get) access.get = get;
|
||||
if (set) access.set = set;
|
||||
newValue = dec.call(decThis, isAccessor ? {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : desc[key], ctx);
|
||||
if (isAccessor) {
|
||||
if (typeof newValue === "object" && newValue) {
|
||||
if (_ = assertCallable(newValue.get, "accessor.get")) {
|
||||
desc.get = _;
|
||||
}
|
||||
if (_ = assertCallable(newValue.set, "accessor.set")) {
|
||||
desc.set = _;
|
||||
}
|
||||
if (_ = assertCallable(newValue.init, "accessor.init")) {
|
||||
init.push(_);
|
||||
}
|
||||
} else if (newValue !== void 0) {
|
||||
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
}
|
||||
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) {
|
||||
if (isField) {
|
||||
init.push(newValue);
|
||||
} else {
|
||||
desc[key] = newValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
}
|
||||
if (isField || isAccessor) {
|
||||
ret.push(function (instance, value) {
|
||||
for (var i = init.length - 1; i >= 0; i--) {
|
||||
value = init[i].call(instance, value);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
}
|
||||
if (!isField && !isClass) {
|
||||
if (isPrivate) {
|
||||
if (isAccessor) {
|
||||
ret.push(_bindPropCall(desc, "get"), _bindPropCall(desc, "set"));
|
||||
} else {
|
||||
ret.push(kind === 2 ? desc[key] : _bindPropCall.call.bind(desc[key]));
|
||||
}
|
||||
} else {
|
||||
Object.defineProperty(Class, name, desc);
|
||||
}
|
||||
}
|
||||
return newValue;
|
||||
}
|
||||
function applyMemberDecs(Class, decInfos, instanceBrand, metadata) {
|
||||
var ret = [];
|
||||
var protoInitializers;
|
||||
var staticInitializers;
|
||||
var staticBrand = function (_) {
|
||||
return (0, _checkInRHS.default)(_) === Class;
|
||||
};
|
||||
var existingNonFields = new Map();
|
||||
function pushInitializers(initializers) {
|
||||
if (initializers) {
|
||||
ret.push(runInitializers.bind(null, initializers));
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (!Array.isArray(decInfo)) continue;
|
||||
var kind = decInfo[1];
|
||||
var name = decInfo[2];
|
||||
var isPrivate = decInfo.length > 3;
|
||||
var decoratorsHaveThis = kind & 16;
|
||||
var isStatic = !!(kind & 8);
|
||||
kind &= 7;
|
||||
var isField = kind === 0;
|
||||
var key = name + "/" + isStatic;
|
||||
if (!isField && !isPrivate) {
|
||||
var existingKind = existingNonFields.get(key);
|
||||
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
|
||||
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);
|
||||
}
|
||||
existingNonFields.set(key, kind > 2 ? kind : true);
|
||||
}
|
||||
applyDec(isStatic ? Class : Class.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : (0, _toPropertyKey.default)(name), kind, metadata, isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, isStatic, isPrivate, isField, kind === 1, isStatic && isPrivate ? staticBrand : instanceBrand);
|
||||
}
|
||||
pushInitializers(protoInitializers);
|
||||
pushInitializers(staticInitializers);
|
||||
return ret;
|
||||
}
|
||||
function defineMetadata(Class, metadata) {
|
||||
return Object.defineProperty(Class, Symbol.metadata || Symbol["for"]("Symbol.metadata"), {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: metadata
|
||||
});
|
||||
}
|
||||
if (arguments.length >= 6) {
|
||||
var parentMetadata = parentClass[Symbol.metadata || Symbol["for"]("Symbol.metadata")];
|
||||
}
|
||||
var metadata = Object.create(parentMetadata == null ? null : parentMetadata);
|
||||
var e = applyMemberDecs(targetClass, memberDecs, instanceBrand, metadata);
|
||||
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
||||
return {
|
||||
e: e,
|
||||
get c() {
|
||||
var initializers = [];
|
||||
return classDecs.length && [defineMetadata(applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, metadata, initializers), metadata), runInitializers.bind(null, initializers, targetClass)];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=applyDecs2305.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+236
@@ -0,0 +1,236 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyDecs2311;
|
||||
var _checkInRHS = require("./checkInRHS.js");
|
||||
var _setFunctionName = require("./setFunctionName.js");
|
||||
var _toPropertyKey = require("./toPropertyKey.js");
|
||||
function applyDecs2311(targetClass, classDecs, memberDecs, classDecsHaveThis, instanceBrand, parentClass) {
|
||||
var symbolMetadata = Symbol.metadata || Symbol["for"]("Symbol.metadata");
|
||||
var defineProperty = Object.defineProperty;
|
||||
var create = Object.create;
|
||||
var metadata;
|
||||
var existingNonFields = [create(null), create(null)];
|
||||
var hasClassDecs = classDecs.length;
|
||||
var _;
|
||||
function createRunInitializers(initializers, useStaticThis, hasValue) {
|
||||
return function (thisArg, value) {
|
||||
if (useStaticThis) {
|
||||
value = thisArg;
|
||||
thisArg = targetClass;
|
||||
}
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
value = initializers[i].apply(thisArg, hasValue ? [value] : []);
|
||||
}
|
||||
return hasValue ? value : thisArg;
|
||||
};
|
||||
}
|
||||
function assertCallable(fn, hint1, hint2, throwUndefined) {
|
||||
if (typeof fn !== "function") {
|
||||
if (throwUndefined || fn !== void 0) {
|
||||
throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
|
||||
}
|
||||
}
|
||||
return fn;
|
||||
}
|
||||
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, initializers, ret, isStatic, isPrivate, isField, hasPrivateBrand) {
|
||||
function assertInstanceIfPrivate(target) {
|
||||
if (!hasPrivateBrand(target)) {
|
||||
throw new TypeError("Attempted to access private element on non-instance");
|
||||
}
|
||||
}
|
||||
var decs = [].concat(decInfo[0]),
|
||||
decVal = decInfo[3],
|
||||
isClass = !ret;
|
||||
var isAccessor = kind === 1;
|
||||
var isGetter = kind === 3;
|
||||
var isSetter = kind === 4;
|
||||
var isMethod = kind === 2;
|
||||
function _bindPropCall(name, useStaticThis, before) {
|
||||
return function (_this, value) {
|
||||
if (useStaticThis) {
|
||||
value = _this;
|
||||
_this = Class;
|
||||
}
|
||||
if (before) {
|
||||
before(_this);
|
||||
}
|
||||
return desc[name].call(_this, value);
|
||||
};
|
||||
}
|
||||
if (!isClass) {
|
||||
var desc = {},
|
||||
init = [],
|
||||
key = isGetter ? "get" : isSetter || isAccessor ? "set" : "value";
|
||||
if (isPrivate) {
|
||||
if (isField || isAccessor) {
|
||||
desc = {
|
||||
get: (0, _setFunctionName.default)(function () {
|
||||
return decVal(this);
|
||||
}, name, "get"),
|
||||
set: function (value) {
|
||||
decInfo[4](this, value);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
desc[key] = decVal;
|
||||
}
|
||||
if (!isField) {
|
||||
(0, _setFunctionName.default)(desc[key], name, isMethod ? "" : key);
|
||||
}
|
||||
} else if (!isField) {
|
||||
desc = Object.getOwnPropertyDescriptor(Class, name);
|
||||
}
|
||||
if (!isField && !isPrivate) {
|
||||
_ = existingNonFields[+isStatic][name];
|
||||
if (_ && (_ ^ kind) !== 7) {
|
||||
throw new Error("Decorating two elements with the same name (" + desc[key].name + ") is not supported yet");
|
||||
}
|
||||
existingNonFields[+isStatic][name] = kind < 3 ? 1 : kind;
|
||||
}
|
||||
}
|
||||
var newValue = Class;
|
||||
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
|
||||
var dec = assertCallable(decs[i], "A decorator", "be", true),
|
||||
decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
|
||||
var decoratorFinishedRef = {};
|
||||
var ctx = {
|
||||
kind: ["field", "accessor", "method", "getter", "setter", "class"][kind],
|
||||
name: name,
|
||||
metadata: metadata,
|
||||
addInitializer: function (decoratorFinishedRef, initializer) {
|
||||
if (decoratorFinishedRef.v) {
|
||||
throw new TypeError("attempted to call addInitializer after decoration was finished");
|
||||
}
|
||||
assertCallable(initializer, "An initializer", "be", true);
|
||||
initializers.push(initializer);
|
||||
}.bind(null, decoratorFinishedRef)
|
||||
};
|
||||
if (isClass) {
|
||||
_ = dec.call(decThis, newValue, ctx);
|
||||
decoratorFinishedRef.v = 1;
|
||||
if (assertCallable(_, "class decorators", "return")) {
|
||||
newValue = _;
|
||||
}
|
||||
} else {
|
||||
ctx["static"] = isStatic;
|
||||
ctx["private"] = isPrivate;
|
||||
_ = ctx.access = {
|
||||
has: isPrivate ? hasPrivateBrand.bind() : function (target) {
|
||||
return name in target;
|
||||
}
|
||||
};
|
||||
if (!isSetter) {
|
||||
_.get = isPrivate ? isMethod ? function (_this) {
|
||||
assertInstanceIfPrivate(_this);
|
||||
return desc.value;
|
||||
} : _bindPropCall("get", 0, assertInstanceIfPrivate) : function (target) {
|
||||
return target[name];
|
||||
};
|
||||
}
|
||||
if (!isMethod && !isGetter) {
|
||||
_.set = isPrivate ? _bindPropCall("set", 0, assertInstanceIfPrivate) : function (target, v) {
|
||||
target[name] = v;
|
||||
};
|
||||
}
|
||||
newValue = dec.call(decThis, isAccessor ? {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : desc[key], ctx);
|
||||
decoratorFinishedRef.v = 1;
|
||||
if (isAccessor) {
|
||||
if (typeof newValue === "object" && newValue) {
|
||||
if (_ = assertCallable(newValue.get, "accessor.get")) {
|
||||
desc.get = _;
|
||||
}
|
||||
if (_ = assertCallable(newValue.set, "accessor.set")) {
|
||||
desc.set = _;
|
||||
}
|
||||
if (_ = assertCallable(newValue.init, "accessor.init")) {
|
||||
init.unshift(_);
|
||||
}
|
||||
} else if (newValue !== void 0) {
|
||||
throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined");
|
||||
}
|
||||
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) {
|
||||
if (isField) {
|
||||
init.unshift(newValue);
|
||||
} else {
|
||||
desc[key] = newValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (kind < 2) {
|
||||
ret.push(createRunInitializers(init, isStatic, 1), createRunInitializers(initializers, isStatic, 0));
|
||||
}
|
||||
if (!isField && !isClass) {
|
||||
if (isPrivate) {
|
||||
if (isAccessor) {
|
||||
ret.splice(-1, 0, _bindPropCall("get", isStatic), _bindPropCall("set", isStatic));
|
||||
} else {
|
||||
ret.push(isMethod ? desc[key] : assertCallable.call.bind(desc[key]));
|
||||
}
|
||||
} else {
|
||||
defineProperty(Class, name, desc);
|
||||
}
|
||||
}
|
||||
return newValue;
|
||||
}
|
||||
function applyMemberDecs() {
|
||||
var ret = [];
|
||||
var protoInitializers;
|
||||
var staticInitializers;
|
||||
var pushInitializers = function (initializers) {
|
||||
if (initializers) {
|
||||
ret.push(createRunInitializers(initializers));
|
||||
}
|
||||
};
|
||||
var applyMemberDecsOfKind = function (isStatic, isField) {
|
||||
for (var i = 0; i < memberDecs.length; i++) {
|
||||
var decInfo = memberDecs[i];
|
||||
var kind = decInfo[1];
|
||||
var kindOnly = kind & 7;
|
||||
if ((kind & 8) == isStatic && !kindOnly == isField) {
|
||||
var name = decInfo[2];
|
||||
var isPrivate = !!decInfo[3];
|
||||
var decoratorsHaveThis = kind & 16;
|
||||
applyDec(isStatic ? targetClass : targetClass.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : (0, _toPropertyKey.default)(name), kindOnly, kindOnly < 2 ? [] : isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, !!isStatic, isPrivate, isField, isStatic && isPrivate ? function (_) {
|
||||
return (0, _checkInRHS.default)(_) === targetClass;
|
||||
} : instanceBrand);
|
||||
}
|
||||
}
|
||||
};
|
||||
applyMemberDecsOfKind(8, 0);
|
||||
applyMemberDecsOfKind(0, 0);
|
||||
applyMemberDecsOfKind(8, 1);
|
||||
applyMemberDecsOfKind(0, 1);
|
||||
pushInitializers(protoInitializers);
|
||||
pushInitializers(staticInitializers);
|
||||
return ret;
|
||||
}
|
||||
function defineMetadata(Class) {
|
||||
return defineProperty(Class, symbolMetadata, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: metadata
|
||||
});
|
||||
}
|
||||
if (parentClass !== undefined) {
|
||||
metadata = parentClass[symbolMetadata];
|
||||
}
|
||||
metadata = create(metadata == null ? null : metadata);
|
||||
_ = applyMemberDecs();
|
||||
if (!hasClassDecs) defineMetadata(targetClass);
|
||||
return {
|
||||
e: _,
|
||||
get c() {
|
||||
var initializers = [];
|
||||
return hasClassDecs && [defineMetadata(targetClass = applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, initializers)), createRunInitializers(initializers, 1)];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=applyDecs2311.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+13
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _arrayLikeToArray;
|
||||
function _arrayLikeToArray(arr, len) {
|
||||
if (len == null || len > arr.length) len = arr.length;
|
||||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
||||
return arr2;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=arrayLikeToArray.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_arrayLikeToArray","arr","len","length","i","arr2","Array"],"sources":["../../src/helpers/arrayLikeToArray.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nexport default function _arrayLikeToArray<T>(\n arr: ArrayLike<T>,\n len?: number | null,\n) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array<T>(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CACvCC,GAAiB,EACjBC,GAAmB,EACnB;EACA,IAAIA,GAAG,IAAI,IAAI,IAAIA,GAAG,GAAGD,GAAG,CAACE,MAAM,EAAED,GAAG,GAAGD,GAAG,CAACE,MAAM;EACrD,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,IAAI,GAAG,IAAIC,KAAK,CAAIJ,GAAG,CAAC,EAAEE,CAAC,GAAGF,GAAG,EAAEE,CAAC,EAAE,EAAEC,IAAI,CAACD,CAAC,CAAC,GAAGH,GAAG,CAACG,CAAC,CAAC;EACxE,OAAOC,IAAI;AACb","ignoreList":[]}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _arrayWithHoles;
|
||||
function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=arrayWithHoles.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_arrayWithHoles","arr","Array","isArray"],"sources":["../../src/helpers/arrayWithHoles.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _arrayWithHoles<T>(arr: T[]) {\n if (Array.isArray(arr)) return arr;\n}\n"],"mappings":";;;;;;AAEe,SAASA,eAAeA,CAAIC,GAAQ,EAAE;EACnD,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE,OAAOA,GAAG;AACpC","ignoreList":[]}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _arrayWithoutHoles;
|
||||
var _arrayLikeToArray = require("./arrayLikeToArray.js");
|
||||
function _arrayWithoutHoles(arr) {
|
||||
if (Array.isArray(arr)) return (0, _arrayLikeToArray.default)(arr);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=arrayWithoutHoles.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_arrayLikeToArray","require","_arrayWithoutHoles","arr","Array","isArray","arrayLikeToArray"],"sources":["../../src/helpers/arrayWithoutHoles.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayLikeToArray from \"./arrayLikeToArray.ts\";\n\nexport default function _arrayWithoutHoles<T>(arr: T[]) {\n if (Array.isArray(arr)) return arrayLikeToArray<T>(arr);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAEe,SAASC,kBAAkBA,CAAIC,GAAQ,EAAE;EACtD,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE,OAAO,IAAAG,yBAAgB,EAAIH,GAAG,CAAC;AACzD","ignoreList":[]}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _assertClassBrand;
|
||||
function _assertClassBrand(brand, receiver, returnValue) {
|
||||
if (typeof brand === "function" ? brand === receiver : brand.has(receiver)) {
|
||||
return arguments.length < 3 ? receiver : returnValue;
|
||||
}
|
||||
throw new TypeError("Private element is not present on this object");
|
||||
}
|
||||
|
||||
//# sourceMappingURL=assertClassBrand.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_assertClassBrand","brand","receiver","returnValue","has","arguments","length","TypeError"],"sources":["../../src/helpers/assertClassBrand.ts"],"sourcesContent":["/* @minVersion 7.24.0 */\n\nexport default function _assertClassBrand(\n brand: Function | WeakMap<any, any> | WeakSet<any>,\n receiver: any,\n returnValue?: any,\n) {\n if (typeof brand === \"function\" ? brand === receiver : brand.has(receiver)) {\n return arguments.length < 3 ? receiver : returnValue;\n }\n throw new TypeError(\"Private element is not present on this object\");\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CACvCC,KAAkD,EAClDC,QAAa,EACbC,WAAiB,EACjB;EACA,IAAI,OAAOF,KAAK,KAAK,UAAU,GAAGA,KAAK,KAAKC,QAAQ,GAAGD,KAAK,CAACG,GAAG,CAACF,QAAQ,CAAC,EAAE;IAC1E,OAAOG,SAAS,CAACC,MAAM,GAAG,CAAC,GAAGJ,QAAQ,GAAGC,WAAW;EACtD;EACA,MAAM,IAAII,SAAS,CAAC,+CAA+C,CAAC;AACtE","ignoreList":[]}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _assertThisInitialized;
|
||||
function _assertThisInitialized(self) {
|
||||
if (self === void 0) {
|
||||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=assertThisInitialized.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_assertThisInitialized","self","ReferenceError"],"sources":["../../src/helpers/assertThisInitialized.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _assertThisInitialized<T>(self: T | undefined): T {\n if (self === void 0) {\n throw new ReferenceError(\n \"this hasn't been initialised - super() hasn't been called\",\n );\n }\n return self;\n}\n"],"mappings":";;;;;;AAEe,SAASA,sBAAsBA,CAAIC,IAAmB,EAAK;EACxE,IAAIA,IAAI,KAAK,KAAK,CAAC,EAAE;IACnB,MAAM,IAAIC,cAAc,CACtB,2DACF,CAAC;EACH;EACA,OAAOD,IAAI;AACb","ignoreList":[]}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _asyncGeneratorDelegate;
|
||||
var _OverloadYield = require("./OverloadYield.js");
|
||||
function _asyncGeneratorDelegate(inner) {
|
||||
var iter = {},
|
||||
waiting = false;
|
||||
function pump(key, value) {
|
||||
waiting = true;
|
||||
value = new Promise(function (resolve) {
|
||||
resolve(inner[key](value));
|
||||
});
|
||||
return {
|
||||
done: false,
|
||||
value: new _OverloadYield.default(value, 1)
|
||||
};
|
||||
}
|
||||
iter[typeof Symbol !== "undefined" && Symbol.iterator || "@@iterator"] = function () {
|
||||
return this;
|
||||
};
|
||||
iter.next = function (value) {
|
||||
if (waiting) {
|
||||
waiting = false;
|
||||
return value;
|
||||
}
|
||||
return pump("next", value);
|
||||
};
|
||||
if (typeof inner["throw"] === "function") {
|
||||
iter["throw"] = function (value) {
|
||||
if (waiting) {
|
||||
waiting = false;
|
||||
throw value;
|
||||
}
|
||||
return pump("throw", value);
|
||||
};
|
||||
}
|
||||
if (typeof inner["return"] === "function") {
|
||||
iter["return"] = function (value) {
|
||||
if (waiting) {
|
||||
waiting = false;
|
||||
return value;
|
||||
}
|
||||
return pump("return", value);
|
||||
};
|
||||
}
|
||||
return iter;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=asyncGeneratorDelegate.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+72
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _asyncIterator;
|
||||
function _asyncIterator(iterable) {
|
||||
var method,
|
||||
async,
|
||||
sync,
|
||||
retry = 2;
|
||||
if (typeof Symbol !== "undefined") {
|
||||
async = Symbol.asyncIterator;
|
||||
sync = Symbol.iterator;
|
||||
}
|
||||
while (retry--) {
|
||||
if (async && (method = iterable[async]) != null) {
|
||||
return method.call(iterable);
|
||||
}
|
||||
if (sync && (method = iterable[sync]) != null) {
|
||||
return new AsyncFromSyncIterator(method.call(iterable));
|
||||
}
|
||||
async = "@@asyncIterator";
|
||||
sync = "@@iterator";
|
||||
}
|
||||
throw new TypeError("Object is not async iterable");
|
||||
}
|
||||
function AsyncFromSyncIterator(s) {
|
||||
AsyncFromSyncIterator = function (s) {
|
||||
this.s = s;
|
||||
this.n = s.next;
|
||||
};
|
||||
AsyncFromSyncIterator.prototype = {
|
||||
s: null,
|
||||
n: null,
|
||||
next: function () {
|
||||
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
||||
},
|
||||
return: function (value) {
|
||||
var ret = this.s["return"];
|
||||
if (ret === undefined) {
|
||||
return Promise.resolve({
|
||||
value: value,
|
||||
done: true
|
||||
});
|
||||
}
|
||||
return AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
|
||||
},
|
||||
throw: function (maybeError) {
|
||||
var thr = this.s["return"];
|
||||
if (thr === undefined) {
|
||||
return Promise.reject(maybeError);
|
||||
}
|
||||
return AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
|
||||
}
|
||||
};
|
||||
function AsyncFromSyncIteratorContinuation(r) {
|
||||
if (Object(r) !== r) {
|
||||
return Promise.reject(new TypeError(r + " is not an object."));
|
||||
}
|
||||
var done = r.done;
|
||||
return Promise.resolve(r.value).then(function (value) {
|
||||
return {
|
||||
value: value,
|
||||
done: done
|
||||
};
|
||||
});
|
||||
}
|
||||
return new AsyncFromSyncIterator(s);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=asyncIterator.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+38
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _asyncToGenerator;
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=asyncToGenerator.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _awaitAsyncGenerator;
|
||||
var _OverloadYield = require("./OverloadYield.js");
|
||||
function _awaitAsyncGenerator(value) {
|
||||
return new _OverloadYield.default(value, 0);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=awaitAsyncGenerator.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_OverloadYield","require","_awaitAsyncGenerator","value","OverloadYield"],"sources":["../../src/helpers/awaitAsyncGenerator.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport OverloadYield from \"./OverloadYield.ts\";\n\nexport default function _awaitAsyncGenerator<T>(value: T) {\n return new OverloadYield<T>(value, /* kind: await */ 0);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAEe,SAASC,oBAAoBA,CAAIC,KAAQ,EAAE;EACxD,OAAO,IAAIC,sBAAa,CAAID,KAAK,EAAoB,CAAC,CAAC;AACzD","ignoreList":[]}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _callSuper;
|
||||
var _getPrototypeOf = require("./getPrototypeOf.js");
|
||||
var _isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
|
||||
var _possibleConstructorReturn = require("./possibleConstructorReturn.js");
|
||||
function _callSuper(_this, derived, args) {
|
||||
derived = (0, _getPrototypeOf.default)(derived);
|
||||
return (0, _possibleConstructorReturn.default)(_this, (0, _isNativeReflectConstruct.default)() ? Reflect.construct(derived, args || [], (0, _getPrototypeOf.default)(_this).constructor) : derived.apply(_this, args));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=callSuper.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _checkInRHS;
|
||||
function _checkInRHS(value) {
|
||||
if (Object(value) !== value) {
|
||||
throw TypeError("right-hand side of 'in' should be an object, got " + (value !== null ? typeof value : "null"));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=checkInRHS.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_checkInRHS","value","Object","TypeError"],"sources":["../../src/helpers/checkInRHS.ts"],"sourcesContent":["/* @minVersion 7.20.5 */\n\nexport default function _checkInRHS(value: unknown) {\n if (Object(value) !== value) {\n throw TypeError(\n \"right-hand side of 'in' should be an object, got \" +\n (value !== null ? typeof value : \"null\"),\n );\n }\n return value;\n}\n"],"mappings":";;;;;;AAEe,SAASA,WAAWA,CAACC,KAAc,EAAE;EAClD,IAAIC,MAAM,CAACD,KAAK,CAAC,KAAKA,KAAK,EAAE;IAC3B,MAAME,SAAS,CACb,mDAAmD,IAChDF,KAAK,KAAK,IAAI,GAAG,OAAOA,KAAK,GAAG,MAAM,CAC3C,CAAC;EACH;EACA,OAAOA,KAAK;AACd","ignoreList":[]}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _checkPrivateRedeclaration;
|
||||
function _checkPrivateRedeclaration(obj, privateCollection) {
|
||||
if (privateCollection.has(obj)) {
|
||||
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=checkPrivateRedeclaration.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_checkPrivateRedeclaration","obj","privateCollection","has","TypeError"],"sources":["../../src/helpers/checkPrivateRedeclaration.ts"],"sourcesContent":["/* @minVersion 7.14.1 */\n\nexport default function _checkPrivateRedeclaration(\n obj: object,\n privateCollection: WeakMap<object, unknown> | WeakSet<object>,\n) {\n if (privateCollection.has(obj)) {\n throw new TypeError(\n \"Cannot initialize the same private elements twice on an object\",\n );\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,0BAA0BA,CAChDC,GAAW,EACXC,iBAA6D,EAC7D;EACA,IAAIA,iBAAiB,CAACC,GAAG,CAACF,GAAG,CAAC,EAAE;IAC9B,MAAM,IAAIG,SAAS,CACjB,gEACF,CAAC;EACH;AACF","ignoreList":[]}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _classApplyDescriptorDestructureSet;
|
||||
function _classApplyDescriptorDestructureSet(receiver, descriptor) {
|
||||
if (descriptor.set) {
|
||||
if (!("__destrObj" in descriptor)) {
|
||||
descriptor.__destrObj = {
|
||||
set value(v) {
|
||||
descriptor.set.call(receiver, v);
|
||||
}
|
||||
};
|
||||
}
|
||||
return descriptor.__destrObj;
|
||||
} else {
|
||||
if (!descriptor.writable) {
|
||||
throw new TypeError("attempted to set read only private field");
|
||||
}
|
||||
return descriptor;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=classApplyDescriptorDestructureSet.js.map
|
||||
Generated
Vendored
+1
File diff suppressed because one or more lines are too long
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _classApplyDescriptorGet;
|
||||
function _classApplyDescriptorGet(receiver, descriptor) {
|
||||
if (descriptor.get) {
|
||||
return descriptor.get.call(receiver);
|
||||
}
|
||||
return descriptor.value;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=classApplyDescriptorGet.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_classApplyDescriptorGet","receiver","descriptor","get","call","value"],"sources":["../../src/helpers/classApplyDescriptorGet.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nexport default function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n return descriptor.value;\n}\n"],"mappings":";;;;;;AAGe,SAASA,wBAAwBA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EACrE,IAAIA,UAAU,CAACC,GAAG,EAAE;IAClB,OAAOD,UAAU,CAACC,GAAG,CAACC,IAAI,CAACH,QAAQ,CAAC;EACtC;EACA,OAAOC,UAAU,CAACG,KAAK;AACzB","ignoreList":[]}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _classApplyDescriptorSet;
|
||||
function _classApplyDescriptorSet(receiver, descriptor, value) {
|
||||
if (descriptor.set) {
|
||||
descriptor.set.call(receiver, value);
|
||||
} else {
|
||||
if (!descriptor.writable) {
|
||||
throw new TypeError("attempted to set read only private field");
|
||||
}
|
||||
descriptor.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=classApplyDescriptorSet.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user