Mocking interfaces (+adding new method to canvas to make it more JS-like)
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adsooi 2024-10-12 04:57:07 +02:00
parent 885d1f5dc3
commit 4c1b705240
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
11 changed files with 216 additions and 13 deletions

View file

@ -57,7 +57,7 @@ export class Module extends BaseEventEmitter {
if(!options.hasOwnProperty(name))
throw new Error(`Option '${name}' of initialize of module ${this.#name} does not exist.`)
if(typeof value === "function" && value.prototype instanceof Interface)
Interface.check_implementation(value, options[name])
Interface.checkImplementation(value, options[name])
else if(typeof value !== typeof options[name])
throw new Error(`Option '${name}' of initialize of module ${this.#name} is not a '${value}' (${typeof options[name]}).`)
}