Description
When using a negative index to remove, it will cause infinite loop.
const magicString = require('magic-string');
let s = ""
let ms = new magicString(s);
ms.remove(-2, -1);
console.log(map);
https://stackblitz.com/edit/stackblitz-starters-qxzkza?file=index.js
To reproduce it, run node index.js in the terminal.
Expect behaviour
it should throw error: Character is out of bounds
Description
When using a negative index to remove, it will cause infinite loop.
https://stackblitz.com/edit/stackblitz-starters-qxzkza?file=index.js
To reproduce it, run
node index.jsin the terminal.Expect behaviour
it should throw error: Character is out of bounds