Skip to content

Commit

Permalink
Revert ast-utils changes to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NotWoods committed Dec 18, 2019
1 parent c35ee4b commit 9560bfd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8,112 deletions.
6 changes: 3 additions & 3 deletions packages/commonjs/src/ast-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function isTruthy(node) {
if (node.type === 'Literal') return !!node.value;
if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);
if (node.operator in operators) return operators[node.operator](node);
return false;
return undefined;
}

export function isFalsy(node) {
Expand All @@ -91,8 +91,8 @@ function not(value) {
}

function equals(a, b, strict) {
if (a.type !== b.type) return false;
if (a.type !== b.type) return undefined;
// eslint-disable-next-line eqeqeq
if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;
return false;
return undefined;
}
1 change: 1 addition & 0 deletions packages/commonjs/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ test('produces optimized code when importing esm without a default export', asyn
const value = "value";
var esm = /*#__PURE__*/Object.freeze({
__proto__: null,
value: value
});
Expand Down
Loading

0 comments on commit 9560bfd

Please sign in to comment.