Skip to content

Commit aa330fe

Browse files
committed
work
1 parent 2c778e5 commit aa330fe

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[
2+
{
3+
"name": "emcc$defun$arrowed",
4+
"reaches": [],
5+
"root": true
6+
},
7+
{
8+
"name": "emcc$defun$bar",
9+
"reaches": [],
10+
"root": true
11+
},
12+
{
13+
"name": "emcc$defun$caller",
14+
"reaches": [
15+
"emcc$defun$foo"
16+
],
17+
"root": true
18+
},
19+
{
20+
"name": "emcc$defun$foo",
21+
"reaches": []
22+
}
23+
]
24+

test/js_optimizer/emitDCEGraph6.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
function foo() {}
3+
4+
function bar() {}
5+
6+
// caller() calls foo(). There is also another function called "caller", down
7+
// below, which should not confuse us (if it does, nothing would refer to foo,
8+
// and instead we'd think the toplevel caller calls bar).
9+
function caller() {
10+
foo();
11+
}
12+
13+
caller();
14+
15+
var object = {
16+
method() {
17+
function caller(data) {
18+
bar();
19+
}
20+
}
21+
};
22+
23+
// Similar, with an arrow function. This should also not confuse us (it would
24+
// make "caller" refer to "arrowed".
25+
26+
function arrowed() {}
27+
28+
var arrow = () => {
29+
function caller(data) {
30+
arrowed();
31+
}
32+
}
33+
34+
wasmImports = {};
35+

0 commit comments

Comments
 (0)