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
(async()=>{letobj={};setTimeout(()=>{console.log('timeout');obj={};},1000);obj['a']=awaitnewPromise((resolve)=>{setTimeout(()=>{console.log('resolved');resolve('a');},1000);});obj['b']='b';console.log('what is obj:',JSON.stringify(obj));})();
when transformed with
babel-transform-regenerator
, the final value ofobj
is{a:'a',b:'b'}
link : https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=BQQwzgngdgxgBMAlHAvAPjgbwFBzgGwFMAXOAewCMArVLAXwG5c4wSAVASwFtCyBXYsCSoMOPHhhkoYMkQB0-MgHNgAcmLdeA1Yibjy1WpkbM6AGjgBGAAy3d2ZpSoBtVSFUBdWiADuIDqRQhD5wAAoATmRcHKxC4YQy-ABuhMjoWMx4rMScPPyCwuli-nCS0rKECspq8YkpACY6eiW1silq7vb65la21l1wdANOrhSetKpjTMxliZWKKqo-ABYgpDEGVABcqhYAUgDKAPIAcnJgxOEcUEocAGYQwE6I9kNIDEA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&evaluate=true&fileSize=false&timeTravel=false&sourceType=module&lineWrap=false&presets=react%2Cstage-2&prettier=false&targets=&version=7.25.6&externalPlugins=%40babel%2Fplugin-transform-regenerator%407.24.7&assumptions=%7B%7D
when
babel-transform-regenerator
plugin removed, the final value ofobj
is{b:'b'}
link: https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=BQQwzgngdgxgBMAlHAvAPjgbwFBzgGwFMAXOAewCMArVLAXwG5c4wSAVASwFtCyBXYsCSoMOPHhhkoYMkQB0-MgHNgAcmLdeA1Yibjy1WpkbM6AGjgBGAAy3d2ZpSoBtVSFUBdWiADuIDqRQhD5wAAoATmRcHKxC4YQy-ABuhMjoWMx4rMScPPyCwuli-nCS0rKECspq8YkpACY6eiW1silq7vb65la21l1wdANOrhSetKpjTMxliZWKKqo-ABYgpDEGVABcqhYAUgDKAPIAcnJgxOEcUEocAGYQwE6I9kNIDEA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&evaluate=true&fileSize=false&timeTravel=false&sourceType=module&lineWrap=false&presets=react%2Cstage-2&prettier=false&targets=&version=7.25.6&externalPlugins=&assumptions=%7B%7D
The text was updated successfully, but these errors were encountered: