mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-02-21 15:34:10 +00:00
Isolate all parsers in a local self-executing function
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
class FunctionNotOverriddenError extends Error {
|
||||
TAC.FunctionNotOverriddenError = class FunctionNotOverriddenError extends Error {
|
||||
constructor(message = "", ...args) {
|
||||
super(message, ...args);
|
||||
this.message = message + " is an abstract base function and must be overwritten.";
|
||||
}
|
||||
}
|
||||
|
||||
class BaseTagParser {
|
||||
TAC.BaseTagParser = class BaseTagParser {
|
||||
triggerCondition = null;
|
||||
|
||||
constructor (triggerCondition) {
|
||||
if (new.target === BaseTagParser) {
|
||||
if (new.target === TAC.BaseTagParser) {
|
||||
throw new TypeError("Cannot construct abstract BaseCompletionParser directly");
|
||||
}
|
||||
this.triggerCondition = triggerCondition;
|
||||
}
|
||||
|
||||
parse() {
|
||||
throw new FunctionNotOverriddenError("parse()");
|
||||
throw new TAC.FunctionNotOverriddenError("parse()");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user