File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,12 +36,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3636
3737/* TODOs:
3838
39- - [later] detect exact position of syntax error and put a squiggly line below
40- it with something like:
41-
42- File "<string>", line 1
43- x~=1
44- ^
4539- make Ace editor resizable width-wise using jQuery resizable
4640 (stackoverflow has some tips for how to do that)
4741 - users want this!
@@ -54,6 +48,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5448- [later] add a codeopticon-style history slider of the user's past
5549 edits (but that might be confusing)
5650
51+ - [later] detect exact position of syntax error and put a squiggly line below
52+ it with something like:
53+
54+ File "<string>", line 1
55+ x~=1
56+ ^
57+
58+ (do this for the OPT classic editor too. and for other language backends)
59+
5760*/
5861
5962
Original file line number Diff line number Diff line change @@ -782,6 +782,14 @@ ExecutionVisualizer.prototype.render = function() {
782782 this . params . startingInstruction -- ;
783783 }
784784
785+ // fail-soft with out-of-bounds startingInstruction values:
786+ if ( this . params . startingInstruction < 0 ) {
787+ this . params . startingInstruction = 0 ;
788+ }
789+ if ( this . params . startingInstruction >= this . curTrace . length ) {
790+ this . params . startingInstruction = this . curTrace . length - 1 ;
791+ }
792+
785793 assert ( 0 <= this . params . startingInstruction &&
786794 this . params . startingInstruction < this . curTrace . length ) ;
787795 this . curInstr = this . params . startingInstruction ;
You can’t perform that action at this time.
0 commit comments