Actually use loopProtect

This commit is contained in:
Berkeley Martinez
2015-12-01 17:24:50 -08:00
parent 3a299daa37
commit f904f91f97
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ window.common = (function(global) {
const { const {
addLoopProtect, addLoopProtect,
getJsFromHtml,
detectUnsafeCode$, detectUnsafeCode$,
updatePreview$, updatePreview$,
challengeType, challengeType,
@ -43,9 +44,9 @@ window.common = (function(global) {
challengeType === challengeTypes.HTML && challengeType === challengeTypes.HTML &&
common.hasJs(code) common.hasJs(code)
) { ) {
output = common.getJsOutput(common.getJsFromHtml(code)); output = common.getJsOutput(getJsFromHtml(code));
} else if (challengeType !== challengeTypes.HTML) { } else if (challengeType !== challengeTypes.HTML) {
output = common.getJsOutput(combinedCode); output = common.getJsOutput(addLoopProtect(combinedCode));
} }
return common.runPreviewTests$({ return common.runPreviewTests$({

View File

@ -10,6 +10,7 @@ window.common = (function(global) {
var libraryIncludes = ` var libraryIncludes = `
<script> <script>
window.$ = parent.$.proxy(parent.$.fn.find, parent.$(document)); window.$ = parent.$.proxy(parent.$.fn.find, parent.$(document));
window.loopProtect = parent.loopProtect;
</script> </script>
<link <link
rel='stylesheet' rel='stylesheet'