bloomberg / bloomberg/pasta-sourcemaps

Support class static blocks

Open
#46 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
184
Forks
10
PR merge metrics
No merged PRs in 30d

Description

The [class static blocks proposal](https://github.com/tc39/proposal-class-static-block) introduces a new lexical scope nested within a `class` body:

```ts
class C {
static {
throw new Error("foo");
}
}
```

`typescript@4.4.0-beta` has implemented this (currently) Stage 3 proposal. [playground](https://www.typescriptlang.org/play?useDefineForClassFields=true&target=7&jsx=0&ts=4.4.0-beta#code/MYGwhgzhAEDC0G8BQ1oQC5nQS2Ilq06AFgE4D2A7tAHYCm1AoqRaQBQBEAZueRwJQBuAgF8kIoA)

We should investigate what changes, if any, need to be made to pasta to support this feature.

---

This currently shows in Chrome console:

```
VM56:3 Uncaught Error: foo
at (:3:15)
at :1:1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.