Skip to content

Should create unique symbols when creating properties on module.exports #37404

@ExE-Boss

Description

@ExE-Boss

TypeScript Version:

3.9.0-dev.20200315

Search Terms:

  • module.exports unique symbol property
  • module.exports unique symbol
  • exports unique symbol property
  • exports unique symbol

Code

// @target: ES2015
// @module: CommonJS
// @allowJs
// @checkJs
// @noEmit
// @filename: index.js

exports.customSymbol = Symbol("custom");
//                ^?

Workbench Repro

Expected behavior:

// some-module.d.ts
export const customSymbol: unique symbol;

Actual behavior:

// some-module.d.ts
export var customSymbol: symbol;

Playground Link:

https://www.typescriptlang.org/play?module=1&useJavaScript=true#code/KYDwDg9gTgLgzgOgMYFc4wgWwMoE9MBGEANgAQC8pehJAFAESrpb0CUA3AFBA

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fix AvailableA PR has been opened for this issueHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-reprosNeeds InvestigationThis issue needs a team member to investigate its status.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions