aurelia / polyfills

The minimal set of polyfills needed to run Aurelia.
MIT License
26 stars 27 forks source link

Support Object.create(null) targets #43

Closed jdanyow closed 2 years ago

jdanyow commented 7 years ago

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 7 years ago

todo: uncomment this line once this issue is fixed-

https://github.com/aurelia/metadata/pull/48/files#diff-0ded15bd8569583909126bfa08b23b3dR39

Alexander-Taran commented 6 years ago

Same behavior with 1.3.0 Is it still relevant?

Alexander-Taran commented 2 years ago

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