How to use the isMemberExpression function from babel-types
Find comprehensive JavaScript babel-types.isMemberExpression code examples handpicked from public code repositorys.
33 34 35 36 37 38 39 40 41 42
); out_file.write('/*\n *\n * https://www.w3.org/Style/CSS/all-properties.en.html\n */\n\n'); function isModuleDotExports(node) { return ( t.isMemberExpression(node, { computed: false }) && t.isIdentifier(node.object, { name: 'module' }) && t.isIdentifier(node.property, { name: 'exports' }) ); }
59
89
10
+ 77 other calls in file
GitHub: pugjs/then-pug
110 111 112 113 114 115 116 117 118 119
Compiler.prototype.ast_postprocess = function(ast) { let needCompaction = function(c) { return t.isExpressionStatement(c) && t.isCallExpression(c.expression) && t.isMemberExpression(c.expression.callee) && t.isIdentifier(c.expression.callee.object) && c.expression.callee.object.name === 'buf' && t.isIdentifier(c.expression.callee.property) && c.expression.callee.property.name === 'push'
5
43
0
+ 7 other calls in file
39 40 41 42 43 44 45 46 47
const parts = Array.isArray(match) ? match : match.split('.'); const nodes = []; let node; for (node = member; babelTypes.isMemberExpression(node); node = node.object) { nodes.push(node.property); } nodes.push(node);
0
49
1
+ 5 other calls in file
GitHub: btd/documentation
143 144 145 146 147 148 149 150 151 152
* Deal with an oddity of espree: the jsdoc comment is attached to a different * node in the two expressions `a.b = c` vs `a.b = function () {}`. */ if (n.isExpressionStatement(path.node) && n.isAssignmentExpression(path.node.expression) && n.isMemberExpression(path.node.expression.left)) { path = path.get('expression').get('left'); } /*
510
0
2
+ 3 other calls in file
17 18 19 20 21 22 23 24 25 26
function match(path, ctx, explicitOnly) { const node = path.node; const isMethodCall = ( t.isCallExpression(node) && t.isMemberExpression(node.callee) && node.callee.computed === false ); if(isMethodCall && ngInject.inspectComment(path, ctx)){
156
0
2
+ 11 other calls in file
39 40 41 42 43 44 45 46 47 48
(attr, idx) => { if (t.isJSXSpreadAttribute(attr)) { invariant( // only allow member expressions and identifiers to be spread for now t.isIdentifier(attr.argument) || t.isMemberExpression(attr.argument), 'Unhandled spread operator value of type `%s` (`%s`)', attr.argument.type, generate(attr).code );
62
0
2
+ 5 other calls in file
25 26 27 28 29 30 31 32 33 34
out_file.write('\'use strict\';\n\n// autogenerated\n\n'); out_file.write('/*\n *\n * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties\n */\n\n'); function isModuleDotExports(node) { return ( t.isMemberExpression(node, {computed: false}) && t.isIdentifier(node.object, {name: 'module'}) && t.isIdentifier(node.property, {name: 'exports'}) ); }
20
50
8
+ 5 other calls in file
GitHub: MarshallOfSound/parcel
214 215 216 217 218 219
} // If we can statically evaluate the name of a CommonJS export, create an ES6-style export for it. // This allows us to remove the CommonJS export object completely in many cases. if ( t.isMemberExpression(left) &&
0
1
3
+ 9 other calls in file
GitHub: bluepeople1/mpx
36 37 38 39 40 41 42 43 44 45
CallExpression: { enter (path) { const callee = path.node.callee const args = path.node.arguments if ( t.isMemberExpression(callee) && t.isThisExpression(callee.object) && (callee.property.name === '__travel' || callee.property.value === '__travel') && t.isBooleanLiteral(args[2]) && args[2].value === true
349
0
0
+ 5 other calls in file
GitHub: captainwz/react-pocket
139 140 141 142 143 144 145 146 147 148
}); } } } if (t.isCallExpression(p.node) && t.isMemberExpression(p.node.callee) && p.node.callee.object.name == 'ReactDOM' && p.node.callee.property.name == 'render' && t.isJSXElement(p.node.arguments[0])) { var el = p.node.arguments[0].openingElement; objArr.forEach(function (obj) {
1
11
1
+ 7 other calls in file
GitHub: captainwz/react-pocket
163 164 165 166 167 168 169 170 171
} } if (t.isCallExpression(p.node) && t.isMemberExpression(p.node.callee) && p.node.callee.object.name == 'ReactDOM' && p.node.callee.property.name == 'render' && t.isJSXElement(p.node.arguments[0])) {
1
11
1
+ 3 other calls in file
270 271 272 273 274 275 276 277 278 279
} const expr = t.list([t.symbol("set!"), next(ast.left), next(ast.right)]); if ( bt.isMemberExpression(ast.left) && utils.isNestedThisExpression(ast.left) ) { utils.alterNestedThisExpression("that", ast.left); return THIS_AS("that", [expr]);
5
91
0
185 186 187 188 189 190 191 192 193 194
// Change displayName let displayNameExpression = ast.program.body.find( stmt => types.isExpressionStatement(stmt) && types.isAssignmentExpression(stmt.expression) && types.isMemberExpression(stmt.expression.left) && stmt.expression.left.object.name === 'newComponent' ).expression; displayNameExpression.left.object.name = this._componentName;
0
2
0
+ 3 other calls in file
GitHub: t-mart/gvd
66 67 68 69 70 71 72 73 74 75 76
t.isRegExpLiteral(n); function simplifyCharCodeAt(path) { var node = path.node; var charCodeCallExprNode = (t.isCallExpression(node.left) && t.isMemberExpression(node.left.callee) && t.isIdentifier(node.left.callee.property) && node.left.callee.property.name === 'charCodeAt') ? node.left : (t.isCallExpression(node.right)
0
1
2
+ 5 other calls in file
GitHub: schempy/platelunch
238 239 240 241 242 243 244 245 246 247
VariableDeclarator: path => { variables = [...variables, path.node.id.name]; }, AssignmentExpression: path => { if (path.node.operator === "=" && t.isMemberExpression(path.node.left)) { if (t.isThisExpression(path.node.left.object)) { members = [...members, path.node.left.property.name]; } }
2
0
0
GitHub: tadasant/parcel
95 96 97 98 99 100 101 102 103 104
// redeclared in this scope if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return; if (path.parentPath.isCallExpression({callee: path.node})) { path.replaceWith(t.sequenceExpression([t.numericLiteral(0), remap])); } else if (path.isJSXIdentifier() && t.isMemberExpression(remap)) { const {object, property} = remap; path.replaceWith( t.JSXMemberExpression( t.JSXIdentifier(object.name),
0
0
3
+ 19 other calls in file
GitHub: arif98741/parcel
73 74 75 76 77 78 79 80 81 82
const parts = Array.isArray(match) ? match : match.split('.'); const nodes = []; let node; for (node = member; types.isMemberExpression(node); node = node.object) { nodes.push(node.property); } nodes.push(node);
0
0
2
+ 11 other calls in file
babel-types.identifier is the most popular function in babel-types (4076 examples)