diff --git a/packages/squiggle-lang/__tests__/JS__Test.ts b/packages/squiggle-lang/__tests__/JS__Test.ts index 67e42e55..be276a93 100644 --- a/packages/squiggle-lang/__tests__/JS__Test.ts +++ b/packages/squiggle-lang/__tests__/JS__Test.ts @@ -58,7 +58,7 @@ describe("Distribution", () => { }); test("toPointSet", () => { expect( - resultMap(dist.toPointSet(), (r: Distribution) => r.toString()).value + resultMap(dist.toPointSet(), (r: Distribution) => r.toString()) ).toEqual(Ok("Point Set Distribution")); }); test("toSparkline", () => { diff --git a/packages/squiggle-lang/src/js/index.ts b/packages/squiggle-lang/src/js/index.ts index 35fa0537..2d331c6e 100644 --- a/packages/squiggle-lang/src/js/index.ts +++ b/packages/squiggle-lang/src/js/index.ts @@ -210,7 +210,7 @@ export class Distribution { toString(): string { let result = Constructors_toString({ env: this.env }, this.t); if(result.tag === "Ok"){ - result.value + return result.value } else { return distributionErrorToString(result.value)