Skip to content

JS should allow merging/expando properties on imports #26912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sandersn opened this issue Sep 5, 2018 · 1 comment
Open

JS should allow merging/expando properties on imports #26912

sandersn opened this issue Sep 5, 2018 · 1 comment
Labels
Domain: JavaScript The issue relates to JavaScript specifically In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@sandersn
Copy link
Member

sandersn commented Sep 5, 2018

// Filename: mod.js
export const Ns = function () { }

// @Filename: use.js
import { Ns } from './mod'
Ns.expando = 1

Expected behavior:
No error, and Ns has property 'expando'

Actual behavior:
Error, 'expando' not found on 'Ns'.

This merge shouldn't be allowed in Typescript, but it will work in Javascript, so it should be allowed there.

@sandersn sandersn added Suggestion An idea for TypeScript Salsa labels Sep 5, 2018
@weswigham weswigham added the In Discussion Not yet reached consensus label Nov 6, 2018
@weswigham
Copy link
Member

Of note: This "works in javascript" in CJS and similar runtimes. However a real es6 namespace object would be immutable and it wouldn't work. So.... eh? Kinda depends on the output target.

@weswigham weswigham added Domain: JavaScript The issue relates to JavaScript specifically and removed Domain: JavaScript The issue relates to JavaScript specifically Salsa labels Nov 29, 2018
orta added a commit to orta/TypeScript that referenced this issue Jul 30, 2019
…at the check for alias symbol is re-applied - re comment in microsoft#26912
orta added a commit to orta/TypeScript that referenced this issue Jul 30, 2019
…at the check for alias symbol is re-applied - re comment in microsoft#26912
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: JavaScript The issue relates to JavaScript specifically In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants