You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
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...
The text was updated successfully, but these errors were encountered:
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:when minified it will turn it into something along the lines of:
That will obviously throw errors because it will incorrectly use the
FactoryProvider
insteadThe only way I've managed to make it work has been to write:
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...
The text was updated successfully, but these errors were encountered: