Support Object.create(null) targets
Closed this issue · 3 comments
jdanyow commented
When target is Object.create(null)
, Reflect.defineMetadata
and Reflect.getOwnMetadata
throw:
TypeError: target.hasOwnProperty is not a function
Running samples: reflect-metadata vs aurelia-polyfills
require("aurelia-polyfills");
var obj = {};
Reflect.defineMetadata('foo', 'test value 1', obj);
console.info(Reflect.getOwnMetadata('foo', obj)); // test value 1
obj = Object.create(null);
Reflect.defineMetadata('foo', 'test value 2', obj); // TypeError: target.hasOwnProperty is not a function
console.info(Reflect.getOwnMetadata('foo', obj)); // TypeError: target.hasOwnProperty is not a function
jdanyow commented
todo: uncomment this line once this issue is fixed-
https://github.com/aurelia/metadata/pull/48/files#diff-0ded15bd8569583909126bfa08b23b3dR39
Alexander-Taran commented
Same behavior with 1.3.0
Is it still relevant?
Alexander-Taran commented
@bigopon mumbo-jumbo javascript.. do we still need this issue?