Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinmombay committed Jul 17, 2019
1 parent 782b858 commit e4910be
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ module.exports = function(babel) {
const {parenthesized} = node.extra || {};

const isDirectCallExpression =
t.isIdentifier(callee, {name: 'devAssert'}) ||
t.isIdentifier(callee, {name: 'userAssert'});
t.isIdentifier(callee, {name: 'devAssert'});
const isMemberAndCallExpression =
t.isMemberExpression(callee) && t.isCallExpression(callee.object);

Expand Down Expand Up @@ -92,16 +91,6 @@ module.exports = function(babel) {
type = typeMap[property.name];
}

// If the CallExpression's direct parent is a ExpressionStatement
// we can remove the whole call. Closure Compiler doesn't seem to
// DCE the arguments that we leave behind even though they might be
// raw strings without any side effects.
const isParentDirectExpStatement = t.isExpressionStatement(path.parent);
if (isParentDirectExpStatement) {
path.remove();
return;
}

if (args) {
if (parenthesized) {
path.replaceWith(t.parenthesizedExpression(args));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
1 + 1;
2 + 2;
undefined;
let result = dev();
let result2 = undefined;
userAssert(1 + 1);
userAssert(2 + 2);
userAssert();
let result = userAssert(dev(), 'hello', 'world');
let result2 = userAssert();

0 comments on commit e4910be

Please sign in to comment.