specifier.get('local').node, t.memberExpression( t.callExpression(t.identifier('require'), [path.get('source').node]), specifier.get('imported').node return t.variableDeclarator( specifier.get('local').node, t.callExpression(t.identifier('require'), [path.get('source').node]) ); } else { const addExportCall = t.callExpression(t.identifier('addExport'), [t.objectExpression(declarations)]); if (path.get('declaration')) { path.replaceWithMultiple([ path.get('declaration').node, t.callExpression(t.identifier('addExport'), [ t.objectExpression( path.get('declaration').get('declarations').map(d => t.objectProperty( path.replaceWith(t.callExpression(t.identifier('setExport'), [path.get('declaration').node]));
function wrapTryCatchInFunction(node) { const ret = wrapTryCatch(babelTypes.returnStatement(node)); const anonymousFun = babelTypes.functionExpression( null, [], babelTypes.blockStatement([ret])); return babelTypes.callExpression(anonymousFun, []); }
function callRandomFunction(path, identifier, seed) { if (seed === undefined) { seed = randomSeed(); } let args = [ identifier, _numericLiteral(seed) ]; args = args.map(_unwrapExpressionStatement); args = args.concat(randomArguments(path)); return babelTypes.callExpression( babelTypes.identifier('__callRandomFunction'), args); }
/** * Filter out disallowed V8 runtime functions. */ function neuterDisallowedV8Natives(ast) { babelTraverse(ast, { CallExpression(path) { if (!babelTypes.isIdentifier(path.node.callee) || !path.node.callee.name.startsWith(V8_BUILTIN_PREFIX)) { return; } const functionName = path.node.callee.name.substr( V8_BUILTIN_PREFIX.length); if (!exceptions.isAllowedRuntimeFunction(functionName)) { path.replaceWith(babelTypes.callExpression( babelTypes.identifier('nop'), [])); } } }); }
t.callExpression(t.identifier("require"), [ t.stringLiteral(`./${basename(outFile)}`), ])
t.variableDeclarator( t.identifier(replacementSetterName), t.callExpression(t.identifier("customSetVal"), [ stateSetter, t.stringLiteral(componentName),