Mocking interfaces (+adding new method to canvas to make it more JS-like)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
885d1f5dc3
commit
4c1b705240
11 changed files with 216 additions and 13 deletions
|
@ -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]}).`)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue