|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
511 bytes
|
| Line | |
|---|
| 1 |
|
|---|
| 2 | import {TokenType as tt} from "../parser/tokenizer/types";
|
|---|
| 3 |
|
|---|
| 4 | import Transformer from "./Transformer";
|
|---|
| 5 |
|
|---|
| 6 | export default class OptionalCatchBindingTransformer extends Transformer {
|
|---|
| 7 | constructor( tokens, nameManager) {
|
|---|
| 8 | super();this.tokens = tokens;this.nameManager = nameManager;;
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | process() {
|
|---|
| 12 | if (this.tokens.matches2(tt._catch, tt.braceL)) {
|
|---|
| 13 | this.tokens.copyToken();
|
|---|
| 14 | this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`);
|
|---|
| 15 | return true;
|
|---|
| 16 | }
|
|---|
| 17 | return false;
|
|---|
| 18 | }
|
|---|
| 19 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.