function _isChakraLoad(path) { // 'WScript.LoadScriptFile' used by Chakra. // TODO(ochang): The optional second argument can change semantics ("self", // "samethread", "crossthread" etc). // Investigate whether if it still makes sense to include them. return (babelTypes.isMemberExpression(path.node.callee) && babelTypes.isIdentifier(path.node.callee.property) && path.node.callee.property.name == 'LoadScriptFile' && path.node.arguments.length >= 1 && babelTypes.isStringLiteral(path.node.arguments[0])); }
// Wrap particular member expressions after `new` that are known to appear // in initializer lists of `let` and `const`. function replaceNewExpression(path) { const callee = path.node.callee; if (!babelTypes.isMemberExpression(callee) || !babelTypes.isIdentifier(callee.object) || !babelTypes.isIdentifier(callee.property)) { return; } if (WRAPPED_MEMBER_EXPRESSIONS.some( ([object, property]) => callee.object.name === object && callee.property.name === property)) { path.replaceWith(wrapTryCatchInFunction(path.node)); path.skip(); } }
Identifier(path, scope) { if (t.isMemberExpression(path.parentPath)) { return; } const { name } = path.node; if (scope.hasOwnBinding(name)) { throw path.buildCodeFrameError( `Expected \`${name}\` ` + `to not come from the closest scope.\n` + `Styled JSX encourages the use of constants ` + `instead of \`props\` or dynamic values ` + `which are better set via inline styles or \`className\` toggling. ` + `See https://github.com/zeit/styled-jsx#dynamic-styles` ); } }
function captureUsageOfImportedFunction(path) { const callee = _.get(path, 'node.callee'); if (t.isMemberExpression(callee)) {
if (babelTypes.isMemberExpression(left)) { thisMutator.printVariables(path, [left.object]); } else {
if (path.isIdentifier() || path.isMemberExpression() || path.isConditionalExpression() || path.isBinaryExpression() || path.isDoExpression() || if (!babelTypes.isMemberExpression(path.node.left)) {