Revert "fix: stop user code after 100ms of execution" (#37965)

This reverts commit 01b37f664f.
This commit is contained in:
Oliver Eyton-Williams
2019-12-21 06:39:32 +01:00
committed by mrugesh
parent c49aee9edc
commit e5abfa15ad
9 changed files with 75 additions and 143 deletions

View File

@@ -1,4 +1,4 @@
import { transformers, transformersPreview } from '../rechallenge/transformers';
import { transformers } from '../rechallenge/transformers';
import { cssToHtml, jsToHtml, concatHtml } from '../rechallenge/builders.js';
import { challengeTypes } from '../../../../utils/challengeTypes';
import createWorker from './worker-executor';
@@ -76,11 +76,11 @@ export function canBuildChallenge(challengeData) {
return buildFunctions.hasOwnProperty(challengeType);
}
export async function buildChallenge(challengeData, preview = false) {
export async function buildChallenge(challengeData) {
const { challengeType } = challengeData;
let build = buildFunctions[challengeType];
if (build) {
return build(challengeData, preview);
return build(challengeData);
}
throw new Error(`Cannot build challenge of type ${challengeType}`);
}
@@ -137,10 +137,8 @@ export function buildDOMChallenge({ files, required = [], template = '' }) {
}));
}
export function buildJSChallenge({ files }, preview = false) {
const pipeLine = preview
? composeFunctions(...transformersPreview)
: composeFunctions(...transformers);
export function buildJSChallenge({ files }) {
const pipeLine = composeFunctions(...transformers);
const finalFiles = Object.keys(files)
.map(key => files[key])
.map(pipeLine);