Skip to content

Conversation

@anton-iskryzhytskyi
Copy link

Relates to #16

@tshemsedinov
Copy link
Member

This PR should not contain commits not related to timeout.

@anton-iskryzhytskyi
Copy link
Author

Updated, ready for review, @tshemsedinov

Copy link
Member

@tshemsedinov tshemsedinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need to use clearTimeout on abort?

web-locks.js Outdated
}

enter(handler) {
enter(handler, timeout) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That it much better, but we need to compare passing timeout and timer instance.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need to use clearTimeout on abort?

Hmm, maybe it would be better to throw an error on timeout, similar to abort behavior?
Also, move all resolve / reject invocations to one place.

specify imported file extensions
@tshemsedinov
Copy link
Member

You are doing good code but mixing multiple changes into one PR, we need to talk about process.

Comment on lines +57 to +58
if (timeout)
timer = setTimeout(finalize, timeout, new TimeoutError('Time Out'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (timeout)
timer = setTimeout(finalize, timeout, new TimeoutError('Time Out'));
if (timeout) {
timer = setTimeout(finalize, timeout, new TimeoutError('Time Out'));
}

anton-iskryzhytskyi added a commit to anton-iskryzhytskyi/web-locks that referenced this pull request Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants