TypeScript/tests/cases/conformance/salsa/requireTwoPropertyAccesses.ts
Nathan Shively-Sanders 55ca5e91b9
Fixes crash on chained property access on require (#40135)
From the user tests:

```js
const x = require('y').z.ka
```

would cause the crash because I forgot to call
getLeftMmostPropertyAccessExpression in one place.

Note that this doesn't fix the alias, it just stops the crash.
2020-08-19 12:59:22 -07:00

14 lines
242 B
TypeScript

// @declaration
// @outdir: out
// @checkjs: true
// @allowjs: true
// @filename: mod.js
module.exports = {
x: {
y: "value"
}
}
// @filename: requireTwoPropertyAccesses.js
const value = require("./mod").x.y
console.log(value)