Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Commit

Permalink
Don't use for-of. Should fix gaearon/react-transform-boilerplate#32
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Sep 24, 2015
1 parent 63b5f51 commit 14de68d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ export default function ({ Plugin, types: t }) {
function buildIsCreateClassCallExpression(factoryMethods) {
const matchMemberExpressions = {};

for (const method of factoryMethods) {
factoryMethods.forEach(method => {
matchMemberExpressions[method] = t.buildMatchMemberExpression(method);
}
});

return node => {
for (const method of factoryMethods) {
for (let i = 0; i < factoryMethods.length; i++) {
const method = factoryMethods[i];
if (method.indexOf('.') !== -1) {
if (matchMemberExpressions[method](node.callee)) {
return true;
Expand Down

0 comments on commit 14de68d

Please sign in to comment.