yui / yuicompressor

YUI Compressor
http://yui.github.com/yuicompressor/
Other
3.01k stars 664 forks source link

yuicompressor fail when use async/await functions #301

Open tufik2 opened 6 years ago

tufik2 commented 6 years ago

Hi, this code broken the compressor

api.fetch = async function(path, data){
    let headers = new Headers();
        headers.append("Cache-Control", "no-cache");
        headers.append("Content-type", "application/x-www-form-urlencoded");
        headers.append("key", api.key);
        headers.append("base64", true);
    let dataToSend = {};
        dataToSend.action = path;
        dataToSend.data = data;
    let response = await (await fetch(api.url, { method: 'POST', credentials:"include", headers: headers, body: cuppa.objectToURL(dataToSend)})).text();
    return response;
};
Chris2011 commented 6 years ago

You are using let, let is ES2015 and ES2015 is not supported for the YUIComporessor. And async and await are ES2017 features and I guess, if ES2015 is not supported, ES2016 and ES2017 is also not supported, unforunately.

Chris2011 commented 6 years ago

Only to let you know this, if you didn't noticed it.

tufik2 commented 6 years ago

Mmm, that is so bad, and I believe there aren't plan to support its. :(

Chris2011 commented 6 years ago

I don't know whether this project is still alive or not. Someone merged PR in summer but that's all.

kcak11 commented 6 years ago

RIP yuicompressor