mirror of
https://github.com/chinchang/web-maker.git
synced 2025-08-08 06:16:31 +02:00
script: fix coffeescript code not compiling while saving as html. fixes #249
This commit is contained in:
@@ -892,20 +892,19 @@ loginModal, profileModal, profileAvatarImg, profileUserName, openItemsBtn
|
|||||||
d.resolve(code);
|
d.resolve(code);
|
||||||
}
|
}
|
||||||
} else if (jsMode === JsModes.COFFEESCRIPT) {
|
} else if (jsMode === JsModes.COFFEESCRIPT) {
|
||||||
var coffeeCode;
|
|
||||||
if (!window.CoffeeScript) {
|
if (!window.CoffeeScript) {
|
||||||
d.resolve('');
|
d.resolve('');
|
||||||
return d.promise;
|
return d.promise;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
coffeeCode = CoffeeScript.compile(code, { bare: true });
|
code = CoffeeScript.compile(code, { bare: true });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showErrors('js', [
|
showErrors('js', [
|
||||||
{ lineNumber: e.location.first_line, message: e.message }
|
{ lineNumber: e.location.first_line, message: e.message }
|
||||||
]);
|
]);
|
||||||
} finally {
|
} finally {
|
||||||
if (shouldPreventInfiniteLoops !== false) {
|
if (shouldPreventInfiniteLoops !== false) {
|
||||||
code = utils.addInfiniteLoopProtection(coffeeCode);
|
code = utils.addInfiniteLoopProtection(code);
|
||||||
}
|
}
|
||||||
d.resolve(code);
|
d.resolve(code);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user