From 47eca261b45161310497701ac4a52bed134a8dee Mon Sep 17 00:00:00 2001
From: Olivier Guimbal <olivier.guimbal@gadz.org>
Date: Tue, 6 Aug 2024 16:39:21 +0200
Subject: [PATCH] Build deno [autogenerated commit]

---
 .deno/evaluator.ts                 | 39 +++++++++++++-----------------
 .deno/parser/expression-builder.ts |  1 +
 2 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/.deno/evaluator.ts b/.deno/evaluator.ts
index d3edb1b9..5dd73957 100644
--- a/.deno/evaluator.ts
+++ b/.deno/evaluator.ts
@@ -26,7 +26,7 @@ export class Evaluator<T = any> implements IValue<T> {
     }
 
     get isConstant(): boolean {
-        return !this.usedColumns.size && !this.forceNotConstant;
+        return !this.usedColumns.size && !this.forceNotConstant || !!this.opts?.actAsConstantLiteral;
     }
 
     get isConstantReal(): boolean {
@@ -51,29 +51,24 @@ export class Evaluator<T = any> implements IValue<T> {
         }
 
         // fetch columns to depend on
-        let depArray: IValue[] | undefined = undefined;
+        let depArray: IValue[] | nil = dependencies && !Array.isArray(dependencies)
+            ? [dependencies]
+            : dependencies;
         let hasNotConstant = false;
-        if (dependencies) {
-            if (!Array.isArray(dependencies)) {
-                depArray = [dependencies];
-                this.usedColumns = dependencies.usedColumns as Set<IValue>;
-                hasNotConstant = !dependencies.isConstant;
-                this.origin = dependencies.origin;
-            } else {
-                this.usedColumns = new Set();
-                for (const d of dependencies) {
-                    if (d.origin) {
-                        if (this.origin && d.origin && this.origin !== d.origin) {
-                            throw new Error('You cannot evaluate an expression which is coming from multiple origins');
-                        }
-                        this.origin = d.origin;
-                    }
-                    if (!d.isConstant) {
-                        hasNotConstant = true;
-                    }
-                    for (const u of d.usedColumns) {
-                        this.usedColumns.add(u);
+        if (depArray) {
+            this.usedColumns = new Set();
+            for (const d of depArray) {
+                if (d.origin) {
+                    if (this.origin && d.origin && this.origin !== d.origin) {
+                        throw new Error('You cannot evaluate an expression which is coming from multiple origins');
                     }
+                    this.origin = d.origin;
+                }
+                if (!d.isConstant) {
+                    hasNotConstant = true;
+                }
+                for (const u of d.usedColumns) {
+                    this.usedColumns.add(u);
                 }
             }
         }
diff --git a/.deno/parser/expression-builder.ts b/.deno/parser/expression-builder.ts
index fe3428c0..867fb577 100644
--- a/.deno/parser/expression-builder.ts
+++ b/.deno/parser/expression-builder.ts
@@ -154,6 +154,7 @@ function _buildValueReal(val: Expr): IValue {
                     , {
                         forceNotConstant: true,
                         actAsConstantLiteral: true,
+                        unpure: true,
                         onCast: toType => {
                             // register the type of the parameter
                             setParameterType(idx, toType);