Skip to content

Commit

Permalink
refactor(ses): update Hermes transform
Browse files Browse the repository at this point in the history
  • Loading branch information
leotm committed Aug 19, 2024
1 parent e4af84a commit 1ed84e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ses/scripts/hermesTransforms.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// @ts-nocheck XXX Babel types
/* eslint-disable import/no-extraneous-dependencies */
import { parse } from '@babel/parser';
import babelGenerate from '@agoric/babel-generator';
import babelTraverse from '@babel/traverse';
import * as t from '@babel/types';

// @ts-expect-error TS2339 Property 'default' does not exist
const traverse = babelTraverse.default || babelTraverse;
const generate = babelGenerate.default || babelGenerate;

const decoder = new TextDecoder('utf-8');
// @ts-expect-error TS2554 Expected 0 arguments, but got 1
const encoder = new TextEncoder('utf-8');

const asyncArrowEliminator = {
Expand Down Expand Up @@ -56,6 +57,7 @@ export const hermesTransforms = {
traverse(ast, transforms);

const { code } = generate(ast, {
// Nothing being done with sourcemaps as this point
retainLines: true,
compact: true,
verbatim: true,
Expand Down

0 comments on commit 1ed84e1

Please sign in to comment.