Skip to content

Commit 9279bcb

Browse files
committed
added
1 parent 71ad662 commit 9279bcb

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{ code: 'function foo() {\n return \'hello\';\n}\n\n// display ordinary properties of functions\nfoo.prop1 = 42;\nfoo.prop2 = \'why?\';\n\nconsole.log(foo.prop1, foo.prop2);',
2+
trace:
3+
[ { stdout: '',
4+
func_name: '',
5+
stack_to_render: [],
6+
globals: { foo: [ 'REF', 1 ] },
7+
ordered_globals: [ 'foo' ],
8+
line: 6,
9+
col: 0,
10+
event: 'step_line',
11+
heap:
12+
{ '1':
13+
[ 'JS_FUNCTION',
14+
'foo',
15+
'function foo() {\n return \'hello\';\n}',
16+
null,
17+
null ] } },
18+
{ stdout: '',
19+
func_name: '',
20+
stack_to_render: [],
21+
globals: { foo: [ 'REF', 1 ] },
22+
ordered_globals: [ 'foo' ],
23+
line: 7,
24+
col: 0,
25+
event: 'step_line',
26+
heap:
27+
{ '1':
28+
[ 'JS_FUNCTION',
29+
'foo',
30+
'function foo() {\n return \'hello\';\n}',
31+
[ [ 'prop1', 42 ] ],
32+
null ] } },
33+
{ stdout: '',
34+
func_name: '',
35+
stack_to_render: [],
36+
globals: { foo: [ 'REF', 1 ] },
37+
ordered_globals: [ 'foo' ],
38+
line: 9,
39+
col: 0,
40+
event: 'step_line',
41+
heap:
42+
{ '1':
43+
[ 'JS_FUNCTION',
44+
'foo',
45+
'function foo() {\n return \'hello\';\n}',
46+
[ [ 'prop1', 42 ], [ 'prop2', 'why?' ] ],
47+
null ] } },
48+
{ stdout: '42 \'why?\'\n',
49+
func_name: '',
50+
stack_to_render: [],
51+
globals: { foo: [ 'REF', 1 ] },
52+
ordered_globals: [ 'foo' ],
53+
line: 9,
54+
col: 34,
55+
event: 'step_line',
56+
heap:
57+
{ '1':
58+
[ 'JS_FUNCTION',
59+
'foo',
60+
'function foo() {\n return \'hello\';\n}',
61+
[ [ 'prop1', 42 ], [ 'prop2', 'why?' ] ],
62+
null ] } } ] }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function foo() {
2+
return 'hello';
3+
}
4+
5+
// display ordinary properties of functions
6+
foo.prop1 = 42;
7+
foo.prop2 = 'why?';
8+
9+
console.log(foo.prop1, foo.prop2);

0 commit comments

Comments
 (0)