Skip to content

Commit b4c5f53

Browse files
luciferankoncraftybones
authored andcommitted
Fix issue of persisting lines from previous execution (#3)
* Fix issue of persisting lines from previous execution * set name for MaxInstructionsExceededException
1 parent dcd208c commit b4c5f53

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/machine.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Machine {
2828
}
2929

3030
load(program) {
31+
this.lines = new Lines(this.maxLinesToExecute);
3132
let instructions = program.split(/\n/);
3233
instructions.forEach((instruction, index) => {
3334
let line;

src/maxInstructionsExceededException.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class MaxInstructionsExceededException extends Error {
22
constructor(maxLinesToExecute) {
33
super();
4+
this.name = this.constructor.name;
45
this.maxLinesToExecute = maxLinesToExecute;
56
}
67
}

0 commit comments

Comments
 (0)