mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
fix(54951): using being too strict to throw on Function type (#54969)
This commit is contained in:
parent
94f03cf0c6
commit
02e8d5ec61
@ -1403,7 +1403,7 @@ export const addDisposableResourceHelper: UnscopedEmitHelper = {
|
||||
text: `
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -1658,4 +1658,29 @@ describe("unittests:: evaluation:: usingDeclarations", () => {
|
||||
"after block"
|
||||
]);
|
||||
});
|
||||
|
||||
it("'using' for 'function' disposable resource ", () => {
|
||||
const { main, output } = evaluator.evaluateTypeScript(`
|
||||
export const output: any[] = [];
|
||||
|
||||
function disposable() {
|
||||
const f = () => output.push("enter");
|
||||
const d = () => output.push("exit");
|
||||
return Object.assign(f, { [Symbol.dispose]: d });
|
||||
}
|
||||
|
||||
export function main() {
|
||||
using run = disposable();
|
||||
run();
|
||||
}
|
||||
|
||||
`, { target: ts.ScriptTarget.ES2018 });
|
||||
|
||||
main();
|
||||
|
||||
assert.deepEqual(output, [
|
||||
"enter",
|
||||
"exit",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@ -111,7 +111,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -102,7 +102,7 @@ export {};
|
||||
//// [awaitUsingDeclarations.1.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -102,7 +102,7 @@ export {};
|
||||
//// [awaitUsingDeclarations.1.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -138,7 +138,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -20,7 +20,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -11,7 +11,7 @@ export {};
|
||||
//// [awaitUsingDeclarations.2.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -11,7 +11,7 @@ export {};
|
||||
//// [awaitUsingDeclarations.2.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -13,7 +13,7 @@ export {};
|
||||
//// [awaitUsingDeclarations.3.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -13,7 +13,7 @@ export {};
|
||||
//// [awaitUsingDeclarations.3.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -49,7 +49,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -12,7 +12,7 @@ async function main() {
|
||||
//// [awaitUsingDeclarationsInFor.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -12,7 +12,7 @@ async function main() {
|
||||
//// [awaitUsingDeclarationsInFor.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -48,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -18,7 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -9,7 +9,7 @@ async function main() {
|
||||
//// [awaitUsingDeclarationsInForAwaitOf.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -9,7 +9,7 @@ async function main() {
|
||||
//// [awaitUsingDeclarationsInForAwaitOf.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -19,7 +19,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -10,7 +10,7 @@ async function main() {
|
||||
//// [awaitUsingDeclarationsInForOf.1.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -10,7 +10,7 @@ async function main() {
|
||||
//// [awaitUsingDeclarationsInForOf.1.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -165,7 +165,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -156,7 +156,7 @@ export {};
|
||||
//// [usingDeclarations.1.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -156,7 +156,7 @@ export {};
|
||||
//// [usingDeclarations.1.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -207,7 +207,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -54,7 +54,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
})();
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -16,7 +16,7 @@ class C2 extends C1 {
|
||||
//// [usingDeclarations.12.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -16,7 +16,7 @@ class C2 extends C1 {
|
||||
//// [usingDeclarations.12.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
//// [usingDeclarations.2.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
//// [usingDeclarations.2.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
//// [usingDeclarations.2.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
//// [usingDeclarations.2.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
//// [usingDeclarations.3.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
//// [usingDeclarations.3.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
//// [usingDeclarations.3.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
//// [usingDeclarations.3.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -8,7 +8,7 @@ for (using d1 = { [Symbol.dispose]() {} }, d2 = null, d3 = undefined;;) {
|
||||
//// [usingDeclarationsInFor.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -8,7 +8,7 @@ for (using d1 = { [Symbol.dispose]() {} }, d2 = null, d3 = undefined;;) {
|
||||
//// [usingDeclarationsInFor.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -8,7 +8,7 @@ for (using d1 = { [Symbol.dispose]() {} }, d2 = null, d3 = undefined;;) {
|
||||
//// [usingDeclarationsInFor.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -8,7 +8,7 @@ for (using d1 = { [Symbol.dispose]() {} }, d2 = null, d3 = undefined;;) {
|
||||
//// [usingDeclarationsInFor.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -19,7 +19,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -10,7 +10,7 @@ async function main() {
|
||||
//// [usingDeclarationsInForAwaitOf.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -10,7 +10,7 @@ async function main() {
|
||||
//// [usingDeclarationsInForAwaitOf.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -8,7 +8,7 @@ for (using d1 of [{ [Symbol.dispose]() {} }, null, undefined]) {
|
||||
//// [usingDeclarationsInForOf.1.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -8,7 +8,7 @@ for (using d1 of [{ [Symbol.dispose]() {} }, null, undefined]) {
|
||||
//// [usingDeclarationsInForOf.1.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -8,7 +8,7 @@ for (using d1 of [{ [Symbol.dispose]() {} }, null, undefined]) {
|
||||
//// [usingDeclarationsInForOf.1.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -8,7 +8,7 @@ for (using d1 of [{ [Symbol.dispose]() {} }, null, undefined]) {
|
||||
//// [usingDeclarationsInForOf.1.js]
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
@ -65,7 +65,7 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
|
||||
};
|
||||
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user