WebReflection / babel-plugin-transform-builtin-classes

A fix for the infamous Babel #4480 bug.
https://github.com/babel/babel/issues/4480
ISC License
43 stars 2 forks source link

Not compatible with document-register-element for IE11 #14

Closed anthony-redFox closed 6 years ago

anthony-redFox commented 6 years ago

In the line return sPO(new Constructor, Class.prototype);

Constructor doesn't have "this" context as Class.prototype and that why document-register-element can't get constructor from "this" statement.

The different with Reflect in the context of call new Constructor

WebReflection commented 6 years ago

are you sure you are following instructions? https://github.com/WebReflection/document-register-element#upgrading-the-constructor-context

WebReflection commented 6 years ago

just to be clear, Reflect.construct does not pass the context neither: https://github.com/WebReflection/babel-plugin-transform-builtin-classes/blob/master/src/index.js#L9-L15

Closing this as the null context is on purpose. The constructor is bound, the new instance is created.

anthony-redFox commented 6 years ago

@WebReflection Thanks a lot!