1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-29 01:30:16 +02:00

upgrade esprima to latest version fixes #252

This commit is contained in:
Kushagra Gour
2024-05-07 14:09:10 +05:30
parent 3d0f5ba6d9
commit 6929bc820f
4 changed files with 33 additions and 14 deletions

View File

@@ -2,7 +2,7 @@ import { deferred } from './deferred';
import { addInfiniteLoopProtection } from './utils';
import { HtmlModes, CssModes, JsModes } from './codeModes';
const esprima = require('esprima');
const esprima = require('esprima-next');
// computeHtml, computeCss & computeJs evaluate the final code according
// to whatever mode is selected and resolve the returned promise with the code.
@@ -18,20 +18,20 @@ export function computeHtml(userCode, mode) {
window.marked
? {
code: marked(code)
}
}
: {
code
}
}
);
} else if (mode === HtmlModes.JADE) {
d.resolve(
window.jade
? {
code: jade.render(code)
}
}
: {
code
}
}
);
}
@@ -198,7 +198,7 @@ export function computeJs(
? code
: addInfiniteLoopProtection(code, {
timeout: infiniteLoopTimeout
});
});
}
d.resolve({
@@ -231,7 +231,7 @@ export function computeJs(
? code
: addInfiniteLoopProtection(code, {
timeout: infiniteLoopTimeout
});
});
}
d.resolve({
code,
@@ -267,7 +267,7 @@ export function computeJs(
? code
: addInfiniteLoopProtection(code, {
timeout: infiniteLoopTimeout
});
});
}
d.resolve({
code,