diff --git a/packages/squiggle-lang/src/js/index.ts b/packages/squiggle-lang/src/js/index.ts index 98a79b84..5bd02f67 100644 --- a/packages/squiggle-lang/src/js/index.ts +++ b/packages/squiggle-lang/src/js/index.ts @@ -4,6 +4,7 @@ import { samplingParams, environment, evaluatePartialUsingExternalBindings, + evaluateUsingOptions, externalBindings, expressionValue, recordEV, @@ -110,7 +111,10 @@ export function run( ? samplingInputs : defaultSamplingInputs; let e = environ ? environ : defaultEnvironment; - let res: result = eval(squiggleString); // , b, e); + let res: result = evaluateUsingOptions( + { externalBindings: b, environment: e }, + squiggleString + ); // , b, e); return resultMap(res, (x) => createTsExport(x, si)); }