add undefinedToVoid optional transformer
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
var t = require("../../types");
|
||||
|
||||
exports.optional = true;
|
||||
|
||||
exports.Identifier = function (node, parent) {
|
||||
if (node.name === "undefined" && t.isReferenced(node, parent)) {
|
||||
return t.unaryExpression("void", t.literal(0), true);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user