- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
20 lines
511 B
JavaScript
20 lines
511 B
JavaScript
|
|
import {TokenType as tt} from "../parser/tokenizer/types";
|
|
|
|
import Transformer from "./Transformer";
|
|
|
|
export default class OptionalCatchBindingTransformer extends Transformer {
|
|
constructor( tokens, nameManager) {
|
|
super();this.tokens = tokens;this.nameManager = nameManager;;
|
|
}
|
|
|
|
process() {
|
|
if (this.tokens.matches2(tt._catch, tt.braceL)) {
|
|
this.tokens.copyToken();
|
|
this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|