1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 QueryInterface: ChromeUtils.generateQI(["nsIXPCTestBug809674"]),
9 /* nsIXPCTestBug809674 */
10 methodWithOptionalArgc() {},
15 addSubMulArgs(x, y, subOut, mulOut) {
23 addMany(x1, x2, x3, x4, x5, x6, x7, x8) {
24 return x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8;
30 methodNoArgsNoRetVal() {},
32 valProperty: {value: 42},
37 // XPConnect wrap the object
38 var o = xpcWrap(Bug809674, Ci.nsIXPCTestBug809674);
40 // Methods marked [implicit_jscontext].
42 Assert.equal(o.addArgs(12, 34), 46);
44 var subRes = {}, mulRes = {};
45 Assert.equal(o.addSubMulArgs(9, 7, subRes, mulRes), 16);
46 Assert.equal(subRes.value, 2);
47 Assert.equal(mulRes.value, 63);
49 Assert.equal(o.addVals("foo", "x"), "foox");
50 Assert.equal(o.addVals("foo", 1.2), "foo1.2");
51 Assert.equal(o.addVals(1234, "foo"), "1234foo");
53 Assert.equal(o.addMany(1, 2, 4, 8, 16, 32, 64, 128), 255);
55 Assert.equal(o.methodNoArgs(), 7);
56 Assert.equal(o.methodNoArgsNoRetVal(), undefined);
58 // Attributes marked [implicit_jscontext].
60 Assert.equal(o.valProperty.value, 42);
62 Assert.equal(o.valProperty, o);
64 Assert.equal(o.uintProperty, 123);
66 Assert.equal(o.uintProperty, 124);
68 // [optional_argc] is not supported.
70 o.methodWithOptionalArgc();
74 Assert.ok(/optional_argc/.test(e))