Tests
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Julien Valverdé
2023-12-09 03:31:46 +01:00
parent 04da4b0f59
commit 706fe3688d
2 changed files with 14 additions and 3 deletions

View File

@@ -27,8 +27,11 @@ class User extends mixTraits(
} }
} }
console.log(Permissible.constructor())
// console.log(Object.getOwnPropertyNames(User.prototype))
const user1 = new User(BigInt(1)) const user1 = new User(BigInt(1))
const user2 = new User(BigInt(2)) const user2 = new User(BigInt(2))
console.log(user1.equals(user2)) // console.log(user1.equals(user2))
console.log(user1.permissions) // console.log(user1.permissions)

View File

@@ -21,7 +21,10 @@ export function copyClassProperties(
to: AbstractClass<any, any>, to: AbstractClass<any, any>,
) { ) {
Object.getOwnPropertyNames(from).forEach(name => { Object.getOwnPropertyNames(from).forEach(name => {
if (name === "length" // console.log(from, to, name, Object.getOwnPropertyDescriptor(from, name))
if (name === "name"
|| name === "length"
|| name === "prototype" || name === "prototype"
) )
return return
@@ -34,6 +37,11 @@ export function copyClassProperties(
}) })
Object.getOwnPropertyNames(from.prototype).forEach(name => { Object.getOwnPropertyNames(from.prototype).forEach(name => {
// console.log(from, to, name, Object.getOwnPropertyDescriptor(from, name))
if (name === "constructor")
return
Object.defineProperty( Object.defineProperty(
to.prototype, to.prototype,
name, name,