Closed
Description
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)