Skip to content

Commit 469051b

Browse files
committed
test case updates
1 parent ce66ba4 commit 469051b

4 files changed

Lines changed: 921 additions & 1281 deletions

File tree

v4-cokapi/backends/javascript/jslogger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
JS logger backend for Online Python Tutor runtime visualizer
44
55
First version created on: 2015-01-02 by Philip Guo
6-
- originally made for Node v0.10.25
6+
- originally made for Node v0.10.25 (Jan 2015)
77
- on 2016-05-01, ported over to also work on Node v6.0.0
88
99
Run as:

v4-cokapi/backends/javascript/tests/constructor.golden

Lines changed: 11 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
v2: [ 'JS_SPECIAL_VAL', 'undefined' ] },
6262
ordered_globals: [ 'Vector', 'v1', 'v2' ],
6363
line: 2,
64-
col: 9,
64+
col: 2,
6565
event: 'call',
6666
heap:
6767
{ '1':
@@ -77,12 +77,7 @@
7777
'function (other) {\n return new Vector(this.x + other.x, this.y + other.y);\n}',
7878
null,
7979
null ],
80-
'4':
81-
[ 'INSTANCE',
82-
'',
83-
[ 'x', [ 'JS_SPECIAL_VAL', 'undefined' ] ],
84-
[ 'y', [ 'JS_SPECIAL_VAL', 'undefined' ] ],
85-
[ '__proto__', [ 'REF', 2 ] ] ] } },
80+
'4': [ 'INSTANCE', '', [ '__proto__', [ 'REF', 2 ] ] ] } },
8681
{ stdout: '',
8782
func_name: 'Vector',
8883
stack_to_render:
@@ -101,7 +96,7 @@
10196
v2: [ 'JS_SPECIAL_VAL', 'undefined' ] },
10297
ordered_globals: [ 'Vector', 'v1', 'v2' ],
10398
line: 3,
104-
col: 9,
99+
col: 2,
105100
event: 'step_line',
106101
heap:
107102
{ '1':
@@ -117,12 +112,7 @@
117112
'function (other) {\n return new Vector(this.x + other.x, this.y + other.y);\n}',
118113
null,
119114
null ],
120-
'4':
121-
[ 'INSTANCE',
122-
'',
123-
[ 'x', 1 ],
124-
[ 'y', [ 'JS_SPECIAL_VAL', 'undefined' ] ],
125-
[ '__proto__', [ 'REF', 2 ] ] ] } },
115+
'4': [ 'INSTANCE', '', [ 'x', 1 ], [ '__proto__', [ 'REF', 2 ] ] ] } },
126116
{ stdout: '',
127117
func_name: 'Vector',
128118
stack_to_render:
@@ -212,7 +202,7 @@
212202
v2: [ 'JS_SPECIAL_VAL', 'undefined' ] },
213203
ordered_globals: [ 'Vector', 'v1', 'v2' ],
214204
line: 2,
215-
col: 9,
205+
col: 2,
216206
event: 'call',
217207
heap:
218208
{ '1':
@@ -234,7 +224,8 @@
234224
[ 'x', 1 ],
235225
[ 'y', 2 ],
236226
[ '__proto__', [ 'REF', 2 ] ] ] } },
237-
{ stdout: '',
227+
{ exception_msg: 'TypeError: Cannot set property \'x\' of undefined',
228+
stdout: '',
238229
func_name: 'Vector',
239230
stack_to_render:
240231
[ { func_name: 'Vector',
@@ -249,87 +240,11 @@
249240
globals:
250241
{ Vector: [ 'REF', 1 ],
251242
v1: [ 'REF', 4 ],
252-
v2: [ 'JS_SPECIAL_VAL', 'undefined' ],
253-
x: 20 },
254-
ordered_globals: [ 'Vector', 'v1', 'v2', 'x' ],
255-
line: 3,
243+
v2: [ 'JS_SPECIAL_VAL', 'undefined' ] },
244+
ordered_globals: [ 'Vector', 'v1', 'v2' ],
245+
line: 2,
256246
col: 9,
257-
event: 'step_line',
258-
heap:
259-
{ '1':
260-
[ 'JS_FUNCTION',
261-
'Vector',
262-
'function Vector(x, y) {\n this.x = x;\n this.y = y;\n}',
263-
[ [ 'prototype', [ 'REF', 2 ] ] ],
264-
null ],
265-
'2': [ 'INSTANCE', '', [ 'plus', [ 'REF', 3 ] ] ],
266-
'3':
267-
[ 'JS_FUNCTION',
268-
'',
269-
'function (other) {\n return new Vector(this.x + other.x, this.y + other.y);\n}',
270-
null,
271-
null ],
272-
'4':
273-
[ 'INSTANCE',
274-
'',
275-
[ 'x', 1 ],
276-
[ 'y', 2 ],
277-
[ '__proto__', [ 'REF', 2 ] ] ] } },
278-
{ stdout: '',
279-
func_name: 'Vector',
280-
stack_to_render:
281-
[ { func_name: 'Vector',
282-
frame_id: 3,
283-
is_highlighted: true,
284-
is_parent: false,
285-
is_zombie: false,
286-
parent_frame_id_list: [],
287-
unique_hash: 'Vector_f3',
288-
ordered_varnames: [ 'x', 'y', '__return__' ],
289-
encoded_locals: { x: 20, y: 30, __return__: [ 'JS_SPECIAL_VAL', 'undefined' ] } } ],
290-
globals:
291-
{ Vector: [ 'REF', 1 ],
292-
v1: [ 'REF', 4 ],
293-
v2: [ 'JS_SPECIAL_VAL', 'undefined' ],
294-
x: 20,
295-
y: 30 },
296-
ordered_globals: [ 'Vector', 'v1', 'v2', 'x', 'y' ],
297-
line: 3,
298-
col: 0,
299-
event: 'return',
300-
heap:
301-
{ '1':
302-
[ 'JS_FUNCTION',
303-
'Vector',
304-
'function Vector(x, y) {\n this.x = x;\n this.y = y;\n}',
305-
[ [ 'prototype', [ 'REF', 2 ] ] ],
306-
null ],
307-
'2': [ 'INSTANCE', '', [ 'plus', [ 'REF', 3 ] ] ],
308-
'3':
309-
[ 'JS_FUNCTION',
310-
'',
311-
'function (other) {\n return new Vector(this.x + other.x, this.y + other.y);\n}',
312-
null,
313-
null ],
314-
'4':
315-
[ 'INSTANCE',
316-
'',
317-
[ 'x', 1 ],
318-
[ 'y', 2 ],
319-
[ '__proto__', [ 'REF', 2 ] ] ] } },
320-
{ stdout: '',
321-
func_name: '',
322-
stack_to_render: [],
323-
globals:
324-
{ Vector: [ 'REF', 1 ],
325-
v1: [ 'REF', 4 ],
326-
v2: [ 'JS_SPECIAL_VAL', 'undefined' ],
327-
x: 20,
328-
y: 30 },
329-
ordered_globals: [ 'Vector', 'v1', 'v2', 'x', 'y' ],
330-
line: 11,
331-
col: 48,
332-
event: 'step_line',
247+
event: 'exception',
333248
heap:
334249
{ '1':
335250
[ 'JS_FUNCTION',

0 commit comments

Comments
 (0)