diff --git a/bun.lockb b/bun.lockb index c643527..fbdbb10 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 9868657..1762214 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "rollup": "^4.7.0", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-ts": "^3.4.5", + "tsx": "^4.7.0", "typescript": "^5.3.3" } } diff --git a/src/tests.ts b/src/tests.ts index 12ede12..523a9bd 100644 --- a/src/tests.ts +++ b/src/tests.ts @@ -40,8 +40,12 @@ class ImplementsIdentifiable extends Identified { abstract class Permissible { static readonly defaultPermissions: string[] = [] - // permissions: string[] = [] - permissions!: string[] + permissions: string[] = [] + // permissions!: string[] + + constructor() { + console.log("Permissible constructor") + } initializer() { console.log("Permissible initializer") @@ -63,13 +67,28 @@ class User extends expresses( } } -console.log(new User(BigInt(1))) +// const user1 = new User(BigInt(1)) +// const user2 = new User(BigInt(2)) -console.log(Permissible.constructor()) -console.log(Object.getOwnPropertyNames(User.prototype)) +// console.log(user1) +// console.log(user1.equals(user2)) -const user1 = new User(BigInt(1)) -const user2 = new User(BigInt(2)) -console.log(user1.equals(user2)) -console.log(user1.permissions) +class ConstructorTests1 { + value: string + + constructor() { + console.log("ConstructorTests1") + this.value = "ConstructorTests1" + } +} + +function ConstructorTests2(this: ConstructorTests1) { + console.log("ConstructorTests2") + this.value = "ConstructorTests2" +} + + +const targetObj = {} + +console.log(Reflect.construct(ConstructorTests1, [], ConstructorTests2))