When I define the following classes on the server I get: RangeError: Maximum call stack size exceeded at at Developer.groups.set (server/classes/ApplicationUser.js:5:1),
at Developer.groups.set (server/classes/ApplicationUser.js:29:9)
ApplicationUser = class ApplicationUser{
constructor(firstName, lastName, username, password, email, groups){
this.firstName = firstName;
this.lastName = lastName;
this.username = username;
this.password = password;
this.email = email;
this.groups = groups;
}
get firstName() {
return this.firstName;
}
set firstName(value) {
this.firstName = value;
}
//repeat for all variables
}
Developer = class Developer extends ApplicationUser{
constructor(firstName, lastName, username, password, email, groups){
super(firstName, lastName, username, password, email, groups);
}
}
But. When I remove all the set and get methods from the ApplicationUser class and replace them with:
…setFirstName(value){ this.firstName = value}
…getFirstName{ return this.firstName}
//repeat for all
the application runs without error? Why is this?