babel/lib/6to5/transformation/transformers/spec/undefined-to-void.js
2015-01-23 23:02:40 +11:00

12 lines
256 B
JavaScript

"use strict";
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);
}
};