Fix JS DCE removing reachable functions

This commit is contained in:
Alexey Andreev
2017-10-09 20:12:03 +03:00
parent cb7d561c6c
commit 8cdef4139e
11 changed files with 108 additions and 13 deletions
+17
View File
@@ -0,0 +1,17 @@
(function(_) {
var x = {};
function foo() {
return x["bar"]();
}
x.bar = function() {
return "bar";
};
x.baz = function() {
return "baz";
};
_.foo = foo;
})(module.exports);
// REQUEST_REACHABLE: main.foo
// ASSERT_REACHABLE: x.bar
// ASSERT_UNREACHABLE: x.baz