| 696 | |
| 697 | |
| 698 | function quote(string) { |
| 699 | |
| 700 | // If the string contains no control characters, no quote characters, and no |
| 701 | // backslash characters, then we can safely slap some quotes around it. |
| 702 | // Otherwise we must also replace the offending characters with safe escape |
| 703 | // sequences. |
| 704 | |
| 705 | escapable.lastIndex = 0; |
| 706 | return escapable.test(string) ? '"' + string.replace(escapable, function (a) { |
| 707 | var c = meta[a]; |
| 708 | return typeof c === 'string' ? c : |
| 709 | '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); |
| 710 | }) + '"' : '"' + string + '"'; |
| 711 | } |
| 712 | |
| 713 | |
| 714 | function str(key, holder) { |