(c)
| 1079 | } |
| 1080 | |
| 1081 | function formatChar (c) { |
| 1082 | const replacements = { |
| 1083 | "'": "\\'", |
| 1084 | '"': '\\"', |
| 1085 | '\\': '\\\\', |
| 1086 | '\b': '\\b', |
| 1087 | '\f': '\\f', |
| 1088 | '\n': '\\n', |
| 1089 | '\r': '\\r', |
| 1090 | '\t': '\\t', |
| 1091 | '\v': '\\v', |
| 1092 | '\0': '\\0', |
| 1093 | '\u2028': '\\u2028', |
| 1094 | '\u2029': '\\u2029', |
| 1095 | } |
| 1096 | |
| 1097 | if (replacements[c]) { |
| 1098 | return replacements[c] |
| 1099 | } |
| 1100 | |
| 1101 | if (c < ' ') { |
| 1102 | const hexString = c.charCodeAt(0).toString(16) |
| 1103 | return '\\x' + ('00' + hexString).substring(hexString.length) |
| 1104 | } |
| 1105 | |
| 1106 | return c |
| 1107 | } |
| 1108 | |
| 1109 | function syntaxError (message) { |
| 1110 | const err = new SyntaxError(message) |
no outgoing calls
no test coverage detected
searching dependent graphs…