esrap 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/handlers.js +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esrap",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Parse in reverse",
5
5
  "repository": {
6
6
  "type": "git",
package/src/handlers.js CHANGED
@@ -408,6 +408,8 @@ const shared = {
408
408
  * @param {import('./types').State} state
409
409
  */
410
410
  'BlockStatement|ClassBody': (node, state) => {
411
+ if (node.body.length === 0) return [c('{}')];
412
+
411
413
  return [
412
414
  c(`{\n${state.indent}\t`),
413
415
  ...handle_body(node.body, { ...state, indent: state.indent + '\t' }),