зеркало из https://github.com/microsoft/tslib.git
Allow functions as values in __addDisposableResource (#215)
This commit is contained in:
Родитель
7c7f3ae0f8
Коммит
1d606f6649
|
@ -294,7 +294,7 @@ export function __classPrivateFieldIn(state, receiver) {
|
|||
|
||||
export function __addDisposableResource(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.");
|
||||
|
|
|
@ -294,7 +294,7 @@ export function __classPrivateFieldIn(state, receiver) {
|
|||
|
||||
export function __addDisposableResource(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.");
|
||||
|
|
2
tslib.js
2
tslib.js
|
@ -342,7 +342,7 @@ var __disposeResources;
|
|||
|
||||
__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.");
|
||||
|
|
Загрузка…
Ссылка в новой задаче