On server side extention i am trying to create new class.
Code: Select all
class _Unit {
constructor(id,user,x,z,type) {
this.id = id;
this.user = user;
this.x = x;
this.z = z;
this.type = type;
}
}
But when i start it, have an error.
Code: Select all
Exception: javax.script.ScriptException
Message: <eval>:7:0 Expected an operand but found class
class _Unit {
^ in <eval> at line number 7 at column number 0
Description: Error while loading Javascript extension
How i can create a new class with JavaScript? Code is true, but have no idea what i must to do?
Please, somebody help me =)
P.S. Sorry for my bad knowlage of English.