зеркало из https://github.com/microsoft/tslib.git
adds __classPrivateFieldIn
Signed-off-by: aclaymore <aclaymore@bloomberg.net>
This commit is contained in:
Родитель
251802eedd
Коммит
ad1140860d
|
@ -127,4 +127,11 @@ export declare function __classPrivateFieldSet<T extends new (...args: any[]) =>
|
|||
kind: "a",
|
||||
f: (v: V) => void
|
||||
): V;
|
||||
/**
|
||||
* Checking the existence of a private field/method/accessor
|
||||
*/
|
||||
export declare function __classPrivateFieldIn(
|
||||
state: (new (...args: any[]) => unknown) | { has(o: any): boolean },
|
||||
receiver: unknown,
|
||||
): boolean;
|
||||
export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void;
|
||||
|
|
|
@ -237,3 +237,8 @@ export function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
}
|
||||
|
||||
export function __classPrivateFieldIn(state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
}
|
||||
|
|
7
tslib.js
7
tslib.js
|
@ -36,6 +36,7 @@ var __importStar;
|
|||
var __importDefault;
|
||||
var __classPrivateFieldGet;
|
||||
var __classPrivateFieldSet;
|
||||
var __classPrivateFieldIn;
|
||||
var __createBinding;
|
||||
(function (factory) {
|
||||
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
|
||||
|
@ -279,6 +280,11 @@ var __createBinding;
|
|||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
};
|
||||
|
||||
__classPrivateFieldIn = function (state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
};
|
||||
|
||||
exporter("__extends", __extends);
|
||||
exporter("__assign", __assign);
|
||||
exporter("__rest", __rest);
|
||||
|
@ -303,4 +309,5 @@ var __createBinding;
|
|||
exporter("__importDefault", __importDefault);
|
||||
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
|
||||
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
|
||||
exporter("__classPrivateFieldIn", __classPrivateFieldIn);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче