summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/pipeline/receiver.js
blob: 588a83e1693fb4390894dc1785deff32fbbdc1da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const BUGNUMBER = 1405943;
const summary = "Implement pipeline operator (receiver)";

print(BUGNUMBER + ": " + summary);

if (hasPipeline()) {
    // Receiver
    eval(`
    const receiver = {
        foo: function (value, extra) {
            assertEq(value, 10);
            assertEq(extra, undefined);
            assertEq(arguments.length, 1);
            assertEq(arguments[0], 10)
            assertEq(this, receiver);
        },
    };

    10 |> receiver.foo;
    `);
}

if (typeof reportCompare === "function")
    reportCompare(0, 0);