change instance of adding loopProtect to this.jsPreprocess
This commit is contained in:
parent
a043dc16fe
commit
9297496a5e
1 changed files with 3 additions and 3 deletions
|
@ -158,12 +158,12 @@ class PreviewFrame extends React.Component {
|
||||||
const scriptsInHTML = sketchDoc.getElementsByTagName('script');
|
const scriptsInHTML = sketchDoc.getElementsByTagName('script');
|
||||||
const scriptsInHTMLArray = Array.prototype.slice.call(scriptsInHTML);
|
const scriptsInHTMLArray = Array.prototype.slice.call(scriptsInHTML);
|
||||||
scriptsInHTMLArray.forEach((script) => {
|
scriptsInHTMLArray.forEach((script) => {
|
||||||
script.innerHTML = loopProtect(script.innerHTML); // eslint-disable-line
|
script.innerHTML = this.jsPreprocess(script.innerHTML); // eslint-disable-line
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
jsPreprocess(sketchDoc) {
|
jsPreprocess(jsText) {
|
||||||
let newContent = sketchDoc;
|
let newContent = jsText;
|
||||||
// check the code for js errors before sending it to strip comments
|
// check the code for js errors before sending it to strip comments
|
||||||
// or loops.
|
// or loops.
|
||||||
JSHINT(newContent);
|
JSHINT(newContent);
|
||||||
|
|
Loading…
Reference in a new issue