@babel/generator
Advanced tools
Comparing version 7.22.5 to 7.22.7
@@ -259,7 +259,7 @@ "use strict"; | ||
if (!this._map) return; | ||
this._normalizePosition(prop, loc, 0, 0); | ||
this._normalizePosition(prop, loc, 0); | ||
} | ||
sourceWithOffset(prop, loc, lineOffset, columnOffset) { | ||
sourceWithOffset(prop, loc, columnOffset) { | ||
if (!this._map) return; | ||
this._normalizePosition(prop, loc, lineOffset, columnOffset); | ||
this._normalizePosition(prop, loc, columnOffset); | ||
} | ||
@@ -272,8 +272,8 @@ withSource(prop, loc, cb) { | ||
} | ||
_normalizePosition(prop, loc, lineOffset, columnOffset) { | ||
_normalizePosition(prop, loc, columnOffset) { | ||
const pos = loc[prop]; | ||
const target = this._sourcePosition; | ||
if (pos) { | ||
target.line = pos.line + lineOffset; | ||
target.column = pos.column + columnOffset; | ||
target.line = pos.line; | ||
target.column = Math.max(pos.column + columnOffset, 0); | ||
target.filename = loc.filename; | ||
@@ -280,0 +280,0 @@ } |
@@ -55,3 +55,3 @@ "use strict"; | ||
} | ||
this.sourceWithOffset("end", node.loc, 0, -1); | ||
this.sourceWithOffset("end", node.loc, -1); | ||
this.tokenChar(125); | ||
@@ -58,0 +58,0 @@ } |
@@ -76,7 +76,7 @@ "use strict"; | ||
} | ||
this.sourceWithOffset("end", node.loc, 0, -1); | ||
this.sourceWithOffset("end", node.loc, -1); | ||
this.tokenChar(125); | ||
} | ||
rightParens(node) { | ||
this.sourceWithOffset("end", node.loc, 0, -1); | ||
this.sourceWithOffset("end", node.loc, -1); | ||
this.tokenChar(41); | ||
@@ -171,6 +171,6 @@ } | ||
} | ||
sourceWithOffset(prop, loc, lineOffset, columnOffset) { | ||
sourceWithOffset(prop, loc, columnOffset) { | ||
if (!loc) return; | ||
this._catchUp(prop, loc); | ||
this._buf.sourceWithOffset(prop, loc, lineOffset, columnOffset); | ||
this._buf.sourceWithOffset(prop, loc, columnOffset); | ||
} | ||
@@ -177,0 +177,0 @@ withSource(prop, loc, cb) { |
{ | ||
"name": "@babel/generator", | ||
"version": "7.22.5", | ||
"version": "7.22.7", | ||
"description": "Turns an AST into code.", | ||
@@ -28,4 +28,5 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
"devDependencies": { | ||
"@babel/helper-fixtures": "^7.22.5", | ||
"@babel/parser": "^7.22.5", | ||
"@babel/helper-fixtures": "^7.22.6", | ||
"@babel/parser": "^7.22.7", | ||
"@jridgewell/sourcemap-codec": "^1.4.15", | ||
"@types/jsesc": "^2.5.0", | ||
@@ -32,0 +33,0 @@ "charcodes": "^0.2.0" |
@@ -5,3 +5,3 @@ # @babel/generator | ||
See our website [@babel/generator](https://babeljs.io/docs/en/babel-generator) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package. | ||
See our website [@babel/generator](https://babeljs.io/docs/babel-generator) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package. | ||
@@ -8,0 +8,0 @@ ## Install |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
24
485479
5