We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
source code:
const test1 = async () => { return Promise.resolve("1"); } export const test2 = async () => { const r = await test1(); switch (r) { case "1": console.log("1111"); break; case "2": console.log("2222"); break; } console.log("33333333333"); }
transformed code:
_$pi.define("client/app_a/a1", ["require", "exports", "module"], function (require, exports, module) { "use strict"; exports.test2 = void 0; const test1 = function () { try { return Promise.resolve("1"); } catch (e) { return Promise.reject(e); } }; exports.test2 = function () { try { return Promise.resolve(test1()).then(function (r) { switch (r) { case "1": console.log("1111"); return; case "2": console.log("2222"); return; } console.log("333"); }); } catch (e) { return Promise.reject(e); } }; });
break transformed to return,the last print 333 can not be printed
The text was updated successfully, but these errors were encountered:
Which version are you using? I've imported the following test case:
async () => { const r = await test1(); switch (r) { case "1": console.log("1111"); break; case "2": console.log("2222"); break; } console.log("33333333333"); }
And get the following output on version 0.8.16:
function(){try{return Promise.resolve(test1()).then(function(r){switch(r){case"1":console.log("1111");break;case"2":console.log("2222");break;}console.log("33333333333");});}catch(e){return Promise.reject(e);}}
Which unminifies to:
function() { try { return Promise.resolve(test1()).then(function(r) { switch (r) { case "1": console.log("1111"); break; case "2": console.log("2222"); break; } console.log("33333333333"); }); } catch (e) { return Promise.reject(e); } }
Sorry, something went wrong.
@chinayu9 checking in. do you have any thoughts on the test case?
No branches or pull requests
source code:
transformed code:
break transformed to return,the last print 333 can not be printed
The text was updated successfully, but these errors were encountered: