tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

xpctest_bug809674.idl (2201B)


      1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
      2 *
      3 * This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "nsISupports.idl"
      8 /*
      9 * Test interface for https://bugzilla.mozilla.org/show_bug.cgi?id=809674 .
     10 *
     11 * This test makes sure that accessing JS-implemented attributes or methods
     12 * marked with [implicit_jscontext] works as expected.
     13 *
     14 * It also makes sure [optional_argc] is not supported on JS-implemented
     15 * methods.
     16 */
     17 
     18 [scriptable, uuid(2df46559-da21-49bf-b863-0d7b7bbcbc73)]
     19 interface nsIXPCTestBug809674 : nsISupports {
     20    // Various interesting [implicit_jscontext] cases.
     21    [implicit_jscontext] unsigned long addArgs(in unsigned long x, in unsigned long y);
     22    [implicit_jscontext] unsigned long addSubMulArgs(in unsigned long x, in unsigned long y,
     23                                                     out unsigned long subOut,
     24                                                     out unsigned long mulOut);
     25    [implicit_jscontext] jsval addVals(in jsval x, in jsval y);
     26 
     27    [implicit_jscontext] unsigned long methodNoArgs();
     28    [implicit_jscontext] void methodNoArgsNoRetVal();
     29 
     30    // When there are many arguments, the context is passed on the stack on
     31    // most platforms.
     32    [implicit_jscontext] unsigned long addMany(in unsigned long x1,
     33                                               in unsigned long x2,
     34                                               in unsigned long x3,
     35                                               in unsigned long x4,
     36                                               in unsigned long x5,
     37                                               in unsigned long x6,
     38                                               in unsigned long x7,
     39                                               in unsigned long x8);
     40 
     41    // Attributes can use [implicit_jscontext], too.
     42    [implicit_jscontext] attribute jsval valProperty;
     43    [implicit_jscontext] attribute unsigned long uintProperty;
     44 
     45    // [optional_argc] is not supported.
     46    [optional_argc] void methodWithOptionalArgc();
     47 };