Skip to content

Conversation

@mhegazy
Copy link
Contributor

@mhegazy mhegazy commented Feb 22, 2017

Mark object literals in a .js file as "open ended", by adding a string index signature to any. This allows adding properties that were not defined in the intializer, as well as reading them.

@Jessidhia
Copy link

This basically works an implicit any in even in noImplicitAny mode?

@mhegazy
Copy link
Contributor Author

mhegazy commented Feb 28, 2017

This is specifically for types we inferred from a .js file; this treats them as openended, basically allowing adding properties that were not defined before. The new properties are not reflected in the type though.

@mhegazy mhegazy added the Salsa label Mar 1, 2017
@mhegazy mhegazy merged commit b3161e3 into master Mar 7, 2017
@mhegazy mhegazy deleted the addAnyStringIndexerToJSObjects branch March 7, 2017 00:44
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants