Can somebody please point out the error in this code?
function inspect(useDoubleQuotes) {
var escapedString = this.replace(/[\x00-\x1f\\]/g, function (character) {
if (character in String.specialChar) {
return String.specialChar[character]
}
return "\\u00" + character.charCodeAt().toPaddedString(2, 16)
});
if (useDoubleQuotes) {
return '"../' + escapedString.replace(/default.htm"/g, '\\"') + '"'
}
return "'../_+escapedString.replace(/default.htm'/g,"\\'")+"'"}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/" [ ^ "\\\n\r]*" / g, "");
return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)
}
Easy: you have two consecutive return statements at the end of your function. The first of which, I can’t read but I suspect is missing a
'just before the first+.EDIT: this is your error:
That means you missed out the
;at the end of the return statement here: