Files
Nicolò RibaudoandGitHub 81942a1592 [hack pipes] Inline topic token when possible (#14278)
* Optimize away `|> #` pipes

* Inline topic token when it's used once and there are no side effects

* Fix deferred topic evaluation

* Update standalone tests
2022-02-19 12:38:40 +01:00

10 lines
158 B
JavaScript

let x = 0;
let fnA = x++ |> (() => @@);
let fnB = x++ |> (0, () => @@);
expect(x).toBe(2);
expect(fnA()).toBe(0);
expect(fnB()).toBe(1);
expect(x).toBe(2);