Author Topic: Beautify Javascript changes string  (Read 139 times)

guth

  • Community Member
  • Posts: 27
  • Hero Points: 1
Beautify Javascript changes string
« on: May 06, 2017, 07:18:50 pm »
I beautified a js file and didn't notice first that citation delimited strings were changed, some spacing where added inside these strings. I don't think beatification shall change the contents of a string. I'm on 21.0.2 64-bit windows.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 729
  • Hero Points: 32
Re: Beautify Javascript changes string
« Reply #1 on: May 08, 2017, 01:07:24 pm »
Odd.  Can you make an example file that the beautifier does this to?  I haven't managed to make it happen so far, I'm probably doing something differently than you.

guth

  • Community Member
  • Posts: 27
  • Hero Points: 1
Re: Beautify Javascript changes string
« Reply #2 on: May 08, 2017, 06:50:13 pm »
Here is one example where the last string will be beautified incorrectly.

var re = new RegExp("A([/\\\\])\1*T([/\\\\])\2*S([/\\\\])\3*", "ig");
if(text === "") text = "[ {p: 'E', c: 0}]";

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 729
  • Hero Points: 32
Re: Beautify Javascript changes string
« Reply #3 on: May 08, 2017, 09:00:22 pm »
Reproduced it.  It's not hot-fixable, but it's been fixed for the 21.0.3 point release, which will be coming out pretty soon.  Thanks for the report, that was a tricky one to trigger.