You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.
asyncwrapCall(fun){constunlock=this.lock();letret;try{console.log('wrapCall() '+this._queueCounter);ret=awaitfun();}catch(err){// not sucessfull -> unlock before throwingunlock();throwerr;}// sucessfull -> unlock before returnunlock();returnret;},
Is transpiled to:
wrapCall: functionwrapCall(fun){varunlock,ret,_this3=this;returnPromise.resolve().then(function(){unlock=_this3.lock();ret=void0;returnPromise.resolve().then(function(){console.log('wrapCall() '+_this3._queueCounter);returnfun();}).then(function(_resp){ret=_resp;}).catch(function(err){// not sucessfull -> unlock before throwingunlock();throwerr;});}).then(function(){// sucessfull -> unlock before returnunlock();returnret;});}
The problem here is that this.lock(); is called after the next tick instead of instantly.
This creates a different side-effect than expected.
Since the lock-call is synchronous it should transpile to something like:
Source:
Is transpiled to:
The problem here is that
this.lock();
is called after the next tick instead of instantly.This creates a different side-effect than expected.
Since the lock-call is synchronous it should transpile to something like:
The text was updated successfully, but these errors were encountered: