diff --git a/currant.js b/currant.js index 938ab57..a46e47a 100644 --- a/currant.js +++ b/currant.js @@ -980,8 +980,7 @@ class CurrantNegateBooleanNode extends CurrantNode { let value = super.childValue(0); if(typeof value.get() !== "boolean") throw new Error(`failed to negate value - "${this.children[0].src}" is not a boolean`); - value.value[0] = !value.value[0]; - return value; + return value.type.fromValue(!value.get()); } } diff --git a/currant/nodes/booleanLogic.js b/currant/nodes/booleanLogic.js index 131a10b..85b68ce 100644 --- a/currant/nodes/booleanLogic.js +++ b/currant/nodes/booleanLogic.js @@ -14,8 +14,7 @@ class CurrantNegateBooleanNode extends CurrantNode { let value = super.childValue(0); if(typeof value.get() !== "boolean") throw new Error(`failed to negate value - "${this.children[0].src}" is not a boolean`); - value.value[0] = !value.value[0]; - return value; + return value.type.fromValue(!value.get()); } }