Use unaryExpression for typeof
This commit is contained in:
@@ -39,8 +39,8 @@ UMDFormatter.prototype.transform = function (ast) {
|
||||
defineArgs = [t.arrayExpression(defineArgs)];
|
||||
|
||||
// typeof exports !== "undefined" && typeof module !== "undefined"
|
||||
var testExports = t.binaryExpression("!==", t.typeOfExpression(t.identifier("exports")), t.literal("undefined")),
|
||||
testModule = t.binaryExpression("!==", t.typeOfExpression(t.identifier("module")), t.literal("undefined")),
|
||||
var testExports = t.binaryExpression("!==", t.unaryExpression("typeof", t.identifier("exports"), true), t.literal("undefined")),
|
||||
testModule = t.binaryExpression("!==", t.unaryExpression("typeof", t.identifier("module"), true), t.literal("undefined")),
|
||||
commonTests = this.passModuleArg ? t.logicalExpression("&&", testExports, testModule) : testExports;
|
||||
|
||||
var commonArgs = [t.identifier("exports")];
|
||||
|
||||
Reference in New Issue
Block a user