(str, quotationMark)
| 2438 | }; |
| 2439 | |
| 2440 | var convertStringToJSLiteral = function (str, quotationMark) { |
| 2441 | // assert(getType(str) === 'string'); |
| 2442 | // assert(quotationMark === '"' || quotationMark === "'"); |
| 2443 | str = JSON.stringify(str); // escapse \n\r or others. |
| 2444 | if (quotationMark === "'") { |
| 2445 | str = "'" + str.slice(1, str.length - 1).replace(/'/g, "\\'") + "'"; |
| 2446 | } |
| 2447 | return str; |
| 2448 | } |
| 2449 | |
| 2450 | /** |
| 2451 | * @usage |
no outgoing calls
no test coverage detected
searching dependent graphs…