From 9cdb24157e7f063fe2e0bc10ad6f0cf292e14a13 Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Wed, 6 Jul 2016 21:58:02 -0400 Subject: [PATCH] Remove unused Position#unshift Not only is it unused, it'll break things if you push a newline since it doesn't set a new `#column` value. --- packages/babel-generator/src/position.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/packages/babel-generator/src/position.js b/packages/babel-generator/src/position.js index de03687185..09283868d5 100644 --- a/packages/babel-generator/src/position.js +++ b/packages/babel-generator/src/position.js @@ -25,18 +25,4 @@ export default class Position { } } } - - /** - * Unshift a string from the current position, mantaining the current line and column. - */ - - unshift(str: string): void { - for (let i = 0; i < str.length; i++) { - if (str[i] === "\n") { - this.line--; - } else { - this.column--; - } - } - } }