|
89 | 89 | if (include(JS_FORBIDDEN, id)) { |
90 | 90 | if (forcedIdentifier) { |
91 | 91 | tag = 'STRING'; |
92 | | - id = ("\"" + id + "\""); |
| 92 | + id = ("\"" + (id) + "\""); |
93 | 93 | if (forcedIdentifier === 'accessor') { |
94 | 94 | close_index = true; |
95 | 95 | if (this.tag() !== '@') { |
|
146 | 146 | doc = this.sanitizeHeredoc(match[2] || match[4], { |
147 | 147 | quote: quote |
148 | 148 | }); |
149 | | - this.interpolateString(("" + quote + doc + quote), { |
| 149 | + this.interpolateString(quote + doc + quote, { |
150 | 150 | heredoc: true |
151 | 151 | }); |
152 | 152 | this.line += count(match[1], "\n"); |
|
204 | 204 | return '\\' + escaped; |
205 | 205 | }); |
206 | 206 | this.tokens = this.tokens.concat([['(', '('], ['NEW', 'new'], ['IDENTIFIER', 'RegExp'], ['CALL_START', '(']]); |
207 | | - this.interpolateString(("\"" + str + "\""), { |
| 207 | + this.interpolateString(("\"" + (str) + "\""), { |
208 | 208 | escapeQuotes: true |
209 | 209 | }); |
210 | 210 | if (flags) { |
211 | | - this.tokens.splice(this.tokens.length, 0, [',', ','], ['STRING', ("\"" + flags + "\"")]); |
| 211 | + this.tokens.splice(this.tokens.length, 0, [',', ','], ['STRING', ("\"" + (flags) + "\"")]); |
212 | 212 | } |
213 | 213 | this.tokens.splice(this.tokens.length, 0, [')', ')'], [')', ')']); |
214 | 214 | } else { |
|
377 | 377 | if (options.herecomment) { |
378 | 378 | return doc; |
379 | 379 | } |
380 | | - return doc.replace(MULTILINER, "\\n").replace(new RegExp(options.quote, 'g'), ("\\" + options.quote)); |
| 380 | + return doc.replace(MULTILINER, "\\n").replace(new RegExp(options.quote, 'g'), ("\\" + (options.quote))); |
381 | 381 | }; |
382 | 382 | Lexer.prototype.tagParameters = function() { |
383 | 383 | var _d, i, tok; |
|
405 | 405 | return this.outdentToken(this.indent); |
406 | 406 | }; |
407 | 407 | Lexer.prototype.identifierError = function(word) { |
408 | | - throw new Error(("SyntaxError: Reserved word \"" + word + "\" on line " + (this.line + 1))); |
| 408 | + throw new Error(("SyntaxError: Reserved word \"" + (word) + "\" on line " + (this.line + 1))); |
409 | 409 | }; |
410 | 410 | Lexer.prototype.assignmentError = function() { |
411 | 411 | throw new Error(("SyntaxError: Reserved word \"" + (this.value()) + "\" on line " + (this.line + 1) + " can't be assigned")); |
|
476 | 476 | interp = ("this." + (interp.substring(1))); |
477 | 477 | } |
478 | 478 | if (pi < i) { |
479 | | - tokens.push(['STRING', ("" + quote + (str.substring(pi, i)) + quote)]); |
| 479 | + tokens.push(['STRING', quote + str.substring(pi, i) + quote]); |
480 | 480 | } |
481 | 481 | tokens.push(['IDENTIFIER', interp]); |
482 | 482 | i += group.length - 1; |
483 | 483 | pi = i + 1; |
484 | 484 | } else if ((expr = this.balancedString(str.substring(i), [['#{', '}']]))) { |
485 | 485 | if (pi < i) { |
486 | | - tokens.push(['STRING', ("" + quote + (str.substring(pi, i)) + quote)]); |
| 486 | + tokens.push(['STRING', quote + str.substring(pi, i) + quote]); |
487 | 487 | } |
488 | 488 | inner = expr.substring(2, expr.length - 1); |
489 | 489 | if (inner.length) { |
490 | 490 | if (options.heredoc) { |
491 | 491 | inner = inner.replace(new RegExp('\\\\' + quote, 'g'), quote); |
492 | 492 | } |
493 | | - nested = lexer.tokenize(("(" + inner + ")"), { |
| 493 | + nested = lexer.tokenize(("(" + (inner) + ")"), { |
494 | 494 | line: this.line |
495 | 495 | }); |
496 | 496 | _f = nested; |
|
501 | 501 | nested.pop(); |
502 | 502 | tokens.push(['TOKENS', nested]); |
503 | 503 | } else { |
504 | | - tokens.push(['STRING', ("" + quote + quote)]); |
| 504 | + tokens.push(['STRING', quote + quote]); |
505 | 505 | } |
506 | 506 | i += expr.length - 1; |
507 | 507 | pi = i + 1; |
508 | 508 | } |
509 | 509 | i += 1; |
510 | 510 | } |
511 | 511 | if (pi < i && pi < str.length - 1) { |
512 | | - tokens.push(['STRING', ("" + quote + (str.substring(pi, i)) + quote)]); |
| 512 | + tokens.push(['STRING', quote + str.substring(pi, i) + quote]); |
513 | 513 | } |
514 | 514 | if (!(tokens[0][0] === 'STRING')) { |
515 | 515 | tokens.unshift(['STRING', '""']); |
|
528 | 528 | this.tokens = this.tokens.concat(value); |
529 | 529 | } else if (tag === 'STRING' && options.escapeQuotes) { |
530 | 530 | escaped = value.substring(1, value.length - 1).replace(/"/g, '\\"'); |
531 | | - this.token(tag, ("\"" + escaped + "\"")); |
| 531 | + this.token(tag, ("\"" + (escaped) + "\"")); |
532 | 532 | } else { |
533 | 533 | this.token(tag, value); |
534 | 534 | } |
|
0 commit comments