Skip to content

Commit 370fde9

Browse files
committed
Add program terminated succesfully output to Java
1 parent 1f5c9f1 commit 370fde9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/commons/utils/JavaHelper.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ import loadSourceModules from 'js-slang/dist/modules/loader';
99
import Constants from './Constants';
1010
import DisplayBufferService from './DisplayBufferService';
1111

12+
class ProgramTerminatedSuccessfully {
13+
toString() {
14+
return 'Program terminated successfully';
15+
}
16+
}
17+
1218
export async function javaRun(javaCode: string, context: Context) {
1319
let compiled = {};
1420

@@ -129,7 +135,11 @@ export async function javaRun(javaCode: string, context: Context) {
129135
resolve(
130136
context.errors.length
131137
? { status: 'error' }
132-
: { status: 'finished', context, value: '' }
138+
: {
139+
status: 'finished',
140+
context,
141+
value: new ProgramTerminatedSuccessfully()
142+
}
133143
);
134144
}
135145
},

0 commit comments

Comments
 (0)