tvcutsem / harmony-reflect

ES5 shim for ES6 Reflect and Proxy objects
http://www.ecma-international.org/ecma-262/6.0/#sec-reflection
Other
478 stars 48 forks source link

Patch Reflect.setPrototypeOf #63

Closed HeavenVolkoff closed 3 years ago

HeavenVolkoff commented 8 years ago

+requirement of new for instantiating Proxy +patch Reflect.setPrototypeOf, now accepts null

tvcutsem commented 8 years ago

Thanks for the patch.

I have been holding off adding the check to require new to invoke the Proxy constructor (it's a documented spec incompatibility in the README) because it will be a breaking change for existing clients of this library. I should probably bite the bullet and upgrade the npm package to 2.x.

Other than better spec compatibility, was there a specific reason you wanted the check?

HeavenVolkoff commented 8 years ago

Hi man, thank you for the great lib. About the new check. I added it because I'm writing a es6-ready code, so I thought it would be nice to be warned if i forget to use it somewhere in my code. This way I could avoid future errors when the official Proxy spec becomes supported. Nevertheless, in fact, I completely forgot about compatibility break, but, personally, I think it would be better to add the check at a new lib version.