How to use the metaProperty function from @babel/types
Find comprehensive JavaScript @babel/types.metaProperty code examples handpicked from public code repositorys.
180 181 182 183 184 185 186 187 188 189
argumentsChild.replaceWith(argsRef); }); } if (newTargetPaths.length > 0) { const newTargetBinding = getBinding(thisEnvFn, "newtarget", () => t.metaProperty(t.identifier("new"), t.identifier("target"))); newTargetPaths.forEach(targetChild => { const targetRef = t.identifier(newTargetBinding); targetRef.loc = targetChild.node.loc; targetChild.replaceWith(targetRef);
0
1
1
+ 40 other calls in file
39 40 41 42 43 44 45 46 47 48
.map((token, i) => babelTypes.templateElement({ raw: token }, i === path.node.elements.length - 1) ), referenceIds.map(referenceId => babelTypes.memberExpression( babelTypes.metaProperty( babelTypes.identifier('import'), babelTypes.identifier('meta') ), babelTypes.identifier(`ROLLUP_FILE_URL_${referenceId}`)
0
0
2
+ 5 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)