Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

isClass and minification #73

Open
Open
@gah-boh

Description

@gah-boh

I've been playing around with this and I believe I found a problem with the way it determines if it's a class when minified.

So this will use ClassProvider because the class name starts with uppercase:

class Person {
// code...
} 

when minified it will turn it into something along the lines of:

class r {
// code...
}

That will obviously throw errors because it will incorrectly use the FactoryProvider instead

The only way I've managed to make it work has been to write:

var Person = class {
// code...
}

This will obviously not have anything in the name property so it will work because it will not go into the if (clsOrFunction.name) block in the isClass function and check the prototype instead of the name.

I've been trying to think what else could work for determining if it's a class or not, but this seems like a tricky issue...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions