Skip to content
This repository has been archived by the owner on Dec 22, 2019. It is now read-only.

The instance.constructor.name cannot get correct result, when I use babel-loader transformed. #47

Closed
zhangwen9229 opened this issue May 29, 2019 · 0 comments

Comments

@zhangwen9229
Copy link

zhangwen9229 commented May 29, 2019

Current Behavior

I package my project with webpack.
The instance.constructor.name cannot get correct result, when I use babel-loader transformed.

    /*AminoType*/
    let objAmino = {

        [className]: class extends BaseAminoType {

            constructor(...args) {
                super()
                let idx = 0;
                properties.forEach(prop => {
                    Reflect.ownKeys(prop).forEach(key => {
    if (typeof instance == 'object') {
        if( instance.constructor.name == 'AminoType' ) return instance.typeName()
        return instance.constructor.name;

    }

The old version code below is ok.

    /*AminoType*/
    class AminoType extends BaseAminoType {

        constructor(...args) {
            super()
            let idx = 0;
            properties.forEach(prop => {
                Reflect.ownKeys(prop).forEach(key => {

Additional Information

You can check the error at my project.
https://github.com/QOSGroup/qweb/tree/v1.0
Clone it. npm install, then npm run dev. Yon can get the error on web console.

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant