Skip to content

Commit

Permalink
simplify AddDisposableResource
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Mar 23, 2023
1 parent ea36fe1 commit e4a5bc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## Changelog
##### Unreleased
- [`Iterator.range` proposal](https://github.com/tc39/proposal-Number.range) moved to Stage 2, [March 2023 TC39 meeting](https://github.com/babel/proposals/issues/87#issuecomment-1480266760)
- `(Async)DisposableStack.prototype.move` marks the original stack as disposed, [#1226](https://github.com/zloirock/core-js/issues/1226)
- (Async) Explicit Resource Management proposals:
- `(Async)DisposableStack.prototype.move` marks the original stack as disposed, [#1226](https://github.com/zloirock/core-js/issues/1226)
- Some simplifications like [proposal-explicit-resource-management/150](https://github.com/tc39/proposal-explicit-resource-management/pull/150)
- Compat data improvements:
- [`URLSearchParams.prototype.size`](https://github.com/whatwg/url/pull/734) marked as supported from FF112, NodeJS 19.8 and Deno 1.32
- Added Deno 1.32 compat data mapping
Expand Down
6 changes: 2 additions & 4 deletions packages/core-js/internals/add-disposable-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ module.exports = function (disposable, V, hint, method) {
var resource;
if (!method) {
if (isNullOrUndefined(V)) return;
resource = createDisposableResource(V, hint);
} else if (isNullOrUndefined(V)) {
resource = createDisposableResource(undefined, hint, method);
resource = createDisposableResource(anObject(V), hint);
} else {
resource = createDisposableResource(anObject(V), hint, method);
resource = createDisposableResource(undefined, hint, method);
}

push(disposable.stack, resource);
Expand Down

0 comments on commit e4a5bc9

Please sign in to comment.