The problem is that you are using a constructor RegExpthat takes a string, and not using a regular expression literal. So, on this line in your unescape:
return string.replace(new RegExp('\\"', 'g'),'"');
... \\ JavaScript , . , , , \". - escape , \" ". , ; , ( ).
RegExp (, - ), :
var utility = {
escapeQuotes: function(string) {
return string.replace(/"/g, '\\"');
},
unescapeQuotes: function(string) {
return string.replace(/\\"/g, '"');
}
};
.