You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(function(){
// not call function, should delete.
function nfn1(){
console.log("not use1");
}
// not use object ,should delete.
var nobj = {};
// not call function, should delete.
nobj.m = function(){
console.log("not use2");
}
var flag = false;
if (flag==true){
console.log("not use3");
}
function kNew(){
return {};
}
var gObj = null;
function kGetDefault(){
if (gObj === null){
gObj = kNew();
}
return gObj;
}
function kSetDefault(ke){
gObj = ke;
}
// /////////
// should remain test:
function uobj(){
console.log("use 3");
}
// export api,must in the source code.
window["abc"] = function(){
console.log("use 1");
}
// direct run code, must in the output code
console.log("use 2");
uobj();
})();
There's no specification violation here, but the gObj variable could be optimized away as an enhancement (probably extra dead-code passes would be needed).
I have all done the test with http://babeljs.io/repl it says babel 6.x
input :
output:
What is the
var h = null;
stuff?The text was updated successfully, but these errors were encountered: