tc39 / proposal-atomics-wait-async

"asynchronous atomic wait" for ECMAScript
https://tc39.github.io/proposal-atomics-wait-async/
Other
89 stars 18 forks source link

Editorial: refactor wait and waitAsync into new AO #19

Closed syg closed 4 years ago

syg commented 4 years ago

@ljharb A refactored AO has a lot of branches inside depending on sync/async that I think makes it more confusing to read.

syg commented 4 years ago

is there any way to have DoWait be a synchronous abstract operation, but have waitAsync turn the strings into a Promise, or set the Waiter Record's [[PromiseCapability]] slot to a capability?

Dunno, maybe? I'm not exactly sure what you have in mind with DoWait being a synchronous operation. I'd be happy to review a patch here, but as is I still think a duplicated copy is clearer than any refactoring here, since there are only two copies.

ljharb commented 4 years ago

Per discussion; i'll defer to your judgement here that the refactor isn't cleaner. Feel free to close.