Skip to content

Minification resulting in use of "this" before super() #1497

@MixMasterMitch

Description

@MixMasterMitch

I think this issue is similar to #242

This class is being converted into the following minified output:

var yJ = class extends X {
    constructor(t) {
        le(this, "_array");
        (0, gJ.default)(t.every(r => r instanceof X), "Reanimated: Animated.block node argument should be an array with elements of type AnimatedNode. One or more of them are not AnimatedNodes"), super({
            type: "block",
            block: t
        }, t), this._array = t
    }
    toString() {
        return `AnimatedBlock, id: ${this.__nodeID}`
    }
    __onEvaluate() {
        let t;
        return this._array.forEach(r => {
            t = Le(r)
        }), t
    }
};

Executing this results in the following browser error:

ReferenceError: 'super()' must be called in derived constructor before accessing |this| or returning non-object.

I am using an esbuild target of es6. I tried other values and all had the same problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions