Skip to content

Object.defineProperties: "Index Signature is missing in type {}" #6535

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

Closed
felixrieseberg opened this issue Jan 19, 2016 · 1 comment
Closed
Labels
Duplicate An existing issue was already created

Comments

@felixrieseberg
Copy link

The following is valid ES5.1 JavaScript, but yields an error when used in TypeScript. TS2345: Argument of type '{}' is not assignable to parameter of type 'PropertyDescriptorMap'. Index signature is missing in type '{}'. A side effect is that Code's IntelliSense considers this JavaScript to be invalid.

var source = {get name() { return 'source'}};
var target = {};

var map = Object.keys(source).reduce(function (descriptors, key) {
    descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
    return descriptors;
}, {});

Object.defineProperties(target, map);

I'd love to fix this, but I'm not sure where to look. Any suggestions?

(Debug info: Tested with Version 1.8.0-dev.20160119)

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jan 19, 2016
@RyanCavanaugh
Copy link
Member

Same root cause as #6041

@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
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants