FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow functions as values in __addDisposableResource (#215) · microsoft/tslib@1d606f6 · GitHub

Repository navigation

Commit 1d606f6

Browse files
authored
Allow functions as values in __addDisposableResource (#215)
1 parent 7c7f3ae commit 1d606f6

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎tslib.es6.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export function __classPrivateFieldIn(state, receiver) {
294294

295295
export function __addDisposableResource(env, value, async) {
296296
if (value !== null && value !== void 0) {
297-
if (typeof value !== "object") throw new TypeError("Object expected.");
297+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
298298
var dispose;
299299
if (async) {
300300
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");

‎tslib.es6.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export function __classPrivateFieldIn(state, receiver) {
294294

295295
export function __addDisposableResource(env, value, async) {
296296
if (value !== null && value !== void 0) {
297-
if (typeof value !== "object") throw new TypeError("Object expected.");
297+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
298298
var dispose;
299299
if (async) {
300300
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");

‎tslib.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ var __disposeResources;
342342

343343
__addDisposableResource = function (env, value, async) {
344344
if (value !== null && value !== void 0) {
345-
if (typeof value !== "object") throw new TypeError("Object expected.");
345+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
346346
var dispose;
347347
if (async) {
348348
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL