From ca1c4bba868baeaae783a4155b6c8beec8774208 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Thu, 21 Jan 2016 22:45:10 -0800 Subject: [PATCH] Fix naming (s/node/path/g) --- .../src/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/babel-plugin-transform-react-jsx-source/src/index.js b/packages/babel-plugin-transform-react-jsx-source/src/index.js index 6ebbdc4b57..c1cfae6fd7 100644 --- a/packages/babel-plugin-transform-react-jsx-source/src/index.js +++ b/packages/babel-plugin-transform-react-jsx-source/src/index.js @@ -27,22 +27,22 @@ export default function ({ types: t }) { } let visitor = { - JSXOpeningElement(node, state) { + JSXOpeningElement(path, state) { if (!state.fileNameIdentifier) { const fileName = state.file.log.filename !== "unknown" ? state.file.log.filename : null; - const fileNameIdentifier = node.scope.generateUidIdentifier(FILE_NAME_VAR); - node.hub.file.scope.push({id: fileNameIdentifier, init: t.stringLiteral(fileName)}); + const fileNameIdentifier = path.scope.generateUidIdentifier(FILE_NAME_VAR); + path.hub.file.scope.push({id: fileNameIdentifier, init: t.stringLiteral(fileName)}); state.fileNameIdentifier = fileNameIdentifier; } const id = t.jSXIdentifier(TRACE_ID); - const location = node.container.openingElement.loc; // undefined for generated elements + const location = path.container.openingElement.loc; // undefined for generated elements if (location) { const trace = makeTrace(state.fileNameIdentifier, location.start.line); - node.container.openingElement.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace))); + path.container.openingElement.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace))); } } };