exec.js 232 B

1234567891011121314
  1. var obj = {
  2. get prop() {
  3. return this._prop = 1;
  4. },
  5. get method() {
  6. if (!this._prop) throw new Error('invalid evaluation order');
  7. return (v) => v;
  8. }
  9. }
  10. var result = obj.prop |> obj.method;
  11. expect(result).toBe(1);