TypeScript/tests/cases/compiler/nestedGlobalNamespaceInClass.ts
Nathan Shively-Sanders 95a124f802
Fix crash on bad namespace parse (#37626)
* Fix crash on bad namespace parse

`global` inside a class body is parsed as a module declaration, and in
the following example has no body:

```ts
class C {
  global x
}
```

`x` is parsed as a separate ExpressionStatement. This caused a crash in
emit because the code didn't expect a module declaration with no body.

* inline node.body variable

* fix missed references to body
2020-04-01 15:05:49 -07:00

5 lines
59 B
TypeScript

// should not crash - from #35717
class C {
global x
}