Skip to content

In JS, Property assignment on imported symbol crashes #24658

Closed

Description

// @Filename: mod.js
export var hurk = {}
// @Filename: use.js
import { hurk } from './mod1'
hurk.expando = 4

Expected behavior:
No crash, probably an error on 'expando' since hurk isn't a global.
Actual behavior:
Crash:

     TypeError: Cannot read property 'kind' of undefined
      at Object.isVariableDeclaration (src/compiler/utilities.ts:5297:21)
      at isJavascriptContainer (src/compiler/binder.ts:2517:26)
      at bindPropertyAssignment (src/compiler/binder.ts:2485:38)
      at bindStaticPropertyAssignment (src/compiler/binder.ts:2462:13)
      at bindSpecialPropertyAssignment (src/compiler/binder.ts:2452:17)
      at bindWorker (src/compiler/binder.ts:2070:29)
      at bind (src/compiler/binder.ts:1958:13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issuecheckJsRelates to checking JavaScript using TypeScript

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions