Skip to content

Commit

Permalink
use undefined insted of null for cleaning internal `(Async)Dispos…
Browse files Browse the repository at this point in the history
…ableStack` state stacks for consistency with the spec text

tc39/proposal-explicit-resource-management#194
  • Loading branch information
zloirock committed Mar 30, 2024
1 parent eae06ae commit d1fd92b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -2,7 +2,7 @@
##### Unreleased
- Added [`URL.parse`](https://url.spec.whatwg.org/#dom-url-parse), [url/825](https://github.com/whatwg/url/pull/825)
- [`RegExp.escape`](https://github.com/tc39/proposal-regex-escaping) [moved to hex-escape semantics](https://github.com/tc39/proposal-regex-escaping/pull/67)
- Some updates of [Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management) Stage 3 proposal like [explicit-resource-management/217](https://github.com/tc39/proposal-explicit-resource-management/pull/217)
- Some minor updates of [Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management) Stage 3 proposal like [explicit-resource-management/217](https://github.com/tc39/proposal-explicit-resource-management/pull/217)

##### [3.36.1 - 2024.03.19](https://github.com/zloirock/core-js/releases/tag/v3.36.1)
- Changes [v3.36.0...v3.36.1](https://github.com/zloirock/core-js/compare/v3.36.0...v3.36.1)
Expand Down
Expand Up @@ -72,14 +72,14 @@ defineBuiltIns(AsyncDisposableStackPrototype, {
var loop = function () {
if (i) {
var disposeMethod = stack[--i];
stack[i] = null;
stack[i] = undefined;
try {
Promise.resolve(disposeMethod()).then(loop, handleError);
} catch (error) {
handleError(error);
}
} else {
internalState.stack = null;
internalState.stack = undefined;
thrown ? reject(suppressed) : resolve(undefined);
}
};
Expand Down
Expand Up @@ -56,7 +56,7 @@ defineBuiltIns(DisposableStackPrototype, {
var suppressed;
while (i) {
var disposeMethod = stack[--i];
stack[i] = null;
stack[i] = undefined;
try {
disposeMethod();
} catch (errorResult) {
Expand All @@ -68,7 +68,7 @@ defineBuiltIns(DisposableStackPrototype, {
}
}
}
internalState.stack = null;
internalState.stack = undefined;
if (thrown) throw suppressed;
},
use: function use(value) {
Expand Down

0 comments on commit d1fd92b

Please sign in to comment.