As you show, identifier after going through JS escaping is `\#identif\\\#ier\.` but that makes the parsed id `#identif\#ier.` (which actually means the javascript line would be

`var objectId = '#identif\\#ier.';`

Which causes the test to pass (I already switched it over to your new parsing code).