Skip to content

Commit

Permalink
Allow functions as values in __addDisposableResource (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton authored Jul 24, 2023
1 parent 7c7f3ae commit 1d606f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tslib.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
2 changes: 1 addition & 1 deletion tslib.es6.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
2 changes: 1 addition & 1 deletion tslib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 1d606f6

Please sign in to comment.