()
| 495 | } |
| 496 | |
| 497 | scanTemplate() { |
| 498 | let tail = true; |
| 499 | let result = ''; |
| 500 | |
| 501 | while (this.next() !== /*`*/0x60) { |
| 502 | if (this.ch === /*$*/0x24) { |
| 503 | if ((this.idx + 1) < this.len && this.src.charCodeAt(this.idx + 1) === /*{*/0x7B) { |
| 504 | this.idx++; |
| 505 | tail = false; |
| 506 | break; |
| 507 | } else { |
| 508 | result += '$'; |
| 509 | } |
| 510 | } else if (this.ch === /*\*/0x5C) { |
| 511 | result += fromCharCode(unescape(this.next())); |
| 512 | } else if (this.ch === /*EOF*/0 || this.idx >= this.len) { |
| 513 | this.err('Unterminated template literal'); |
| 514 | } else { |
| 515 | result += fromCharCode(this.ch); |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | this.next(); |
| 520 | this.val = result; |
| 521 | if (tail) { |
| 522 | return T$TemplateTail; |
| 523 | } |
| 524 | return T$TemplateContinuation; |
| 525 | } |
| 526 | |
| 527 | scanTemplateTail() { |
| 528 | if (this.idx >= this.len) { |
no test coverage detected