aurelia/polyfills

Support Object.create(null) targets

Closed this issue · 3 comments

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

Same behavior with 1.3.0
Is it still relevant?

@bigopon mumbo-jumbo javascript.. do we still need this issue?