aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/javascript/cpp11_decltype_runme.js
blob: c067d9b5563f4707b4d27f0ac01fb9c1f83b3ee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var cpp11_decltype = require("cpp11_decltype");

a = new cpp11_decltype.A;
a.i = 5;
if (a.i != 5) {
    throw new Error("Assignment to a.i failed.");
}

a.j = 10;
if (a.j != 10) {
    throw new Error("Assignment to a.j failed.");
}

b = a.get_number(5);
if (b != 10) {
    throw new Error("get_number(5) should return 10.");
}

b = a.get_number(6);
if (b != 0) {
    throw new Error("get_number(6) should return 0.");
}