4
4
findDeclaration ,
5
5
getNames ,
6
6
interrupt ,
7
- parseError ,
8
7
Result ,
9
8
resume ,
10
9
runFilesInContext ,
@@ -15,9 +14,7 @@ import { defineSymbol } from 'js-slang/dist/createContext';
15
14
import { InterruptedError } from 'js-slang/dist/errors/errors' ;
16
15
import { parse } from 'js-slang/dist/parser/parser' ;
17
16
import { manualToggleDebugger } from 'js-slang/dist/stdlib/inspector' ;
18
- import { typeCheck } from 'js-slang/dist/typeChecker/typeChecker' ;
19
17
import { Chapter , Variant } from 'js-slang/dist/types' ;
20
- import { validateAndAnnotate } from 'js-slang/dist/validator/validator' ;
21
18
import { random } from 'lodash' ;
22
19
import Phaser from 'phaser' ;
23
20
import { SagaIterator } from 'redux-saga' ;
@@ -1241,22 +1238,9 @@ export function* evalCode(
1241
1238
// Safe to use ! as storyEnv will be defined from above when we call from EVAL_STORY
1242
1239
yield put ( actions . evalStoryError ( context . errors , storyEnv ! ) ) ;
1243
1240
}
1244
- // we need to parse again, but preserve the errors in context
1245
- const oldErrors = context . errors ;
1246
- context . errors = [ ] ;
1247
- // Note: Type checking does not support multiple file programs.
1248
- const parsed = parse ( entrypointCode , context ) ;
1249
- const typeErrors = parsed && typeCheck ( validateAndAnnotate ( parsed ! , context ) , context ) [ 1 ] ;
1250
- context . errors = oldErrors ;
1251
- // for achievement event tracking
1241
+
1252
1242
const events = context . errors . length > 0 ? [ EventType . ERROR ] : [ ] ;
1253
1243
1254
- if ( typeErrors && typeErrors . length > 0 && ! isStoriesBlock ) {
1255
- events . push ( EventType . ERROR ) ;
1256
- yield put (
1257
- actions . sendReplInputToOutput ( 'Hints:\n' + parseError ( typeErrors ) , workspaceLocation )
1258
- ) ;
1259
- }
1260
1244
yield put ( actions . addEvent ( events ) ) ;
1261
1245
return ;
1262
1246
} else if ( result . status === 'suspended' || result . status === 'suspended-ec-eval' ) {
0 commit comments