Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
shysolocup authored Sep 21, 2023
1 parent 6c78260 commit db4ea01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ const { builder } = require('./builder');

class Class {
constructor(name, c, autodefine=true) {
c = (c instanceof Function) ? c : (c == undefined) ? class {} : class { constructor() { return c; } };
let cl = (c instanceof Function) ? c : (c == undefined) ? class {} : class { constructor() { return c; } };


Object.defineProperty(c, "name", { value: name });
c = builder(c);
Object.defineProperty(cl, "name", { value: name });
cl = builder(cl);


if (autodefine) return new Function("c", `return ${name} = c`)(c);
else return c;
if (autodefine) return new Function("cl", `return ${name} = cl`)(cl);
else return cl;
}
}

Expand Down

0 comments on commit db4ea01

Please sign in to comment.