@babel/plugin-transform-react-jsx-source
Advanced tools
Comparing version 7.0.0-beta.43 to 7.0.0-beta.44
@@ -9,5 +9,5 @@ "use strict"; | ||
function _helperPluginUtils() { | ||
const data = require("@babel/helper-plugin-utils"); | ||
var data = require("@babel/helper-plugin-utils"); | ||
_helperPluginUtils = function () { | ||
_helperPluginUtils = function _helperPluginUtils() { | ||
return data; | ||
@@ -20,5 +20,5 @@ }; | ||
function _core() { | ||
const data = require("@babel/core"); | ||
var data = require("@babel/core"); | ||
_core = function () { | ||
_core = function _core() { | ||
return data; | ||
@@ -30,14 +30,14 @@ }; | ||
const TRACE_ID = "__source"; | ||
const FILE_NAME_VAR = "_jsxFileName"; | ||
var TRACE_ID = "__source"; | ||
var FILE_NAME_VAR = "_jsxFileName"; | ||
var _default = (0, _helperPluginUtils().declare)(api => { | ||
var _default = (0, _helperPluginUtils().declare)(function (api) { | ||
api.assertVersion(7); | ||
function makeTrace(fileNameIdentifier, lineNumber) { | ||
const fileLineLiteral = lineNumber != null ? _core().types.numericLiteral(lineNumber) : _core().types.nullLiteral(); | ||
var fileLineLiteral = lineNumber != null ? _core().types.numericLiteral(lineNumber) : _core().types.nullLiteral(); | ||
const fileNameProperty = _core().types.objectProperty(_core().types.identifier("fileName"), fileNameIdentifier); | ||
var fileNameProperty = _core().types.objectProperty(_core().types.identifier("fileName"), fileNameIdentifier); | ||
const lineNumberProperty = _core().types.objectProperty(_core().types.identifier("lineNumber"), fileLineLiteral); | ||
var lineNumberProperty = _core().types.objectProperty(_core().types.identifier("lineNumber"), fileLineLiteral); | ||
@@ -47,7 +47,7 @@ return _core().types.objectExpression([fileNameProperty, lineNumberProperty]); | ||
const visitor = { | ||
JSXOpeningElement(path, state) { | ||
const id = _core().types.jsxIdentifier(TRACE_ID); | ||
var visitor = { | ||
JSXOpeningElement: function JSXOpeningElement(path, state) { | ||
var id = _core().types.jsxIdentifier(TRACE_ID); | ||
const location = path.container.openingElement.loc; | ||
var location = path.container.openingElement.loc; | ||
@@ -58,6 +58,6 @@ if (!location) { | ||
const attributes = path.container.openingElement.attributes; | ||
var attributes = path.container.openingElement.attributes; | ||
for (let i = 0; i < attributes.length; i++) { | ||
const name = attributes[i].name; | ||
for (var i = 0; i < attributes.length; i++) { | ||
var name = attributes[i].name; | ||
@@ -70,4 +70,4 @@ if (name && name.name === TRACE_ID) { | ||
if (!state.fileNameIdentifier) { | ||
const fileName = state.filename || ""; | ||
const fileNameIdentifier = path.scope.generateUidIdentifier(FILE_NAME_VAR); | ||
var fileName = state.filename || ""; | ||
var fileNameIdentifier = path.scope.generateUidIdentifier(FILE_NAME_VAR); | ||
path.hub.file.scope.push({ | ||
@@ -80,9 +80,8 @@ id: fileNameIdentifier, | ||
const trace = makeTrace(state.fileNameIdentifier, location.start.line); | ||
var trace = makeTrace(state.fileNameIdentifier, location.start.line); | ||
attributes.push(_core().types.jsxAttribute(id, _core().types.jsxExpressionContainer(trace))); | ||
} | ||
}; | ||
return { | ||
visitor | ||
visitor: visitor | ||
}; | ||
@@ -89,0 +88,0 @@ }); |
{ | ||
"name": "@babel/plugin-transform-react-jsx-source", | ||
"version": "7.0.0-beta.43", | ||
"version": "7.0.0-beta.44", | ||
"description": "Add a __source prop to all JSX Elements", | ||
@@ -12,12 +12,12 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source", | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "7.0.0-beta.43", | ||
"@babel/plugin-syntax-jsx": "7.0.0-beta.43" | ||
"@babel/helper-plugin-utils": "7.0.0-beta.44", | ||
"@babel/plugin-syntax-jsx": "7.0.0-beta.44" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "7.0.0-beta.43" | ||
"@babel/core": "7.0.0-beta.44" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.43", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.43" | ||
"@babel/core": "7.0.0-beta.44", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.44" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3504
+ Added@babel/code-frame@7.0.0-beta.44(transitive)
+ Added@babel/core@7.0.0-beta.44(transitive)
+ Added@babel/generator@7.0.0-beta.44(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.44(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.44(transitive)
+ Added@babel/helper-plugin-utils@7.0.0-beta.44(transitive)
+ Added@babel/helper-split-export-declaration@7.0.0-beta.44(transitive)
+ Added@babel/helpers@7.0.0-beta.44(transitive)
+ Added@babel/highlight@7.0.0-beta.44(transitive)
+ Added@babel/plugin-syntax-jsx@7.0.0-beta.44(transitive)
+ Added@babel/template@7.0.0-beta.44(transitive)
+ Added@babel/traverse@7.0.0-beta.44(transitive)
+ Added@babel/types@7.0.0-beta.44(transitive)
+ Addedbabylon@7.0.0-beta.44(transitive)
- Removed@babel/code-frame@7.0.0-beta.43(transitive)
- Removed@babel/core@7.0.0-beta.43(transitive)
- Removed@babel/generator@7.0.0-beta.43(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.43(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.43(transitive)
- Removed@babel/helper-plugin-utils@7.0.0-beta.43(transitive)
- Removed@babel/helper-split-export-declaration@7.0.0-beta.43(transitive)
- Removed@babel/helpers@7.0.0-beta.43(transitive)
- Removed@babel/highlight@7.0.0-beta.43(transitive)
- Removed@babel/plugin-syntax-jsx@7.0.0-beta.43(transitive)
- Removed@babel/template@7.0.0-beta.43(transitive)
- Removed@babel/traverse@7.0.0-beta.43(transitive)
- Removed@babel/types@7.0.0-beta.43(transitive)
- Removedbabylon@7.0.0-beta.43(transitive)