Bug 662000 part 1: Remove interfaces and tests. r=mrbkap
authorMatheus Kerschbaum <matjk7@gmail.com>
Tue, 14 Jun 2011 05:50:17 +0200
changeset 71537 d115405d4e0b244422336e5cebfff04003f79c01
parent 71536 060127d32405ec7da605e8f2b2e87073f569dd84
child 71538 65936325f47f35517502200161f71b43ec7d6905
push id159
push usereakhgari@mozilla.com
push dateTue, 16 Aug 2011 17:53:11 +0000
treeherdermozilla-beta@8786e3e49240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs662000
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 662000 part 1: Remove interfaces and tests. r=mrbkap
js/src/xpconnect/idl/XPCIDispatch.idl
js/src/xpconnect/idl/nsIActiveXSecurityPolicy.idl
js/src/xpconnect/idl/nsIDispatchSupport.idl
js/src/xpconnect/src/XPCDispConvert.cpp
js/src/xpconnect/src/XPCDispInlines.h
js/src/xpconnect/src/XPCDispInterface.cpp
js/src/xpconnect/src/XPCDispObject.cpp
js/src/xpconnect/src/XPCDispParams.cpp
js/src/xpconnect/src/XPCDispPrivate.h
js/src/xpconnect/src/XPCDispTearOff.cpp
js/src/xpconnect/src/XPCDispTypeInfo.cpp
js/src/xpconnect/src/XPCIDispatchClassInfo.cpp
js/src/xpconnect/src/XPCIDispatchExtension.cpp
js/src/xpconnect/src/nsDispatchSupport.cpp
js/src/xpconnect/tests/idispatch/COM/StdAfx.cpp
js/src/xpconnect/tests/idispatch/COM/StdAfx.h
js/src/xpconnect/tests/idispatch/COM/XPCDispUtilities.h
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.cpp
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.def
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.dsp
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.dsw
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.idl
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.rc
js/src/xpconnect/tests/idispatch/COM/nsXPCDispSimple.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispSimple.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispSimple.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestArrays.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestArrays.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestArrays.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestMethods.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestMethods.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestMethods.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestNoIDispatch.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestNoIDispatch.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestNoIDispatch.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestProperties.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestProperties.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestProperties.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOff.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOff.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOff.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOn.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOn.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOn.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestWrappedJS.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestWrappedJS.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestWrappedJS.rgs
js/src/xpconnect/tests/idispatch/COM/resource.h
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/Arrays/XPCIDispatchArrayTests.js
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/Attributes/XPCIDispatchAttributeTests.js
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/General/XPCIDispatchInstantiations.js
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/General/XPCStress.js
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/Methods/XPCIDispatchMethodTests.js
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/shell.js
js/src/xpconnect/tests/idispatch/Tests/WrappedJS/General/XPCIDispatchTestWrappedJS.js
js/src/xpconnect/tests/idispatch/Tests/WrappedJS/shell.js
js/src/xpconnect/tests/idispatch/Tests/exectests.cmd
js/src/xpconnect/tests/idispatch/Tests/jsDriver.pl
deleted file mode 100644
--- a/js/src/xpconnect/idl/XPCIDispatch.idl
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-%{C++
-#error "You should not be including this file"
-%}
-
-#include "nsISupports.idl"
-
-/**
- * This interface is not to be used directly, it is to be used internally
- * for XPConnect's IDispatch support
- */
-[scriptable, uuid(00020400-0000-0000-C000-000000000046)]
-interface IDispatch : nsISupports
-{
-};
deleted file mode 100644
--- a/js/src/xpconnect/idl/nsIActiveXSecurityPolicy.idl
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsISupports.idl"
-
-%{ C++
-#define NS_IACTIVEXSECURITYPOLICY_CONTRACTID "@mozilla.org/nsactivexsecuritypolicy;1"
-%}
-
-[scriptable, uuid(0a3928d2-76c8-4c25-86a9-9c005ad832f4)]
-interface nsIActiveXSecurityPolicy : nsISupports
-{
-    /** Host nothing at all. */
-    const unsigned long HOSTING_FLAGS_HOST_NOTHING          = 0x00000000;
-    /** Allow hosting of safe for scripting objects. */
-    const unsigned long HOSTING_FLAGS_HOST_SAFE_OBJECTS     = 1;
-    /** Allow any object to be hosted. */
-    const unsigned long HOSTING_FLAGS_HOST_ALL_OBJECTS      = 2;
-    /** Allow objects to be downloaded and installed. */
-    const unsigned long HOSTING_FLAGS_DOWNLOAD_CONTROLS     = 4;
-    /** Allow objects marked safe for scripting to be scripted. */
-    const unsigned long HOSTING_FLAGS_SCRIPT_SAFE_OBJECTS   = 8;
-    /** Allow any object to be scripted. */
-    const unsigned long HOSTING_FLAGS_SCRIPT_ALL_OBJECTS    = 16;
-
-    /**
-     * Return the ActiveX security and hosting flags.
-     * @param context The context for which flags are requested. At present the
-     *                only valid value is nsnull.
-     */
-    unsigned long getHostingFlags(in string aContext);
-};
-
deleted file mode 100644
--- a/js/src/xpconnect/idl/nsIDispatchSupport.idl
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsISupports.idl"
-#include "nsIVariant.idl"
-
-%{ C++
-// Pull in jsval definition
-#include "jspubtd.h"
-
-// {40c4883d-079f-43db-82a9-df0a59d37998}
-#define NS_IDISPATCH_SUPPORT_CID \
-    { 0x40c4883d, 0x079f, 0x43db, \
-      { 0x82, 0xa9, 0xdf, 0x0a, 0x59, 0xd3, 0x79, 0x98 } }
-#ifdef XPC_IDISPATCH_SUPPORT
-#define NS_IDISPATCH_SUPPORT_CONTRACTID "@mozilla.org/nsdispatchsupport;1"
-// Disable the warning concerning IDispatch being a struct but now defined
-// as a class
-#pragma warning(push)
-#pragma warning(disable : 4099)
-#endif
-%}
-
-native COMVARIANT(VARIANT);
-[ptr] native COMVARIANTPtr(VARIANT);
-[ptr] native JSContextPtr(JSContext);
-
-interface IDispatch;
-
-[uuid(38df70e9-12f8-4732-af91-df36c38dc6f6)]
-interface nsIDispatchSupport : nsISupports
-{
-    /**
-     * Converts a COM Variant to a jsval.
-     * @param comvar The COM Variant to be converted.
-     * @param val The jsval to receive the converted value.
-     */
-    void COMVariant2JSVal(in COMVARIANTPtr comvar, out jsval val);
-
-    /**
-     * Converts a jsval to a COM Variant
-     * @param var The jsval to be converted.
-     * @param comvar The COM Variant to receive the converted value
-     */
-    void JSVal2COMVariant(in jsval var, out COMVARIANT comvar);
-    
-    /**
-     * Test if the class is safe to host.
-     * @param clsid The nsID representation of the CLSID to test.
-     * @param classExists Returns containing PR_FALSE if the class is
-     *                    not registered.
-     */
-    boolean isClassSafeToHost(in JSContextPtr cx, in nsCIDRef cid,
-                              in boolean capsCheck, out boolean classExists);
-    
-    /**
-     * Test if the specified class is marked safe for scripting.
-     * @param cid The nsID representation of the CLSID to test.
-     * @param classExists Returns containing PR_FALSE if the class is not
-     *                    registered.
-     */
-    boolean isClassMarkedSafeForScripting(in nsCIDRef cid, 
-                                          out boolean classExists);
-
-    /**
-     * Test if the instantiated object is safe for scripting on the specified
-     * interface.
-     * @param theObject The object to test (an IUnknown cast into a void *).
-     * @param iid The interface to test if it is safe for scripting on.
-     */
-    boolean isObjectSafeForScripting(in voidPtr theObject, in nsIIDRef id);
-
-    /**
-     * Return the ActiveX security and hosting flags. See nsIActiveXSecurityPolicy
-     * for list of flags.
-     * @param context The context for which flags are requested. At present the
-     *                only valid value is nsnull.
-     */
-    unsigned long getHostingFlags(in string aContext);
-};
-
-%{ C++
-#pragma warning(pop)
-%}
deleted file mode 100644
--- a/js/src/xpconnect/src/XPCDispConvert.cpp
+++ /dev/null
@@ -1,593 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * \file XPCDispConvert.cpp
- * Contains the implementation of the XPCDispConvert class
- */
-
-#include "xpcprivate.h"
-
-VARTYPE XPCDispConvert::JSTypeToCOMType(XPCCallContext& ccx, jsval val)
-{
-    if(JSVAL_IS_PRIMITIVE(val))
-    {
-        if(JSVAL_IS_STRING(val))
-        {
-            return VT_BSTR;
-        }
-        if(JSVAL_IS_INT(val))
-        {
-            return VT_I4;
-        }
-        if(JSVAL_IS_DOUBLE(val))
-        {
-            return VT_R8;
-        }
-        if(JSVAL_IS_BOOLEAN(val))
-        {
-            return VT_BOOL;
-        }
-        if(JSVAL_IS_VOID(val))
-        {
-            return VT_EMPTY;
-        }
-        if(JSVAL_IS_NULL(val))
-        {
-            return VT_NULL;
-        }
-    }
-    else
-    {
-        if(JS_IsArrayObject(ccx, JSVAL_TO_OBJECT(val)))
-            return VT_ARRAY | VT_VARIANT;
-        return VT_DISPATCH;
-    }
-    NS_ERROR("XPCDispConvert::JSTypeToCOMType was unable to identify the type of the jsval");
-    return VT_EMPTY;
-}
-
-JSBool XPCDispConvert::JSArrayToCOMArray(XPCCallContext& ccx, JSObject *obj, 
-                                         VARIANT & var, nsresult& err)
-{
-    err = NS_OK;
-    jsuint len;
-    if(!JS_GetArrayLength(ccx, obj, &len))
-    {
-        // TODO: I think we should create a specific error for this
-        err = NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY;
-        return PR_FALSE;
-    }
-    // Create the safe array of variants and populate it
-    SAFEARRAY * array = nsnull;
-    VARIANT* varArray = 0;
-    for(jsuint index = 0; index < len; ++index)
-    {
-        jsval val;
-        if(JS_GetElement(ccx, obj, index, &val))
-        {
-            if(!JSVAL_IS_VOID(val))
-            {
-                if(!array)
-                {
-                    // Create an array that starts at index, and has len 
-                    // elements
-                    array = SafeArrayCreateVector(VT_VARIANT, index, len - index);
-                    if(!array)
-                    {
-                        err = NS_ERROR_OUT_OF_MEMORY;
-                        return JS_FALSE;
-                    }
-                    if(FAILED(SafeArrayAccessData(array, reinterpret_cast<void**>(&varArray))))
-                    {
-                        err = NS_ERROR_FAILURE;
-                        return JS_FALSE;
-                    }
-                }
-                if(!JSToCOM(ccx, val, *varArray, err))
-                {
-                    SafeArrayUnaccessData(array);
-                    err = NS_ERROR_FAILURE;
-                    // This cleans up the elements as well
-                    SafeArrayDestroyData(array);
-                    return JS_FALSE;
-                }
-            }
-            if(varArray)
-                ++varArray;
-        }
-    }
-    if(!array)
-    {
-        array = SafeArrayCreateVector(VT_VARIANT, 0, 0);
-        if(!array)
-        {
-            err = NS_ERROR_OUT_OF_MEMORY;
-            return JS_FALSE;
-        }
-    }
-    else
-    {
-        SafeArrayUnaccessData(array);
-    }
-    var.vt = VT_ARRAY | VT_VARIANT;
-    var.parray = array;
-    return JS_TRUE;
-}
-
-#define XPC_ASSIGN(src, dest, data) *dest.p##data = src.data
-
-/**
- * Copies a variant to a by ref variant
- * NOTE: This does not perform any reference counting. It simply does
- * a copy of the values, it's up to the caller to manage any ownership issues
- * @param src the variant to be copied
- * @param dest the destination for the copy
- * @return JS_TRUE if the copy was performed JS_FALSE if it failed
- */
-inline
-JSBool xpc_CopyVariantByRef(VARIANT & src, VARIANT & dest)
-{
-    VARIANT temp;
-    VARTYPE vt = dest.vt & ~(VT_BYREF);
-    if(vt != src.vt)
-    {
-        // TODO: This fails more than I had hoped, we may want to
-        // add some logic to handle more conversions
-        if(FAILED(VariantChangeType(&temp, &src, VARIANT_ALPHABOOL, vt)))
-        {
-            return JS_FALSE;
-        }
-    }
-    else
-        temp = src;
-    switch (vt)
-    {
-        case VT_I2:
-        {
-            XPC_ASSIGN(temp, dest, iVal);
-        }
-        break;
-	    case VT_I4:
-        {
-            XPC_ASSIGN(temp, dest, lVal);
-        }
-        break;
-	    case VT_R4:
-        {
-            XPC_ASSIGN(temp, dest, fltVal);
-        }
-        break;
-	    case VT_R8:
-        {
-            XPC_ASSIGN(temp, dest, dblVal);
-        }
-        break;
-	    case VT_CY:
-        {
-            XPC_ASSIGN(temp, dest, cyVal);
-        }
-        break;
-	    case VT_DATE:
-        {
-            XPC_ASSIGN(temp, dest, date);
-        }
-        break;
-	    case VT_BSTR:
-        {
-            XPC_ASSIGN(temp, dest, bstrVal);
-        }
-        break;
-	    case VT_DISPATCH:
-        {
-            XPC_ASSIGN(temp, dest, pdispVal);
-        }
-        break;
-	    case VT_ERROR:
-        {
-            XPC_ASSIGN(temp, dest, scode);
-        }
-        break;
-	    case VT_BOOL:
-        {
-            XPC_ASSIGN(temp, dest, boolVal);
-        }
-        break;
-	    case VT_VARIANT:
-        {
-            // Not Supported right now
-            return JS_FALSE;
-        }
-        break;
-	    case VT_I1:
-        {
-            XPC_ASSIGN(temp, dest, cVal);
-        }
-        break;
-	    case VT_UI1:
-        {
-            XPC_ASSIGN(temp, dest, bVal);
-        }
-        break;
-	    case VT_UI2:
-        {
-            XPC_ASSIGN(temp, dest, iVal);
-        }
-        break;
-	    case VT_UI4:
-        {
-            XPC_ASSIGN(temp, dest, uiVal);
-        }
-        break;
-	    case VT_INT:
-        {
-            XPC_ASSIGN(temp, dest, intVal);
-        }
-        break;
-	    case VT_UINT:
-        {
-            XPC_ASSIGN(temp, dest, uintVal);
-        }
-        break;
-        default:
-        {
-            return JS_FALSE;
-        }
-    }
-    return JS_TRUE;
-}
-
-JSBool XPCDispConvert::JSToCOM(XPCCallContext& ccx,
-                               jsval src,
-                               VARIANT & dest,
-                               nsresult& err,
-                               JSBool isByRef)
-{
-    err = NS_OK;
-    VARIANT byRefVariant;
-    VARIANT * varDest = isByRef ? &byRefVariant : &dest;
-    varDest->vt = JSTypeToCOMType(ccx, src);
-    switch (varDest->vt)
-    {
-        case VT_BSTR:
-        {
-            JSString* str = JSVAL_TO_STRING(src);
-            jschar * chars = JS_GetStringChars(str);
-            if(!chars)
-            {
-                err = NS_ERROR_XPC_BAD_CONVERT_NATIVE;
-                // Avoid cleaning up garbage
-                varDest->vt = VT_EMPTY;
-                return JS_FALSE;
-            }
-
-            CComBSTR val(JS_GetStringLength(str),
-                         reinterpret_cast<const WCHAR *>(chars));
-            varDest->bstrVal = val.Detach();
-        }
-        break;
-        case VT_I4:
-        {
-            varDest->vt = VT_I4;
-            varDest->lVal = JSVAL_TO_INT(src);
-        }
-        break;
-        case VT_R8:
-        {
-            varDest->vt = VT_R8;
-            varDest->dblVal = JSVAL_TO_DOUBLE(src);
-        }
-        break;
-        case VT_EMPTY:
-        case VT_NULL:
-        break;
-        case VT_ARRAY | VT_VARIANT:
-        {
-            JSObject * obj = JSVAL_TO_OBJECT(src);
-            return JSArrayToCOMArray(ccx, obj, *varDest, err);
-        }
-        break;
-        case VT_DISPATCH:
-        {
-            JSObject * obj = JSVAL_TO_OBJECT(src);
-            IUnknown * pUnknown = nsnull;
-            if(!XPCConvert::JSObject2NativeInterface(
-                ccx, 
-                (void**)&pUnknown, 
-                obj, 
-                &NSID_IDISPATCH,
-                nsnull, 
-                &err))
-            {
-                // Avoid cleaning up garbage
-                varDest->vt = VT_EMPTY;
-                return JS_FALSE;
-            }
-            varDest->vt = VT_DISPATCH;
-            pUnknown->QueryInterface(IID_IDispatch, 
-                                     reinterpret_cast<void**>
-                                                     (&varDest->pdispVal));
-            NS_IF_RELEASE(pUnknown);
-        }
-        break;
-        case VT_BOOL:
-        {
-            varDest->boolVal = JSVAL_TO_BOOLEAN(src) ? VARIANT_TRUE : VARIANT_FALSE;
-        }
-        break;
-        default:
-        {
-            NS_ERROR("This is out of synce with XPCDispConvert::JSTypeToCOMType");
-            err = NS_ERROR_XPC_BAD_CONVERT_NATIVE;
-            // Avoid cleaning up garbage
-            varDest->vt = VT_EMPTY;
-            return JS_FALSE;
-        }
-        break;
-    }
-    if(isByRef)
-    {
-        if(!xpc_CopyVariantByRef(byRefVariant, dest))
-        {
-            // Avoid cleaning up garbage
-            dest.vt = VT_EMPTY;
-        }
-    }
-    return JS_TRUE;
-}
-
-JSBool XPCDispConvert::COMArrayToJSArray(XPCCallContext& ccx,
-                                         const VARIANT & src,
-                                         jsval & dest, nsresult& err)
-{
-    err = NS_OK;
-    // We only support one dimensional arrays for now
-    if(SafeArrayGetDim(src.parray) != 1)
-    {
-        err = NS_ERROR_FAILURE;
-        return JS_FALSE;
-    }
-    // Get the upper bound;
-    long ubound;
-    if(FAILED(SafeArrayGetUBound(src.parray, 1, &ubound)))
-    {
-        err = NS_ERROR_FAILURE;
-        return JS_FALSE;
-    }
-    // Get the lower bound
-    long lbound;
-    if(FAILED(SafeArrayGetLBound(src.parray, 1, &lbound)))
-    {
-        err = NS_ERROR_FAILURE;
-        return JS_FALSE;
-    }
-    // Create the JS Array
-    JSObject * array = JS_NewArrayObject(ccx, ubound - lbound + 1, nsnull);
-    if(!array)
-    {
-        err = NS_ERROR_OUT_OF_MEMORY;
-        return JS_FALSE;
-    }
-    AUTO_MARK_JSVAL(ccx, OBJECT_TO_JSVAL(array));
-    // Divine the type of our array
-    VARTYPE vartype;
-    if((src.vt & VT_ARRAY) != 0)
-    {
-        vartype = src.vt & ~VT_ARRAY;
-    }
-    else // This was maybe a VT_SAFEARRAY
-    {
-        if(FAILED(SafeArrayGetVartype(src.parray, &vartype)))
-            return JS_FALSE;
-    }
-    jsval val = JSVAL_NULL;
-    AUTO_MARK_JSVAL(ccx, &val);
-    for(long index = lbound; index <= ubound; ++index)
-    {
-        HRESULT hr;
-        _variant_t var;
-        if(vartype == VT_VARIANT)
-        {
-            hr = SafeArrayGetElement(src.parray, &index, &var);
-        }
-        else
-        {
-            var.vt = vartype;
-            hr = SafeArrayGetElement(src.parray, &index, &var.byref);
-        }
-        if(FAILED(hr))
-        {
-            err = NS_ERROR_FAILURE;
-            return JS_FALSE;
-        }
-        if(!COMToJS(ccx, var, val, err))
-            return JS_FALSE;
-        JS_SetElement(ccx, array, index, &val);
-    }
-    dest = OBJECT_TO_JSVAL(array);
-    return JS_TRUE;
-}
-
-/**
- * Converts a string to a jsval
- * @param cx the JSContext
- * @param str the unicode string to be converted
- * @param len the length of the string being converted
- * @return the jsval representing the string
- */
-inline
-jsval StringToJSVal(JSContext* cx, const PRUnichar * str, PRUint32 len)
-{
-    JSString * s = JS_NewUCStringCopyN(cx,
-                                       reinterpret_cast<const jschar *>(str),
-                                       len);
-    if(s)
-        return STRING_TO_JSVAL(s);
-    else
-        return JSVAL_NULL;
-}
-
-
-#define VALUE(val) (isPtr ? *src.p##val : src.val)
-JSBool XPCDispConvert::COMToJS(XPCCallContext& ccx, const VARIANT& src,
-                               jsval& dest, nsresult& err)
-{
-    err = NS_OK;
-    if(src.vt & VT_ARRAY || src.vt == VT_SAFEARRAY)
-    {
-        return COMArrayToJSArray(ccx, src, dest, err);
-    }
-    PRBool isPtr = src.vt & VT_BYREF;
-    switch (src.vt & ~(VT_BYREF))
-    {
-        case VT_UINT:
-        {
-            return JS_NewNumberValue(ccx, VALUE(uintVal), &dest);
-        }
-        break;
-        case VT_UI4:
-        {
-            return JS_NewNumberValue(ccx, VALUE(ulVal), &dest);
-        }
-        break;
-        case VT_INT:
-        {
-            return JS_NewNumberValue(ccx, VALUE(intVal), &dest);
-        }
-        break;
-        case VT_I4:
-        {
-            return JS_NewNumberValue(ccx, VALUE(lVal), &dest);
-        }
-        break;
-        case VT_UI1:
-        {
-            dest = INT_TO_JSVAL(VALUE(bVal));
-        }
-        break;
-        case VT_I1:
-        {
-            dest = INT_TO_JSVAL(VALUE(cVal));
-        }
-        break;
-        case VT_UI2:
-        {
-            dest = INT_TO_JSVAL(VALUE(uiVal));
-        }
-        break;
-        case VT_I2:
-        {
-            dest = INT_TO_JSVAL(VALUE(iVal));
-        }
-        break;
-        case VT_R4:
-        {
-            return JS_NewNumberValue(ccx, VALUE(fltVal), &dest);
-        }
-        break;
-        case VT_R8:
-        {
-            return JS_NewNumberValue(ccx, VALUE(dblVal), &dest);
-        }
-        break;
-        case VT_BOOL:
-        {
-            dest = BOOLEAN_TO_JSVAL(VALUE(boolVal) != VARIANT_FALSE ? JS_TRUE : JS_FALSE);
-        }
-        break;
-        case VT_DISPATCH:
-        {
-            XPCDispObject::WrapIDispatch(VALUE(pdispVal), ccx,
-                                         JS_GetGlobalObject(ccx), &dest);
-        }
-        break;
-        case VT_DATE:
-        {
-            // Convert date to string and frees it when we're done
-            _bstr_t str(src);
-            dest = StringToJSVal(ccx, str, str.length());
-        }
-        break;
-        case VT_EMPTY:
-        {
-            dest = JSVAL_VOID;
-        }
-        break;
-        case VT_NULL:
-        {
-            dest = JSVAL_NULL;
-        }
-        break;
-        case VT_ERROR:
-        {
-            return JS_NewNumberValue(ccx, VALUE(scode), &dest);
-        }
-        break;
-        case VT_CY:
-        {
-            return JS_NewNumberValue(
-                ccx, 
-                static_cast<double>
-                           (isPtr ? src.pcyVal->int64 : 
-                                       src.cyVal.int64) / 100.0,
-                &dest);
-        }
-        break;
-        /**
-         * Currently unsupported conversion types
-         */
-        case VT_UNKNOWN:
-        default:
-        {
-            // Last ditch effort to convert to string
-            if(FAILED(VariantChangeType(const_cast<VARIANT*>(&src), 
-                                         const_cast<VARIANT*>(&src), 
-                                         VARIANT_ALPHABOOL, VT_BSTR)))
-            {
-                err = NS_ERROR_XPC_BAD_CONVERT_JS;
-                return JS_FALSE;
-            }
-            isPtr = FALSE;
-        } // Fall through on success
-        case VT_BSTR:
-        {
-            dest = StringToJSVal(ccx, VALUE(bstrVal), SysStringLen(VALUE(bstrVal)));
-        }
-        break;
-    }
-    return JS_TRUE;
-}
deleted file mode 100644
--- a/js/src/xpconnect/src/XPCDispInlines.h
+++ /dev/null
@@ -1,654 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * \file XPCDispInlines.h inline implementations
- * Implementations for inline members of classes found in DispPrivate.h
- */
-
-
-inline
-PRBool nsXPConnect::IsIDispatchEnabled() 
-{
-    return XPCIDispatchExtension::IsEnabled();
-}
-
-//=============================================================================
-// XPCDispInterface::Member:ParamInfo inlines
-
-inline
-XPCDispInterface::Member::ParamInfo::ParamInfo(
-    const ELEMDESC * paramInfo) : mParamInfo(paramInfo) 
-{
-}
-
-inline
-JSBool XPCDispInterface::Member::ParamInfo::InitializeOutputParam(
-    void * varBuffer, VARIANT & var) const
-{
-    var.vt = GetType() | VT_BYREF;
-    var.byref = varBuffer;
-    return JS_TRUE;
-}
-
-inline
-PRBool XPCDispInterface::Member::ParamInfo::IsFlagSet(
-    unsigned short flag) const 
-{
-    return mParamInfo->paramdesc.wParamFlags & flag ? PR_TRUE : PR_FALSE; 
-}
-
-inline
-PRBool XPCDispInterface::Member::ParamInfo::IsIn() const 
-{
-    return IsFlagSet(PARAMFLAG_FIN) || mParamInfo->paramdesc.wParamFlags == 0;
-}
-
-inline
-PRBool XPCDispInterface::Member::ParamInfo::IsOut() const 
-{
-    return IsFlagSet(PARAMFLAG_FOUT);
-}
-
-inline
-PRBool XPCDispInterface::Member::ParamInfo::IsOptional() const 
-{
-    return IsFlagSet(PARAMFLAG_FOPT);
-}
-
-inline
-PRBool XPCDispInterface::Member::ParamInfo::IsRetVal() const 
-{
-    return IsFlagSet(PARAMFLAG_FRETVAL);
-}
-
-// TODO: Handle VT_ARRAY as well
-inline
-VARTYPE XPCDispInterface::Member::ParamInfo::GetType() const 
-{
-    return mParamInfo->tdesc.vt == VT_PTR ? mParamInfo->tdesc.lptdesc->vt : mParamInfo->tdesc.vt;
-}
-
-//=============================================================================
-// XPCDispInterface::Member inlines
-
-inline
-XPCDispInterface::Member::Member() : 
-    mType(UNINITIALIZED), mFuncDesc(nsnull), mGetterFuncDesc(nsnull),
-    mTypeInfo(reinterpret_cast<ITypeInfo *>(nsnull))
-{
-}
-
-inline
-XPCDispInterface::Member::~Member() 
-{
-    if(mTypeInfo)
-    {
-        // Test to see if we have a separate getter. If we only have a getter they can
-        // be the same
-        PRBool releaseGetter = mGetterFuncDesc != nsnull && mFuncDesc != mGetterFuncDesc;
-        if(mFuncDesc) 
-            mTypeInfo->ReleaseFuncDesc(mFuncDesc);
-        if(releaseGetter)
-            mTypeInfo->ReleaseFuncDesc(mGetterFuncDesc);
-    }
-}
-
-inline
-void* XPCDispInterface::Member::operator new(size_t, Member* p)
-{
-    return p;
-}
-
-inline
-void XPCDispInterface::Member::MakeGetter() 
-{
-    NS_ASSERTION(!IsFunction(), "Can't be function and property"); 
-    mType |= GET_PROPERTY; 
-}
-
-inline
-void XPCDispInterface::Member::MakeSetter() 
-{ 
-    NS_ASSERTION(!IsFunction(), "Can't be function and property"); 
-    mType |= SET_PROPERTY; 
-}
-
-inline
-void XPCDispInterface::Member::ResetType() 
-{
-    mType = UNINITIALIZED;
-}
-
-inline
-void XPCDispInterface::Member::SetFunction() 
-{ 
-    NS_ASSERTION(!IsProperty(), "Can't be function and property"); 
-    mType = FUNCTION; 
-}
-
-inline
-PRBool XPCDispInterface::Member::IsFlagSet(unsigned short flag) const 
-{
-    return mType & flag ? PR_TRUE : PR_FALSE; 
-}
-
-inline
-PRBool XPCDispInterface::Member::IsSetter() const
-{
-    return IsFlagSet(SET_PROPERTY);
-}
-
-inline
-PRBool XPCDispInterface::Member::IsGetter() const
-{
-    return IsFlagSet(GET_PROPERTY);
-}
-
-inline
-PRBool XPCDispInterface::Member::IsProperty() const
-{
-    return IsSetter() || IsGetter(); 
-}
-
-inline
-PRBool XPCDispInterface::Member::IsFunction() const
-{
-    return IsFlagSet(FUNCTION);
-}
-
-inline
-PRBool XPCDispInterface::Member::IsParameterizedSetter() const
-{
-    return IsSetter() && GetParamCount() > 1;
-}
-
-inline
-PRBool XPCDispInterface::Member::IsParameterizedGetter() const
-{
-    return IsGetter() && (GetParamCount(PR_TRUE) > 1 ||
-        (GetParamCount(PR_TRUE) == 1 && !GetParamInfo(0, PR_TRUE).IsRetVal()));
-}
-
-inline
-PRBool XPCDispInterface::Member::IsParameterizedProperty() const
-{
-    return IsParameterizedSetter() || IsParameterizedGetter();
-}
-
-inline
-jsid XPCDispInterface::Member::GetName() const
-{
-    return mName;
-}
-
-inline
-void XPCDispInterface::Member::SetName(jsid name)
-{
-    mName = name;
-}
-
-inline
-PRUint32 XPCDispInterface::Member::GetDispID() const
-{
-    return mFuncDesc->memid;
-}
-
-inline
-PRUint32 XPCDispInterface::Member::GetParamCount(PRBool getter) const
-{
-    return (getter && mGetterFuncDesc) ? mGetterFuncDesc->cParams : mFuncDesc->cParams;
-}
-
-inline
-XPCDispInterface::Member::ParamInfo XPCDispInterface::Member::GetParamInfo(PRUint32 index, PRBool getter) const
-{
-    NS_ASSERTION(index < GetParamCount(getter), "Array bounds error");
-    return ParamInfo(((getter && mGetterFuncDesc) ? mGetterFuncDesc->lprgelemdescParam : mFuncDesc->lprgelemdescParam) + index);
-}
-
-inline
-void XPCDispInterface::Member::SetTypeInfo(DISPID dispID, 
-                                                ITypeInfo* pTypeInfo, 
-                                                FUNCDESC* funcdesc)
-{
-    mTypeInfo = pTypeInfo; 
-    mFuncDesc = funcdesc;
-}
-
-inline
-void XPCDispInterface::Member::SetGetterFuncDesc(FUNCDESC* funcdesc)
-{
-    mGetterFuncDesc = funcdesc;
-}
-
-inline
-PRUint16 XPCDispInterface::Member::GetParamType(PRUint32 index) const 
-{
-    return mFuncDesc->lprgelemdescParam[index].paramdesc.wParamFlags; 
-}
-
-inline
-void XPCDispInterface::Member::SetMemID(DISPID memID)
-{
-    mMemID = memID;
-}
-
-inline
-DISPID XPCDispInterface::Member::GetMemID() const
-{
-    return mMemID;
-}
-
-//=============================================================================
-// XPCDispInterface::Allocator
-
-inline
-XPCDispInterface* XPCDispInterface::Allocator::Allocate()
-{
-    return Valid() ? new (Count()) XPCDispInterface(mCX, mTypeInfo, mIDispatchMembers) : nsnull;
-}
-
-inline
-XPCDispInterface::Allocator::~Allocator()
-{
-    delete [] mMemIDs;
-}
-
-PRBool XPCDispInterface::Allocator::Valid() const
-{
-    return mMemIDs ? PR_TRUE : PR_FALSE;
-}
-
-//=============================================================================
-// XPCDispInterface inlines
-
-inline
-JSObject* XPCDispInterface::GetJSObject() const
-{
-    return mJSObject;
-}
-
-inline
-void XPCDispInterface::SetJSObject(JSObject* jsobj) 
-{
-    mJSObject = jsobj;
-}
-
-inline
-const XPCDispInterface::Member* XPCDispInterface::FindMember(jsid name) const
-{
-    // Iterate backwards to save time
-    const Member* member = mMembers + mMemberCount;
-    while(member > mMembers)
-    {
-        --member;
-        if(name == member->GetName())
-        {
-            return member;
-        }
-    }
-    return nsnull;
-}
-
-
-inline
-const XPCDispInterface::Member& XPCDispInterface::GetMember(PRUint32 index)
-{ 
-    NS_ASSERTION(index < mMemberCount, "invalid index");
-    return mMembers[index]; 
-}
-
-inline
-PRUint32 XPCDispInterface::GetMemberCount() const 
-{
-    return mMemberCount;
-}
-
-inline
-void XPCDispInterface::operator delete(void * p) 
-{
-    PR_Free(p);
-}
-
-inline
-XPCDispInterface::~XPCDispInterface()
-{
-    // Cleanup our members, the first gets cleaned up by the destructor
-    // We have to cleanup the rest manually. These members are allocated
-    // as part of the XPCIDispInterface object at the end
-    for(PRUint32 index = 1; index < GetMemberCount(); ++index)
-    {
-        mMembers[index].~Member();
-    }
-}
-
-inline
-XPCDispInterface::XPCDispInterface(JSContext* cx, ITypeInfo * pTypeInfo,
-                                   PRUint32 members) : mJSObject(nsnull)
-{
-    InspectIDispatch(cx, pTypeInfo, members);
-}
-
-inline
-void * XPCDispInterface::operator new (size_t, PRUint32 members) 
-{
-    // Must allow for the member in XPCDispInterface
-    if(!members)
-        members = 1;
-    // Calculate the size needed for the base XPCDispInterface and its members
-    return PR_Malloc(sizeof(XPCDispInterface) + sizeof(Member) * (members - 1));
-}
-
-//=============================================================================
-// XPCDispNameArray inlines
-
-inline
-XPCDispNameArray::XPCDispNameArray() : mCount(0), mNames(0) 
-{
-}
-
-inline
-XPCDispNameArray::~XPCDispNameArray() 
-{ 
-    delete [] mNames;
-}
-
-inline
-void XPCDispNameArray::SetSize(PRUint32 size) 
-{
-    NS_ASSERTION(mCount == 0, "SetSize called more than once");
-    mCount = size;
-    mNames = (size ? new nsString[size] : 0);
-}
-
-inline
-PRUint32 XPCDispNameArray::GetSize() const 
-{
-    return mCount;
-}
-
-inline
-void XPCDispNameArray::SetName(DISPID dispid, nsAString const & name) 
-{
-    NS_ASSERTION(dispid <= (PRInt32)mCount, "Array bounds error in XPCDispNameArray::SetName");
-    mNames[dispid - 1] = name;
-}
-
-inline
-const nsAString & XPCDispNameArray::GetName(DISPID dispid) const 
-{
-    NS_ASSERTION(dispid <= (PRInt32)mCount, "Array bounds error in XPCDispNameArray::Get");
-    if(dispid > 0)
-        return mNames[dispid - 1];
-    return EmptyString();
-}
-
-inline
-DISPID XPCDispNameArray::Find(const nsAString &target) const
-{
-    for(PRUint32 index = 0; index < mCount; ++index) 
-    {
-        if(mNames[index].Equals(target)) 
-            return static_cast<DISPID>(index + 1);
-    }
-    return 0; 
-}
-
-//=============================================================================
-// XPCDispIDArray inlines
-
-inline
-PRUint32 XPCDispIDArray::Length() const
-{
-    return mIDArray.Length();
-}
-
-inline
-jsval XPCDispIDArray::Item(JSContext* cx, PRUint32 index) const
-{
-    jsval val;
-    if(!JS_IdToValue(cx, mIDArray.ElementAt(index), &val))
-        return JSVAL_NULL;
-    return val;
-}
-
-inline
-void XPCDispIDArray::Unmark()
-{
-    mMarked = JS_FALSE;
-}
-
-inline
-JSBool XPCDispIDArray::IsMarked() const
-{
-    return mMarked;
-}
-
-//=============================================================================
-// XPCDispTypeInfo inlines
-
-inline
-FUNCDESC* XPCDispTypeInfo::FuncDescArray::Get(PRUint32 index) 
-{
-    return &mArray[index];
-}
-
-inline
-void XPCDispTypeInfo::FuncDescArray::Release(FUNCDESC *) 
-{
-}
-
-inline
-PRUint32 XPCDispTypeInfo::FuncDescArray::Length() const 
-{
-    return mArray.Length();
-}
-
-inline
-const nsAString & XPCDispTypeInfo::GetNameForDispID(DISPID dispID)
-{
-    return mNameArray.GetName(dispID);
-}
-
-//=============================================================================
-// XPCDispJSPropertyInfo inlines
-
-inline
-PRBool XPCDispJSPropertyInfo::Valid() const 
-{
-    return mPropertyType != INVALID;
-}
-
-inline
-PRUint32 XPCDispJSPropertyInfo::GetParamCount() const
-{
-    return IsSetter() ? 1 : mParamCount;
-}
-
-inline
-PRUint32 XPCDispJSPropertyInfo::GetMemID() const
-{
-    return mMemID;
-}
-
-inline
-INVOKEKIND XPCDispJSPropertyInfo::GetInvokeKind() const
-{
-    return IsSetter() ? INVOKE_PROPERTYPUT : 
-        (IsProperty() ? INVOKE_PROPERTYGET : INVOKE_FUNC); 
-}
-
-inline
-PRBool XPCDispJSPropertyInfo::IsProperty() const
-{
-    return PropertyType() == PROPERTY || PropertyType() == READONLY_PROPERTY;
-}
-
-inline
-PRBool XPCDispJSPropertyInfo::IsReadOnly() const
-{
-    return PropertyType()== READONLY_PROPERTY;
-}
-
-inline
-PRBool XPCDispJSPropertyInfo::IsSetter() const
-{
-    return (mPropertyType & SETTER_MODE) != 0;
-}
-inline
-void XPCDispJSPropertyInfo::SetSetter()
-{
-    mPropertyType |= SETTER_MODE;
-}
-
-inline
-const nsAString & XPCDispJSPropertyInfo::GetName() const
-{
-    return mName; 
-}
-
-inline
-XPCDispJSPropertyInfo::property_type XPCDispJSPropertyInfo::PropertyType() const
-{
-    return static_cast<property_type>(mPropertyType & ~SETTER_MODE);
-}
-
-//=============================================================================
-// GUID/nsIID/nsCID conversion functions
-
-inline
-const nsIID & XPCDispIID2nsIID(const IID & iid)
-{
-    NS_ASSERTION(sizeof(IID) == sizeof(nsIID), "IID is not the same size as nsIID");
-    return reinterpret_cast<const nsIID &>(iid);
-}
-
-inline
-const IID & XPCDispIID2IID(const nsIID & iid)
-{
-    NS_ASSERTION(sizeof(IID) == sizeof(nsIID), "IID is not the same size as nsIID");
-    return reinterpret_cast<const IID &>(iid);
-}
-
-inline
-const nsCID & XPCDispCLSID2nsCID(const CLSID & clsid)
-{
-    NS_ASSERTION(sizeof(CLSID) == sizeof(nsCID), "CLSID is not the same size as nsCID");
-    return reinterpret_cast<const nsCID &>(clsid);
-}
-
-inline
-const CLSID & XPCDispnsCID2CLSID(const nsCID & clsid)
-{
-    NS_ASSERTION(sizeof(CLSID) == sizeof(nsCID), "CLSID is not the same size as nsCID");
-    return reinterpret_cast<const CLSID &>(clsid);
-}
-
-//=============================================================================
-// XPCDispParams inlines
-
-inline
-void XPCDispParams::SetNamedPropID()
-{
-    mDispParams.rgdispidNamedArgs = &mPropID; 
-    mDispParams.cNamedArgs = 1; 
-}
-
-inline
-VARIANT & XPCDispParams::GetParamRef(PRUint32 index)
-{
-    NS_ASSERTION(index < mDispParams.cArgs, "XPCDispParams::GetParam bounds error");
-    return mDispParams.rgvarg[mDispParams.cArgs - index - 1];
-}
-
-inline
-_variant_t XPCDispParams::GetParam(PRUint32 index) const
-{
-    return const_cast<XPCDispParams*>(this)->GetParamRef(index);
-}
-
-inline
-void * XPCDispParams::GetOutputBuffer(PRUint32 index)
-{
-    NS_ASSERTION(index < mDispParams.cArgs, "XPCDispParams::GetParam bounds error");
-    return mRefBuffer + sizeof(VARIANT) * index;
-}
-
-//=============================================================================
-// Other helper functions
-
-/**
- * Converts a jsval that is a string to a char const *
- * @param cx a JS context
- * @param val The JS value to be converted
- * @return a C string (Does not need to be freed)
- */
-inline
-jschar * xpc_JSString2String(JSContext * cx, jsval val, PRUint32 * len = 0)
-{
-    JSString* str = JSVAL_IS_STRING(val) ? JSVAL_TO_STRING(val) : 
-                                           JS_ValueToString(cx, val);
-    if(str)
-    {
-        if(len)
-            *len = JS_GetStringLength(str);
-        return JS_GetStringChars(str);
-    }
-    if(len)
-        *len = 0;
-    return nsnull;
-}
-
-/**
- * Converts a JSString * to a PRUnichar *
- * @param cx a JS context
- * @param str the JSString to be converted
- * @param length optional pointer to a variable to hold the length
- * @return a PRUnichar buffer (Does not need to be freed)
- */
-inline
-PRUnichar* xpc_JSString2PRUnichar(XPCCallContext& ccx, JSString* str,
-                                  size_t* length = nsnull)
-{
-    if(!str)
-        return nsnull;
-    if(length)
-        *length = JS_GetStringLength(str);
-    return reinterpret_cast<PRUnichar*>(JS_GetStringChars(str));
-}
-
deleted file mode 100644
--- a/js/src/xpconnect/src/XPCDispInterface.cpp
+++ /dev/null
@@ -1,372 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/** \file XPCDispInterface.cpp
- * XPCDispInterface implementation
- * This file contains the implementation of the XPCDispInterface class
- */
-
-#include "xpcprivate.h"
-
-/**
- * Is this function reflectable
- * This function determines if we should reflect a particular method of an
- * interface
- */
-inline
-PRBool IsReflectable(FUNCDESC * pFuncDesc)
-{
-    return (pFuncDesc->wFuncFlags&FUNCFLAG_FRESTRICTED) == 0 &&
-           pFuncDesc->funckind == FUNC_DISPATCH || 
-           pFuncDesc->funckind == FUNC_PUREVIRTUAL ||
-           pFuncDesc->funckind == FUNC_VIRTUAL;
-}
-
-XPCDispInterface::Allocator::Allocator(JSContext * cx, ITypeInfo * pTypeInfo) :
-    mMemIDs(nsnull), mCount(0), mIDispatchMembers(0), mCX(cx), 
-    mTypeInfo(pTypeInfo)
-{
-    TYPEATTR * attr;
-    HRESULT hr = pTypeInfo->GetTypeAttr(&attr);
-    if(SUCCEEDED(hr))
-    {
-        mIDispatchMembers = attr->cFuncs;
-        mMemIDs = new DISPID[mIDispatchMembers];
-        pTypeInfo->ReleaseTypeAttr(attr);
-        // Bail if we couldn't create the buffer
-        if(!mMemIDs)
-            return;
-    }
-    for(UINT iMethod = 0; iMethod < mIDispatchMembers; iMethod++ )
-    {
-        FUNCDESC* pFuncDesc;
-        if(SUCCEEDED(pTypeInfo->GetFuncDesc(iMethod, &pFuncDesc)))
-        {
-            // Only add the function to our list if it is at least at nesting level
-            // 2 (i.e. defined in an interface derived from IDispatch).
-            if(IsReflectable(pFuncDesc))
-                Add(pFuncDesc->memid);
-            pTypeInfo->ReleaseFuncDesc(pFuncDesc);
-        }
-    }
-}
-
-void XPCDispInterface::Allocator::Add(DISPID memID)
-{
-    NS_ASSERTION(Valid(), "Add should never be called if out of memory");
-    // Start from the end and work backwards, the last item is the most
-    // likely to match
-    PRUint32 index = mCount;
-    while(index > 0)
-    {
-        if(mMemIDs[--index] == memID)
-            return;
-    };
-    NS_ASSERTION(Count() < mIDispatchMembers, "mCount should always be less "
-                                             "than the IDispatch member count "
-                                             "here");
-    mMemIDs[mCount++] = memID;
-    return;
-}
-
-inline
-PRUint32 XPCDispInterface::Allocator::Count() const 
-{
-    return mCount;
-}
-
-XPCDispInterface*
-XPCDispInterface::NewInstance(JSContext* cx, nsISupports * pIface)
-{
-    CComQIPtr<IDispatch> pDispatch(reinterpret_cast<IUnknown*>(pIface));
-
-    if(pDispatch)
-    {
-        unsigned int count;
-        HRESULT hr = pDispatch->GetTypeInfoCount(&count);
-        if(SUCCEEDED(hr) && count > 0)
-        {
-            CComPtr<ITypeInfo> pTypeInfo;
-            hr = pDispatch->GetTypeInfo(0,LOCALE_SYSTEM_DEFAULT, &pTypeInfo);
-            if(SUCCEEDED(hr))
-            {
-                Allocator allocator(cx, pTypeInfo);
-                return allocator.Allocate();
-            }
-        }
-    }
-    return nsnull;
-}
-
-/**
- * Sets a members type based on COM's INVOKEKIND
- */
-static
-void ConvertInvokeKind(INVOKEKIND invokeKind, XPCDispInterface::Member & member)
-{
-    switch (invokeKind)
-    {
-        case INVOKE_FUNC:
-        {
-            member.SetFunction();
-        }
-        break;
-        case INVOKE_PROPERTYGET:
-        {
-            member.MakeGetter();
-        }
-        break;
-        case INVOKE_PROPERTYPUT:
-        {
-            member.MakeSetter();
-        }
-        break;
-        // TODO: Handle putref
-        default:
-        {
-            NS_ERROR("Invalid invoke kind found in COM type info");
-        }
-        break;
-    }
-}
-
-static
-PRBool InitializeMember(JSContext * cx, ITypeInfo * pTypeInfo,
-                        FUNCDESC * pFuncDesc, 
-                        XPCDispInterface::Member * pInfo)
-{
-    pInfo->SetMemID(pFuncDesc->memid);
-    BSTR name;
-    UINT nameCount;
-    if(FAILED(pTypeInfo->GetNames(
-        pFuncDesc->memid,
-        &name,
-        1,
-        &nameCount)))
-        return PR_FALSE;
-    if(nameCount != 1)
-        return PR_FALSE;
-    JSString* str = JS_InternUCStringN(cx,
-                                       reinterpret_cast<const jschar *>(name),
-                                       ::SysStringLen(name));
-    ::SysFreeString(name);
-    if(!str)
-        return PR_FALSE;
-    // Initialize
-    pInfo = new (pInfo) XPCDispInterface::Member;
-    if(!pInfo)
-        return PR_FALSE;
-    pInfo->SetName(INTERNED_STRING_TO_JSID(cx, str));
-    pInfo->ResetType();
-    ConvertInvokeKind(pFuncDesc->invkind, *pInfo);
-    pInfo->SetTypeInfo(pFuncDesc->memid, pTypeInfo, pFuncDesc);
-    return PR_TRUE;
-}
-
-static
-XPCDispInterface::Member * FindExistingMember(XPCDispInterface::Member * first,
-                                              XPCDispInterface::Member * last,
-                                              MEMBERID memberID)
-{
-    // Iterate backward since the last one in is the most likely match
-    XPCDispInterface::Member * cur = last;
-    if (cur != first)
-    {
-        do 
-        {
-            --cur;
-            if(cur->GetMemID() == memberID)
-                return cur;
-        } while(cur != first);
-    } 
-    // no existing property, return the new one
-    return last;
-}
-
-PRBool XPCDispInterface::InspectIDispatch(JSContext * cx, ITypeInfo * pTypeInfo, PRUint32 members)
-{
-    HRESULT hResult;
-
-    XPCDispInterface::Member * pInfo = mMembers;
-    mMemberCount = 0;
-    for(PRUint32 index = 0; index < members; index++ )
-    {
-        FUNCDESC* pFuncDesc;
-        hResult = pTypeInfo->GetFuncDesc(index, &pFuncDesc );
-        if(FAILED(hResult))
-            continue;
-        if(IsReflectable(pFuncDesc))
-        {
-            switch(pFuncDesc->invkind)
-            {
-                case INVOKE_PROPERTYPUT:
-                case INVOKE_PROPERTYPUTREF:
-                case INVOKE_PROPERTYGET:
-                {
-                    XPCDispInterface::Member * pExisting = FindExistingMember(mMembers, pInfo, pFuncDesc->memid);
-                    if(pExisting == pInfo)
-                    {
-                        if(InitializeMember(cx, pTypeInfo, pFuncDesc, pInfo))
-                        {
-                            ++pInfo;
-                            ++mMemberCount;
-                        }
-                    }
-                    else
-                    {
-                        ConvertInvokeKind(pFuncDesc->invkind, *pExisting);
-                    }
-                    if(pFuncDesc->invkind == INVOKE_PROPERTYGET)
-                    {
-                        pExisting->SetGetterFuncDesc(pFuncDesc);
-                    }
-                }
-                break;
-                case INVOKE_FUNC:
-                {
-                    if(InitializeMember(cx, pTypeInfo, pFuncDesc, pInfo))
-                    {
-                        ++pInfo;
-                        ++mMemberCount;
-                    }
-                }
-                break;
-                default:
-                    pTypeInfo->ReleaseFuncDesc(pFuncDesc);
-                break;
-            }
-        }
-        else
-        {
-            pTypeInfo->ReleaseFuncDesc(pFuncDesc);
-        }
-    }
-    return PR_TRUE;
-}
-
-/**
- * Compares a PRUnichar and a JS string ignoring case
- * @param ccx an XPConnect call context
- * @param lhr the PRUnichar string to be compared
- * @param lhsLength the length of the PRUnichar string
- * @param rhs the jsid that is the other string to compare
- * @return true if the strings are equal
- */
-inline
-PRBool CaseInsensitiveCompare(XPCCallContext& ccx, const PRUnichar* lhs, size_t lhsLength, jsid rhs)
-{
-    if(lhsLength == 0)
-        return PR_FALSE;
-    size_t rhsLength;
-    PRUnichar* rhsString = xpc_JSString2PRUnichar(ccx, JSID_TO_STRING(rhs), &rhsLength);
-    return rhsString && 
-        lhsLength == rhsLength &&
-        _wcsnicmp(lhs, rhsString, lhsLength) == 0;
-}
-
-const XPCDispInterface::Member* XPCDispInterface::FindMemberCI(XPCCallContext& ccx, jsid name) const
-{
-    size_t nameLength;
-    PRUnichar* sName = xpc_JSString2PRUnichar(ccx, JSID_TO_STRING(name), &nameLength);
-    if(!sName)
-        return nsnull;
-    // Iterate backwards over the members array (more efficient)
-    const Member* member = mMembers + mMemberCount;
-    while(member > mMembers)
-    {
-        --member;
-        if(CaseInsensitiveCompare(ccx, sName, nameLength, member->GetName()))
-        {
-            return member;
-        }
-    }
-    return nsnull;
-}
-
-JSBool XPCDispInterface::Member::GetValue(XPCCallContext& ccx,
-                                          XPCNativeInterface * iface, 
-                                          jsval * retval) const
-{
-    // This is a method or attribute - we'll be needing a function object
-
-    // We need to use the safe context for this thread because we don't want
-    // to parent the new (and cached forever!) function object to the current
-    // JSContext's global object. That would be bad!
-    if((mType & RESOLVED) == 0)
-    {
-        JSContext* cx = ccx.GetSafeJSContext();
-        if(!cx)
-            return JS_FALSE;
-
-        intN argc;
-        JSNative callback;
-        // Is this a function or a parameterized getter/setter
-        if(IsFunction() || IsParameterizedProperty())
-        {
-            argc = GetParamCount();
-            callback = XPC_IDispatch_CallMethod;
-        }
-        else
-        {
-            argc = 0;
-            callback = XPC_IDispatch_GetterSetter;
-        }
-
-        JSFunction *fun = JS_NewFunctionById(cx, callback, argc, 0, nsnull, mName);
-        if(!fun)
-            return JS_FALSE;
-
-        JSObject* funobj = JS_GetFunctionObject(fun);
-        if(!funobj)
-            return JS_FALSE;
-
-        // Store ourselves and our native interface within the JSObject
-        if(!JS_SetReservedSlot(ccx, funobj, 0, PRIVATE_TO_JSVAL((void *) this)))
-            return JS_FALSE;
-
-        if(!JS_SetReservedSlot(ccx, funobj, 1, PRIVATE_TO_JSVAL(iface)))
-            return JS_FALSE;
-
-        {   // scoped lock
-            XPCAutoLock lock(ccx.GetRuntime()->GetMapLock());
-            const_cast<Member*>(this)->mVal = OBJECT_TO_JSVAL(funobj);
-            const_cast<Member*>(this)->mType |= RESOLVED;
-        }
-    }
-    *retval = mVal;
-    return JS_TRUE;
-}
deleted file mode 100644
--- a/js/src/xpconnect/src/XPCDispObject.cpp
+++ /dev/null
@@ -1,496 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * \file XPCDispObject.cpp
- * Contains the XPCDispObject class implementation,
- * XPC_IDispatch_GetterSetter, and XPC_IDispatch_CallMethod
- */
-#include "xpcprivate.h"
-#include "nsIActiveXSecurityPolicy.h"
-
-/**
- * This is COM's IDispatch IID, but in XPCOM's nsID type
- */
-const nsID NSID_IDISPATCH = { 0x00020400, 0x0000, 0x0000, { 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } };
-
-PRBool
-XPCDispObject::WrapIDispatch(IDispatch *pDispatch, XPCCallContext &ccx,
-                             JSObject *obj, jsval *rval)
-{
-    if(!pDispatch)
-    {
-        return PR_FALSE;
-    }
-
-    // Wrap the desired COM object
-    nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
-    nsresult rv = ccx.GetXPConnect()->WrapNative(
-        ccx, obj, reinterpret_cast<nsISupports*>(pDispatch), NSID_IDISPATCH,
-        getter_AddRefs(holder));
-    if(NS_FAILED(rv) || !holder)
-    {
-        return PR_FALSE;
-    }
-    JSObject * jsobj;
-    if(NS_FAILED(holder->GetJSObject(&jsobj)))
-        return PR_FALSE;
-    *rval = OBJECT_TO_JSVAL(jsobj);
-    return PR_TRUE;
-}
-
-HRESULT XPCDispObject::SecurityCheck(XPCCallContext & ccx, const CLSID & aCID,
-                                     IDispatch ** createdObject)
-{
-    nsresult rv;
-    nsCOMPtr<nsIDispatchSupport> dispSupport = do_GetService(NS_IDISPATCH_SUPPORT_CONTRACTID, &rv);
-    if(NS_FAILED(rv)) return E_UNEXPECTED;
-
-    PRUint32 hostingFlags = nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_NOTHING;
-    dispSupport->GetHostingFlags(nsnull, &hostingFlags);
-    PRBool allowSafeObjects;
-    if(hostingFlags & (nsIActiveXSecurityPolicy::HOSTING_FLAGS_SCRIPT_SAFE_OBJECTS))
-        allowSafeObjects = PR_TRUE;
-    else
-        allowSafeObjects = PR_FALSE;
-    PRBool allowAnyObjects;
-    if(hostingFlags & (nsIActiveXSecurityPolicy::HOSTING_FLAGS_SCRIPT_ALL_OBJECTS))
-        allowAnyObjects = PR_TRUE;
-    else
-        allowAnyObjects = PR_FALSE;
-    if(!allowSafeObjects && !allowAnyObjects)
-        return E_FAIL;
-
-    PRBool classExists = PR_FALSE;
-    PRBool ok = PR_FALSE;
-    const nsCID & ourCID = XPCDispCLSID2nsCID(aCID);
-    dispSupport->IsClassSafeToHost(ccx, ourCID, PR_FALSE, &classExists, &ok);
-    if(classExists && !ok)
-        return E_FAIL;
-
-    // Test if the object is scriptable
-    PRBool isScriptable = PR_FALSE;
-    if(!allowAnyObjects)
-    {
-        PRBool classExists = PR_FALSE;
-        dispSupport->IsClassMarkedSafeForScripting(ourCID, &classExists, &isScriptable);
-        if(!classExists)
-            return REGDB_E_CLASSNOTREG;
-    }
-
-    // Create the object
-    CComPtr<IDispatch> disp;
-    // If createdObject isn't null we need to create the object
-    if (createdObject)
-    {
-        HRESULT hr = disp.CoCreateInstance(aCID);
-        if(FAILED(hr))
-            return hr;
-        // if we don't allow just any object, and it wasn't marked 
-        // safe for scripting then ask the object (MS idea of security)
-        if (!allowAnyObjects && !isScriptable)
-        {
-            dispSupport->IsObjectSafeForScripting(disp, NSID_IDISPATCH, &isScriptable);
-            if(!isScriptable)
-                return E_FAIL;
-        }
-        disp.CopyTo(createdObject);
-    }
-
-    return S_OK;
-}
-
-HRESULT XPCDispObject::COMCreateInstance(XPCCallContext & ccx, BSTR className,
-                                         PRBool enforceSecurity,
-                                         IDispatch ** result)
-{
-    NS_ENSURE_ARG_POINTER(result);
-    // Turn the string into a CLSID
-    _bstr_t bstrName(className);
-    CLSID classID = CLSID_NULL;
-    HRESULT hr = CLSIDFromString(bstrName, &classID);
-    if(FAILED(hr))
-        hr = CLSIDFromProgID(bstrName, &classID);
-    if(FAILED(hr) || ::IsEqualCLSID(classID, CLSID_NULL))
-        return hr;
-    
-    // If the caller cares about security do the necessary checks
-    // This results in the object being instantiated, so we'll use
-    // it
-    if(enforceSecurity)
-        return SecurityCheck(ccx, classID, result);
-    
-    CComPtr<IDispatch> disp;
-    hr = disp.CoCreateInstance(classID);
-    if(FAILED(hr))
-        return hr;
-
-    disp.CopyTo(result);
-
-    return S_OK;
-}
-
-// static
-JSBool XPCDispObject::Dispatch(XPCCallContext& ccx, IDispatch * disp,
-                               DISPID dispID, CallMode mode, 
-                               XPCDispParams * params,
-                               jsval* retval,
-                               XPCDispInterface::Member * member,
-                               XPCJSRuntime* rt)
-{
-    _variant_t dispResult;
-    jsval val;
-    uintN err;
-    uintN argc = params->GetParamCount();
-    // Figure out what we're doing (getter/setter/method)
-    WORD dispFlags;
-    if(mode == CALL_SETTER)
-    {
-        dispFlags = DISPATCH_PROPERTYPUT;
-    }
-    else if(mode == CALL_GETTER)
-    {
-        dispFlags = DISPATCH_PROPERTYGET;
-    }
-    else
-    {
-        dispFlags = DISPATCH_METHOD;
-    }
-    HRESULT invokeResult;
-    EXCEPINFO exception;
-    // Scope the lock
-    {
-        // avoid deadlock in case the native method blocks somehow
-        JSAutoSuspendRequest req(ccx);  // scoped suspend of request
-        // call IDispatch's invoke
-        invokeResult= disp->Invoke(
-            dispID,                  // IDispatch ID
-            IID_NULL,                // Reserved must be IID_NULL
-            LOCALE_SYSTEM_DEFAULT,   // The locale context, use the system's
-            dispFlags,               // Type of Invoke call
-            params->GetDispParams(), // Parameters
-            &dispResult,             // Where the result is stored
-            &exception,              // Exception information
-            0);                      // Index of an argument error
-    }
-    if(SUCCEEDED(invokeResult))
-    {
-        *retval = JSVAL_VOID;
-        if(mode == CALL_METHOD)
-        {
-            NS_ASSERTION(member, "member must not be null if this is a method");
-            for(PRUint32 index = 0; index < argc; ++index)
-            {
-                const XPCDispInterface::Member::ParamInfo & paramInfo = member->GetParamInfo(index);
-                if(paramInfo.IsOut())
-                {
-                    if(!XPCDispConvert::COMToJS(ccx, params->GetParamRef(index), val, err))
-                        return ThrowBadParam(err, index, ccx);
-
-                    if(paramInfo.IsRetVal())
-                    {
-                        *retval = val;
-                    }
-                    else
-                    {
-                        jsval * argv = ccx.GetArgv();
-                        // Out, in/out parameters must be objects
-                        if(!JSVAL_IS_OBJECT(argv[index]) ||
-                            !JS_SetPropertyById(ccx, JSVAL_TO_OBJECT(argv[index]),
-                                rt->GetStringID(XPCJSRuntime::IDX_VALUE), &val))
-                            return ThrowBadParam(NS_ERROR_XPC_CANT_SET_OUT_VAL, index, ccx);
-                    }
-                }
-            }
-        }
-        if(dispResult.vt != VT_EMPTY)
-        {
-            if(!XPCDispConvert::COMToJS(ccx, dispResult, val, err))
-            {
-                ThrowBadParam(err, 0, ccx);
-            }
-            *retval = val;
-        }
-    }
-    // Set the result and throw the error if one occurred
-    ccx.GetXPCContext()->SetLastResult(invokeResult);
-
-    if(NS_FAILED(invokeResult))
-    {
-        XPCThrower::ThrowCOMError(ccx, invokeResult, NS_ERROR_XPC_COM_ERROR, 
-                                  invokeResult == DISP_E_EXCEPTION ? 
-                                      &exception : nsnull);
-        return JS_FALSE;
-    }
-    return JS_TRUE;
-}
-
-JSBool XPCDispObject::Invoke(XPCCallContext & ccx, CallMode mode)
-{
-    nsresult rv = ccx.CanCallNow();
-    if(NS_FAILED(rv))
-    {
-        // If the security manager is complaining then this is not really an
-        // internal error in xpconnect. So, no reason to botch the assertion.
-        NS_ASSERTION(rv == NS_ERROR_XPC_SECURITY_MANAGER_VETO, 
-                     "hmm? CanCallNow failed in XPCDispObject::Invoke. "
-                     "We are finding out about this late!");
-        XPCThrower::Throw(rv, ccx);
-        return JS_FALSE;
-    }
-
-    // TODO: Remove type cast and change GetIDispatchMember to use the correct type
-    XPCDispInterface::Member* member = reinterpret_cast<XPCDispInterface::Member*>(ccx.GetIDispatchMember());
-    XPCJSRuntime* rt = ccx.GetRuntime();
-    XPCContext* xpcc = ccx.GetXPCContext();
-    XPCPerThreadData* tls = ccx.GetThreadData();
-
-    jsval* argv = ccx.GetArgv();
-    uintN argc = ccx.GetArgc();
-
-    tls->SetException(nsnull);
-    xpcc->SetLastResult(NS_ERROR_UNEXPECTED);
-
-    // set up the method index and do the security check if needed
-
-    PRUint32 secFlag;
-    PRUint32 secAction;
-
-    switch(mode)
-    {
-        case CALL_METHOD:
-            secFlag   = nsIXPCSecurityManager::HOOK_CALL_METHOD;
-            secAction = nsIXPCSecurityManager::ACCESS_CALL_METHOD;
-            break;
-        case CALL_GETTER:
-            secFlag   = nsIXPCSecurityManager::HOOK_GET_PROPERTY;
-            secAction = nsIXPCSecurityManager::ACCESS_GET_PROPERTY;
-            break;
-        case CALL_SETTER:
-            secFlag   = nsIXPCSecurityManager::HOOK_SET_PROPERTY;
-            secAction = nsIXPCSecurityManager::ACCESS_SET_PROPERTY;
-            break;
-        default:
-            NS_ERROR("bad value");
-            return JS_FALSE;
-    }
-    jsid name = member->GetName();
-
-    nsIXPCSecurityManager* sm = xpcc->GetAppropriateSecurityManager(secFlag);
-    XPCWrappedNative* wrapper = ccx.GetWrapper();
-    if(sm && NS_FAILED(sm->CanAccess(secAction, &ccx, ccx,
-                                     ccx.GetFlattenedJSObject(),
-                                     wrapper->GetIdentityObject(),
-                                     wrapper->GetClassInfo(), name,
-                                     wrapper->GetSecurityInfoAddr())))
-    {
-        // the security manager vetoed. It should have set an exception.
-        return JS_FALSE;
-    }
-
-    IDispatch * pObj = reinterpret_cast<IDispatch*>
-                                       (ccx.GetTearOff()->GetNative());
-    PRUint32 args = member->GetParamCount();
-    uintN err;
-    // Make sure setter has one argument
-    if(mode == CALL_SETTER)
-        args = 1;
-    // Allow for optional parameters. We'll let COM handle the error if there
-    // are not enough parameters
-    if(argc < args)
-        args = argc;
-    XPCDispParams * params = new XPCDispParams(args);
-    jsval val;
-    // If this is a setter, we just need to convert the first parameter
-    if(mode == CALL_SETTER)
-    {
-        params->SetNamedPropID();
-        if(!XPCDispConvert::JSToCOM(ccx, argv[0], params->GetParamRef(0), err))
-        {
-            delete params;
-            return ThrowBadParam(err, 0, ccx);
-        }
-    }
-    else if(mode != CALL_GETTER)    // This is a function
-    {
-        // Convert the arguments to the function
-        for(PRUint32 index = 0; index < args; ++index)
-        {
-            const XPCDispInterface::Member::ParamInfo & paramInfo = member->GetParamInfo(index);
-            if(paramInfo.IsIn())
-            {
-                val = argv[index];
-                if(paramInfo.IsOut())
-                {
-                    if(JSVAL_IS_PRIMITIVE(val) ||
-                        !JS_GetPropertyById(ccx, JSVAL_TO_OBJECT(val),
-                            rt->GetStringID(XPCJSRuntime::IDX_VALUE), &val))
-                    {
-                        delete params;
-                        return ThrowBadParam(NS_ERROR_XPC_NEED_OUT_OBJECT, index, ccx);
-                    }
-                    paramInfo.InitializeOutputParam(params->GetOutputBuffer(index), params->GetParamRef(index));
-                }
-                if(!XPCDispConvert::JSToCOM(ccx, val, params->GetParamRef(index), err, paramInfo.IsOut()))
-                {
-                    delete params;
-                    return ThrowBadParam(err, index, ccx);
-                }
-            }
-            else
-            {
-                paramInfo.InitializeOutputParam(params->GetOutputBuffer(index), params->GetParamRef(index));
-            }
-        }
-    }
-    if(member->IsParameterizedProperty())
-    {
-        mode = CALL_GETTER;
-    }
-    JSBool retval = Dispatch(ccx, pObj, member->GetDispID(), mode, params, &val, member, rt);
-    if(retval && mode == CALL_SETTER)
-    {
-        ccx.SetRetVal(argv[0]);
-    }
-    else
-    {
-        ccx.SetRetVal(val);
-    }
-    delete params;
-    return retval;
-}
-
-static
-JSBool GetMember(XPCCallContext& ccx, JSObject* funobj, XPCNativeInterface*& iface, XPCDispInterface::Member*& member)
-{
-    jsval val;
-    if(!JS_GetReservedSlot(ccx, funobj, 1, &val))
-        return JS_FALSE;
-    if(JSVAL_IS_VOID(val))
-        return JS_FALSE;
-    iface = reinterpret_cast<XPCNativeInterface*>(JSVAL_TO_PRIVATE(val));
-    if(!JS_GetReservedSlot(ccx, funobj, 0, &val))
-        return JS_FALSE;
-    if(JSVAL_IS_VOID(val))
-        return JS_FALSE;
-    member = reinterpret_cast<XPCDispInterface::Member*>(JSVAL_TO_PRIVATE(val));
-    return JS_TRUE;
-}
-
-// Handy macro used in callbacks below.
-#define THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper)                         \
-    PR_BEGIN_MACRO                                                           \
-    if(!wrapper)                                                             \
-    {                                                                        \
-        XPCThrower::Throw(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO, cx);              \
-        return JS_FALSE;                                                     \
-    }                                                                        \
-    if(!wrapper->IsValid())                                                  \
-    {                                                                        \
-        XPCThrower::Throw(NS_ERROR_XPC_HAS_BEEN_SHUTDOWN, cx);               \
-        return JS_FALSE;                                                     \
-    }                                                                        \
-    PR_END_MACRO
-
-/**
- * Callback for functions
- * This callback is called by JS when a function on a JSObject proxying
- * for an IDispatch instance
- * @param cx A pointer to a JS context
- * @param obj JS object that the parameterized property is on
- * @param argc Number of arguments in this call
- * @param argv The parameters passed in if any
- * @param vp The return value
- * @return Returns JS_TRUE if the operation succeeded
- */
-JSBool
-XPC_IDispatch_CallMethod(JSContext* cx, JSObject* obj, uintN argc,
-                         jsval* argv, jsval* vp)
-{
-    NS_ASSERTION(JS_TypeOfValue(cx, argv[-2]) == JSTYPE_FUNCTION, "bad function");
-    JSObject* funobj = JSVAL_TO_OBJECT(argv[-2]);
-    XPCCallContext ccx(JS_CALLER, cx, obj, funobj, INT_TO_JSID(0), argc, argv, vp);
-    XPCWrappedNative* wrapper = ccx.GetWrapper();
-    THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
-    ccx.SetArgsAndResultPtr(argc, argv, vp);
-
-    XPCDispInterface::Member* member;
-    XPCNativeInterface* iface;
-#ifdef DEBUG
-    PRBool ok =
-#endif
-    GetMember(ccx, funobj, iface, member);
-    NS_ASSERTION(ok, "GetMember faild in XPC_IDispatch_CallMethod");
-    ccx.SetIDispatchInfo(iface, member);
-
-    return XPCDispObject::Invoke(ccx, XPCDispObject::CALL_METHOD);
-}
-
-/**
- * Callback for properties
- * This callback is called by JS when a property is set or retrieved on a 
- * JSObject proxying for an IDispatch instance
- * @param cx A pointer to a JS context
- * @param obj JS object that the parameterized property is on
- * @param argc Number of arguments in this call
- * @param argv The parameters passed in if any
- * @param vp The return value
- * @return Returns JS_TRUE if the operation succeeded
- */
-JSBool
-XPC_IDispatch_GetterSetter(JSContext *cx, JSObject *obj, uintN argc,
-                           jsval *argv, jsval *vp)
-{
-    NS_ASSERTION(JS_TypeOfValue(cx, argv[-2]) == JSTYPE_FUNCTION, "bad function");
-    JSObject* funobj = JSVAL_TO_OBJECT(argv[-2]);
-
-    XPCCallContext ccx(JS_CALLER, cx, obj, funobj);
-    XPCWrappedNative* wrapper = ccx.GetWrapper();
-    THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
-
-    ccx.SetArgsAndResultPtr(argc, argv, vp);
-    XPCDispInterface::Member* member;
-    XPCNativeInterface* iface;
-#ifdef DEBUG
-    PRBool ok =
-#endif
-    GetMember(ccx, funobj, iface, member);
-    NS_ASSERTION(ok, "GetMember faild in XPC_IDispatch_CallMethod");
-
-    ccx.SetIDispatchInfo(iface, member);
-    return XPCDispObject::Invoke(ccx, argc != 0 ? XPCDispObject::CALL_SETTER : XPCDispObject::CALL_GETTER);
-}
deleted file mode 100644
--- a/js/src/xpconnect/src/XPCDispParams.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * \file XPCDispParams.cpp
- * Implementation of the helper class XPCDispParams
- */
-
-#include "xpcprivate.h"
-
-XPCDispParams::XPCDispParams(PRUint32 args) : 
-    mRefBuffer(mStackRefBuffer + sizeof(VARIANT)),
-    mDispParamsAllocated(nsnull),
-    mRefBufferAllocated(nsnull),
-    mPropID(DISPID_PROPERTYPUT)
-#ifdef DEBUG
-    ,mInserted(PR_FALSE)
-#endif
-{
-    if(args >= DEFAULT_ARG_ARRAY_SIZE)
-    {
-        mRefBufferAllocated = new char[RefBufferSize(args)];
-        mRefBuffer = mRefBufferAllocated + sizeof(VARIANT);
-    }
-    // Initialize the full buffer that was allocated
-    memset(mRefBuffer - sizeof(VARIANT), 0, RefBufferSize(args));
-    // Initialize the IDispatch parameters
-    mDispParams.cArgs = args;
-    if(args == 0)
-        mDispParams.rgvarg = nsnull;
-    else if (args <= DEFAULT_ARG_ARRAY_SIZE)
-        mDispParams.rgvarg = mStackArgs + 1;
-    else
-    {
-        mDispParamsAllocated = new VARIANT[args + 1];
-        mDispParams.rgvarg =  mDispParamsAllocated + 1;
-    }
-    mDispParams.rgdispidNamedArgs = nsnull;
-    mDispParams.cNamedArgs = 0;
-}
-
-
-XPCDispParams::~XPCDispParams()
-{
-    // Cleanup the variants
-    for(PRUint32 index = 0; index < mDispParams.cArgs; ++index)
-        VariantClear(mDispParams.rgvarg + index);
-    // Cleanup if we allocated the variant array. Remember that
-    // our buffer may point one element into the allocate buffer
-    delete [] mRefBufferAllocated;
-    delete [] mDispParamsAllocated;
-}
-
-void XPCDispParams::InsertParam(_variant_t & var)
-{
-#ifdef DEBUG
-    NS_ASSERTION(!mInserted, 
-                 "XPCDispParams::InsertParam cannot be called more than once");
-    mInserted = PR_TRUE;
-#endif
-    // Bump the pointer back and increment the arg count
-    --mDispParams.rgvarg;
-    mRefBuffer -= sizeof(VARIANT);
-    ++mDispParams.cArgs;
-    // Assign the value
-    mDispParams.rgvarg[0] = var.Detach();
-    // initialize the ref buffer
-    memset(mRefBuffer, 0, sizeof(VARIANT));
-}
deleted file mode 100644
--- a/js/src/xpconnect/src/XPCDispPrivate.h
+++ /dev/null
@@ -1,1330 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef XPCDispPrivate_h__
-#define XPCDispPrivate_h__
-
-/**
- * \file XPCDispPrivate.h
- * \brief Contains all the private class declarations
- */
-
-#ifndef xpcprivate_h___
-#error "DispPrivate.h should not be included directly, please use XPCPrivate.h"
-#endif
-
-/**
- * Needed for CComPtr and friends
- */
-#include <atlbase.h>
-/**
- * Needed for _variant_t and _bstr_t
- */
-#include <comdef.h>
-/**
- * IObjectSafety interface and friends
- */
-#include "objsafe.h"
-
-// MS clutters the global namespace with so many macro names :-(
-// I tried to keep these includes in the CPP's but it became too
-// convoluted
-#undef GetClassInfo
-#undef GetClassName
-#undef GetMessage
-
-// We need IDispatch
-#include "nsIDispatchSupport.h"
-
-// The following are macro helpers pulled from XPCOM but tailored to COM
-#define NS_DECL_IUNKNOWN                                                      \
-public:                                                                       \
-  STDMETHOD(QueryInterface)(REFIID aIID,                                      \
-                            void** aInstancePtr);                             \
-  STDMETHODIMP_(ULONG) AddRef(void);                                          \
-  STDMETHODIMP_(ULONG) Release(void);                                         \
-protected:                                                                    \
-  ULONG mRefCnt;                                                       
-
-#define NS_IMPL_COM_QUERY_HEAD(_class)                                        \
-STDMETHODIMP _class::QueryInterface(REFIID aIID, void** aInstancePtr)         \
-{                                                                             \
-  NS_ASSERTION(aInstancePtr,                                                  \
-               "QueryInterface requires a non-NULL destination!");            \
-  if( !aInstancePtr )                                                         \
-    return E_POINTER;                                                         \
-  IUnknown* foundInterface;
-
-#define NS_IMPL_COM_QUERY_BODY(_interface)                                    \
-  if(IsEqualIID(aIID, __uuidof(_interface)) )                                 \
-    foundInterface = static_cast<_interface*>(this);                          \
-  else
-
-#define NS_IMPL_COM_QUERY_TAIL_GUTS                                           \
-    foundInterface = 0;                                                       \
-  HRESULT status;                                                             \
-  if( !foundInterface )                                                       \
-    status = E_NOINTERFACE;                                                   \
-  else                                                                        \
-    {                                                                         \
-      NS_ADDREF(foundInterface);                                              \
-      status = S_OK;                                                          \
-    }                                                                         \
-  *aInstancePtr = foundInterface;                                             \
-  return status;                                                              \
-}
-
-#define NS_COM_MAP_BEGIN(_implClass)      NS_IMPL_COM_QUERY_HEAD(_implClass)
-#define NS_COM_MAP_ENTRY(_interface)      NS_IMPL_COM_QUERY_BODY(_interface)
-#define NS_COM_MAP_END                    NS_IMPL_COM_QUERY_TAIL_GUTS
-
-#define NS_COM_IMPL_ADDREF(_class)                                            \
-STDMETHODIMP_(ULONG) _class::AddRef(void)                                     \
-{                                                                             \
-  NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");                   \
-  NS_ASSERT_OWNINGTHREAD(_class);                                             \
-  ++mRefCnt;                                                                  \
-  NS_LOG_ADDREF(this, mRefCnt, #_class, sizeof(*this));                       \
-  return mRefCnt;                                                             \
-}
-
-#define NS_COM_IMPL_RELEASE(_class)                                           \
-STDMETHODIMP_(ULONG) _class::Release(void)                                    \
-{                                                                             \
-  NS_PRECONDITION(0 != mRefCnt, "dup release");                               \
-  NS_ASSERT_OWNINGTHREAD(_class);                                             \
-  --mRefCnt;                                                                  \
-  NS_LOG_RELEASE(this, mRefCnt, #_class);                                     \
-  if(mRefCnt == 0) {                                                         \
-    mRefCnt = 1; /* stabilize */                                              \
-    delete this;                                                              \
-    return 0;                                                                 \
-  }                                                                           \
-  return mRefCnt;                                                             \
-}
-
-extern const nsID NSID_IDISPATCH;
-
-/**
- * JS<>COM Conversion functions. XPCDispConvert serves more as a namespace than
- * a class. It contains the functions to convert between JS and COM data and
- * any helper functions needed
- */
-class XPCDispConvert
-{
-public:
-    /**
-     * Returns the COM type for a given jsval
-     * @param ccx XPConnect call context
-     * @param val Value to look up the type for
-     * @return the COM variant type
-     */
-    static
-    VARTYPE JSTypeToCOMType(XPCCallContext& ccx, jsval val);
-
-    /**
-     * Converts a JSVal to a COM variant
-     * @param ccx XPConnect call context
-     * @param src JS Value to convert
-     * @param dest COM variant to receive the converted value
-     * @param err receives the error code if any of a failed conversion
-     * @return True if the conversion succeeded
-     */
-    static
-    JSBool JSToCOM(XPCCallContext& ccx, jsval src, VARIANT & dest, 
-                   nsresult& err, JSBool isByRef = JS_FALSE);
-
-    /**
-     * Converts a COM variant to a jsval
-     * @param ccx XPConnect call context
-     * @param src COM variant to convert
-     * @param dest jsval to receive the converted value
-     * @param err receives the error code if any of a failed conversion
-     * @return Returns true if the conversion succeeded
-     */
-    static
-    JSBool COMToJS(XPCCallContext& ccx, const VARIANT & src, jsval & dest,
-                   nsresult& err);
-private:
-    /**
-     * Converts a JS Array to a safe array
-     * @param ccx XPConnect call context
-     * @param obj JSObject that is the array
-     * @param var the variant to receive the array
-     * @param err receives the error code if any of a failed conversion
-     * @return True if the conversion succeeded
-     */
-    static
-    JSBool JSArrayToCOMArray(XPCCallContext& ccx, JSObject *obj, VARIANT & var,
-                          nsresult& err);
-    /**
-     * Converts a COM Array to a JS Array
-     * @param ccx XPConnect call context
-     * @param src the variant holding the array
-     * @param dest the jsval to receive the array
-     * @param err receives the error code if any of a failed conversion
-     * @return True if the conversion succeeded
-     */
-    static
-    JSBool COMArrayToJSArray(XPCCallContext& ccx, const VARIANT & src,
-                             jsval & dest, nsresult& err);
-};
-
-/**
- * JS callback function that is called when a function is invoked
- * @param cx the JS context the function is invoked with
- * @param obj the object the function is invoked on
- * @param argc the number of parameters passed to the function
- * @param argv the array of parameters passed to the function
- * @param vp holds the result of the function
- * @return true if the function completes without error
- */
-JSBool
-XPC_IDispatch_CallMethod(JSContext *cx, JSObject *obj, uintN argc,
-                         jsval *argv, jsval *vp);
-/**
- * JS callback function that is called when a getter/setter is invoked
- * @param cx the JS context the function is invoked with
- * @param obj the object the function is invoked on
- * @param argc the number of parameters passed to the function
- * @param argv the array of parameters passed to the function
- * @param vp holds the result of the function
- * @return true if the function completes without error
- */
-JSBool
-XPC_IDispatch_GetterSetter(JSContext *cx, JSObject *obj, uintN argc, 
-                           jsval *argv, jsval *vp);
-
-/**
- * This class holds an array of names. This is only used in wrapped
- * JS objects, so the dispid's are not arbitrary. They begin with 1
- * and so dispid - 1 is the index into the array mNames
- */
-class XPCDispNameArray
-{
-public:
-    /**
-     * Intializes the array to zero elements
-     */
-    XPCDispNameArray();
-    /**
-     * Cleans up the mNames array
-     */
-    ~XPCDispNameArray();
-    /**
-     * Sets the size of the array
-     * @param size the new size of the array
-     */
-    void SetSize(PRUint32 size);
-    /**
-     * Returns the current size of the array
-     * @return the current size of the array
-     */
-    PRUint32 GetSize() const;
-    /**
-     * Assigns a name/string to a given element. This function will not
-     * expand the array and performs bounds checking in debug builds.
-     * @param dispid IDispatch id for the name
-     * @param name the name to assign
-     */
-    void SetName(DISPID dispid, nsAString const & name);
-    /**
-     * Retrieves a name/string for a dispid. This function
-     * performs bounds checking in debug builds
-     * @param dispid dispatch ID of the name to retrieve
-     */
-    const nsAString&  GetName(DISPID dispid) const;
-    /**
-     * Performs a search of the array for the target returning the
-     * the id for the name
-     * @param target the name to find
-     */
-    DISPID Find(const nsAString &target) const;
-private:
-    PRUint32 mCount;
-    nsString* mNames;
-};
-
-/**
- * This class represents an array of JSID's.
- * It takes care of marking the ID's during GC
- */
-class XPCDispIDArray
-{
-public:
-    /**
-     * Initializes the array from the JSIdArray passed in
-     * @param ccx XPConnect call context
-     * @param array a JS array of ID's
-     */
-    XPCDispIDArray(XPCCallContext& ccx, JSIdArray* array);
-
-    /**
-     * Returns the length of the array
-     * @return length of the array
-     */
-    PRUint32 Length() const;
-
-    /**
-     * Returns an ID within the array
-     * @param cx a JS context
-     * @param index index into the array
-     * @return the ID as a jsval
-     */
-    jsval Item(JSContext* cx, PRUint32 index) const;
-
-    /**
-     * Called to trace jsval associated with the ID's
-     */
-    void TraceJS(JSTracer* trc);
-
-    /**
-     * Called to unmark the ID's marked during GC marking trace
-     */
-    void Unmark();
-
-    /**
-     * Tests whether the ID is marked
-     */
-    JSBool IsMarked() const;
-private:
-    JSBool mMarked;
-    nsTArray<jsid> mIDArray;
-};
-
-/**
- * Implements ITypeInfo interface for JSObjects
- */
-class XPCDispTypeInfo : public ITypeInfo
-{
-    NS_DECL_IUNKNOWN
-public:
-    /**
-     * Manages an array of FUNCDESC structs
-     */
-    class FuncDescArray
-    {
-    public:
-        /**
-         * Initializes the function description array
-         */
-        FuncDescArray(XPCCallContext& ccx, JSObject* obj, 
-                      const XPCDispIDArray& array, XPCDispNameArray & names);
-        /**
-         * cleans up the function description array
-         */
-        ~FuncDescArray();
-        /**
-         * Retrieves a function description from the array.
-         * @param index index into the array
-         * @return pointer to the function description
-         */
-        FUNCDESC* Get(PRUint32 index);
-        /**
-         * Releases a function description object. Currently there is nothing
-         * to do as ownership is maintained by the object and the objects 
-         * returned never live longer than the FuncDescArray instance they
-         * were created on
-         */
-        void Release(FUNCDESC *);
-        /**
-         * Returns the length of the array
-         * @return the length of the array
-         */
-        PRUint32 Length() const;
-    private:
-        nsTArray<FUNCDESC> mArray;
-        /**
-         * Initializes a function description object
-         * @param ccx XPConnect context
-         * @param obj Array to used for the initialization
-         * @param propInfo property information for the element/function
-         */
-        PRBool BuildFuncDesc(XPCCallContext& ccx, JSObject* obj,
-                           XPCDispJSPropertyInfo & propInfo);
-    };
-    /**
-     * Creates an instance of XPCDispTypeInfo
-     * This static function is to be used to create instances of XPCDispTypeInfo.
-     */
-    static
-    XPCDispTypeInfo* New(XPCCallContext& ccx, JSObject* obj);
-    virtual ~XPCDispTypeInfo();
-    // ITypeInfo methods, see MSDN for detail information
-    STDMETHOD(GetTypeAttr)( 
-        /* [out] */ TYPEATTR __RPC_FAR *__RPC_FAR *ppTypeAttr);
-    
-    STDMETHOD(GetTypeComp)(
-        /* [out] */ ITypeComp __RPC_FAR *__RPC_FAR *ppTComp);
-    
-    STDMETHOD(GetFuncDesc)( 
-        /* [in] */ UINT index,
-        /* [out] */ FUNCDESC __RPC_FAR *__RPC_FAR *ppFuncDesc);
-    
-    STDMETHOD(GetVarDesc)( 
-        /* [in] */ UINT index,
-        /* [out] */ VARDESC __RPC_FAR *__RPC_FAR *ppVarDesc);
-    
-    STDMETHOD(GetNames)( 
-        /* [in] */ MEMBERID memid,
-        /* [length_is][size_is][out] */ BSTR __RPC_FAR *rgBstrNames,
-        /* [in] */ UINT cMaxNames,
-        /* [out] */ UINT __RPC_FAR *pcNames);
-    
-    STDMETHOD(GetRefTypeOfImplType)( 
-        /* [in] */ UINT index,
-        /* [out] */ HREFTYPE __RPC_FAR *pRefType);
-    
-    STDMETHOD(GetImplTypeFlags)( 
-        /* [in] */ UINT index,
-        /* [out] */ INT __RPC_FAR *pImplTypeFlags);
-    
-    STDMETHOD(GetIDsOfNames)( 
-        /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
-        /* [in] */ UINT cNames,
-        /* [size_is][out] */ MEMBERID __RPC_FAR *pMemId);
-    
-    STDMETHOD(Invoke)( 
-        /* [in] */ PVOID pvInstance,
-        /* [in] */ MEMBERID memid,
-        /* [in] */ WORD wFlags,
-        /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
-        /* [out] */ VARIANT __RPC_FAR *pVarResult,
-        /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
-        /* [out] */ UINT __RPC_FAR *puArgErr);
-    
-    STDMETHOD(GetDocumentation)( 
-        /* [in] */ MEMBERID memid,
-        /* [out] */ BSTR __RPC_FAR *pBstrName,
-        /* [out] */ BSTR __RPC_FAR *pBstrDocString,
-        /* [out] */ DWORD __RPC_FAR *pdwHelpContext,
-        /* [out] */ BSTR __RPC_FAR *pBstrHelpFile);
-    
-    STDMETHOD(GetDllEntry)( 
-        /* [in] */ MEMBERID memid,
-        /* [in] */ INVOKEKIND invKind,
-        /* [out] */ BSTR __RPC_FAR *pBstrDllName,
-        /* [out] */ BSTR __RPC_FAR *pBstrName,
-        /* [out] */ WORD __RPC_FAR *pwOrdinal);
-    
-    STDMETHOD(GetRefTypeInfo)( 
-        /* [in] */ HREFTYPE hRefType,
-        /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
-    
-    STDMETHOD(AddressOfMember)( 
-        /* [in] */ MEMBERID memid,
-        /* [in] */ INVOKEKIND invKind,
-        /* [out] */ PVOID __RPC_FAR *ppv);
-    
-    STDMETHOD(CreateInstance)( 
-        /* [in] */ IUnknown __RPC_FAR *pUnkOuter,
-        /* [in] */ REFIID riid,
-        /* [iid_is][out] */ PVOID __RPC_FAR *ppvObj);
-    
-    STDMETHOD(GetMops)( 
-        /* [in] */ MEMBERID memid,
-        /* [out] */ BSTR __RPC_FAR *pBstrMops);
-    
-    STDMETHOD(GetContainingTypeLib)( 
-        /* [out] */ ITypeLib __RPC_FAR *__RPC_FAR *ppTLib,
-        /* [out] */ UINT __RPC_FAR *pIndex);
-    
-    virtual /* [local] */ void STDMETHODCALLTYPE ReleaseTypeAttr( 
-        /* [in] */ TYPEATTR __RPC_FAR *pTypeAttr);
-    
-    virtual /* [local] */ void STDMETHODCALLTYPE ReleaseFuncDesc( 
-        /* [in] */ FUNCDESC __RPC_FAR *pFuncDesc);
-    
-    virtual /* [local] */ void STDMETHODCALLTYPE ReleaseVarDesc( 
-        /* [in] */ VARDESC __RPC_FAR *pVarDesc);
-    /**
-     * Returns the name of a function given a DISPID
-     * @param dispID the DISPID to look up
-     * @return the name of the function
-     */
-    const nsAString& GetNameForDispID(DISPID dispID);
-private:
-    /**
-     * Initializes the object
-     * @param ccx an XPConnect call context
-     * @param obj the JS object being wrapped
-     * @param array the array of JS ID's for the object
-     */
-    XPCDispTypeInfo(XPCCallContext& ccx, JSObject* obj, XPCDispIDArray* array);
-    JSObject*               mJSObject;
-    XPCDispIDArray*         mIDArray;
-    XPCDispNameArray        mNameArray;
-    // mFuncDescArray must occur after
-    // TODO: We should probably refactor this so this isn't a requirement
-    FuncDescArray        mFuncDescArray;
-};
-
-/**
- * Helper class that describes a JS function or property
- */
-class XPCDispJSPropertyInfo
-{
-public:
-    /**
-     * Inspects a JS Function or property
-     * @param cx A JS Context
-     * @param memid the ID of the property or function
-     * @param obj the JS object the property or function resides on
-     * @param val ID val of the property or function
-     */
-    XPCDispJSPropertyInfo(JSContext*cx, PRUint32 memid, JSObject* obj, jsval val);
-    /**
-     * Returns true if the property information was initialized property
-     * @return true if the property information was initialized property
-     */
-    PRBool Valid() const;
-    /**
-     * Returns the number of parameters
-     * If this is a setter, the parameter count is always one
-     * @return the number of parameters
-     */
-    PRUint32 GetParamCount() const;
-    /**
-     * Returns the generated member ID/dispid
-     * This is based on the order of the function/property within the object
-     * @return the memid of the property
-     */
-    PRUint32 GetMemID() const;
-    /**
-     * Returns the COM's INVOKEKIND for the property/method
-     * @return the COM's INVOKEKIND for the property/method
-     */
-    INVOKEKIND GetInvokeKind() const;
-    /**
-     * Assigns the return type in elemDesc
-     * @param ccx an xpconnect call context
-     * @param elemDesc the element description to set the return type
-     */
-    void GetReturnType(XPCCallContext& ccx, ELEMDESC & elemDesc);
-    /**
-     * Returns an element description for the property
-     * @return the element descriptoin object, ownership is assumed by
-     * the caller.
-     */
-    ELEMDESC * GetParamInfo();
-    /**
-     * Tests whether this is a property
-     * @return true if this is a property
-     */
-    PRBool IsProperty() const;
-    /**
-     * Test whether this is read-only
-     * @return true if this is read-only
-     */
-    PRBool IsReadOnly() const;
-    /**
-     * Tests whether this is a setter
-     * @return true if this is a setter
-     */
-    PRBool IsSetter() const;
-    /**
-     * Denotes this property has a setter (is not read-only)
-     */
-    void SetSetter();
-    /**
-     * returns the name of the property/method
-     * @return the name of the property/method
-     */
-    nsAString const & GetName() const;
-private:
-    enum property_type
-    {
-        INVALID,
-        PROPERTY,
-        READONLY_PROPERTY,
-        FUNCTION,
-        SETTER_MODE = 0x20
-    };
-
-    PRUint32        mPropertyType;
-    PRUint32        mParamCount;
-    PRUint32        mMemID;
-    jsval           mProperty;
-    nsString        mName;
-
-    /**
-     * Accessor for the property type mProperty
-     * @return property_type for the property
-     */
-    inline
-    property_type PropertyType() const;
-};
-
-/**
- * Tearoff for nsXPCWrappedJS to use
- */
-class XPCDispatchTearOff : public IDispatch, public ISupportErrorInfo
-{
-public:
-    /**
-     * Constructor initializes our COM pointer back to our main object
-     */
-    XPCDispatchTearOff(nsIXPConnectWrappedJS * wrappedJS);
-    /**
-     * Release the our allocated data, and decrements our main objects refcnt
-     */
-    virtual ~XPCDispatchTearOff();
-    /**
-     * Error handling function
-     * @param riid the interface IID of the error
-     */
-    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
-    /**
-     * Thread safe AddRef
-     */
-    STDMETHODIMP_(ULONG) AddRef();
-    /**
-     * Thread safe Release
-     */
-    STDMETHODIMP_(ULONG) Release();
-    /**
-     * QueryInterface that returns us or the main object
-     * See MSDN for form information
-     * @param IID interface ID we're querying to
-     * @param pPtr a pointer to the pointer that will receive the resultant 
-     * interface pointer
-     * @return HRESULT
-     */
-    STDMETHOD(QueryInterface)(REFIID IID,void ** pPtr);
-    /**
-     * Returns the number of type info's for this IDispatch instance.
-     * See MSDN for form information
-     * @param pctinfo pointer to the variable to receive the count
-     * @return HRESULT
-     */
-    STDMETHOD(GetTypeInfoCount)(unsigned int * pctinfo);
-    /**
-     * Returns the type information for this IDispatch instance
-     * See MSDN for form information
-     * @return HRESULT
-     */
-    STDMETHOD(GetTypeInfo)(unsigned int iTInfo, LCID lcid, 
-                           ITypeInfo FAR* FAR* ppTInfo);
-    /**
-     * Returns the ID's for the given names of methods
-     * See MSDN for form information
-     * @return HRESULT
-     */
-    STDMETHOD(GetIDsOfNames)(REFIID riid, OLECHAR FAR* FAR* rgszNames, 
-                             unsigned int cNames, LCID  lcid, 
-                             DISPID FAR* rgDispId);
-    /**
-     * Invokes an interface method
-     * See MSDN for form information
-     * @return HRESULT
-     */
-    STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
-                      DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, 
-                      EXCEPINFO FAR* pExcepInfo, unsigned int FAR* puArgErr);
-
-private:
-    // Pointer back to our main object
-    nsCOMPtr<nsIXPConnectWrappedJS> mWrappedJS;
-    // The Type information for our instance
-    XPCDispTypeInfo *                 mCOMTypeInfo;
-    // Reference count
-    ULONG                             mRefCnt;
-    // Returns the type information
-    XPCDispTypeInfo *                 GetCOMTypeInfo();
-    // Returns the JS Object being used to wrap
-    inline
-    JSObject* GetJSObject();
-
-    NS_DECL_OWNINGTHREAD;
-};
-
-/**
- * IDispatch interface information.
- * This is used within the XPCWrappedNativeTearOff to collect and maintain 
- * information for a specific IDispatch interface. This is similar to
- * XPCNativeInterface
- */
-class XPCDispInterface
-{
-public:
-    /**
-     * Member information. This class is used within the XPCDispInterface
-     * to describe a specific method of an IDispatch interface.
-     */
-    class Member
-    {
-    public:
-        /**
-         * Parameter Information. This class is mainly a wrapper around 
-         * ELEMDESC that allows easier inspection
-         */
-        class ParamInfo
-        {
-        public:
-            /**
-             * Initializes mParamInfo to the element description passed in
-             * @param paramInfo the parameter information being wrapped
-             */
-            ParamInfo(const ELEMDESC * paramInfo);
-            /**
-             * Initializes an output parameter
-             * @param varBuffer a pointer to the variant's buffer
-             * @param var Pointer to the variant being initialized
-             */
-            JSBool InitializeOutputParam(void * varBuffer, 
-                                         VARIANT & var) const;
-            /**
-             * Tests if a specific flag is set
-             * @param flag the flag to be tested
-             * @return true if the flag is set
-             */
-            PRBool IsFlagSet(unsigned short flag) const;
-            /**
-             * Returns true if this is an input parameter
-             * @return true if this is an input parameter
-             */
-            PRBool IsIn() const;
-            /**
-             * Returns true if this is an output parameter
-             * @return true if this is an output parameter
-             */
-            PRBool IsOut() const;
-            /**
-             * Returns true if this is an optional parameter
-             * @return true if this is an optional parameter
-             */
-            PRBool IsOptional() const;
-            /**
-             * Returns true if this is a return value parameter
-             * @return true if this is a return value parameter
-             */
-            PRBool IsRetVal() const;
-            // TODO: Handle VT_ARRAY as well
-            /**
-             * Returns the type of the parameter
-             * @return VARTYPE, the type of the parameter
-             */
-            VARTYPE GetType() const;
-        private:
-            const ELEMDESC * mParamInfo;
-        };
-        Member();
-        ~Member();
-        /**
-         * Placement new is needed to initialize array in class XPCDispInterface
-         * @param p the address of the member to construct
-         * @return p
-         */
-        void* operator new(size_t, Member* p) CPP_THROW_NEW;
-        /**
-         * Is this a setter
-         * @return true if this is a setter
-         */
-        PRBool IsSetter() const;
-        /**
-         * Is this a getter
-         * @return true if this is a getter
-         */
-        PRBool IsGetter() const;
-        /**
-         * Is this a property
-         * @return true if this is a property
-         */
-        PRBool IsProperty() const;
-        /**
-         * Is this a parameterized setter
-         * @return true if this is a parameterized property
-         */
-        PRBool IsParameterizedSetter() const;
-        /**
-         * Is this a parameterized getter
-         * @return true if this is a parameterized property
-         */
-        PRBool IsParameterizedGetter() const;
-        /**
-         * Is this a parameterized property
-         * @return true if this is a parameterized property
-         */
-        PRBool IsParameterizedProperty() const;
-        /**
-         * Is this a function
-         * @return true if this is a function
-         */
-        PRBool IsFunction() const;
-        /**
-         * Returns the name of the method as a jsid
-         * @return the name of the method as a jsid
-         */
-        jsid GetName() const;
-        /**
-         * Returns the function object as a value for the method
-         * @param ccx an XPConnect call context
-         * @param iface The native interface of the function
-         * @param retval pointer to the jsval to receive the name
-         * @return JS_TRUE if the function object was return
-         */
-        JSBool GetValue(XPCCallContext& ccx, XPCNativeInterface* iface, 
-                        jsval * retval) const;
-        /**
-         * returns the dispid of the method
-         * @return the dispid of the method
-         */
-        PRUint32 GetDispID() const;
-        /**
-         * returns the number of parameters of the method
-         * @param Ask from getter instead of setter version of the function
-         * @return the number of parameters of the method
-         */
-        PRUint32 GetParamCount(PRBool getter = PR_FALSE) const;
-        /**
-         * Returns parameter information for the specified parameter
-         * @param index the index of the parameter
-         * @param Ask from getter instead of setter version of the function
-         * @return Parameter information
-         */
-        ParamInfo GetParamInfo(PRUint32 index, PRBool getter = PR_FALSE) const;
-        // === Setup functions ===
-        /**
-         * Sets the name of the method
-         * @param name the name to assign
-         */
-        void SetName(jsid name);
-        /**
-         * Marks the member as a getter.
-         * Both MakeGetter and MakeSetter can be called, making it a setter/getter
-         */
-        void MakeGetter();
-        /**
-         * Marks the member as a setter
-         */
-        void MakeSetter();
-        /**
-         * Marks the member as a function
-         * Should not be called if MakeGetter/Setter is called. Will assert
-         */
-        void SetFunction();
-        /**
-         * Used to reset the type of of member
-         */
-        void ResetType();
-        /**
-         * Sets the type information for the parameter
-         * @param dispID the DISPID of the member
-         * @param pTypeInfo Pointer to the COM type information
-         * @param fundesc function description
-         */ 
-        void SetTypeInfo(DISPID dispID, ITypeInfo* pTypeInfo,
-                         FUNCDESC* funcdesc);
-        /**
-         * Sets the function description for the getter version of the function.
-         * @param funcdesc function description
-         */
-        void SetGetterFuncDesc(FUNCDESC* funcdesc);
-        /**
-         * Sets the member ID
-         * @param memID the IDispatch ID of the member
-         */
-        void SetMemID(DISPID memID);
-        /**
-         * Returns the IDispatch ID of the member
-         * @return the IDispatch ID of the member
-         */
-        DISPID GetMemID() const;
-
-    private:
-       DISPID   mMemID;
-        /**
-         * Our internal flags identify the type of member
-         * A member can be both getter/setter
-         */
-        enum member_type
-        {
-            UNINITIALIZED = 0,
-            SET_PROPERTY = 1,
-            GET_PROPERTY = 2,
-            FUNCTION = 4,
-            RESOLVED = 8
-        };
-        PRUint16 mType;
-        jsval mVal;     // Mutable
-        jsid mName;    // Mutable
-        CComPtr<ITypeInfo> mTypeInfo;
-        FUNCDESC* mFuncDesc; // We own this
-        FUNCDESC* mGetterFuncDesc; // We own this
-        /**
-         * Helper function to return the parameter type
-         * @param index index of the parameter to return the type of
-         * @return The parameter type
-         */
-        PRUint16 GetParamType(PRUint32 index) const;
-        /**
-         * Helper function to test if a flag is set in mType
-         * @param flag the flag to test for
-         * @return true if the flag is set
-         */
-        PRBool IsFlagSet(unsigned short flag) const;
-    };
-    /**
-     * Returns the JSObject for the tearoff
-     * @return pointer to the JSObject
-     * @see mJSObject
-     */
-    JSObject* GetJSObject() const;
-    /**
-     * Sets the JSObject for the tearoff
-     * @param jsobj the object being assigned
-     * @see GetJSObject() const
-     */
-    void SetJSObject(JSObject* jsobj);
-    /**
-     * Locates the member by name
-     * @param name the name of the member to be returned
-     * @return pointer to the member found, nsnull if not found
-     */
-    const Member * FindMember(jsid name) const;
-    /**
-     * Looksup a member ignoring case
-     * TODO: We should look at performance issues concerning this
-     * @param ccx A call context
-     * @param name The name of the member
-     * @return A pointer to a member or nsnull if not found
-     */
-    const Member* FindMemberCI(XPCCallContext& ccx, jsid name) const;
-    /**
-     * Returns a member via index
-     * @param index the index of the parameter
-     * @return reference to the member in the array
-     */
-    const Member & GetMember(PRUint32 index);
-    /**
-     * Returns the number of members
-     * @return the number of members
-     */
-    PRUint32 GetMemberCount() const;
-    /**
-     * Creates a new instance of XPCDispInterface
-     * @param cx a JS Context
-     * @param pIface the interface pointer to the object
-     * @return new instance of XPCDispInterface
-     */
-    static
-    XPCDispInterface* NewInstance(JSContext* cx, nsISupports * pIface);
-    /**
-     * Delete operator that frees up the memory allocated to the object
-     * @param p pointer to the objects memory
-     */
-    void operator delete(void * p);
-    /**
-     * Cleans up the members
-     */
-    ~XPCDispInterface();
-private:
-    /**
-     * Initializes the object's members
-     * @param cx a JS context
-     * @param pTypeInfo pointer to the type type information
-     * @param members number of members for the object
-     */
-    XPCDispInterface(JSContext* cx, 
-                          ITypeInfo * pTypeInfo,
-                          PRUint32 members);
-    /**
-     * Allocates the memory for the object
-     * @param members number of members in this interface
-     * @return pointer to the memory for the object
-     */
-    void * operator new (size_t, PRUint32 members) CPP_THROW_NEW;
-
-    /**
-     * This stores the JSObject for the tearoff, since this object
-     * is stored as the JSObject * in the tearoff
-     */
-    JSObject*   mJSObject;
-    PRUint32    mMemberCount;
-    Member      mMembers[1];
-    /**
-     * Inspects the type information and stores it in this object
-     * @param cx a JS context
-     * @param pTypeInfo pointer to the type information for the object
-     * @param members number of members in the interface
-     * @return PR_TRUE if it worked, PR_FALSE if it didn't (usually out of 
-     * memory)
-     */
-    PRBool InspectIDispatch(JSContext * cx, ITypeInfo * pTypeInfo, 
-                          PRUint32 members);
-
-    /**
-     * Small utility to count members needed for XPConnect
-     * XPConnect has one entry for a property while IDispatch can have two
-     * Generally interfaces are small enough, that linear searching should
-     * be ok
-     */
-    class Allocator
-    {
-    public:
-        /**
-         * Constructor, creates the initial buffer
-         * @param cx a JS context
-         * @param pTypeInfo pointer to IDispatch type info, our caller holds
-         * the reference we don't need to
-         */
-        Allocator(JSContext * cx, ITypeInfo * pTypeInfo);
-        /**
-         * Destructor, frees the buffer we allocated
-         */
-        inline
-        ~Allocator();
-        /**
-         * Returns the allocated XPCDispInterface object
-         * @return the allocated XPCDispInterface object
-         */
-        inline
-        XPCDispInterface* Allocate();
-    private:
-        DISPID * mMemIDs;
-        PRUint32 mCount;            // Total unique ID's found
-        PRUint32 mIDispatchMembers; // Total entries reported by ITypeInfo
-        JSContext* mCX;
-        ITypeInfo* mTypeInfo;
-
-        /**
-         * Returns the number of members found
-         * @return The number of members found
-         */
-        inline
-        PRUint32 Count() const;
-        /**
-         * Adds the member ID to the list
-         * @param memID The member ID to test
-         */
-        void Add(DISPID memID);
-        /**
-         * Allows our caller to handle unexpected problems like out of memory
-         * @return PR_TRUE if the buffer was allocated
-         */
-        inline
-        PRBool Valid() const;
-
-        // No copying or assigning allowed
-        Allocator(const Allocator&);
-        Allocator& operator =(const Allocator&);
-    };
-    /**
-     * Friendship need to gain access to private operator new
-     */
-    friend class Allocator;
-};
-
-/**
- * Used to invoke IDispatch methods
- * This has turned into kind of a catch all, and probably should be
- * cleaned up
- */
-class XPCDispObject
-{
-public:
-    enum CallMode {CALL_METHOD, CALL_GETTER, CALL_SETTER};
-    /**
-     * This invokes an IDispatch method
-     * @param ccx an XPConnect call context
-     * @param pDisp the IDispatch pointer
-     * @param dispID the DISPID of the method/property
-     * @param mode the call mode, method/property
-     * @param params the parameters need for the method/property
-     * @param retval pointer to a jsval to receive the return value
-     * @param member a pointer to an interface member
-     * @param rt a pointer to the XPConnect JS Runtime
-     * @return true if the method/property was invoked properly
-     */
-    static
-    JSBool Dispatch(XPCCallContext& ccx, IDispatch * pDisp,
-                    DISPID dispID, CallMode mode, XPCDispParams * params,
-                    jsval* retval, XPCDispInterface::Member* member = nsnull,
-                    XPCJSRuntime* rt = nsnull);
-    /**
-     * Used to invoke an IDispatch method using the XPCCallContext
-     * @param ccx an XPConnect call context
-     * @param mode call mode for the call
-     */
-    static
-    JSBool Invoke(XPCCallContext & ccx, CallMode mode);
-    /**
-     * Performs the various security checks, caps, hosting flags, etc.
-     * Instantiates the object and will return that object if createdObject 
-     * result is not null
-     * @param ccx an XPConnect call context
-     * @param aCID the class ID to be tested
-     * @param createdObject is the optional object to be returned
-     */
-    static
-    HRESULT SecurityCheck(XPCCallContext & ccx, const CLSID & aCID,
-                          IDispatch ** createdObject = nsnull);
-    /**
-     * Instantiates a COM object given a class ID or a prog ID
-     * @param ccx an XPConnect call context
-     * @param className a prog ID or a class ID in the form of 
-     * {00000000-0000-0000-0000-000000000000}
-     * @param enforceSecurity if true, will apply checks to ensure
-     *                        the object can be created giving the current
-     *                        security settings.
-     * @param result pointer to the pointer to receive the interface pointer
-     */
-    static
-    HRESULT COMCreateInstance(XPCCallContext & ccx, BSTR className,
-                              PRBool enforceSecurity, IDispatch ** result);
-    /**
-     * Wraps an IDispatch interface, returning the object as a jsval
-     * @param pDispatch IDispatch pointer
-     * @param cx a JS Context
-     * @param obj A pointer to a JS object serving as the global object
-     * @param rval is a pointer to a jsval to receive the JS object wrapper
-     */
-    static
-    PRBool WrapIDispatch(IDispatch *pDispatch, XPCCallContext & ccx,
-                         JSObject *obj, jsval *rval);
-};
-
-class XPCIDispatchExtension
-{
-public:
-    /**
-     * Reset the enabled flag if xpconnect is re-initialized.
-     */
-    static void InitStatics() { mIsEnabled = PR_TRUE; }
-
-    /**
-     * returns true if IDispatch extension is enabled
-     * @return true if IDispatch extension is enabled
-     */
-    static PRBool IsEnabled() { return mIsEnabled; }
-    /**
-     * Enables the IDispatch extension
-     */
-    static void Enable() { mIsEnabled = PR_TRUE; }
-    /**
-     * Disables the IDispatch extension
-     */
-    static void Disable() { mIsEnabled = PR_FALSE; }
-    /**
-     * This is the define property for the IDispatch system. It called from
-     * the XPConnect's DefineProperty
-     * @param ccx an XPConnect call context
-     * @param obj the JS object receiving the property
-     * @param idval ID of the property to add
-     * @param wrapperToReflectInterfaceNames the wrapper
-     * @param propFlags JS property flags
-     * @param resolved a pointer to a JSBool, set to true if properly resolved
-     */
-    static JSBool DefineProperty(XPCCallContext & ccx, 
-                                 JSObject *obj, jsid id,
-                                 XPCWrappedNative* wrapperToReflectInterfaceNames,
-                                 uintN propFlags, JSBool* resolved);
-    /**
-     * IDispatch system's enumeration function. This is called 
-     * from XPC_WN_Shared_Enumerate
-     * @param ccx a XPConnect call context
-     * @param obj pointer to the JSObject
-     * @param wrapper pointer to the wrapper
-     * @return true if the enumeration was successful
-     */
-    static JSBool Enumerate(XPCCallContext& ccx, JSObject* obj, 
-                            XPCWrappedNative * wrapper);
-    /**
-     * This is the delegated QI called from the wrapped JS class
-     * DelegatedQueryInterface
-     * @param self pointer to the object
-     * @param aInstancePtr pointer to an interface pointer to receive the QI'd
-     * pointer
-     * @return an XPCOM result
-     */
-    static nsresult IDispatchQIWrappedJS(nsXPCWrappedJS * self, 
-                                         void ** aInstancePtr);
-
-private:
-    static PRBool  mIsEnabled;
-};
-
-/**
- * This is a helper class that factored out the parameter cleanup code
- */
-class XPCDispParams
-{
-public:
-    /**
-     * Initializes the parameters object
-     * @param args the number of parameters this object will hold
-     */
-    XPCDispParams(PRUint32 args);
-    /**
-     * Cleans up the parameters' data
-     */
-    ~XPCDispParams();
-    /**
-     * This sets the named prop ID to our local mPropId. This is used for
-     * setters.
-     */
-    void SetNamedPropID();
-    /**
-     * Returns a reference to a parameter
-     * @param index index of the parameter
-     * @return a reference to the parameter at index
-     */
-    VARIANT & GetParamRef(PRUint32 index);
-    /**
-     * Returns the parameter by value
-     * @param index index of the parameter
-     * @return a copy of the parameter
-     */
-    _variant_t GetParam(PRUint32 index) const;
-    /**
-     * Returns the output buffer for an output parameter
-     * @param index index of the output parameter
-     * @return a pointer to the buffer for the output parameter
-     */
-    void * GetOutputBuffer(PRUint32 index);
-    /**
-     * Returns a DISPPARAMS structure pointer for the parameters
-     * @return a DISPPARAMS structure pointer for the parameters
-     */
-    DISPPARAMS* GetDispParams() const { return &const_cast<XPCDispParams*>(this)->mDispParams; }
-    /**
-     * Returns the number of parameters
-     * @return the number of parameters
-     */
-    uintN GetParamCount() const { return mDispParams.cArgs; }
-    /**
-     * Inserts a parameter
-     * This is mainly used for parameterized properties
-     * @param var the parameter to insert
-     */
-    void InsertParam(_variant_t & var);
-private:
-    /**
-     * Don't allow copying
-     */
-    XPCDispParams(const XPCDispParams & other) {
-        NS_ERROR("XPCDispParams can't be copied"); }
-    /**
-     * We don't allow assignments
-     */
-    XPCDispParams& operator =(const XPCDispParams&) {
-        NS_ERROR("XPCDispParams can't be assigned"); }
-
-    enum
-    {
-        DEFAULT_ARG_ARRAY_SIZE = 8,
-        DEFAULT_REF_BUFFER_SIZE = 8 * sizeof(VARIANT)
-    };
-    static
-    PRUint32 RefBufferSize(PRUint32 args) { return (args + 1) * sizeof(VARIANT); }
-
-    DISPPARAMS  mDispParams;
-    char*       mRefBuffer;
-    VARIANT*    mDispParamsAllocated;
-    char*       mRefBufferAllocated;
-    /**
-     * Used by output/ref variant types
-     */
-    char        mStackRefBuffer[DEFAULT_REF_BUFFER_SIZE];
-    VARIANT     mStackArgs[DEFAULT_ARG_ARRAY_SIZE];
-    DISPID      mPropID;
-#ifdef DEBUG
-    PRBool mInserted;
-#endif
-};
-
-/**
- * This class is a service that exposes some handy utility methods for
- * IDispatch users
- */
-class nsDispatchSupport : public nsIDispatchSupport
-{
-public:
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIDISPATCHSUPPORT
-    /**
-     * Initialize nsISupports base objects
-     */
-    nsDispatchSupport();
-    /**
-     * Cleansup nsISupports
-     */
-    virtual ~nsDispatchSupport();
-    /**
-     * Returns the existing instance or creates a new one
-     * @return an nsDispatchSupport object
-     */
-    static nsDispatchSupport* GetSingleton();
-    /**
-     * Called on shutdown to free the instance
-     */
-    static void FreeSingleton() { NS_IF_RELEASE(mInstance); }
-
-private:
-    static nsDispatchSupport* mInstance;
-};
-
-/**
- * Provides class info for IDispatch based objects
- */
-class XPCIDispatchClassInfo : public nsIClassInfo
-{
-public:
-    /**
-     * Returns a single instance of XPCIDispatchClassInfo
-     * @return the lone instance
-     */
-    static XPCIDispatchClassInfo* GetSingleton();
-    /**
-     * Releases our hold on the instance
-     */
-    static void FreeSingleton();
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSICLASSINFO
-private:
-    /**
-     * Only our methods create and destroy instances
-     */
-    XPCIDispatchClassInfo() {}
-    virtual ~XPCIDispatchClassInfo() {}
-
-    static XPCIDispatchClassInfo*  sInstance;
-};
-
-#include "XPCDispInlines.h"
-
-#endif
deleted file mode 100644
--- a/js/src/xpconnect/src/XPCDispTearOff.cpp
+++ /dev/null
@@ -1,539 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * \file XPCDispTearOff.cpp
- * Contains the implementation of the XPCDispTearoff class
- */
-#include "xpcprivate.h"
-
-/**
- * Sets the COM error from a result code and text message. This is the base
- * implementation for subsequent string based overrides
- * @param hResult the COM error code to be used
- * @param message the message to put in the error
- * @return the error code passed in via hResult
- */
-static HRESULT Error(HRESULT hResult, const CComBSTR & message)
-{
-    CComPtr<ICreateErrorInfo> pCreateError;
-    CComPtr<IErrorInfo> pError;
-    HRESULT result = CreateErrorInfo(&pCreateError);
-    if(FAILED(result))
-        return E_NOTIMPL;
-    result = pCreateError->QueryInterface(&pError);
-    if(FAILED(result))
-        return E_NOTIMPL;
-    result = pCreateError->SetDescription(message);
-    if(FAILED(result))
-        return E_NOTIMPL;
-    result = pCreateError->SetGUID(IID_IDispatch);
-    if(FAILED(result))
-        return E_NOTIMPL;
-    CComBSTR source(L"@mozilla.XPCDispatchTearOff");
-    result = pCreateError->SetSource(source);
-    if(FAILED(result))
-        return E_NOTIMPL;
-    result = SetErrorInfo(0, pError);
-    if(FAILED(result))
-        return E_NOTIMPL;
-    return hResult;
-}
-
-
-/**
- * Sets the COM error from a result code and text message
- * @param hResult the COM error code to be used
- * @param message the message to put in the error
- * @return the error code passed in via hResult
- */
-inline
-HRESULT Error(HRESULT hResult, const char * message)
-{
-    CComBSTR someText(message);
-    return Error(hResult, someText);
-}
-
-/**
- * Helper function that converts an exception to a string
- * @param exception
- * @return the description of the exception
- */
-static void BuildMessage(nsIException * exception, nsCString & result)
-{
-    nsXPIDLCString msg;
-    exception->GetMessageMoz(getter_Copies(msg));
-    nsXPIDLCString filename;
-    exception->GetFilename(getter_Copies(filename));
-
-    PRUint32 lineNumber;
-    if(NS_FAILED(exception->GetLineNumber(&lineNumber)))
-        lineNumber = 0;
-    result = "Error in file ";
-    result += filename;
-    result += ",#";
-    result.AppendInt(lineNumber);
-    result += " : ";
-    result += msg;
-}
-
-/**
- * Sets the COM error given an nsIException
- * @param exception the exception being set
- */
-inline
-static void SetCOMError(nsIException * exception)
-{
-    nsCString message;
-    BuildMessage(exception, message);
-    Error(E_FAIL, message.get());
-}
-
-XPCDispatchTearOff::XPCDispatchTearOff(nsIXPConnectWrappedJS * wrappedJS) :
-    mWrappedJS(wrappedJS),
-    mCOMTypeInfo(nsnull),
-    mRefCnt(0)
-{
-}
-
-XPCDispatchTearOff::~XPCDispatchTearOff()
-{
-    NS_IF_RELEASE(mCOMTypeInfo);
-}
-
-NS_COM_IMPL_ADDREF(XPCDispatchTearOff)
-NS_COM_IMPL_RELEASE(XPCDispatchTearOff)
-
-// See bug 127982:
-//
-// Microsoft's InlineIsEqualGUID global function is multiply defined
-// in ATL and/or SDKs with varying namespace requirements. To save the control
-// from future grief, this method is used instead. 
-static inline BOOL _IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
-{
-   return (
-	  ((PLONG) &rguid1)[0] == ((PLONG) &rguid2)[0] &&
-	  ((PLONG) &rguid1)[1] == ((PLONG) &rguid2)[1] &&
-	  ((PLONG) &rguid1)[2] == ((PLONG) &rguid2)[2] &&
-	  ((PLONG) &rguid1)[3] == ((PLONG) &rguid2)[3]);
-}
-
-STDMETHODIMP XPCDispatchTearOff::InterfaceSupportsErrorInfo(REFIID riid)
-{
-    static const IID* arr[] = 
-    {
-        &IID_IDispatch,
-    };
-
-    for(int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
-    {
-        if(_IsEqualGUID(*arr[i],riid))
-            return S_OK;
-    }
-    return S_FALSE;
-}
-
-STDMETHODIMP XPCDispatchTearOff::QueryInterface(const struct _GUID & guid,
-                                              void ** pPtr)
-{
-    if(IsEqualIID(guid, IID_IDispatch))
-    {
-        *pPtr = static_cast<IDispatch*>(this);
-        NS_ADDREF_THIS();
-        return NS_OK;
-    }
-
-    if(IsEqualIID(guid, IID_ISupportErrorInfo))
-    {
-        *pPtr = static_cast<IDispatch*>(this);
-        NS_ADDREF_THIS();
-        return NS_OK;
-    }
-
-    return mWrappedJS->QueryInterface(XPCDispIID2nsIID(guid), pPtr);
-}
-
-STDMETHODIMP XPCDispatchTearOff::GetTypeInfoCount(unsigned int FAR * pctinfo)
-{
-    *pctinfo = 1;
-    return S_OK;
-}
-
-XPCDispTypeInfo * XPCDispatchTearOff::GetCOMTypeInfo()
-{
-    // If one was already created return it
-    if(mCOMTypeInfo)
-        return mCOMTypeInfo;
-    // Build a new one, save the pointer and return it
-    XPCCallContext ccx(NATIVE_CALLER);
-    if(!ccx.IsValid())
-        return nsnull;
-    JSObject* obj = GetJSObject();
-    if(!obj)
-        return nsnull;
-    mCOMTypeInfo = XPCDispTypeInfo::New(ccx, obj);
-    NS_IF_ADDREF(mCOMTypeInfo);
-    return mCOMTypeInfo;
-}
-
-STDMETHODIMP XPCDispatchTearOff::GetTypeInfo(unsigned int, LCID, 
-                                         ITypeInfo FAR* FAR* ppTInfo)
-{
-    *ppTInfo = GetCOMTypeInfo();
-    NS_ADDREF(*ppTInfo);
-    return S_OK;
-}
-
-STDMETHODIMP XPCDispatchTearOff::GetIDsOfNames(REFIID riid, 
-                                           OLECHAR FAR* FAR* rgszNames, 
-                                           unsigned int cNames, LCID  lcid,
-                                           DISPID FAR* rgDispId)
-{
-    ITypeInfo * pTypeInfo = GetCOMTypeInfo();
-    if(pTypeInfo != nsnull)
-    {
-        return pTypeInfo->GetIDsOfNames(rgszNames, cNames, rgDispId);
-    }
-    return S_OK;
-}
-
-void
-xpcWrappedJSErrorReporter(JSContext *cx, const char *message,
-                          JSErrorReport *report);
-
-STDMETHODIMP XPCDispatchTearOff::Invoke(DISPID dispIdMember, REFIID riid, 
-                                        LCID lcid, WORD wFlags,
-                                        DISPPARAMS FAR* pDispParams, 
-                                        VARIANT FAR* pVarResult, 
-                                        EXCEPINFO FAR* pExcepInfo, 
-                                        unsigned int FAR* puArgErr)
-{
-    XPCDispTypeInfo* pTypeInfo = GetCOMTypeInfo();
-    if(!pTypeInfo)
-    {
-        return E_FAIL;
-    }
-    XPCCallContext ccx(NATIVE_CALLER);
-    XPCContext* xpcc;
-    JSContext* cx;
-    if(ccx.IsValid())
-    {
-        xpcc = ccx.GetXPCContext();
-        cx = ccx.GetJSContext();
-    }
-    else
-    {
-        xpcc = nsnull;
-        cx = nsnull;
-    }
-    // Get the name as a flat string
-    // This isn't that efficient, but we have to make the conversion somewhere
-    NS_LossyConvertUTF16toASCII name(pTypeInfo->GetNameForDispID(dispIdMember));
-    if(name.IsEmpty())
-        return E_FAIL;
-    // Decide if this is a getter or setter
-    PRBool getter = (wFlags & DISPATCH_PROPERTYGET) != 0;
-    PRBool setter = (wFlags & DISPATCH_PROPERTYPUT) != 0;
-    // It's a property
-    if(getter || setter)
-    {
-        jsval val;
-        uintN err;
-        JSObject* obj;
-        if(getter)
-        {
-            // Get the property and convert the value
-            obj = GetJSObject();
-            if(!obj)
-                return E_FAIL;
-            if(!JS_GetProperty(cx, obj, name.get(), &val))
-            {
-                nsCString msg("Unable to retrieve property ");
-                msg += name;
-                return Error(E_FAIL, msg.get());
-            }
-            if(!XPCDispConvert::JSToCOM(ccx, val, *pVarResult, err))
-            {
-                nsCString msg("Failed to convert value from JS property ");
-                msg += name;
-                return Error(E_FAIL, msg.get());
-            }
-        }
-        else if(pDispParams->cArgs > 0)
-        {
-            // Convert the property and then set it
-            if(!XPCDispConvert::COMToJS(ccx, pDispParams->rgvarg[0], val, err))
-            {
-                nsCString msg("Failed to convert value for JS property ");
-                msg += name;
-                return Error(E_FAIL, msg.get());
-            }
-            AUTO_MARK_JSVAL(ccx, &val);
-            obj = GetJSObject();
-            if(!obj)
-                return Error(E_FAIL, "The JS wrapper did not return a JS object");
-            if(!JS_SetProperty(cx, obj, name.get(), &val))
-            {
-                nsCString msg("Unable to set property ");
-                msg += name;
-                return Error(E_FAIL, msg.get());
-            }
-        }
-    }
-    else // We're invoking a function
-    {
-        jsval* stackbase = nsnull;
-        jsval* sp = nsnull;
-        uint8 i;
-        uint8 argc = pDispParams->cArgs;
-        uint8 stack_size;
-        jsval result;
-        uint8 paramCount=0;
-        nsresult retval = NS_ERROR_FAILURE;
-        nsresult pending_result = NS_OK;
-        JSBool success;
-        JSBool readyToDoTheCall = JS_FALSE;
-        uint8 outConversionFailedIndex;
-        JSObject* obj;
-        jsval fval;
-        nsCOMPtr<nsIException> xpc_exception;
-        void* mark;
-        JSBool foundDependentParam;
-        JSObject* thisObj;
-        AutoScriptEvaluate scriptEval(ccx);
-        XPCJSRuntime* rt = ccx.GetRuntime();
-        int j;
-
-        js::InvokeArgsGuard args;
-
-        thisObj = obj = GetJSObject();;
-
-        if(!cx || !xpcc)
-            goto pre_call_clean_up;
-
-        scriptEval.StartEvaluating(xpcWrappedJSErrorReporter);
-
-        xpcc->SetPendingResult(pending_result);
-        xpcc->SetException(nsnull);
-        ccx.GetThreadData()->SetException(nsnull);
-
-        // We use js_Invoke so that the gcthings we use as args will be rooted
-        // by the engine as we do conversions and prepare to do the function
-        // call.
-
-        js::LeaveTrace(cx);
-
-        // In the xpidl [function] case we are making sure now that the 
-        // JSObject is callable. If it is *not* callable then we silently 
-        // fallback to looking up the named property...
-        // (because jst says he thinks this fallback is 'The Right Thing'.)
-        //
-        // In the normal (non-function) case we just lookup the property by 
-        // name and as long as the object has such a named property we go ahead
-        // and try to make the call. If it turns out the named property is not
-        // a callable object then the JS engine will throw an error and we'll
-        // pass this along to the caller as an exception/result code.
-        fval = OBJECT_TO_JSVAL(obj);
-        if(JS_TypeOfValue(ccx, fval) != JSTYPE_FUNCTION && 
-            !JS_GetProperty(cx, obj, name.get(), &fval))
-        {
-            // XXX We really want to factor out the error reporting better and
-            // specifically report the failure to find a function with this name.
-            // This is what we do below if the property is found but is not a
-            // function. We just need to factor better so we can get to that
-            // reporting path from here.
-            goto pre_call_clean_up;
-        }
-
-        if (!cx->stack().pushInvokeArgsFriendAPI(cx, argc, args))
-        {
-            retval = NS_ERROR_OUT_OF_MEMORY;
-            goto pre_call_clean_up;
-        }
-
-        sp = stackbase = Jsvalify(args.getvp());
-
-        // this is a function call, so push function and 'this'
-        *sp++ = fval;
-        *sp++ = OBJECT_TO_JSVAL(thisObj);
-
-        // make certain we leave no garbage in the stack
-        for(i = 0; i < argc; i++)
-        {
-            sp[i] = JSVAL_VOID;
-        }
-
-        uintN err;
-        // build the args
-        // NOTE: COM expects args in DISPPARAMS to be in reverse order
-        for (j = argc - 1; j >= 0; --j )
-        {
-            jsval val;
-            if((pDispParams->rgvarg[j].vt & VT_BYREF) == 0)
-            {
-                if(!XPCDispConvert::COMToJS(ccx, pDispParams->rgvarg[j], val, err))
-                    goto pre_call_clean_up;
-                *sp++ = val;
-            }
-            else
-            {
-                // create an 'out' object
-                JSObject* out_obj = JS_NewObject(cx, nsnull, nsnull, nsnull);
-                if(!out_obj)
-                {
-                    retval = NS_ERROR_OUT_OF_MEMORY;
-                    goto pre_call_clean_up;
-                }
-                // We'll assume in/out
-                // TODO: I'm not sure we tell out vs in/out
-                JS_SetPropertyById(cx, out_obj,
-                        rt->GetStringID(XPCJSRuntime::IDX_VALUE),
-                        &val);
-                *sp++ = OBJECT_TO_JSVAL(out_obj);
-            }
-        }
-
-        readyToDoTheCall = JS_TRUE;
-
-pre_call_clean_up:
-
-        if(!readyToDoTheCall)
-            goto done;
-
-        // do the deed - note exceptions
-
-        JS_ClearPendingException(cx);
-
-        if(!JSVAL_IS_PRIMITIVE(fval))
-        {
-            success = js::InvokeFriendAPI(cx, args, 0);
-            result = stackbase[0];
-        }
-        else
-        {
-            // The property was not an object so can't be a function.
-            // Let's build and 'throw' an exception.
-
-            static const nsresult code =
-                    NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED;
-            static const char format[] = "%s \"%s\"";
-            const char * msg;
-            char* sz = nsnull;
-
-            if(nsXPCException::NameAndFormatForNSResult(code, nsnull, &msg) && msg)
-                sz = JS_smprintf(format, msg, name);
-
-            nsCOMPtr<nsIException> e;
-
-            XPCConvert::ConstructException(code, sz, "IDispatch", name.get(),
-                                           nsnull, getter_AddRefs(e), nsnull, nsnull);
-            xpcc->SetException(e);
-            if(sz)
-                JS_smprintf_free(sz);
-        }
-
-        if(!success)
-        {
-            retval = nsXPCWrappedJSClass::CheckForException(ccx, name.get(),
-                                                            "IDispatch",
-                                                            PR_FALSE);
-            goto done;
-        }
-
-        ccx.GetThreadData()->SetException(nsnull); // XXX necessary?
-
-        // convert out args and result
-        // NOTE: this is the total number of native params, not just the args
-        // Convert independent params only.
-        // When we later convert the dependent params (if any) we will know that
-        // the params upon which they depend will have already been converted -
-        // regardless of ordering.
-
-        outConversionFailedIndex = paramCount;
-        foundDependentParam = JS_FALSE;
-        if(JSVAL_IS_VOID(result) || XPCDispConvert::JSToCOM(ccx, result, *pVarResult, err))
-        {
-            for(i = 0; i < paramCount; i++)
-            {
-                jsval val;
-                if(JSVAL_IS_PRIMITIVE(stackbase[i+2]) ||
-                        !JS_GetPropertyById(cx, JSVAL_TO_OBJECT(stackbase[i+2]),
-                            rt->GetStringID(XPCJSRuntime::IDX_VALUE),
-                            &val))
-                {
-                    outConversionFailedIndex = i;
-                    break;
-                }
-
-            }
-        }
-
-        if(outConversionFailedIndex != paramCount)
-        {
-            // We didn't manage all the result conversions!
-            // We have to cleanup any junk that *did* get converted.
-
-            for(PRUint32 index = 0; index < outConversionFailedIndex; index++)
-            {
-                if((pDispParams->rgvarg[index].vt & VT_BYREF) != 0)
-                {
-                    VariantClear(pDispParams->rgvarg + i);
-                }
-            }
-        }
-        else
-        {
-            // set to whatever the JS code might have set as the result
-            retval = pending_result;
-        }
-
-done:
-        // TODO: I think we may need to translate this error, 
-        // for now we'll pass through
-        return retval;
-    }
-    return S_OK;
-}
-
-inline
-JSObject* XPCDispatchTearOff::GetJSObject()
-{
-    JSObject* obj;
-    if(NS_SUCCEEDED(mWrappedJS->GetJSObject(&obj)))
-        return obj;
-    return nsnull;
-}
deleted file mode 100644
--- a/js/src/xpconnect/src/XPCDispTypeInfo.cpp
+++ /dev/null
@@ -1,466 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * \file XPCDispTypeInfo.cpp
- * Is the implementation for XPCDispTypeInfo and supporting classes
- */
-
-/**
- * \file XPCDispTypeInfo.cpp 
- * \brief implementation of XPCDispTypeInfo
- * This file contains the implementations for XPCDispTypeInfo class and
- * associated helper classes and functions
- */
-
-#include "xpcprivate.h"
-
-/**
- * Helper function that initializes the element description
- * @param vt The type of variant
- * @param paramFlags flats for the type of parameter, in, out, etc.
- * @param elemDesc The element being initialized
- */
-inline
-void FillOutElemDesc(VARTYPE vt, PRUint16 paramFlags, ELEMDESC & elemDesc)
-{
-    elemDesc.tdesc.vt = vt;
-    elemDesc.paramdesc.wParamFlags = paramFlags;
-    elemDesc.paramdesc.pparamdescex = 0;
-    elemDesc.tdesc.lptdesc = 0;
-    elemDesc.tdesc.lpadesc = 0;
-    elemDesc.tdesc.hreftype = 0;
-}
-
-XPCDispTypeInfo::~XPCDispTypeInfo()
-{
-    delete mIDArray;
-}
-
-void XPCDispJSPropertyInfo::GetReturnType(XPCCallContext& ccx, ELEMDESC & elemDesc)
-{
-    VARTYPE vt;
-    if(IsSetter())      // if this is a setter
-    {
-        vt = VT_EMPTY;
-    }
-    else if(IsProperty())   // If this is a property
-    {
-        vt = XPCDispConvert::JSTypeToCOMType(ccx, mProperty);
-    }
-    else                    // if this is a function
-    {
-        vt = VT_VARIANT;
-    }
-    FillOutElemDesc(vt, PARAMFLAG_FRETVAL, elemDesc);
-}
-
-ELEMDESC* XPCDispJSPropertyInfo::GetParamInfo()
-{
-    PRUint32 paramCount = GetParamCount();
-    ELEMDESC* elemDesc;
-    if(paramCount != 0)
-    {
-        elemDesc = new ELEMDESC[paramCount];
-        if(elemDesc)
-        {
-            for(PRUint32 index = 0; index < paramCount; ++index)
-            {
-                FillOutElemDesc(VT_VARIANT, PARAMFLAG_FIN, elemDesc[index]);
-            }
-        }
-    }
-    else
-        elemDesc = 0;
-    // Caller becomes owner
-    return elemDesc;
-}
-
-XPCDispJSPropertyInfo::XPCDispJSPropertyInfo(JSContext* cx, PRUint32 memid, 
-                                             JSObject* obj, jsval val) : 
-    mPropertyType(INVALID), mMemID(memid)
-{
-    PRUint32 len;
-    jschar * chars = xpc_JSString2String(cx, val, &len);
-    if(!chars)
-        return;
-
-    mName = nsString(reinterpret_cast<const PRUnichar *>(chars), len);
-    JSBool found;
-    uintN attr;
-    // Get the property's attributes, and make sure it's found and enumerable 
-    if(!JS_GetUCPropertyAttributes(cx, obj, chars, len, &attr, &found) || 
-        !found || (attr & JSPROP_ENUMERATE) == 0)
-        return;
-
-    // Retrieve the property 
-    if(!chars || !JS_GetUCProperty(cx, obj, chars, len, &mProperty) ||
-        JSVAL_IS_NULL(mProperty))
-        return;
-
-    // If this is a function
-    if(JSVAL_IS_OBJECT(mProperty) && 
-        JS_ObjectIsFunction(cx, JSVAL_TO_OBJECT(mProperty)))
-    {
-        mPropertyType = FUNCTION;
-        JSObject * funcObj = JSVAL_TO_OBJECT(mProperty);
-        JSIdArray * funcObjArray = JS_Enumerate(cx, funcObj);
-        if(funcObjArray)
-        {
-            mParamCount = funcObjArray->length;
-        }
-    }
-    else // It's a property
-    {
-        mParamCount = 0;
-        if((attr & JSPROP_READONLY) != 0)
-        {
-            mPropertyType = READONLY_PROPERTY;
-        }
-        else
-        {
-            mPropertyType = PROPERTY;
-        }
-    }
-}
-
-PRBool XPCDispTypeInfo::FuncDescArray::BuildFuncDesc(XPCCallContext& ccx, JSObject* obj, 
-                                     XPCDispJSPropertyInfo & propInfo)
-{
-    // While this memory is passed out, we're ultimately responsible to free it
-    FUNCDESC* funcDesc = mArray.AppendElement();
-    if(!funcDesc)
-        return PR_FALSE;
-    // zero is reserved
-    funcDesc->memid = propInfo.GetMemID();
-    funcDesc->lprgscode = 0; // Not used (for 16 bit systems)
-    funcDesc->funckind = FUNC_DISPATCH;
-    funcDesc->invkind = propInfo.GetInvokeKind();
-    funcDesc->callconv = CC_STDCALL;
-    funcDesc->cParams = propInfo.GetParamCount();
-    funcDesc->lprgelemdescParam = propInfo.GetParamInfo();
-    // We might want to make all parameters optional since JS can handle that
-    funcDesc->cParamsOpt = 0; // Optional parameters
-    // This could be a problem, supposed to be used for functions of
-    // type FUNC_VIRTUAL which we aren't, so zero should be ok
-    funcDesc->oVft = 0;         // Specifies offset in VTBL for FUNC_VIRTUAL
-    funcDesc->cScodes = 0;      // Counts the permitted return values.
-    funcDesc->wFuncFlags = 0;   // Indicates the FUNCFLAGS of a function.
-    propInfo.GetReturnType(ccx, funcDesc->elemdescFunc);
-    return PR_TRUE;
-}
-
-XPCDispTypeInfo::FuncDescArray::FuncDescArray(XPCCallContext& ccx, JSObject* obj, const XPCDispIDArray& array, XPCDispNameArray & names)
-{
-    PRUint32 size = array.Length();
-    names.SetSize(size);
-    PRUint32 memid = 0;
-    JSContext* cx = ccx;
-    // Initialize each function description in the array
-    for(PRUint32 index = 0; index < size; ++index)
-    {
-        XPCDispJSPropertyInfo propInfo(cx, ++memid, obj, array.Item(cx, index));
-        names.SetName(index + 1, propInfo.GetName());
-        if(!BuildFuncDesc(ccx, obj, propInfo))
-            return;
-        // non-readonly Properties get two function descriptions
-        if(propInfo.IsProperty() && !propInfo.IsReadOnly())
-        {
-            propInfo.SetSetter();
-            if(!BuildFuncDesc(ccx, obj, propInfo))
-                return;
-        }
-    }
-}
-
-XPCDispTypeInfo::FuncDescArray::~FuncDescArray()
-{
-    PRUint32 size = mArray.Length();
-    for(PRUint32 index = 0; index < size; ++index)
-    {
-        delete [] mArray[index].lprgelemdescParam;
-    }
-}
-
-XPCDispTypeInfo::XPCDispTypeInfo(XPCCallContext& ccx, JSObject* obj, 
-                               XPCDispIDArray* array) :
-    mRefCnt(0), mJSObject(obj), mIDArray(array), 
-    mFuncDescArray(ccx, obj, *array, mNameArray)
-{
-}
-
-XPCDispTypeInfo * XPCDispTypeInfo::New(XPCCallContext& ccx, JSObject* obj)
-{
-    XPCDispTypeInfo * pTypeInfo = 0;
-    JSIdArray * jsArray = JS_Enumerate(ccx, obj);
-    if(!jsArray)
-        return nsnull;
-    XPCDispIDArray* array = new XPCDispIDArray(ccx, jsArray);
-    if(!array)
-        return nsnull;
-    pTypeInfo = new XPCDispTypeInfo(ccx, obj, array);
-    if(!pTypeInfo)
-    {
-        delete array;
-        return nsnull;
-    }
-    NS_ADDREF(pTypeInfo);
-    return pTypeInfo;
-}
-
-NS_COM_MAP_BEGIN(XPCDispTypeInfo)
-    NS_COM_MAP_ENTRY(ITypeInfo)
-    NS_COM_MAP_ENTRY(IUnknown)
-NS_COM_MAP_END
-
-NS_IMPL_THREADSAFE_ADDREF(XPCDispTypeInfo)
-NS_IMPL_THREADSAFE_RELEASE(XPCDispTypeInfo)
-
-
-STDMETHODIMP XPCDispTypeInfo::GetTypeAttr( 
-    /* [out] */ TYPEATTR __RPC_FAR *__RPC_FAR *ppTypeAttr)
-{
-    return E_NOTIMPL;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::GetTypeComp(
-    /* [out] */ ITypeComp __RPC_FAR *__RPC_FAR *ppTComp)
-{
-    return E_NOTIMPL;
-}
-
-STDMETHODIMP XPCDispTypeInfo::GetFuncDesc(
-        /* [in] */ UINT index,
-        /* [out] */ FUNCDESC __RPC_FAR *__RPC_FAR *ppFuncDesc)
-{
-    return E_NOTIMPL;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::GetVarDesc(
-        /* [in] */ UINT index,
-        /* [out] */ VARDESC __RPC_FAR *__RPC_FAR *ppVarDesc)
-{
-    return E_NOTIMPL;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::GetNames(
-        /* [in] */ MEMBERID memid,
-        /* [length_is][size_is][out] */ BSTR __RPC_FAR *rgBstrNames,
-        /* [in] */ UINT cMaxNames,
-        /* [out] */ UINT __RPC_FAR *pcNames)
-{
-    return E_NOTIMPL;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::GetRefTypeOfImplType(
-        /* [in] */ UINT index,
-        /* [out] */ HREFTYPE __RPC_FAR *pRefType)
-{
-    return E_NOTIMPL;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::GetImplTypeFlags(
-        /* [in] */ UINT index,
-        /* [out] */ INT __RPC_FAR *pImplTypeFlags)
-{
-    return E_NOTIMPL;
-}
-
-STDMETHODIMP XPCDispTypeInfo::GetIDsOfNames(
-        /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
-        /* [in] */ UINT cNames,
-        /* [size_is][out] */ MEMBERID __RPC_FAR *pMemId)
-{
-    // lookup each name
-    for(UINT index = 0; index < cNames; ++index)
-    {
-        nsDependentString buffer(static_cast<const PRUnichar *>
-                                            (rgszNames[index]),
-                                 wcslen(rgszNames[index]));
-        pMemId[index] = mNameArray.Find(buffer);
-
-    }
-    return S_OK;
-}
-
-STDMETHODIMP XPCDispTypeInfo::Invoke(
-        /* [in] */ PVOID pvInstance,
-        /* [in] */ MEMBERID memid,
-        /* [in] */ WORD wFlags,
-        /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
-        /* [out] */ VARIANT __RPC_FAR *pVarResult,
-        /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
-        /* [out] */ UINT __RPC_FAR *puArgErr)
-{
-    CComQIPtr<IDispatch> pDisp(reinterpret_cast<IUnknown*>(pvInstance));
-    if(pDisp)
-    {
-        return pDisp->Invoke(memid, IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, 
-                               pDispParams, pVarResult, pExcepInfo, puArgErr);
-    }
-    return E_NOINTERFACE;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::GetDocumentation(
-        /* [in] */ MEMBERID memid,
-        /* [out] */ BSTR __RPC_FAR *pBstrName,
-        /* [out] */ BSTR __RPC_FAR *pBstrDocString,
-        /* [out] */ DWORD __RPC_FAR *pdwHelpContext,
-        /* [out] */ BSTR __RPC_FAR *pBstrHelpFile)
-{
-    PRUint32 index = memid;
-    if(index < mIDArray->Length())
-        return E_FAIL;
-
-    XPCCallContext ccx(NATIVE_CALLER);
-    PRUnichar * chars = xpc_JSString2PRUnichar(ccx, JSVAL_TO_STRING(mIDArray->Item(ccx, index)));
-    if(!chars)
-    {
-        return E_FAIL;
-    }
-    CComBSTR name(chars);
-    *pBstrName = name.Detach();
-    pBstrDocString = 0;
-    pdwHelpContext = 0;
-    pBstrHelpFile = 0;
-    return S_OK;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::GetDllEntry(
-        /* [in] */ MEMBERID memid,
-        /* [in] */ INVOKEKIND invKind,
-        /* [out] */ BSTR __RPC_FAR *pBstrDllName,
-        /* [out] */ BSTR __RPC_FAR *pBstrName,
-        /* [out] */ WORD __RPC_FAR *pwOrdinal)
-{
-    // We are not supporting this till a need arrises
-    return E_NOTIMPL;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::GetRefTypeInfo(
-        /* [in] */ HREFTYPE hRefType,
-        /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo)
-{
-    return E_NOTIMPL;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::AddressOfMember(
-        /* [in] */ MEMBERID memid,
-        /* [in] */ INVOKEKIND invKind,
-        /* [out] */ PVOID __RPC_FAR *ppv)
-{
-    // We are not supporting this till a need arrises
-    return E_NOTIMPL;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::CreateInstance(
-        /* [in] */ IUnknown __RPC_FAR *pUnkOuter,
-        /* [in] */ REFIID riid,
-        /* [iid_is][out] */ PVOID __RPC_FAR *ppvObj)
-{
-    // We are not supporting this till a need arrises
-    return E_NOTIMPL;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::GetMops(
-        /* [in] */ MEMBERID memid,
-        /* [out] */ BSTR __RPC_FAR *pBstrMops)
-{
-    return E_NOTIMPL;
-}
-    
-STDMETHODIMP XPCDispTypeInfo::GetContainingTypeLib(
-        /* [out] */ ITypeLib __RPC_FAR *__RPC_FAR *ppTLib,
-        /* [out] */ UINT __RPC_FAR *pIndex)
-{
-    // We are not supporting this till a need arrises
-    return E_NOTIMPL;
-}
-    
-void STDMETHODCALLTYPE XPCDispTypeInfo::ReleaseTypeAttr( 
-    /* [in] */ TYPEATTR __RPC_FAR *pTypeAttr)
-{
-    // Nothing for us to do
-}
-
-void STDMETHODCALLTYPE XPCDispTypeInfo::ReleaseFuncDesc( 
-    /* [in] */ FUNCDESC __RPC_FAR *pFuncDesc)
-{
-    // Nothing for us to do
-}
-
-void STDMETHODCALLTYPE XPCDispTypeInfo::ReleaseVarDesc( 
-    /* [in] */ VARDESC __RPC_FAR *pVarDesc)
-{
-    // Nothing for us to do
-}
-
-XPCDispIDArray::XPCDispIDArray(XPCCallContext& ccx, JSIdArray* array) : 
-    mMarked(JS_FALSE), mIDArray(array->length)
-{
-    mIDArray.SetLength(array->length);
-    
-    // copy the JS ID Array to our internal array
-    for(jsint index = 0; index < array->length; ++index)
-    {
-        mIDArray[index] = array->vector[index];
-    }   
-}
-
-void XPCDispIDArray::TraceJS(JSTracer* trc)
-{
-    // If already marked nothing to do
-    if(JS_IsGCMarkingTracer(trc))
-    {
-        if (IsMarked())
-            return;
-        mMarked = JS_TRUE;
-    }
-
-    PRInt32 count = Length();
-    jsval val;
-
-    // Iterate each of the ID's and mark them
-    for(PRInt32 index = 0; index < count; ++index)
-    {
-        if(JS_IdToValue(trc->context, mIDArray.ElementAt(index), &val))
-        {
-            JS_CALL_VALUE_TRACER(trc, val, "disp_id_array_element");
-        }
-    }
-}
-
deleted file mode 100644
--- a/js/src/xpconnect/src/XPCIDispatchClassInfo.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "xpcprivate.h"
-#include "nsCRT.h"
-
-NS_IMPL_ISUPPORTS1(XPCIDispatchClassInfo, nsIClassInfo)
-
-XPCIDispatchClassInfo* XPCIDispatchClassInfo::sInstance = nsnull;
-
-XPCIDispatchClassInfo* XPCIDispatchClassInfo::GetSingleton()
-{
-    if(!sInstance)
-    {
-        sInstance = new XPCIDispatchClassInfo;
-        NS_IF_ADDREF(sInstance);
-    }
-    NS_IF_ADDREF(sInstance);
-    return sInstance;
-}
-
-void XPCIDispatchClassInfo::FreeSingleton()
-{
-    NS_IF_RELEASE(sInstance);
-    sInstance = nsnull;
-}
-
-/* void getInterfaces (out PRUint32 count, [array, size_is (count), retval] 
-                       out nsIIDPtr array); */
-NS_IMETHODIMP 
-XPCIDispatchClassInfo::GetInterfaces(PRUint32 *count, nsIID * **array)
-{
-    *count = 0;
-    *array = static_cast<nsIID**>(nsMemory::Alloc(sizeof(nsIID*)));
-    NS_ENSURE_TRUE(*array, NS_ERROR_OUT_OF_MEMORY);
-
-    **array = static_cast<nsIID *>(nsMemory::Clone(&NSID_IDISPATCH,
-                                                      sizeof(NSID_IDISPATCH)));
-    if(!**array)
-    {
-        nsMemory::Free(*array);
-        *array = nsnull;
-        return NS_ERROR_OUT_OF_MEMORY;
-    }
-
-    *count = 1;
-    return NS_OK;
-}
-
-/* nsISupports getHelperForLanguage (in PRUint32 language); */
-NS_IMETHODIMP 
-XPCIDispatchClassInfo::GetHelperForLanguage(PRUint32 language, 
-                                            nsISupports **retval)
-{
-    *retval = nsnull;
-    return NS_OK;
-}
-
-/* readonly attribute string contractID; */
-NS_IMETHODIMP 
-XPCIDispatchClassInfo::GetContractID(char * *aContractID)
-{
-    *aContractID = nsnull;
-    return NS_OK;
-}
-
-/* readonly attribute string classDescription; */
-NS_IMETHODIMP 
-XPCIDispatchClassInfo::GetClassDescription(char * *aClassDescription)
-{
-    *aClassDescription = nsCRT::strdup("IDispatch");
-    return *aClassDescription ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
-}
-
-/* readonly attribute nsCIDPtr classID; */
-NS_IMETHODIMP 
-XPCIDispatchClassInfo::GetClassID(nsCID * *aClassID)
-{
-    *aClassID = nsnull;
-    return NS_OK;
-}
-
-/* readonly attribute PRUint32 implementationLanguage; */
-NS_IMETHODIMP 
-XPCIDispatchClassInfo::GetImplementationLanguage(
-    PRUint32 *aImplementationLanguage)
-{
-    *aImplementationLanguage = nsIProgrammingLanguage::UNKNOWN;
-    return NS_OK;
-}
-
-/* readonly attribute PRUint32 flags; */
-NS_IMETHODIMP 
-XPCIDispatchClassInfo::GetFlags(PRUint32 *aFlags)
-{
-    *aFlags = nsIClassInfo::DOM_OBJECT;
-    return NS_OK;
-}
-
-/* [notxpcom] readonly attribute nsCID classIDNoAlloc; */
-NS_IMETHODIMP 
-XPCIDispatchClassInfo::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
-{
-    return NS_ERROR_NOT_AVAILABLE;
-}
deleted file mode 100644
--- a/js/src/xpconnect/src/XPCIDispatchExtension.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "xpcprivate.h"
-
-static const char* const IDISPATCH_NAME = "IDispatch";
-
-#define XPC_IDISPATCH_CTOR_MAX_ARG_LEN 2000
-
-PRBool XPCIDispatchExtension::mIsEnabled = PR_TRUE;
-
-JSBool XPCIDispatchExtension::DefineProperty(XPCCallContext & ccx, 
-                                             JSObject *obj, jsid id,
-                                             XPCWrappedNative* wrapperToReflectInterfaceNames,
-                                             uintN propFlags, JSBool* resolved)
-{
-    // Look up the native interface for IDispatch and then find a tearoff
-    XPCNativeInterface* iface = XPCNativeInterface::GetNewOrUsed(ccx,
-                                                                 "IDispatch");
-    // The native interface isn't defined so just exit with an error
-    if(iface == nsnull)
-        return JS_FALSE;
-    XPCWrappedNativeTearOff* to = 
-        wrapperToReflectInterfaceNames->LocateTearOff(ccx, iface);
-    // This object has no IDispatch interface so bail.
-    if(to == nsnull)
-        return JS_FALSE;
-    // Look up the member in the interface
-    const XPCDispInterface::Member * member = to->GetIDispatchInfo()->FindMember(id);
-    if(!member)
-    {
-        // IDispatch is case insensitive, so if we don't find a case sensitive
-        // match, we'll try a more expensive case-insensisitive search
-        // TODO: We need to create cleaner solution that doesn't create
-        // multiple properties of different case on the JS Object
-        member = to->GetIDispatchInfo()->FindMemberCI(ccx, id);
-        if(!member)
-            return JS_FALSE;
-    }
-    // Get the function object
-    jsval funval;
-    if(!member->GetValue(ccx, iface, &funval))
-        return JS_FALSE;
-    // Protect the jsval 
-    AUTO_MARK_JSVAL(ccx, funval);
-    // clone a function we can use for this object 
-    JSObject* funobj = xpc_CloneJSFunction(ccx, JSVAL_TO_OBJECT(funval), obj);
-    if(!funobj)
-        return JS_FALSE;
-    // If this is a function or a parameterized property
-    if(member->IsFunction() || member->IsParameterizedProperty())
-    {
-        // define the function on the object
-        AutoResolveName arn(ccx, id);
-        if(resolved)
-            *resolved = JS_TRUE;
-        return JS_DefinePropertyById(ccx, obj, id, OBJECT_TO_JSVAL(funobj),
-                                     nsnull, nsnull, propFlags);
-    }
-    // Define the property on the object
-    NS_ASSERTION(member->IsProperty(), "way broken!");
-    propFlags |= JSPROP_GETTER | JSPROP_SHARED;
-    JSPropertyOp getter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, funobj);
-    JSPropertyOp setter;
-    if(member->IsSetter())
-    {
-        propFlags |= JSPROP_SETTER;
-        propFlags &= ~JSPROP_READONLY;
-        setter = getter;
-    }
-    else
-    {
-        setter = js_GetterOnlyPropertyStub;
-    }
-    AutoResolveName arn(ccx, id);
-    if(resolved)
-        *resolved = JS_TRUE;
-    return JS_DefinePropertyById(ccx, obj, id, JSVAL_VOID, getter, setter,
-                                 propFlags);
-
-}
-
-JSBool XPCIDispatchExtension::Enumerate(XPCCallContext& ccx, JSObject* obj,
-                                        XPCWrappedNative * wrapper)
-{
-    XPCNativeInterface* iface = XPCNativeInterface::GetNewOrUsed(
-        ccx,&NSID_IDISPATCH);
-    if(!iface)
-        return JS_FALSE;
-
-    XPCWrappedNativeTearOff* tearoff = wrapper->FindTearOff(ccx, iface);
-    if(!tearoff)
-        return JS_FALSE;
-
-    if(!tearoff->IsIDispatch())
-        return JS_FALSE;
-
-    XPCDispInterface* pInfo = tearoff->GetIDispatchInfo();
-
-    PRUint32 members = pInfo->GetMemberCount();
-    // Iterate over the members and force the properties to be resolved
-    for(PRUint32 index = 0; index < members; ++index)
-    {
-        const XPCDispInterface::Member & member = pInfo->GetMember(index);
-        jsid name = member.GetName();
-        if(!xpc_ForcePropertyResolve(ccx, obj, name))
-            return JS_FALSE;
-    }
-    return JS_TRUE;
-}
-
-nsresult XPCIDispatchExtension::IDispatchQIWrappedJS(nsXPCWrappedJS * self, 
-                                                     void ** aInstancePtr)
-{
-    // Lookup the root and create a tearoff based on that
-    nsXPCWrappedJS* root = self->GetRootWrapper();
-
-    if(!root->IsValid())
-    {
-        *aInstancePtr = nsnull;
-        return NS_NOINTERFACE;
-    }
-    XPCDispatchTearOff* tearOff = new XPCDispatchTearOff(root);
-    if(!tearOff)
-        return NS_ERROR_OUT_OF_MEMORY;
-    tearOff->AddRef();
-    *aInstancePtr = tearOff;
-    
-    return NS_OK;
-}
deleted file mode 100644
--- a/js/src/xpconnect/src/nsDispatchSupport.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * \file nsDispatchSupport.cpp
- * Contains the implementation for the nsDispatchSupport class
- * this is an XPCOM service
- */
-
-#include "XPCPrivate.h"
-
-#include "nsIActiveXSecurityPolicy.h"
-
-static PRBool
-ClassIsListed(HKEY hkeyRoot, const TCHAR *szKey, const CLSID &clsid, PRBool &listIsEmpty)
-{
-    // Test if the specified CLSID is found in the specified registry key
-
-    listIsEmpty = PR_TRUE;
-
-    CRegKey keyList;
-    if(keyList.Open(hkeyRoot, szKey, KEY_READ) != ERROR_SUCCESS)
-    {
-        // Class is not listed, because there is no key to read!
-        return PR_FALSE;
-    }
-
-    // Enumerate CLSIDs looking for this one
-    int i = 0;
-    do {
-        USES_CONVERSION;
-        TCHAR szCLSID[64];
-        DWORD kBufLength = sizeof(szCLSID) / sizeof(szCLSID[0]);
-        DWORD len = kBufLength;
-        memset(szCLSID, 0, sizeof(szCLSID));
-        if(::RegEnumKeyEx(keyList, i, szCLSID, &len, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
-        {
-            // End of list
-            break;
-        }
-        ++i;
-        listIsEmpty = PR_FALSE;
-        szCLSID[len - 1] = TCHAR('\0');
-        CLSID clsidToCompare = GUID_NULL;
-        if(SUCCEEDED(::CLSIDFromString(T2OLE(szCLSID), &clsidToCompare)) &&
-            ::IsEqualCLSID(clsid, clsidToCompare))
-        {
-            // Class is listed
-            return PR_TRUE;
-        }
-    } while(1);
-
-    // Class not found
-    return PR_FALSE;
-}
-
-static PRBool
-ClassExists(const CLSID &clsid)
-{
-    // Test if there is a CLSID entry. If there isn't then obviously
-    // the object doesn't exist.
-    CRegKey key;
-    if(key.Open(HKEY_CLASSES_ROOT, _T("CLSID"), KEY_READ) != ERROR_SUCCESS)
-        return PR_FALSE; // Must fail if we can't even open this!
-    
-    LPOLESTR szCLSID = NULL;
-    if(FAILED(StringFromCLSID(clsid, &szCLSID)))
-        return PR_FALSE; // Can't allocate string from CLSID
-
-    USES_CONVERSION;
-    CRegKey keyCLSID;
-    LONG lResult = keyCLSID.Open(key, W2CT(szCLSID), KEY_READ);
-    CoTaskMemFree(szCLSID);
-    if(lResult != ERROR_SUCCESS)
-        return PR_FALSE; // Class doesn't exist
-
-    return PR_TRUE;
-}
-
-static PRBool
-ClassImplementsCategory(const CLSID &clsid, const CATID &catid, PRBool &bClassExists)
-{
-    bClassExists = ClassExists(clsid);
-    // Non existent classes won't implement any category...
-    if(!bClassExists)
-        return PR_FALSE;
-
-    // CLSID exists, so try checking what categories it implements
-    bClassExists = PR_TRUE;
-    CComPtr<ICatInformation> catInfo;
-    HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL,
-        CLSCTX_INPROC_SERVER, __uuidof(ICatInformation), (LPVOID*) &catInfo);
-    if(catInfo == NULL)
-        return PR_FALSE; // Must fail if we can't open the category manager
-    
-    // See what categories the class implements
-    CComPtr<IEnumCATID> enumCATID;
-    if(FAILED(catInfo->EnumImplCategoriesOfClass(clsid, &enumCATID)))
-        return PR_FALSE; // Can't enumerate classes in category so fail
-
-    // Search for matching categories
-    BOOL bFound = FALSE;
-    CATID catidNext = GUID_NULL;
-    while(enumCATID->Next(1, &catidNext, NULL) == S_OK)
-    {
-        if(::IsEqualCATID(catid, catidNext))
-            return PR_TRUE; // Match
-    }
-    return PR_FALSE;
-}
-
-nsDispatchSupport* nsDispatchSupport::mInstance = nsnull;
-
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsDispatchSupport, nsIDispatchSupport)
-
-nsDispatchSupport::nsDispatchSupport()
-{
-    /* member initializers and constructor code */
-}
-
-nsDispatchSupport::~nsDispatchSupport()
-{
-    /* destructor code */
-}
-
-/**
- * Converts a COM variant to a jsval
- * @param comvar the variant to convert
- * @param val pointer to the jsval to receive the value
- * @return nsresult
- */
-NS_IMETHODIMP nsDispatchSupport::COMVariant2JSVal(VARIANT * comvar, jsval *val)
-{
-    XPCCallContext ccx(NATIVE_CALLER);
-    nsresult retval;
-    XPCDispConvert::COMToJS(ccx, *comvar, *val, retval);
-    return retval;
-}
-
-/**
- * Converts a jsval to a COM variant
- * @param val the jsval to be converted
- * @param comvar pointer to the variant to receive the value
- * @return nsresult
- */
-NS_IMETHODIMP nsDispatchSupport::JSVal2COMVariant(jsval val, VARIANT * comvar)
-{
-    XPCCallContext ccx(NATIVE_CALLER);
-    nsresult retval;
-    XPCDispConvert::JSToCOM(ccx, val, *comvar, retval);
-    return retval;
-}
-
-/* boolean isClassSafeToHost (in nsCIDRef clsid, out boolean classExists); */
-NS_IMETHODIMP nsDispatchSupport::IsClassSafeToHost(JSContext * cx,
-                                                   const nsCID & cid,
-                                                   PRBool ignoreException, 
-                                                   PRBool *classExists, 
-                                                   PRBool *aResult)
-{
-    NS_ENSURE_ARG_POINTER(aResult);
-    NS_ENSURE_ARG_POINTER(classExists);
-
-    *aResult = PR_FALSE;
-
-    CLSID clsid = XPCDispnsCID2CLSID(cid);
-
-    // Ask security manager if it's ok to create this object
-    XPCCallContext ccx(JS_CALLER, cx);
-    nsIXPCSecurityManager* sm =
-            ccx.GetXPCContext()->GetAppropriateSecurityManager(
-                        nsIXPCSecurityManager::HOOK_CREATE_INSTANCE);
-    *aResult = !sm ||
-        NS_SUCCEEDED(sm->CanCreateInstance(ccx, cid));
-
-    if(!*aResult)
-    {
-        if (ignoreException)
-            JS_ClearPendingException(ccx);
-        *classExists = PR_TRUE;
-        return NS_OK;
-    }
-    *classExists = ClassExists(clsid);
-
-    // Test the Internet Explorer black list
-    const TCHAR kIEControlsBlacklist[] = _T("SOFTWARE\\Microsoft\\Internet Explorer\\ActiveX Compatibility");
-    CRegKey keyExplorer;
-    if(keyExplorer.Open(HKEY_LOCAL_MACHINE,
-        kIEControlsBlacklist, KEY_READ) == ERROR_SUCCESS)
-    {
-        LPOLESTR szCLSID = NULL;
-        ::StringFromCLSID(clsid, &szCLSID);
-        if(szCLSID)
-        {
-            CRegKey keyCLSID;
-            USES_CONVERSION;
-            if(keyCLSID.Open(keyExplorer, W2T(szCLSID), KEY_READ) == ERROR_SUCCESS)
-            {
-                DWORD dwType = REG_DWORD;
-                DWORD dwFlags = 0;
-                DWORD dwBufSize = sizeof(dwFlags);
-                if(::RegQueryValueEx(keyCLSID, _T("Compatibility Flags"),
-                    NULL, &dwType, (LPBYTE) &dwFlags, &dwBufSize) == ERROR_SUCCESS)
-                {
-                    // Documented flags for this reg key
-                    const DWORD kKillBit = 0x00000400; // MS Knowledge Base 240797
-                    if(dwFlags & kKillBit)
-                    {
-                        ::CoTaskMemFree(szCLSID);
-                        *aResult = PR_FALSE;
-                        return NS_OK;
-                    }
-                }
-            }
-            ::CoTaskMemFree(szCLSID);
-        }
-    }
-
-    *aResult = PR_TRUE;
-    return NS_OK;
-}
-
-/* boolean isClassMarkedSafeForScripting (in nsCIDRef clsid, out boolean classExists); */
-NS_IMETHODIMP nsDispatchSupport::IsClassMarkedSafeForScripting(const nsCID & cid, PRBool *classExists, PRBool *aResult)
-{
-    NS_ENSURE_ARG_POINTER(aResult);
-    NS_ENSURE_ARG_POINTER(classExists);
-    // Test the category the object belongs to
-    CLSID clsid = XPCDispnsCID2CLSID(cid);
-    *aResult = ClassImplementsCategory(clsid, CATID_SafeForScripting, *classExists);
-    return NS_OK;
-}
-
-/* boolean isObjectSafeForScripting (in voidPtr theObject, in nsIIDRef iid); */
-NS_IMETHODIMP nsDispatchSupport::IsObjectSafeForScripting(void * theObject, const nsIID & id, PRBool *aResult)
-{
-    NS_ENSURE_ARG_POINTER(theObject);
-    NS_ENSURE_ARG_POINTER(aResult);
-
-    // Test if the object implements IObjectSafety and is marked safe for scripting
-    IUnknown *pObject = (IUnknown *) theObject;
-    IID iid = XPCDispIID2IID(id);
-
-    // Ask the control if its safe for scripting
-    CComQIPtr<IObjectSafety> objectSafety = pObject;
-    if(!objectSafety)
-    {
-        *aResult = PR_TRUE;
-        return NS_OK;
-    }
-
-    DWORD dwSupported = 0; // Supported options (mask)
-    DWORD dwEnabled = 0;   // Enabled options
-
-    // Assume scripting via IDispatch
-    if(FAILED(objectSafety->GetInterfaceSafetyOptions(
-            iid, &dwSupported, &dwEnabled)))
-    {
-        // Interface is not safe or failure.
-        *aResult = PR_FALSE;
-        return NS_OK;
-    }
-
-    // Test if safe for scripting
-    if(!(dwEnabled & dwSupported) & INTERFACESAFE_FOR_UNTRUSTED_CALLER)
-    {
-        // Object says it is not set to be safe, but supports unsafe calling,
-        // try enabling it and asking again.
-
-        if(!(dwSupported & INTERFACESAFE_FOR_UNTRUSTED_CALLER) ||
-            FAILED(objectSafety->SetInterfaceSafetyOptions(
-                iid, INTERFACESAFE_FOR_UNTRUSTED_CALLER, INTERFACESAFE_FOR_UNTRUSTED_CALLER)) ||
-            FAILED(objectSafety->GetInterfaceSafetyOptions(
-                iid, &dwSupported, &dwEnabled)) ||
-            !(dwEnabled & dwSupported) & INTERFACESAFE_FOR_UNTRUSTED_CALLER)
-        {
-            *aResult = PR_FALSE;
-            return NS_OK;
-        }
-    }
-
-    *aResult = PR_TRUE;
-    return NS_OK;
-}
-
-static const PRUint32 kDefaultHostingFlags =
-    nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_NOTHING;
-
-/* unsigned long getHostingFlags (in string aContext); */
-NS_IMETHODIMP nsDispatchSupport::GetHostingFlags(const char *aContext, PRUint32 *aResult)
-{
-    NS_ENSURE_ARG_POINTER(aResult);
-
-    // Ask the activex security policy what the hosting flags are
-    nsresult rv;
-    nsCOMPtr<nsIActiveXSecurityPolicy> securityPolicy =
-        do_GetService(NS_IACTIVEXSECURITYPOLICY_CONTRACTID, &rv);
-    if(NS_SUCCEEDED(rv) && securityPolicy)
-        return securityPolicy->GetHostingFlags(aContext, aResult);
-    
-    // No policy so use the defaults
-    *aResult = kDefaultHostingFlags;
-    return NS_OK;
-}
-
-nsDispatchSupport* nsDispatchSupport::GetSingleton()
-{
-    if(!mInstance)
-    {
-        mInstance = new nsDispatchSupport;
-        NS_IF_ADDREF(mInstance);
-    }
-    NS_IF_ADDREF(mInstance);
-    return mInstance;
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/StdAfx.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-//  stdafx.pch will be the pre-compiled header
-//  stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-#ifdef _ATL_STATIC_REGISTRY
-#include <statreg.h>
-#include <statreg.cpp>
-#endif
-
-#include <atlimpl.cpp>
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/StdAfx.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// stdafx.h : include file for standard system include files,
-//      or project specific include files that are used frequently,
-//      but are changed infrequently
-
-#if !defined(AFX_STDAFX_H__3B3A8A37_A147_4D96_BFA3_51B0F69B5D8D__INCLUDED_)
-#define AFX_STDAFX_H__3B3A8A37_A147_4D96_BFA3_51B0F69B5D8D__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#define STRICT
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0400
-#endif
-#define _ATL_APARTMENT_THREADED
-
-#include <atlbase.h>
-//You may derive a class from CComModule and use it if you want to override
-//something, but do not change the name of _Module
-extern CComModule _Module;
-#include <atlcom.h>
-#include <comdef.h>
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__3B3A8A37_A147_4D96_BFA3_51B0F69B5D8D__INCLUDED)
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/XPCDispUtilities.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef XPCDispUtilities_h
-#define XPCDispUtilities_h
-
-template <class T>
-inline
-HRESULT XPCCreateInstance(const CLSID & clsid, const IID & iid, T ** result)
-{
-    return CoCreateInstance(clsid, 0, CLSCTX_ALL, iid, reinterpret_cast<void**>(result));
-}
-
-DISPID GetIDsOfNames(IDispatch * pIDispatch , CComBSTR const & name)
-{
-    DISPID dispid;
-    OLECHAR * pName = name;
-    HRESULT hresult = pIDispatch->GetIDsOfNames(
-        IID_NULL,
-        &pName,
-        1, 
-        LOCALE_SYSTEM_DEFAULT,
-        &dispid);
-    if (!SUCCEEDED(hresult))
-    {
-        dispid = 0;
-    }
-    return dispid;
-}
-
-#endif
\ No newline at end of file
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-// XPCIDispatchTest.cpp : Implementation of DLL Exports.
-
-
-// Note: Proxy/Stub Information
-//      To build a separate proxy/stub DLL, 
-//      run nmake -f IDispatchTestps.mk in the project directory.
-
-#include "stdafx.h"
-#include "resource.h"
-#include <initguid.h>
-#include "XPCIDispatchTest.h"
-
-#include "XPCIDispatchTest_i.c"
-#include "nsXPCDispTestMethods.h"
-#include "nsXPCDispSimple.h"
-#include "nsXPCDispTestNoIDispatch.h"
-#include "nsXPCDispTestProperties.h"
-#include "nsXPCDispTestArrays.h"
-#include "nsXPCDispTestScriptOn.h"
-#include "nsXPCDispTestScriptOff.h"
-#include "nsXPCDispTestWrappedJS.h"
-
-CComModule _Module;
-
-BEGIN_OBJECT_MAP(ObjectMap)
-OBJECT_ENTRY(CLSID_nsXPCDispTestMethods, nsXPCDispTestMethods)
-OBJECT_ENTRY(CLSID_nsXPCDispSimple, nsXPCDispSimple)
-OBJECT_ENTRY(CLSID_nsXPCDispTestNoIDispatch, nsXPCDispTestNoIDispatch)
-OBJECT_ENTRY(CLSID_nsXPCDispTestProperties, nsXPCDispTestProperties)
-OBJECT_ENTRY(CLSID_nsXPCDispTestArrays, nsXPCDispTestArrays)
-OBJECT_ENTRY(CLSID_nsXPCDispTestScriptOn, nsXPCDispTestScriptOn)
-OBJECT_ENTRY(CLSID_nsXPCDispTestScriptOff, nsXPCDispTestScriptOff)
-OBJECT_ENTRY(CLSID_nsXPCDispTestWrappedJS, nsXPCDispTestWrappedJS)
-END_OBJECT_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// DLL Entry Point
-
-extern "C"
-BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
-{
-    if (dwReason == DLL_PROCESS_ATTACH)
-    {
-        _Module.Init(ObjectMap, hInstance, &LIBID_IDispatchTestLib);
-        DisableThreadLibraryCalls(hInstance);
-    }
-    else if (dwReason == DLL_PROCESS_DETACH)
-        _Module.Term();
-    return TRUE;    // ok
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// Used to determine whether the DLL can be unloaded by OLE
-
-STDAPI DllCanUnloadNow(void)
-{
-    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// Returns a class factory to create an object of the requested type
-
-STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
-{
-    return _Module.GetClassObject(rclsid, riid, ppv);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// DllRegisterServer - Adds entries to the system registry
-
-STDAPI DllRegisterServer(void)
-{
-    // registers object, typelib and all interfaces in typelib
-    return _Module.RegisterServer(TRUE);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// DllUnregisterServer - Removes entries from the system registry
-
-STDAPI DllUnregisterServer(void)
-{
-    return _Module.UnregisterServer(TRUE);
-}
-
-
-#include "nsXPCDispTestWrappedJS.h"
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.def
+++ /dev/null
@@ -1,9 +0,0 @@
-; XPCIDispatchTest.def : Declares the module parameters.
-
-LIBRARY      "XPCIDispatchTest.DLL"
-
-EXPORTS
-	DllCanUnloadNow     @1 PRIVATE
-	DllGetClassObject   @2 PRIVATE
-	DllRegisterServer   @3 PRIVATE
-	DllUnregisterServer	@4 PRIVATE
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.dsp
+++ /dev/null
@@ -1,318 +0,0 @@
-# Microsoft Developer Studio Project File - Name="XPCIDispatchTest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=XPCIDispatchTest - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "XPCIDispatchTest.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "XPCIDispatchTest.mak" CFG="XPCIDispatchTest - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "XPCIDispatchTest - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "XPCIDispatchTest - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "XPCIDispatchTest - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c
-# ADD CPP /nologo /MTd /W4 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
-# Begin Custom Build - Performing registration
-OutDir=.\Debug
-TargetPath=.\Debug\XPCIDispatchTest.dll
-InputPath=.\Debug\XPCIDispatchTest.dll
-SOURCE="$(InputPath)"
-
-"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
-	regsvr32 /s /c "$(TargetPath)" 
-	echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" 
-	
-# End Custom Build
-
-!ELSEIF  "$(CFG)" == "XPCIDispatchTest - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "XPCIDispatchTest___Win32_Release"
-# PROP BASE Intermediate_Dir "XPCIDispatchTest___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# Begin Custom Build - Performing registration
-OutDir=.\Release
-TargetPath=.\Release\XPCIDispatchTest.dll
-InputPath=.\Release\XPCIDispatchTest.dll
-SOURCE="$(InputPath)"
-
-"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
-	regsvr32 /s /c "$(TargetPath)" 
-	echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" 
-	
-# End Custom Build
-
-!ENDIF 
-
-# Begin Target
-
-# Name "XPCIDispatchTest - Win32 Debug"
-# Name "XPCIDispatchTest - Win32 Release"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\nsXPCDispSimple.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestArrays.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestMethods.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestNoIDispatch.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestProperties.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestScriptOff.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestScriptOn.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestWrappedJS.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.cpp
-# ADD CPP /Yc"stdafx.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\XPCIDispatchTest.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\XPCIDispatchTest.def
-# End Source File
-# Begin Source File
-
-SOURCE=.\XPCIDispatchTest.idl
-# ADD MTL /tlb ".\XPCIDispatchTest.tlb" /h "XPCIDispatchTest.h" /iid "XPCIDispatchTest_i.c" /Oicf
-# End Source File
-# Begin Source File
-
-SOURCE=.\XPCIDispatchTest.rc
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\nsXPCDispSimple.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestArrays.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestMethods.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestNoIDispatch.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestProperties.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestScriptOff.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestScriptOn.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestWrappedJS.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Resource.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\XPCDispUtilities.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\nsXPCDispSimple.rgs
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestArrays.rgs
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestMethods.rgs
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestNoIDispatch.rgs
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestNoScript.rgs
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestProperties.rgs
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestScriptOff.rgs
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestScriptOn.rgs
-# End Source File
-# Begin Source File
-
-SOURCE=.\nsXPCDispTestWrappedJS.rgs
-# End Source File
-# End Group
-# Begin Group "JS Files"
-
-# PROP Default_Filter "js"
-# Begin Group "WrappedCOM"
-
-# PROP Default_Filter ""
-# Begin Group "Arrays"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\Tests\WrappedCOM\Arrays\XPCIDispatchArrayTests.js
-# End Source File
-# End Group
-# Begin Group "Attributes"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\Tests\WrappedCOM\Attributes\XPCIDispatchAttributeTests.js
-# End Source File
-# End Group
-# Begin Group "General"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\Tests\WrappedCOM\General\XPCIDispatchInstantiations.js
-# End Source File
-# Begin Source File
-
-SOURCE=..\Tests\WrappedCOM\General\XPCStress.js
-# End Source File
-# End Group
-# Begin Group "Methods"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\Tests\WrappedCOM\Methods\XPCIDispatchMethodTests.js
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=..\Tests\WrappedCOM\shell.js
-# End Source File
-# End Group
-# Begin Group "WrappedJS"
-
-# PROP Default_Filter ""
-# Begin Group "General (WJS)"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\Tests\WrappedJS\General\XPCIDispatchTestWrappedJS.js
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=..\Tests\WrappedJS\shell.js
-# End Source File
-# End Group
-# End Group
-# End Target
-# End Project
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "XPCIDispatchTest"=.\XPCIDispatchTest.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.idl
+++ /dev/null
@@ -1,454 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-// XPCIDispatchTest.idl : IDL source for XPCIDispatchTest.dll
-//
-
-// This file will be processed by the MIDL tool to
-// produce the type library (XPCIDispatchTest.tlb) and marshalling code.
-
-import "oaidl.idl";
-import "ocidl.idl";
-import "objsafe.idl";
-
-[
-    uuid(83A51226-F49D-488A-8F78-75BB2F927F4C),
-    version(1.0),
-    helpstring("XPCIDispatchTest 1.0 Type Library")
-]
-library IDispatchTestLib
-{
-    importlib("stdole32.tlb");
-    importlib("stdole2.tlb");
-
-    [
-        object,
-        uuid(0de5dbae-1d78-45cb-91a2-24516fef2837),
-        dual,
-        helpstring("nsIXPCDispSimple interface"),
-        pointer_default(unique)
-    ]
-    interface nsIXPCDispSimple : IDispatch
-    {
-        [id(1), helpstring("Simple method returning the name of the class")]
-            HRESULT ClassName([out]BSTR * name);
-        [propget, id(2), helpstring("Simple number property")]
-            HRESULT Number([out, retval]long * result);
-        [propput, id(2), helpstring("Simple number property")]
-            HRESULT Number([in]long result);
-    }
-    [
-        uuid(9F39237C-D179-4260-8EF3-4B6D4D7D5570),
-        helpstring("nsXPCDispSimple Class")
-    ]
-    coclass nsXPCDispSimple
-    {
-        [default] interface nsIXPCDispSimple;
-    };
-    [
-        object,
-        uuid(47bf6c99-a30c-4105-8af6-de76dcfdd6dd),
-        dual,
-        helpstring("nsIXPCDispTestMethods interface"),
-        pointer_default(unique)
-    ]
-    interface nsIXPCDispTestMethods : IDispatch
-    {
-        /* Return values test */
-        [id(1), helpstring("method with no parameters")]
-            HRESULT NoParameters();
-        [id(2), helpstring("method that returns a string")]
-            HRESULT ReturnBSTR([out, retval]BSTR * result);
-        [id(3), helpstring("method that returns a 32 bit signed integer")]
-            HRESULT ReturnI4([out, retval]int * result);
-        [id(4), helpstring("method that returns an 8 bit unsigned integer")]
-            HRESULT ReturnUI1([out, retval]unsigned char * result);
-        [id(5), helpstring("method that returns a 16 bit signed integer")]
-            HRESULT ReturnI2([out, retval]short * result);
-        [id(6), helpstring("method that returns a 32 bit floating point number")]
-            HRESULT ReturnR4([out, retval]float * result);
-        [id(7), helpstring("method that returns a 64 bit floating point number")]
-            HRESULT ReturnR8([out, retval]double * result);
-        [id(8), helpstring("method that returns a boolean")]
-            HRESULT ReturnBool([out, retval]VARIANT_BOOL * result);
-        [id(9), helpstring("method that returns an IDispatch pointer")]
-            HRESULT ReturnIDispatch([out, retval]IDispatch ** result);
-        [id(10), helpstring("method that returns an error")]
-            HRESULT ReturnError([out, retval]SCODE * result);
-        [id(12), helpstring("method that returns a date")]
-            HRESULT ReturnDate([out, retval]DATE * result);
-        [id(13), helpstring("method that returns an IUnknown")]
-            HRESULT ReturnIUnknown([out, retval]IUnknown ** result);
-        [id(14), helpstring("method that returns a signed 8 bit integer")]
-            HRESULT ReturnI1([out, retval]char * result);
-        [id(15), helpstring("method that returns an unsigned 16 bit integer")]
-            HRESULT ReturnUI2([out, retval]unsigned short * result);
-        [id(16), helpstring("method that returns an unsigned 32 bit integer")]
-            HRESULT ReturnUI4([out, retval]unsigned long * result);
-        [id(17), helpstring("method that returns an integer")]
-            HRESULT ReturnInt([out, retval]int * result);
-        [id(18), helpstring("method that returns an unsigned integer")]
-            HRESULT ReturnUInt([out, retval]unsigned int * result);
-
-        /* Single input parameter tests */
-        [id(19), helpstring("method that takes a string")]
-            HRESULT TakesBSTR([in]BSTR result);
-        [id(20), helpstring("method that takes a 32 bit signed integer")]
-            HRESULT TakesI4([in]int result);
-        [id(21), helpstring("method that takes an 8 bit unsigned integer")]
-            HRESULT TakesUI1([in]unsigned char result);
-        [id(22), helpstring("method that takes a 16 bit signed integer")]
-            HRESULT TakesI2([in]short result);
-        [id(23), helpstring("method that takes a 32 bit floating point number")]
-            HRESULT TakesR4([in]float result);
-        [id(24), helpstring("method that takes a 64 bit floating point number")]
-            HRESULT TakesR8([in]double result);
-        [id(25), helpstring("method that takes a boolean")]
-            HRESULT TakesBool([in]VARIANT_BOOL result);
-        [id(26), helpstring("method that takes an IDispatch pointer")]
-            HRESULT TakesIDispatch([in]IDispatch * result);
-        [id(27), helpstring("method that takes an error")]
-            HRESULT TakesError([in]SCODE result);
-        [id(29), helpstring("method that takes a date")]
-            HRESULT TakesDate([in]DATE result);
-        [id(30), helpstring("method that takes an IUnknown")]
-            HRESULT TakesIUnknown([in]IUnknown * result);
-        [id(31), helpstring("method that takes a signed 8 bit integer")]
-            HRESULT TakesI1([in]char result);
-        [id(32), helpstring("method that takes an unsigned 16 bit integer")]
-            HRESULT TakesUI2([in]unsigned short result);
-        [id(33), helpstring("method that takes an unsigned 32 bit integer")]
-            HRESULT TakesUI4([in]unsigned long result);
-        [id(34), helpstring("method that takes an integer")]
-            HRESULT TakesInt([in]int result);
-        [id(35), helpstring("method that takes an unsigned integer")]
-            HRESULT TakesUInt([in]unsigned int result);
-
-        /* output parameter tests */
-        [id(36), helpstring("method that outputs a string")]
-            HRESULT OutputsBSTR([out]BSTR * result);
-        [id(37), helpstring("method that outputs a 32 bit signed integer")]
-            HRESULT OutputsI4([out]long * result);
-        [id(38), helpstring("method that outputs an 8 bit unsigned integer")]
-            HRESULT OutputsUI1([out]unsigned char * result);
-        [id(39), helpstring("method that outputs a 16 bit signed integer")]
-            HRESULT OutputsI2([out]short * result);
-        [id(40), helpstring("method that outputs a 32 bit floating point number")]
-            HRESULT OutputsR4([out]float * result);
-        [id(41), helpstring("method that outputs a 64 bit floating point number")]
-            HRESULT OutputsR8([out]double * result);
-        [id(42), helpstring("method that outputs a boolean")]
-            HRESULT OutputsBool([out]VARIANT_BOOL * result);
-        [id(43), helpstring("method that outputs an IDispatch pointer")]
-            HRESULT OutputsIDispatch([out]IDispatch ** result);
-        [id(44), helpstring("method that outputs an error")]
-            HRESULT OutputsError([out]SCODE * result);
-        [id(46), helpstring("method that outputs a date")]
-            HRESULT OutputsDate([out]DATE * result);
-        [id(47), helpstring("method that outputs an IUnknown")]
-            HRESULT OutputsIUnknown([out]IUnknown ** result);
-        [id(48), helpstring("method that outputs a signed 8 bit integer")]
-            HRESULT OutputsI1([out]char * result);
-        [id(49), helpstring("method that outputs an unsigned 16 bit integer")]
-            HRESULT OutputsUI2([out]unsigned short * result);
-        [id(50), helpstring("method that outputs an unsigned 32 bit integer")]
-            HRESULT OutputsUI4([out]unsigned long * result);
-    
-        /* in/outparameter tests */
-        [id(53), helpstring("method that in/outs a string")]
-            HRESULT InOutsBSTR([in, out]BSTR * result);
-        [id(54), helpstring("method that in/outs a 32 bit signed integer")]
-            HRESULT InOutsI4([in, out]long * result);
-        [id(55), helpstring("method that in/outs an 8 bit unsigned integer")]
-            HRESULT InOutsUI1([in, out]unsigned char * result);
-        [id(56), helpstring("method that in/outs a 16 bit signed integer")]
-            HRESULT InOutsI2([in, out]short * result);
-        [id(57), helpstring("method that in/outs a 32 bit floating point number")]
-            HRESULT InOutsR4([in, out]float * result);
-        [id(58), helpstring("method that in/outs a 64 bit floating point number")]
-            HRESULT InOutsR8([in, out]double * result);
-        [id(59), helpstring("method that in/outs a boolean")]
-            HRESULT InOutsBool([in, out]VARIANT_BOOL * result);
-        [id(60), helpstring("method that in/outs an IDispatch pointer")]
-            HRESULT InOutsIDispatch([in, out]IDispatch ** result);
-        [id(61), helpstring("method that in/outs an error")]
-            HRESULT InOutsError([in, out]SCODE * result);
-        [id(63), helpstring("method that in/outs a date")]
-            HRESULT InOutsDate([in, out]DATE * result);
-        [id(64), helpstring("method that in/outs an IUnknown")]
-            HRESULT InOutsIUnknown([in, out]IUnknown ** result);
-        [id(65), helpstring("method that in/outs a signed 8 bit integer")]
-            HRESULT InOutsI1([in, out]char * result);
-        [id(66), helpstring("method that in/outs an unsigned 16 bit integer")]
-            HRESULT InOutsUI2([in, out]unsigned short * result);
-        [id(67), helpstring("method that in/outs an unsigned 32 bit integer")]
-            HRESULT InOutsUI4([in, out]unsigned long * result);
-
-        /* input and return tests*/
-        [id(70), helpstring("method that takes an long and returns it")]
-            HRESULT OneParameterWithReturn([in]long input, [out,retval]long* result);
-        [id(71), helpstring("method that takes a string and returns it")]
-            HRESULT StringInputAndReturn([in]BSTR str, [out, retval]BSTR* result);
-        [id(72), helpstring("method that takes an IDispatch and returns it")]
-            HRESULT IDispatchInputAndReturn([in]IDispatch* input, [out,retval]IDispatch** result);
-    
-        /* Multiple parameters */
-        [id(73), helpstring("method that takes two parameters")]
-            HRESULT TwoParameters([in]long one, [in]long two);
-        [id(74), helpstring("method that takes 12 input parameters")]
-            HRESULT TwelveInParameters([in]long one, [in]long two, [in]long three, 
-                                       [in]long four, [in]long five, [in]long six,
-                                       [in]long seven, [in]long eight, 
-                                       [in]long nine, [in]long ten,
-                                       [in]long eleven, [in]long twelve);
-        [id(75), helpstring("method that takes 12 out parameters")]
-            HRESULT TwelveOutParameters([out]long *one, [out]long *two,
-                                        [out]long *three, [out]long *four,
-                                        [out]long *five, [out]long *six,
-                                        [out]long *seven, [out]long *eight,
-                                        [out]long *nine, [out]long *ten,
-                                        [out]long *eleven, [out]long *twelve);
-        [id(76), helpstring("method that takes 12 input string parameters")]
-            HRESULT TwelveStrings([in]BSTR one, [in]BSTR two, [in]BSTR three,
-                                 [in]BSTR four, [in]BSTR five, [in]BSTR six,
-                                 [in]BSTR seven, [in]BSTR eight, [in]BSTR nine,
-                                 [in]BSTR ten, [in]BSTR eleven, [in]BSTR twelve);
-        [id(77), helpstring("method that takes 12 input string parameters")]
-            HRESULT TwelveOutStrings([out]BSTR* one, [out]BSTR* two,
-                                     [out]BSTR* three, [out]BSTR* four,
-                                     [out]BSTR* five, [out]BSTR* six,
-                                     [out]BSTR* seven, [out]BSTR* eight,
-                                     [out]BSTR* nine, [out]BSTR* ten,
-                                     [out]BSTR* eleven, [out]BSTR* twelve);
-        [id(78), helpstring("method that takes 12 input string parameters")]
-            HRESULT TwelveIDispatch([in]IDispatch* one, [in]IDispatch* two,
-                                    [in]IDispatch* three, [in]IDispatch* four,
-                                    [in]IDispatch* five, [in]IDispatch* six,
-                                    [in]IDispatch* seven, [in]IDispatch* eight,
-                                    [in]IDispatch* nine, [in]IDispatch* ten,
-                                    [in]IDispatch* eleven,
-                                    [in]IDispatch* twelve);
-        [id(79), helpstring("method that takes 12 input string parameters")]
-            HRESULT TwelveOutIDispatch([out]IDispatch** one,
-                                       [out]IDispatch** two,
-                                       [out]IDispatch** three,
-                                       [out]IDispatch** four,
-                                       [out]IDispatch** five,
-                                       [out]IDispatch** six,
-                                       [out]IDispatch** seven,
-                                       [out]IDispatch** eight,
-                                       [out]IDispatch** nine,
-                                       [out]IDispatch** ten,
-                                       [out]IDispatch** eleven,
-                                       [out]IDispatch** twelve);
-        [id(80), helpstring("method that generates an error")]
-            HRESULT CreateError();
-    }
-    [
-        uuid(745D1149-9F46-418C-B176-71EAA98974BA),
-        helpstring("nsXPCDispTestMethods Class")
-    ]
-    coclass nsXPCDispTestMethods
-    {
-        [default] interface nsIXPCDispTestMethods;
-    };
-    [
-        object,
-        uuid(f876c083-ae00-4b78-93b8-8305980f0864),
-        dual,
-        helpstring("nsIXPCDispTestArrays interface"),
-        pointer_default(unique)
-    ]
-    interface nsIXPCDispTestArrays : IDispatch
-    {
-        [id(1), helpstring("returns a SAFEARRAY")]
-            HRESULT ReturnSafeArray([out, retval]SAFEARRAY(VARIANT)* result);
-        [id(2), helpstring("returns a SAFEARRAY")]
-            HRESULT ReturnSafeArrayBSTR([out, retval]SAFEARRAY(VARIANT)* result);
-        [id(3), helpstring("returns a SAFEARRAY")]
-            HRESULT ReturnSafeArrayIDispatch([out, retval]SAFEARRAY(VARIANT)* result);
-        [id(4), helpstring("method that takes a SAFEARRAY")]
-            HRESULT TakesSafeArray([in]SAFEARRAY(VARIANT) array);
-        [id(5), helpstring("method that takes a SAFEARRAY")]
-            HRESULT TakesSafeArrayBSTR([in]SAFEARRAY(VARIANT) array);
-        [id(6), helpstring("method that takes a SAFEARRAY")]
-            HRESULT TakesSafeArrayIDispatch([in]SAFEARRAY(VARIANT) array);
-        [id(7), helpstring("method that takes a SAFEARRAY")]
-            HRESULT InOutSafeArray([in, out]SAFEARRAY(VARIANT) * array);
-        [id(8), helpstring("method that takes a SAFEARRAY")]
-            HRESULT InOutSafeArrayBSTR([in, out]SAFEARRAY(VARIANT) * array);
-        [id(9), helpstring("method that takes a SAFEARRAY")]
-            HRESULT InOutSafeArrayIDispatch([in, out]SAFEARRAY(VARIANT) * array);
-    }
-    [
-        uuid(AB085C43-C619-48C8-B68C-C495BDE12DFB),
-        helpstring("nsXPCDispTestArrays Class")
-    ]
-    coclass nsXPCDispTestArrays
-    {
-        [default] interface nsIXPCDispTestArrays;
-    };
-    [
-        object,
-        uuid(9782107f-14cc-40b2-b0cd-988d81a46e9e),
-        dual,
-        helpstring("nsIXPCDispTestNoIDispatch interface"),
-        pointer_default(unique)
-    ]
-    interface nsIXPCDispTestNoIDispatch : IUnknown
-    {
-    }
-    [
-        uuid(7414404F-A4CC-4E3C-9B32-BB20CB22F541),
-        helpstring("nsXPCDispTestNoIDispatch Class")
-    ]
-    coclass nsXPCDispTestNoIDispatch
-    {
-        [default] interface nsIXPCDispTestNoIDispatch;
-    };
-    [
-        object,
-        uuid(7830CACE-5019-489D-8B69-029E70CF39B7),
-        dual,
-        helpstring("nsIXPCDispTestProperties Interface"),
-        pointer_default(unique)
-    ]
-    interface nsIXPCDispTestProperties : IDispatch
-    {
-        [propget, id(1), helpstring("property Short")] HRESULT Short([out, retval] short *pVal);
-        [propput, id(1), helpstring("property Short")] HRESULT Short([in] short newVal);
-        [propget, id(2), helpstring("property Long")] HRESULT Long([out, retval] long *pVal);
-        [propput, id(2), helpstring("property Long")] HRESULT Long([in] long newVal);
-        [propget, id(3), helpstring("property Float")] HRESULT Float([out, retval] float *pVal);
-        [propput, id(3), helpstring("property Float")] HRESULT Float([in] float newVal);
-        [propget, id(4), helpstring("property Double")] HRESULT Double([out, retval] double *pVal);
-        [propput, id(4), helpstring("property Double")] HRESULT Double([in] double newVal);
-        [propget, id(5), helpstring("property Currency")] HRESULT Currency([out, retval] CURRENCY *pVal);
-        [propput, id(5), helpstring("property Currency")] HRESULT Currency([in] CURRENCY newVal);
-        [propget, id(6), helpstring("property Date")] HRESULT Date([out, retval] DATE *pVal);
-        [propput, id(6), helpstring("property Date")] HRESULT Date([in] DATE newVal);
-        [propget, id(7), helpstring("property String")] HRESULT String([out, retval] BSTR *pVal);
-        [propput, id(7), helpstring("property String")] HRESULT String([in] BSTR newVal);
-        [propget, id(8), helpstring("property DispatchPtr")] HRESULT DispatchPtr([out, retval] IDispatch* *pVal);
-        [propput, id(8), helpstring("property DispatchPtr")] HRESULT DispatchPtr([in] IDispatch* newVal);
-        [propget, id(9), helpstring("property SCode")] HRESULT SCode([out, retval] SCODE *pVal);
-        [propput, id(9), helpstring("property SCode")] HRESULT SCode([in] SCODE newVal);
-        [propget, id(10), helpstring("property Boolean")] HRESULT Boolean([out, retval] BOOL *pVal);
-        [propput, id(10), helpstring("property Boolean")] HRESULT Boolean([in] BOOL newVal);
-        [propget, id(11), helpstring("property Variant")] HRESULT Variant([out, retval] VARIANT *pVal);
-        [propput, id(11), helpstring("property Variant")] HRESULT Variant([in] VARIANT newVal);
-        [propget, id(12), helpstring("property COMPtr")] HRESULT COMPtr([out, retval] IUnknown* *pVal);
-        [propput, id(12), helpstring("property COMPtr")] HRESULT COMPtr([in] IUnknown* newVal);
-        [propget, id(13), helpstring("property Char")] HRESULT Char([out, retval] unsigned char *pVal);
-        [propput, id(13), helpstring("property Char")] HRESULT Char([in] unsigned char newVal);
-		[propget, id(14), helpstring("property ParameterizedProperty")] HRESULT ParameterizedProperty([in]long aIndex, [out, retval] long *pVal);
-		[propput, id(14), helpstring("property ParameterizedProperty")] HRESULT ParameterizedProperty([in]long aIndex, [in] long newVal);
-		[propget, id(15), helpstring("property ParameterizedPropertyCount")] HRESULT ParameterizedPropertyCount([out, retval] long *pVal);
-    };
-    
-    [
-        object,
-        uuid(0797788A-CB08-4995-BD45-7BF8C468DE21),
-        dual,
-        helpstring("nsIXPCDispTestScriptOn Interface"),
-        pointer_default(unique)
-    ]
-    interface nsIXPCDispTestScriptOn : IDispatch
-    {
-    };
-    
-    [
-        uuid(2A06373F-3E61-4882-A3D7-A104F70B09ED),
-        helpstring("nsXPCDispTestScriptOn Class")
-    ]
-    coclass nsXPCDispTestScriptOn
-    {
-        [default] interface nsIXPCDispTestScriptOn;
-    };
-
-    [
-        object,
-        uuid(EE6F9DB5-890F-422D-B9DC-9C5AB5A1D654),
-        dual,
-        helpstring("nsIXPCDispTestScriptOff Interface"),
-        pointer_default(unique)
-    ]
-    interface nsIXPCDispTestScriptOff : IDispatch
-    {
-    };
-	
-	[
-		object,
-		uuid(D84352CA-1A01-4E72-9072-77AFA669B3AD),
-		dual,
-		helpstring("nsIXPCDispTestWrappedJS Interface"),
-		pointer_default(unique)
-	]
-	interface nsIXPCDispTestWrappedJS : IDispatch
-	{
-		[id(1), helpstring("method TestParamTypes")] HRESULT TestParamTypes([in] IDispatch * obj, [out, retval]BSTR * errMsg);
-	};
-    
-	[
-		uuid(EAEE6BB2-C005-4B91-BCA7-6613236F6F69),
-		helpstring("nsXPCDispTestWrappedJS Class")
-	]
-	coclass nsXPCDispTestWrappedJS
-	{
-		[default] interface nsIXPCDispTestWrappedJS;
-	};
-
-    [
-        uuid(959CD122-9826-4757-BA09-DE327D55F9E7),
-        helpstring("nsXPCDispTestScriptOff Class")
-    ]
-    coclass nsXPCDispTestScriptOff
-    {
-        [default] interface nsIXPCDispTestScriptOff;
-    };
-
-    [
-        uuid(D8B4265B-1768-4CA9-A285-7CCAEEB51C74),
-        helpstring("nsXPCDispTestProperties Class")
-    ]
-    coclass nsXPCDispTestProperties
-    {
-        [default] interface nsIXPCDispTestProperties;
-    };
-
-    
-};
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.rc
+++ /dev/null
@@ -1,145 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "winres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#include ""winres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "1 TYPELIB ""XPCIDispatchTest.tlb""\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904B0"
-        BEGIN
-            VALUE "CompanyName", "\0"
-            VALUE "FileDescription", "XPCIDispatchTest Module\0"
-            VALUE "FileVersion", "1, 0, 0, 1\0"
-            VALUE "InternalName", "XPCIDispatchTest\0"
-            VALUE "LegalCopyright", "Copyright 2002\0"
-            VALUE "OriginalFilename", "XPCIDispatchTest.DLL\0"
-            VALUE "ProductName", "XPCIDispatchTest Module\0"
-            VALUE "ProductVersion", "1, 0, 0, 1\0"
-            VALUE "OLESelfRegister", "\0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1200
-    END
-END
-
-#endif    // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// REGISTRY
-//
-
-IDR_nsXPCDispTestMethods REGISTRY DISCARDABLE    "nsXPCDispTestMethods.rgs"
-IDR_nsXPCDispSimple     REGISTRY DISCARDABLE    "nsXPCDispSimple.rgs"
-IDR_nsXPCDispTestNoIDispatch REGISTRY DISCARDABLE    "nsXPCDispTestNoIDispatch.rgs"
-IDR_nsXPCDispTestProperties REGISTRY DISCARDABLE    "nsXPCDispTestProperties.rgs"
-IDR_nsXPCDispTestArrays REGISTRY DISCARDABLE    "nsXPCDispTestArrays.rgs"
-IDR_nsXPCDispTestScriptOn REGISTRY DISCARDABLE    "nsXPCDispTestScriptOn.rgs"
-IDR_nsXPCDispTestScriptOff REGISTRY DISCARDABLE    "nsXPCDispTestScriptOff.rgs"
-IDR_nsXPCDispTestWrappedJS REGISTRY DISCARDABLE    "nsXPCDispTestWrappedJS.rgs"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_PROJNAME            "XPCIDispatchTest"
-    IDS_NSXPCDISPTTESTMETHODS_DESC "nsXPCDisptTestMethods Class"
-    IDS_NSXPCDISPTESTMETHODS_DESC "nsXPCDispTestMethods Class"
-    IDS_NSXPCDISPSIMPLE_DESC "nsXPCDispSimple Class"
-    IDS_NSXPCDISPTESTNOIDISPATCH_DESC "nsXPCDispTestNoIDispatch Class"
-    IDS_NSXPCDISPTESTNOSCRIPT_DESC "nsXPCDispTestNoScript Class"
-    IDS_NSXPCDISPTESTPROPERTIES_DESC "nsXPCDispTestProperties Class"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_NSXPCDISPTESTARRAYS_DESC "nsXPCDispTestArrays Class"
-    IDS_NSXPCDISPTESTSCRIPTON_DESC "nsXPCDispTestScriptOn Class"
-    IDS_NSXPCDISPTESTSCRIPTOFF_DESC "nsXPCDispTestScriptOff Class"
-    IDS_NSXPCDISPTESTWRAPPEDJS_DESC "nsXPCDispTestWrappedJS Class"
-END
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-1 TYPELIB "XPCIDispatchTest.tlb"
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispSimple.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-// nsXPCDispSimple.cpp : Implementation of CXPCIDispatchTestApp and DLL registration.
-
-#include "stdafx.h"
-#include "XPCIDispatchTest.h"
-#include "nsXPCDispSimple.h"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-
-STDMETHODIMP nsXPCDispSimple::InterfaceSupportsErrorInfo(REFIID riid)
-{
-    static const IID* arr[] = 
-    {
-        &IID_nsIXPCDispSimple,
-    };
-
-    for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
-    {
-        if (InlineIsEqualGUID(*arr[i],riid))
-            return S_OK;
-    }
-    return S_FALSE;
-}
-
-STDMETHODIMP nsXPCDispSimple::ClassName(BSTR * name)
-{
-    if (name == NULL)
-        return E_POINTER;
-    CComBSTR x("nsXPCDispSimple");
-    *name = x.Detach();
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispSimple::get_Number(LONG * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = mNumber;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispSimple::put_Number(LONG result)
-{
-    mNumber = result;
-    return S_OK;
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispSimple.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// nsXPCDispSimple.h: Definition of the nsXPCDispSimple class
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_NSXPCDISPSIMPLE_H__5502A675_46D9_4762_A7F9_1A023A052152__INCLUDED_)
-#define AFX_NSXPCDISPSIMPLE_H__5502A675_46D9_4762_A7F9_1A023A052152__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "resource.h"       // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// nsXPCDispSimple
-
-class nsXPCDispSimple : 
-    public ISupportErrorInfo,
-    public CComObjectRoot,
-    public CComCoClass<nsXPCDispSimple,&CLSID_nsXPCDispSimple>,
-    public IDispatchImpl<nsIXPCDispSimple, &IID_nsIXPCDispSimple, &LIBID_IDispatchTestLib>
-{
-public:
-    nsXPCDispSimple() : mNumber(5) {}
-BEGIN_CATEGORY_MAP(nsXPCDispSimple)
-    IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
-END_CATEGORY_MAP()
-BEGIN_COM_MAP(nsXPCDispSimple)
-    COM_INTERFACE_ENTRY(IDispatch)
-    COM_INTERFACE_ENTRY(ISupportErrorInfo)
-    COM_INTERFACE_ENTRY(nsIXPCDispSimple)
-END_COM_MAP()
-DECLARE_NOT_AGGREGATABLE(nsXPCDispSimple) 
-
-DECLARE_REGISTRY_RESOURCEID(IDR_nsXPCDispSimple)
-// ISupportsErrorInfo
-    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
-
-// nsIXPCDispSimple
-public:
-// nsIXPCDispSimple
-    STDMETHOD(ClassName)(BSTR * name);
-    STDMETHOD(get_Number)(LONG * result);
-    STDMETHOD(put_Number)(LONG result);
-    template <class T>
-    static HRESULT CreateInstance(T ** result)
-    {
-        return CoCreateInstance(CLSID_nsXPCDispSimple, 0, CLSCTX_ALL,
-                                __uuidof(T),
-                                reinterpret_cast<void**>(result));
-    }
-private:
-    long mNumber;
-};
-
-#endif // !defined(AFX_NSXPCDISPSIMPLE_H__5502A675_46D9_4762_A7F9_1A023A052152__INCLUDED_)
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispSimple.rgs
+++ /dev/null
@@ -1,23 +0,0 @@
-HKCR
-{
-	XPCIDispatchTest.nsXPCDispSimple.1 = s 'nsXPCDispSimple Class'
-	{
-		CLSID = s '{9F39237C-D179-4260-8EF3-4B6D4D7D5570}'
-	}
-	XPCIDispatchTest.nsXPCDispSimple = s 'nsXPCDispSimple Class'
-	{
-		CLSID = s '{9F39237C-D179-4260-8EF3-4B6D4D7D5570}'
-	}
-	NoRemove CLSID
-	{
-		ForceRemove {9F39237C-D179-4260-8EF3-4B6D4D7D5570} = s 'nsXPCDispSimple Class'
-		{
-			ProgID = s 'XPCIDispatchTest.nsXPCDispSimple.1'
-			VersionIndependentProgID = s 'XPCIDispatchTest.nsXPCDispSimple'
-			InprocServer32 = s '%MODULE%'
-			{
-				val ThreadingModel = s 'both'
-			}
-		}
-	}
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestArrays.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-// nsXPCDispTestArrays.cpp : Implementation of CXPCIDispatchTestApp and DLL registration.
-
-#include "stdafx.h"
-#include "XPCIDispatchTest.h"
-#include "nsXPCDispTestArrays.h"
-
-unsigned int zero = 0;
-
-/////////////////////////////////////////////////////////////////////////////
-//
-
-STDMETHODIMP nsXPCDispTestArrays::InterfaceSupportsErrorInfo(REFIID riid)
-{
-    static const IID* arr[] = 
-    {
-        &IID_nsIXPCDispTestArrays,
-    };
-
-    for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
-    {
-        if (InlineIsEqualGUID(*arr[i],riid))
-            return S_OK;
-    }
-    return S_FALSE;
-}
-
-STDMETHODIMP nsXPCDispTestArrays::ReturnSafeArray(LPSAFEARRAY * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-
-	*result = SafeArrayCreateVector(VT_I4, 0, 3);
-    for (long index = 0; index < 3; ++index)
-    {
-        SafeArrayPutElement(*result, &index, &index);
-    }
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestArrays::ReturnSafeArrayBSTR(LPSAFEARRAY * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-
-	*result = SafeArrayCreateVector(VT_BSTR, 0, 3);
-    for (long index = 0; index < 3; ++index)
-    {
-        _variant_t var(index);
-        HRESULT hr = VariantChangeType(&var, &var, VARIANT_ALPHABOOL, VT_BSTR);
-
-        if (FAILED(hr))
-            return hr;
-        SafeArrayPutElement(*result, &index, var.bstrVal);
-    }
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestArrays::ReturnSafeArrayIDispatch(LPSAFEARRAY * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-
-	*result = SafeArrayCreateVector(VT_DISPATCH, 0, 3);
-    for (long index = 0; index < 3; ++index)
-    {
-        CComPtr<nsIXPCDispSimple> ptr;
-        ptr.CoCreateInstance(CLSID_nsXPCDispSimple);
-        SafeArrayPutElement(*result, &index, ptr.p);
-    }
-    return S_OK;
-}
-
-#define RETURN_IF_FAIL(x) hr = x; if (FAILED(hr)) return hr;
-
-STDMETHODIMP nsXPCDispTestArrays::TakesSafeArray(LPSAFEARRAY array)
-{
-    long lbound;
-    long ubound;
-    HRESULT hr;
-
-    RETURN_IF_FAIL(SafeArrayGetLBound(array, 1, &lbound));
-    if (lbound != 0)
-        return E_FAIL;
-    RETURN_IF_FAIL(SafeArrayGetUBound(array, 1, &ubound));
-    if (ubound != 3)
-        return E_FAIL;
-    for (long index = lbound; index <= ubound; ++index)
-    {
-        _variant_t value;
-        RETURN_IF_FAIL(SafeArrayGetElement(array, &index, &value));
-        if (value != _variant_t(index))
-            return E_FAIL;
-    }
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestArrays::TakesSafeArrayBSTR(LPSAFEARRAY array)
-{
-    long lbound;
-    long ubound;
-    HRESULT hr;
-
-    RETURN_IF_FAIL(SafeArrayGetLBound(array, 1, &lbound));
-    if (lbound != 0)
-        return E_FAIL;
-    RETURN_IF_FAIL(SafeArrayGetUBound(array, 1, &ubound));
-    if (ubound != 3)
-        return E_FAIL;
-    for (long index = lbound; index <= ubound; ++index)
-    {
-        _variant_t value;
-        RETURN_IF_FAIL(SafeArrayGetElement(array, &index, &value));
-        _variant_t test(index);
-        if (_bstr_t(value) != _bstr_t(test))
-            return E_FAIL;
-    }
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestArrays::TakesSafeArrayIDispatch(LPSAFEARRAY array)
-{
-    long lbound;
-    long ubound;
-    HRESULT hr;
-
-    RETURN_IF_FAIL(SafeArrayGetLBound(array, 0, &lbound));
-    if (lbound != 0)
-        return E_FAIL;
-    RETURN_IF_FAIL(SafeArrayGetUBound(array, 0, &ubound));
-    if (ubound != 3)
-        return E_FAIL;
-    for (long index = lbound; index <= ubound; ++index)
-    {
-        _variant_t value;
-        RETURN_IF_FAIL(SafeArrayGetElement(array, &index, &value));
-        // We need to do more here, but this is good enough for now
-        if (!value.pdispVal)
-            return E_FAIL;
-    }
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestArrays::InOutSafeArray(LPSAFEARRAY * array)
-{
-    if (array == NULL)
-        return E_POINTER;
-    long lbound;
-    long ubound;
-    HRESULT hr;
-
-    RETURN_IF_FAIL(SafeArrayGetLBound(*array, 0, &lbound));
-    if (lbound != 0)
-        return E_FAIL;
-    RETURN_IF_FAIL(SafeArrayGetUBound(*array, 0, &ubound));
-    if (ubound != 3)
-        return E_FAIL;
-	LPSAFEARRAY newArray = SafeArrayCreateVector(VT_I4, lbound, ubound);
-    for (long index = lbound; index <= ubound; ++index)
-    {
-        long value;
-        RETURN_IF_FAIL(SafeArrayGetElement(*array, &index, &value));
-        if (value != index)
-            return E_FAIL;
-        value += 42;
-        RETURN_IF_FAIL(SafeArrayPutElement(newArray, &index, &value));
-    }
-    SafeArrayDestroy(*array);
-    *array = newArray;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestArrays::InOutSafeArrayBSTR(LPSAFEARRAY * array)
-{
-    if (array == NULL)
-        return E_POINTER;
-        
-    long lbound;
-    long ubound;
-    HRESULT hr;
-
-    RETURN_IF_FAIL(SafeArrayGetLBound(*array, 0, &lbound));
-    if (lbound != 0)
-        return E_FAIL;
-    RETURN_IF_FAIL(SafeArrayGetUBound(*array, 0, &ubound));
-    if (ubound != 3)
-        return E_FAIL;
-	LPSAFEARRAY newArray = SafeArrayCreateVector(VT_BSTR, lbound, ubound);
-    for (long index = lbound; index <= ubound; ++index)
-    {
-        BSTR value;
-        RETURN_IF_FAIL(SafeArrayGetElement(*array, &index, &value));
-        _bstr_t newValue(value, TRUE);
-        newValue += L"Appended";
-        RETURN_IF_FAIL(SafeArrayPutElement(newArray, &index, newValue.copy()));
-    }
-    SafeArrayDestroy(*array);
-    *array = newArray;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestArrays::InOutSafeArrayIDispatch(LPSAFEARRAY * array)
-{
-    if (array == NULL)
-        return E_POINTER;
-        
-    long lbound;
-    long ubound;
-    HRESULT hr;
-
-    RETURN_IF_FAIL(SafeArrayGetLBound(*array, 0, &lbound));
-    if (lbound != 0)
-        return E_FAIL;
-    RETURN_IF_FAIL(SafeArrayGetUBound(*array, 0, &ubound));
-    if (ubound != 3)
-        return E_FAIL;
-	LPSAFEARRAY newArray = SafeArrayCreateVector(VT_DISPATCH, lbound, ubound);
-    for (long index = lbound; index <= ubound; ++index)
-    {
-        IDispatch* value;
-        RETURN_IF_FAIL(SafeArrayGetElement(*array, &index, &value));
-        RETURN_IF_FAIL(SafeArrayPutElement(newArray, &index, &value));
-    }
-    SafeArrayDestroy(*array);
-    *array = newArray;
-    return S_OK;
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestArrays.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// nsXPCDispTestArrays.h: Definition of the nsXPCDispTestArrays class
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_NSXPCDISPTESTARRAYS_H__5F59BD4C_16A4_4BD6_8281_796DE6A2889C__INCLUDED_)
-#define AFX_NSXPCDISPTESTARRAYS_H__5F59BD4C_16A4_4BD6_8281_796DE6A2889C__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "resource.h"       // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// nsXPCDispTestArrays
-
-class nsXPCDispTestArrays : 
-    public IDispatchImpl<nsIXPCDispTestArrays, &IID_nsIXPCDispTestArrays, &LIBID_IDispatchTestLib>,
-    public ISupportErrorInfo,
-    public CComObjectRoot,
-    public CComCoClass<nsXPCDispTestArrays,&CLSID_nsXPCDispTestArrays>
-{
-public:
-    nsXPCDispTestArrays() {}
-BEGIN_CATEGORY_MAP(nsXPCDispTestArrays)
-    IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
-END_CATEGORY_MAP()
-BEGIN_COM_MAP(nsXPCDispTestArrays)
-    COM_INTERFACE_ENTRY(IDispatch)
-    COM_INTERFACE_ENTRY(ISupportErrorInfo)
-    COM_INTERFACE_ENTRY(nsIXPCDispTestArrays)
-END_COM_MAP()
-DECLARE_NOT_AGGREGATABLE(nsXPCDispTestArrays) 
-
-DECLARE_REGISTRY_RESOURCEID(IDR_nsXPCDispTestArrays)
-// ISupportsErrorInfo
-    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
-
-// nsIXPCDispTestArrays
-public:
-// nsIXPCDispTestArrays
-    STDMETHOD(ReturnSafeArray)(LPSAFEARRAY * result);
-    STDMETHOD(ReturnSafeArrayBSTR)(LPSAFEARRAY * result);
-    STDMETHOD(ReturnSafeArrayIDispatch)(LPSAFEARRAY * result);
-    STDMETHOD(TakesSafeArray)(LPSAFEARRAY array);
-    STDMETHOD(TakesSafeArrayBSTR)(LPSAFEARRAY array);
-    STDMETHOD(TakesSafeArrayIDispatch)(LPSAFEARRAY array);
-    STDMETHOD(InOutSafeArray)(LPSAFEARRAY * array);
-    STDMETHOD(InOutSafeArrayBSTR)(LPSAFEARRAY * array);
-    STDMETHOD(InOutSafeArrayIDispatch)(LPSAFEARRAY * array);
-};
-
-#endif // !defined(AFX_NSXPCDISPTESTARRAYS_H__5F59BD4C_16A4_4BD6_8281_796DE6A2889C__INCLUDED_)
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestArrays.rgs
+++ /dev/null
@@ -1,23 +0,0 @@
-HKCR
-{
-	XPCIDispatchTest.nsXPCDispTestArrays.1 = s 'nsXPCDispTestArrays Class'
-	{
-		CLSID = s '{AB085C43-C619-48C8-B68C-C495BDE12DFB}'
-	}
-	XPCIDispatchTest.nsXPCDispTestArrays = s 'nsXPCDispTestArrays Class'
-	{
-		CLSID = s '{AB085C43-C619-48C8-B68C-C495BDE12DFB}'
-	}
-	NoRemove CLSID
-	{
-		ForceRemove {AB085C43-C619-48C8-B68C-C495BDE12DFB} = s 'nsXPCDispTestArrays Class'
-		{
-			ProgID = s 'XPCIDispatchTest.nsXPCDispTestArrays.1'
-			VersionIndependentProgID = s 'XPCIDispatchTest.nsXPCDispTestArrays'
-			InprocServer32 = s '%MODULE%'
-			{
-				val ThreadingModel = s 'both'
-			}
-		}
-	}
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestMethods.cpp
+++ /dev/null
@@ -1,699 +0,0 @@
-// nsXPCDispTestMethods.cpp : Implementation of CIDispatchTestApp and DLL registration.
-
-#include "stdafx.h"
-#include "XPCIDispatchTest.h"
-#include "nsXPCDispTestMethods.h"
-#include "XPCDispUtilities.h"
-#include "nsXPCDispSimple.h"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-
-STDMETHODIMP nsXPCDispTestMethods::InterfaceSupportsErrorInfo(REFIID riid)
-{
-    static const IID* arr[] = 
-    {
-        &IID_nsIXPCDispTestMethods,
-    };
-
-    for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
-    {
-        if (InlineIsEqualGUID(*arr[i],riid))
-            return S_OK;
-    }
-    return S_FALSE;
-}
-
-STDMETHODIMP nsXPCDispTestMethods::NoParameters()
-{
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnBSTR(BSTR * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-        
-    CComBSTR x("Boo");
-    *result = x.Detach();
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnI4(INT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 99999;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnUI1(BYTE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 99;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnI2(SHORT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 9999;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnR4(FLOAT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 99999.1f;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnR8(DOUBLE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 99999999999.99;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnBool(VARIANT_BOOL * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = VARIANT_TRUE;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnIDispatch(IDispatch * * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    return nsXPCDispSimple::CreateInstance(result);
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnError(SCODE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = E_FAIL;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnDate(DATE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    CComBSTR dateStr(L"5/2/02");
-    return VarDateFromStr(dateStr, LOCALE_SYSTEM_DEFAULT,
-                          LOCALE_NOUSEROVERRIDE, result);
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnIUnknown(IUnknown * * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-        
-    return XPCCreateInstance<IUnknown>(CLSID_nsXPCDispTestNoIDispatch, IID_IUnknown, result);
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnI1(unsigned char * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-        
-    *result = 120;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnUI2(USHORT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 9999;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnUI4(ULONG * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 3000000000;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnInt(INT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = -999999;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::ReturnUInt(UINT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-        
-    *result = 3000000000;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesBSTR(BSTR result)
-{
-    CComBSTR str(result);
-    static CComBSTR test(L"TakesBSTR");
-    return str == test ? S_OK: E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesI4(INT result)
-{
-    return result == 999999 ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesUI1(BYTE result)
-{
-    return result == 42 ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesI2(SHORT result)
-{
-    return result == 32000 ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesR4(FLOAT result)
-{
-    // Hopefully we won't run into any precision/rounding issues
-    return result == 99999.99f ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesR8(DOUBLE result)
-{
-    // Hopefully we won't run into any precision/rounding issues
-    return result == 999999999.99 ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesBool(VARIANT_BOOL result)
-{
-    return result ? S_OK : E_FAIL;
-}
-
-inline
-HRESULT GetProperty(IDispatch *pDisp, const CComBSTR & name, CComVariant& output)
-{
-    DISPID dispid = GetIDsOfNames(pDisp, name);
-    DISPPARAMS dispParams;
-    dispParams.cArgs = 0;
-    dispParams.cNamedArgs = 0;
-    dispParams.rgdispidNamedArgs = 0;
-    dispParams.rgvarg = 0;
-    return pDisp->Invoke(dispid, IID_NULL, LOCALE_SYSTEM_DEFAULT,DISPATCH_PROPERTYGET, &dispParams, &output, 0, 0);
-}
-    
-inline
-HRESULT PutProperty(IDispatch *pDisp, const CComBSTR & name, const CComVariant& input)
-{
-    DISPPARAMS dispParams;
-    DISPID did = DISPID_PROPERTYPUT;
-    dispParams.cArgs = 1;
-    CComVariant var(input);
-    dispParams.rgvarg = &var;
-    dispParams.cNamedArgs = 1;
-    dispParams.rgdispidNamedArgs = &did;
-    CComVariant result;
-    DISPID dispID = GetIDsOfNames(pDisp, name);
-    return pDisp->Invoke(dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT,
-                               DISPATCH_PROPERTYPUT, &dispParams, &result,
-                               0, 0);
-}
-
-HRESULT VerifynsXPCDispSimple(IDispatch * result)
-{
-    CComVariant property;
-    HRESULT hResult = GetProperty(result, L"Number", property);
-    CComVariant test((long)5);
-    if (FAILED(hResult))
-        return hResult;
-    if (property != test)
-        return E_FAIL;
-    return PutProperty(result, L"Number", 76);
-}
-
-STDMETHODIMP nsXPCDispTestMethods::TakesIDispatch(IDispatch * result)
-{
-    return VerifynsXPCDispSimple(result);
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesError(SCODE result)
-{
-    return result == E_FAIL ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesDate(DATE result)
-{
-    CComBSTR dateStr(L"5/2/02");
-    DATE myDate;
-    HRESULT hResult = VarDateFromStr(dateStr, LOCALE_SYSTEM_DEFAULT,
-                                    LOCALE_NOUSEROVERRIDE, &myDate);
-    if (SUCCEEDED(hResult))
-        return myDate == result ? S_OK : E_FAIL;
-    else
-        return hResult;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesIUnknown(IUnknown * result)
-{
-    CComPtr<IUnknown> ptr(result);
-    ULONG before = result->AddRef();
-    ULONG after = result->Release();
-    CComQIPtr<nsIXPCDispTestNoIDispatch> noIDispatch(ptr);
-    return before - 1 == after ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesI1(unsigned char result)
-{
-    return result == 42 ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesUI2(USHORT result)
-{
-    return result == 50000 ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesUI4(ULONG result)
-{
-    return result == 0xF0000000 ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesInt(INT result)
-{
-    return result == -10000000 ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TakesUInt(UINT result)
-{
-    return result == 0xE0000000 ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsBSTR(BSTR * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-        
-    CComBSTR x("Boo");
-    *result = x.Detach();
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsI4(LONG * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 99999;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsUI1(BYTE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 99;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsI2(SHORT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 9999;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsR4(FLOAT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 999999.1f;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsR8(DOUBLE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 99999999999.99;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsBool(VARIANT_BOOL * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = VARIANT_TRUE;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsIDispatch(IDispatch * * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    return nsXPCDispSimple::CreateInstance(result);
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsError(SCODE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = E_FAIL;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsDate(DATE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    CComBSTR dateStr(L"5/2/02");
-    return VarDateFromStr(dateStr, LOCALE_SYSTEM_DEFAULT,
-                          LOCALE_NOUSEROVERRIDE, result);
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsIUnknown(IUnknown * * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-        
-    return XPCCreateInstance<IUnknown>(CLSID_nsXPCDispTestNoIDispatch, IID_IUnknown, result);
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsI1(unsigned char * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-        
-    *result = L'x';
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsUI2(USHORT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 9999;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OutputsUI4(ULONG * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = 3000000000;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsBSTR(BSTR * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    CComBSTR str(*result);
-    str += L"Appended";
-    SysFreeString(*result);
-    *result = str.Detach();
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsI4(LONG * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result -= 4000000;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsUI1(BYTE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result -= 42;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsI2(SHORT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result += 10000;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsR4(FLOAT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result += 5.05f;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsR8(DOUBLE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result += 50000000.00000005;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsBool(VARIANT_BOOL * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = !*result;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsIDispatch(IDispatch * * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    CComPtr<nsIXPCDispSimple> ptr;
-    ptr.CoCreateInstance(CLSID_nsXPCDispSimple);
-    CComPtr<IDispatch> incoming(*result);
-    CComVariant value;
-    HRESULT hResult = GetProperty(incoming, L"Number", value);
-    if (FAILED(hResult))
-        return hResult;
-    if (value.lVal != 10)
-        return E_FAIL;
-    hResult = ptr->put_Number(value.lVal + 5);
-    if (FAILED(hResult))
-        return hResult;
-
-    *result = ptr.Detach();
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsError(SCODE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result += 1;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsDate(DATE * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    ULONG days;
-    HRESULT hResult = VarUI4FromDate(*result, &days);
-    if (FAILED(hResult))
-        return hResult;
-
-    return VarDateFromUI4(days + 1, result);
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsIUnknown(IUnknown * * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-        
-    CComPtr<IUnknown> ptr(*result);
-    ULONG before = (*result)->AddRef();
-    ULONG after = (*result)->Release();
-    if (before - 1 != after)
-        return E_FAIL;
-    return nsXPCDispSimple::CreateInstance(result);
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsI1(unsigned char * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    ++*result;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsUI2(USHORT * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result += 42;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::InOutsUI4(ULONG * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result -= 42;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::OneParameterWithReturn(LONG input, 
-                                                          LONG * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    *result = input + 42;
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::StringInputAndReturn(BSTR str, 
-                                                        BSTR * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    CComBSTR input(str);
-    input += L"Appended";
-    *result = input.Detach();
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::IDispatchInputAndReturn(IDispatch * input, IDispatch * * result)
-{
-    if (result == NULL)
-        return E_POINTER;
-    HRESULT hResult = VerifynsXPCDispSimple(input);
-
-    hResult = XPCCreateInstance<IDispatch>(CLSID_nsXPCDispSimple, IID_IDispatch, result);
-    if (FAILED(hResult))
-        return hResult;
-    CComVariant variant;
-    hResult = GetProperty(input, L"Number", variant);
-    if (FAILED(hResult))
-        return hResult;
-    return PutProperty(*result, L"Number", variant.lVal + 5);
-}
-STDMETHODIMP nsXPCDispTestMethods::TwoParameters(LONG one, LONG two)
-{
-    return one + 1 == two ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TwelveInParameters(LONG one, LONG two,
-                                                      LONG three, LONG four,
-                                                      LONG five, LONG six,
-                                                      LONG seven, LONG eight,
-                                                      LONG nine, LONG ten,
-                                                      LONG eleven, LONG twelve)
-{
-    return one + two + three + four + five + six + seven + eight + nine + 
-        ten + eleven + twelve == 78 ? S_OK : E_FAIL;
-}
-STDMETHODIMP nsXPCDispTestMethods::TwelveOutParameters(LONG * one, LONG * two,
-                                                       LONG * three,
-                                                       LONG * four,
-                                                       LONG * five, LONG * six,
-                                                       LONG * seven,
-                                                       LONG * eight,
-                                                       LONG * nine, LONG * ten,
-                                                       LONG * eleven,
-                                                       LONG * twelve)
-{
-    if (one == 0 || two == 0 || three == 0 || four == 0 || 
-        five == 0 || six == 0 || seven == 0 || eight == 0 ||
-        nine == 0 || ten == 0 || eleven == 0 || twelve == 0)
-        return E_POINTER;
-    
-    *one = 1;
-    *two = 2;
-    *three = 3;
-    *four = 4;
-    *five = 5;
-    *six = 6;
-    *seven = 7;
-    *eight = 8;
-    *nine = 9;
-    *ten = 10;
-    *eleven = 11;
-    *twelve = 12;
-    return S_OK;
-}
-
-inline
-boolean Equals(BSTR left, const char * str)
-{
-    return CComBSTR(left) == str;
-}
-#define TESTPARAM(val) Equals(val, #val)
-
-STDMETHODIMP nsXPCDispTestMethods::TwelveStrings(BSTR one, BSTR two, BSTR three, BSTR four, BSTR five, BSTR six, BSTR seven, BSTR eight, BSTR nine, BSTR ten, BSTR eleven, BSTR twelve)
-{
-    return TESTPARAM(one) && TESTPARAM(two) && TESTPARAM(three) && 
-        TESTPARAM(four) && TESTPARAM(five) && TESTPARAM(six) && 
-        TESTPARAM(seven) && TESTPARAM(eight) && TESTPARAM(nine) && 
-        TESTPARAM(ten) && TESTPARAM(eleven) && TESTPARAM(twelve) ? 
-            S_OK : E_FAIL;
-}
-
-#define ASSIGNPARAM(val) \
-    if (val == 0) \
-        return E_POINTER; \
-    *val = CComBSTR(#val).Detach()
-STDMETHODIMP nsXPCDispTestMethods::TwelveOutStrings(BSTR * one, BSTR * two, BSTR * three, BSTR * four, BSTR * five, BSTR * six, BSTR * seven, BSTR * eight, BSTR * nine, BSTR * ten, BSTR * eleven, BSTR * twelve)
-{
-    ASSIGNPARAM(one);
-    ASSIGNPARAM(two);
-    ASSIGNPARAM(three);
-    ASSIGNPARAM(four);
-    ASSIGNPARAM(five);
-    ASSIGNPARAM(six);
-    ASSIGNPARAM(seven);
-    ASSIGNPARAM(eight);
-    ASSIGNPARAM(nine);
-    ASSIGNPARAM(ten);
-    ASSIGNPARAM(eleven);
-    ASSIGNPARAM(twelve);
-    return S_OK;
-}
-#define VERIFYSIMPLE(param) \
-    hResult = VerifynsXPCDispSimple(param); \
-    if (FAILED(hResult)) \
-        return hResult
-STDMETHODIMP nsXPCDispTestMethods::TwelveIDispatch(IDispatch * one,
-                                                   IDispatch * two,
-                                                   IDispatch * three,
-                                                   IDispatch * four,
-                                                   IDispatch * five,
-                                                   IDispatch * six,
-                                                   IDispatch * seven,
-                                                   IDispatch * eight,
-                                                   IDispatch * nine,
-                                                   IDispatch * ten,
-                                                   IDispatch * eleven,
-                                                   IDispatch * twelve)
-{
-    HRESULT hResult;
-    VERIFYSIMPLE(one);
-    VERIFYSIMPLE(two);
-    VERIFYSIMPLE(three);
-    VERIFYSIMPLE(four);
-    VERIFYSIMPLE(five);
-    VERIFYSIMPLE(six);
-    VERIFYSIMPLE(seven);
-    VERIFYSIMPLE(eight);
-    VERIFYSIMPLE(nine);
-    VERIFYSIMPLE(ten);
-    VERIFYSIMPLE(eleven);
-    VERIFYSIMPLE(twelve);
-    return S_OK;
-}
-
-#define ASSIGNSIMPLE(param) \
-    if (param == 0) \
-        return E_POINTER; \
-    hResult = nsXPCDispSimple::CreateInstance(param); \
-    if (FAILED(hResult)) \
-        return hResult;  \
-    
-STDMETHODIMP nsXPCDispTestMethods::TwelveOutIDispatch(IDispatch * * one,
-                                                      IDispatch * * two,
-                                                      IDispatch * * three,
-                                                      IDispatch * * four,
-                                                      IDispatch * * five,
-                                                      IDispatch * * six,
-                                                      IDispatch * * seven,
-                                                      IDispatch * * eight,
-                                                      IDispatch * * nine,
-                                                      IDispatch * * ten,
-                                                      IDispatch * * eleven,
-                                                      IDispatch * * twelve){
-    HRESULT hResult;
-    ASSIGNSIMPLE(one);
-    ASSIGNSIMPLE(two);
-    ASSIGNSIMPLE(three);
-    ASSIGNSIMPLE(four);
-    ASSIGNSIMPLE(five);
-    ASSIGNSIMPLE(six);
-    ASSIGNSIMPLE(seven);
-    ASSIGNSIMPLE(eight);
-    ASSIGNSIMPLE(nine);
-    ASSIGNSIMPLE(ten);
-    ASSIGNSIMPLE(eleven);
-    ASSIGNSIMPLE(twelve);
-    return S_OK;
-}
-STDMETHODIMP nsXPCDispTestMethods::CreateError()
-{
-    CComBSTR someText(L"CreateError Test");
-    ICreateErrorInfo * pCreateError;
-    IErrorInfo * pError;
-    HRESULT result = CreateErrorInfo(&pCreateError);
-    if (FAILED(result))
-        return E_NOTIMPL;
-    result = pCreateError->QueryInterface(&pError);
-    if (FAILED(result))
-        return E_NOTIMPL;
-    result = pCreateError->SetDescription(someText);
-    if (FAILED(result))
-        return E_NOTIMPL;
-    result = pCreateError->SetGUID(IID_nsIXPCDispTestMethods);
-    if (FAILED(result))
-        return E_NOTIMPL;
-    CComBSTR source(L"XPCIDispatchTest.nsXPCDispTestMethods.1");
-    result = pCreateError->SetSource(source);
-    if (FAILED(result))
-        return E_NOTIMPL;
-    result = SetErrorInfo(0, pError);
-    if (FAILED(result))
-        return E_NOTIMPL;
-    pError->Release();
-    pCreateError->Release();
-    return E_FAIL;
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestMethods.h
+++ /dev/null
@@ -1,138 +0,0 @@
-// nsXPCDispTestMethods.h: Definition of the nsXPCDispTestMethods class
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_NSXPCDISPTESTMETHODS_H__A516B1D7_1971_419C_AE35_EDFAC27D1227__INCLUDED_)
-#define AFX_NSXPCDISPTESTMETHODS_H__A516B1D7_1971_419C_AE35_EDFAC27D1227__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "resource.h"       // main symbols
-#include "XPCIDispatchTest.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// nsXPCDispTestMethods
-
-class nsXPCDispTestMethods : 
-    public ISupportErrorInfo,
-    public CComObjectRoot,
-    public CComCoClass<nsXPCDispTestMethods,&CLSID_nsXPCDispTestMethods>,
-    public IDispatchImpl<nsIXPCDispTestMethods, &IID_nsIXPCDispTestMethods, &LIBID_IDispatchTestLib>
-{
-public:
-    nsXPCDispTestMethods() {}
-BEGIN_CATEGORY_MAP(nsXPCDispTestMethods)
-    IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
-END_CATEGORY_MAP()
-BEGIN_COM_MAP(nsXPCDispTestMethods)
-    COM_INTERFACE_ENTRY(IDispatch)
-    COM_INTERFACE_ENTRY(ISupportErrorInfo)
-    COM_INTERFACE_ENTRY(nsIXPCDispTestMethods)
-END_COM_MAP()
-DECLARE_NOT_AGGREGATABLE(nsXPCDispTestMethods) 
-
-DECLARE_REGISTRY_RESOURCEID(IDR_nsXPCDispTestMethods)
-// ISupportsErrorInfo
-    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
-
-// nsIXPCDispTestMethods
-public:
-// nsIXPCDispTestMethod
-    STDMETHOD(NoParameters)();
-    STDMETHOD(ReturnBSTR)(BSTR * result);
-    STDMETHOD(ReturnI4)(INT * result);
-    STDMETHOD(ReturnUI1)(BYTE * result);
-    STDMETHOD(ReturnI2)(SHORT * result);
-    STDMETHOD(ReturnR4)(FLOAT * result);
-    STDMETHOD(ReturnR8)(DOUBLE * result);
-    STDMETHOD(ReturnBool)(VARIANT_BOOL * result);
-    STDMETHOD(ReturnIDispatch)(IDispatch * * result);
-    STDMETHOD(ReturnError)(SCODE * result);
-    STDMETHOD(ReturnDate)(DATE * result);
-    STDMETHOD(ReturnIUnknown)(IUnknown * * result);
-    STDMETHOD(ReturnI1)(unsigned char * result);
-    STDMETHOD(ReturnUI2)(USHORT * result);
-    STDMETHOD(ReturnUI4)(ULONG * result);
-    STDMETHOD(ReturnInt)(INT * result);
-    STDMETHOD(ReturnUInt)(UINT * result);
-    STDMETHOD(TakesBSTR)(BSTR result);
-    STDMETHOD(TakesI4)(INT result);
-    STDMETHOD(TakesUI1)(BYTE result);
-    STDMETHOD(TakesI2)(SHORT result);
-    STDMETHOD(TakesR4)(FLOAT result);
-    STDMETHOD(TakesR8)(DOUBLE result);
-    STDMETHOD(TakesBool)(VARIANT_BOOL result);
-    STDMETHOD(TakesIDispatch)(IDispatch * result);
-    STDMETHOD(TakesError)(SCODE result);
-    STDMETHOD(TakesDate)(DATE result);
-    STDMETHOD(TakesIUnknown)(IUnknown * result);
-    STDMETHOD(TakesI1)(unsigned char result);
-    STDMETHOD(TakesUI2)(USHORT result);
-    STDMETHOD(TakesUI4)(ULONG result);
-    STDMETHOD(TakesInt)(INT result);
-    STDMETHOD(TakesUInt)(UINT result);
-    STDMETHOD(OutputsBSTR)(BSTR * result);
-    STDMETHOD(OutputsI4)(LONG * result);
-    STDMETHOD(OutputsUI1)(BYTE * result);
-    STDMETHOD(OutputsI2)(SHORT * result);
-    STDMETHOD(OutputsR4)(FLOAT * result);
-    STDMETHOD(OutputsR8)(DOUBLE * result);
-    STDMETHOD(OutputsBool)(VARIANT_BOOL * result);
-    STDMETHOD(OutputsIDispatch)(IDispatch * * result);
-    STDMETHOD(OutputsError)(SCODE * result);
-    STDMETHOD(OutputsDate)(DATE * result);
-    STDMETHOD(OutputsIUnknown)(IUnknown * * result);
-    STDMETHOD(OutputsI1)(unsigned char * result);
-    STDMETHOD(OutputsUI2)(USHORT * result);
-    STDMETHOD(OutputsUI4)(ULONG * result);
-    STDMETHOD(InOutsBSTR)(BSTR * result);
-    STDMETHOD(InOutsI4)(LONG * result);
-    STDMETHOD(InOutsUI1)(BYTE * result);
-    STDMETHOD(InOutsI2)(SHORT * result);
-    STDMETHOD(InOutsR4)(FLOAT * result);
-    STDMETHOD(InOutsR8)(DOUBLE * result);
-    STDMETHOD(InOutsBool)(VARIANT_BOOL * result);
-    STDMETHOD(InOutsIDispatch)(IDispatch * * result);
-    STDMETHOD(InOutsError)(SCODE * result);
-    STDMETHOD(InOutsDate)(DATE * result);
-    STDMETHOD(InOutsIUnknown)(IUnknown * * result);
-    STDMETHOD(InOutsI1)(unsigned char * result);
-    STDMETHOD(InOutsUI2)(USHORT * result);
-    STDMETHOD(InOutsUI4)(ULONG * result);
-    STDMETHOD(OneParameterWithReturn)(LONG input, LONG * result);
-    STDMETHOD(StringInputAndReturn)(BSTR str, BSTR * result);
-    STDMETHOD(IDispatchInputAndReturn)(IDispatch * input, IDispatch** result);
-    STDMETHOD(TwoParameters)(LONG one, LONG two);
-    STDMETHOD(TwelveInParameters)(LONG one, LONG two, LONG three, LONG four,
-                                  LONG five, LONG six, LONG seven, LONG eight,
-                                  LONG nine, LONG ten, LONG eleven,
-                                  LONG twelve);
-    STDMETHOD(TwelveOutParameters)(LONG * one, LONG * two, LONG * three, 
-                                   LONG * four, LONG * five, LONG * six,
-                                   LONG * seven, LONG * eight, LONG * nine,
-                                   LONG * ten, LONG * eleven, LONG * twelve);
-    STDMETHOD(TwelveStrings)(BSTR one, BSTR two, BSTR three, BSTR four,
-                             BSTR five, BSTR six, BSTR seven, BSTR eight,
-                             BSTR nine, BSTR ten, BSTR eleven, BSTR twelve);
-    STDMETHOD(TwelveOutStrings)(BSTR * one, BSTR * two, BSTR * three,
-                                BSTR * four, BSTR * five, BSTR * six,
-                                BSTR * seven, BSTR * eight, BSTR * nine,
-                                BSTR * ten, BSTR * eleven, BSTR * twelve);
-    STDMETHOD(TwelveIDispatch)(IDispatch * one, IDispatch * two,
-                               IDispatch * three, IDispatch * four,
-                               IDispatch * five, IDispatch * six,
-                               IDispatch * seven, IDispatch * eight,
-                               IDispatch * nine, IDispatch * ten,
-                               IDispatch * eleven, IDispatch * twelve);
-    STDMETHOD(TwelveOutIDispatch)(IDispatch * * one, IDispatch * * two,
-                                  IDispatch * * three, IDispatch * * four,
-                                  IDispatch * * five, IDispatch * * six,
-                                  IDispatch * * seven, IDispatch * * eight,
-                                  IDispatch * * nine, IDispatch * * ten,
-                                  IDispatch * * eleven, IDispatch * * twelve);
-    STDMETHOD(CreateError)();
-};
-
-#endif // !defined(AFX_NSXPCDISPTESTMETHODS_H__A516B1D7_1971_419C_AE35_EDFAC27D1227__INCLUDED_)
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestMethods.rgs
+++ /dev/null
@@ -1,23 +0,0 @@
-HKCR
-{
-	XPCIDispatchTest.nsXPCDispTestMethods.1 = s 'nsXPCDispTestMethods Class'
-	{
-		CLSID = s '{745D1149-9F46-418C-B176-71EAA98974BA}'
-	}
-	XPCIDispatchTest.nsXPCDispTestMethods = s 'nsXPCDispTestMethods Class'
-	{
-		CLSID = s '{745D1149-9F46-418C-B176-71EAA98974BA}'
-	}
-	NoRemove CLSID
-	{
-		ForceRemove {745D1149-9F46-418C-B176-71EAA98974BA} = s 'nsXPCDispTestMethods Class'
-		{
-			ProgID = s 'XPCIDispatchTest.nsXPCDispTestMethods.1'
-			VersionIndependentProgID = s 'XPCIDispatchTest.nsXPCDispTestMethods'
-			InprocServer32 = s '%MODULE%'
-			{
-				val ThreadingModel = s 'both'
-			}
-		}
-	}
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestNoIDispatch.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// nsXPCDispTestNoIDispatch.cpp : Implementation of CXPCIDispatchTestApp and DLL registration.
-
-#include "stdafx.h"
-#include "XPCIDispatchTest.h"
-#include "nsXPCDispTestNoIDispatch.h"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-
-STDMETHODIMP nsXPCDispTestNoIDispatch::InterfaceSupportsErrorInfo(REFIID riid)
-{
-    static const IID* arr[] = 
-    {
-        &IID_nsIXPCDispTestNoIDispatch,
-    };
-
-    for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
-    {
-        if (InlineIsEqualGUID(*arr[i],riid))
-            return S_OK;
-    }
-    return S_FALSE;
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestNoIDispatch.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// nsXPCDispTestNoIDispatch.h: Definition of the nsXPCDispTestNoIDispatch class
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_NSXPCDISPTESTNOIDISPATCH_H__E4B74F67_BA6B_4654_8674_E60E487129F7__INCLUDED_)
-#define AFX_NSXPCDISPTESTNOIDISPATCH_H__E4B74F67_BA6B_4654_8674_E60E487129F7__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "resource.h"       // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// nsXPCDispTestNoIDispatch
-
-class nsXPCDispTestNoIDispatch :
-    public nsIXPCDispTestNoIDispatch,
-    public ISupportErrorInfo,
-    public CComObjectRoot,
-    public CComCoClass<nsXPCDispTestNoIDispatch,&CLSID_nsXPCDispTestNoIDispatch>
-{
-public:
-    nsXPCDispTestNoIDispatch() {}
-BEGIN_COM_MAP(nsXPCDispTestNoIDispatch)
-    COM_INTERFACE_ENTRY(nsIXPCDispTestNoIDispatch)
-    COM_INTERFACE_ENTRY(ISupportErrorInfo)
-END_COM_MAP()
-//DECLARE_NOT_AGGREGATABLE(nsXPCDispTestNoIDispatch) 
-// Remove the comment from the line above if you don't want your object to 
-// support aggregation. 
-
-DECLARE_REGISTRY_RESOURCEID(IDR_nsXPCDispTestNoIDispatch)
-// ISupportsErrorInfo
-    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
-
-// nsIXPCDispTestNoIDispatch
-public:
-};
-
-#endif // !defined(AFX_NSXPCDISPTESTNOIDISPATCH_H__E4B74F67_BA6B_4654_8674_E60E487129F7__INCLUDED_)
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestNoIDispatch.rgs
+++ /dev/null
@@ -1,23 +0,0 @@
-HKCR
-{
-	XPCIDispatchTest.nsXPCDispTestNoIDispatch.1 = s 'nsXPCDispTestNoIDispatch Class'
-	{
-		CLSID = s '{7414404F-A4CC-4E3C-9B32-BB20CB22F541}'
-	}
-	XPCIDispatchTest.nsXPCDispTestNoIDispatch = s 'nsXPCDispTestNoIDispatch Class'
-	{
-		CLSID = s '{7414404F-A4CC-4E3C-9B32-BB20CB22F541}'
-	}
-	NoRemove CLSID
-	{
-		ForceRemove {7414404F-A4CC-4E3C-9B32-BB20CB22F541} = s 'nsXPCDispTestNoIDispatch Class'
-		{
-			ProgID = s 'XPCIDispatchTest.nsXPCDispTestNoIDispatch.1'
-			VersionIndependentProgID = s 'XPCIDispatchTest.nsXPCDispTestNoIDispatch'
-			InprocServer32 = s '%MODULE%'
-			{
-				val ThreadingModel = s 'both'
-			}
-		}
-	}
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestProperties.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-// nsXPCDispTestProperties.cpp : Implementation of CXPCIDispatchTestApp and DLL registration.
-
-#include "stdafx.h"
-#include "XPCIDispatchTest.h"
-#include "nsXPCDispTestProperties.h"
-
-const long PARAMETERIZED_PROPERTY_COUNT = 5;
-/////////////////////////////////////////////////////////////////////////////
-//
-
-STDMETHODIMP nsXPCDispTestProperties::InterfaceSupportsErrorInfo(REFIID riid)
-{
-    static const IID* arr[] = 
-    {
-        &IID_nsIXPCDispTestProperties,
-    };
-
-    for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
-    {
-        if (InlineIsEqualGUID(*arr[i],riid))
-            return S_OK;
-    }
-    return S_FALSE;
-}
-
-nsXPCDispTestProperties::nsXPCDispTestProperties() :
-    mChar('a'),
-    mBOOL(FALSE),
-    mSCode(0),
-    mDATE(0),
-    mDouble(0.0),
-    mFloat(0.0f),
-    mLong(0),
-    mShort(0),
-    mParameterizedProperty(new long[PARAMETERIZED_PROPERTY_COUNT])
-{
-    mCURRENCY.int64 = 0;
-    CComBSTR string("Initial value");
-    mBSTR = string.Detach();
-    for (long index = 0; index < PARAMETERIZED_PROPERTY_COUNT; ++index)
-        mParameterizedProperty[index] = index + 1;
-}
-
-nsXPCDispTestProperties::~nsXPCDispTestProperties()
-{
-    delete [] mParameterizedProperty;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_Short(short *pVal)
-{
-    *pVal = mShort;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_Short(short newVal)
-{
-    mShort = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_Long(long *pVal)
-{
-    *pVal = mLong;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_Long(long newVal)
-{
-    mLong = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_Float(float *pVal)
-{
-    *pVal = mFloat;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_Float(float newVal)
-{
-    mFloat = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_Double(double *pVal)
-{
-    *pVal = mDouble;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_Double(double newVal)
-{
-    mDouble = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_Currency(CURRENCY *pVal)
-{
-    *pVal = mCURRENCY;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_Currency(CURRENCY newVal)
-{
-    mCURRENCY = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_Date(DATE *pVal)
-{
-    *pVal = mDATE;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_Date(DATE newVal)
-{
-    mDATE = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_String(BSTR *pVal)
-{
-    *pVal = mBSTR.Copy();
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_String(BSTR newVal)
-{
-    mBSTR = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_DispatchPtr(IDispatch **pVal)
-{
-    mIDispatch.CopyTo(pVal);
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_DispatchPtr(IDispatch *newVal)
-{
-    mIDispatch = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_SCode(SCODE *pVal)
-{
-    *pVal = mSCode;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_SCode(SCODE newVal)
-{
-    mSCode = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_Boolean(BOOL *pVal)
-{
-    *pVal = mBOOL;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_Boolean(BOOL newVal)
-{
-    mBOOL = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_Variant(VARIANT *pVal)
-{
-    ::VariantCopy(pVal, &mVariant);
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_Variant(VARIANT newVal)
-{
-    mVariant = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_COMPtr(IUnknown **pVal)
-{
-    mIUnknown.CopyTo(pVal);
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_COMPtr(IUnknown *newVal)
-{
-    mIUnknown = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_Char(unsigned char *pVal)
-{
-    *pVal = mChar;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_Char(unsigned char newVal)
-{
-    mChar = newVal;
-
-    return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_ParameterizedProperty(long aIndex, long *pVal)
-{
-    if (aIndex < 0 || aIndex >= PARAMETERIZED_PROPERTY_COUNT)
-        return E_FAIL;
-
-	*pVal = mParameterizedProperty[aIndex];
-
-	return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::put_ParameterizedProperty(long aIndex, long newVal)
-{
-    if (aIndex < 0 || aIndex >= PARAMETERIZED_PROPERTY_COUNT)
-        return E_FAIL;
-
-	mParameterizedProperty[aIndex] = newVal;
-
-	return S_OK;
-}
-
-STDMETHODIMP nsXPCDispTestProperties::get_ParameterizedPropertyCount(long *pVal)
-{
-	*pVal = PARAMETERIZED_PROPERTY_COUNT;
-
-	return S_OK;
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestProperties.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// nsXPCDispTestProperties.h: Definition of the nsXPCDispTestProperties class
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_NSXPCDISPTESTPROPERTIES_H__9E10C7AC_36AF_4A3A_91C7_2CFB9EB166A5__INCLUDED_)
-#define AFX_NSXPCDISPTESTPROPERTIES_H__9E10C7AC_36AF_4A3A_91C7_2CFB9EB166A5__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "resource.h"       // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// nsXPCDispTestProperties
-
-class nsXPCDispTestProperties : 
-    public IDispatchImpl<nsIXPCDispTestProperties, &IID_nsIXPCDispTestProperties, &LIBID_IDispatchTestLib>, 
-    public ISupportErrorInfo,
-    public CComObjectRoot,
-    public CComCoClass<nsXPCDispTestProperties,&CLSID_nsXPCDispTestProperties>
-{
-public:
-    nsXPCDispTestProperties();
-    virtual ~nsXPCDispTestProperties();
-BEGIN_CATEGORY_MAP(nsXPCDispTestProperties)
-    IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
-END_CATEGORY_MAP()
-BEGIN_COM_MAP(nsXPCDispTestProperties)
-    COM_INTERFACE_ENTRY(IDispatch)
-    COM_INTERFACE_ENTRY(nsIXPCDispTestProperties)
-    COM_INTERFACE_ENTRY(ISupportErrorInfo)
-END_COM_MAP()
-DECLARE_NOT_AGGREGATABLE(nsXPCDispTestProperties) 
-
-DECLARE_REGISTRY_RESOURCEID(IDR_nsXPCDispTestProperties)
-// ISupportsErrorInfo
-    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
-
-// nsIXPCDispTestProperties
-public:
-	STDMETHOD(get_ParameterizedPropertyCount)(/*[out, retval]*/ long *pVal);
-	STDMETHOD(get_ParameterizedProperty)(/*[in]*/long aIndex, /*[out, retval]*/ long *pVal);
-	STDMETHOD(put_ParameterizedProperty)(/*[in]*/long aIndex, /*[in]*/ long newVal);
-    STDMETHOD(get_Char)(/*[out, retval]*/ unsigned char *pVal);
-    STDMETHOD(put_Char)(/*[in]*/ unsigned char newVal);
-    STDMETHOD(get_COMPtr)(/*[out, retval]*/ IUnknown* *pVal);
-    STDMETHOD(put_COMPtr)(/*[in]*/ IUnknown* newVal);
-    STDMETHOD(get_Variant)(/*[out, retval]*/ VARIANT *pVal);
-    STDMETHOD(put_Variant)(/*[in]*/ VARIANT newVal);
-    STDMETHOD(get_Boolean)(/*[out, retval]*/ BOOL *pVal);
-    STDMETHOD(put_Boolean)(/*[in]*/ BOOL newVal);
-    STDMETHOD(get_SCode)(/*[out, retval]*/ SCODE *pVal);
-    STDMETHOD(put_SCode)(/*[in]*/ SCODE newVal);
-    STDMETHOD(get_DispatchPtr)(/*[out, retval]*/ IDispatch* *pVal);
-    STDMETHOD(put_DispatchPtr)(/*[in]*/ IDispatch* newVal);
-    STDMETHOD(get_String)(/*[out, retval]*/ BSTR *pVal);
-    STDMETHOD(put_String)(/*[in]*/ BSTR newVal);
-    STDMETHOD(get_Date)(/*[out, retval]*/ DATE *pVal);
-    STDMETHOD(put_Date)(/*[in]*/ DATE newVal);
-    STDMETHOD(get_Currency)(/*[out, retval]*/ CURRENCY *pVal);
-    STDMETHOD(put_Currency)(/*[in]*/ CURRENCY newVal);
-    STDMETHOD(get_Double)(/*[out, retval]*/ double *pVal);
-    STDMETHOD(put_Double)(/*[in]*/ double newVal);
-    STDMETHOD(get_Float)(/*[out, retval]*/ float *pVal);
-    STDMETHOD(put_Float)(/*[in]*/ float newVal);
-    STDMETHOD(get_Long)(/*[out, retval]*/ long *pVal);
-    STDMETHOD(put_Long)(/*[in]*/ long newVal);
-    STDMETHOD(get_Short)(/*[out, retval]*/ short *pVal);
-    STDMETHOD(put_Short)(/*[in]*/ short newVal);
-private:
-    unsigned char       mChar;
-    CComPtr<IUnknown>   mIUnknown;
-    CComVariant         mVariant;
-    BOOL                mBOOL;
-    SCODE               mSCode;
-    CComPtr<IDispatch>  mIDispatch;
-    CComBSTR            mBSTR;
-    DATE                mDATE;
-    CURRENCY            mCURRENCY;
-    double              mDouble;
-    float               mFloat;
-    long                mLong;
-    short               mShort;
-    long *              mParameterizedProperty;
-};
-
-#endif // !defined(AFX_NSXPCDISPTESTPROPERTIES_H__9E10C7AC_36AF_4A3A_91C7_2CFB9EB166A5__INCLUDED_)
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestProperties.rgs
+++ /dev/null
@@ -1,23 +0,0 @@
-HKCR
-{
-	XPCIDispatchTest.nsXPCDispTestProperties.1 = s 'nsXPCDispTestProperties Class'
-	{
-		CLSID = s '{D8B4265B-1768-4CA9-A285-7CCAEEB51C74}'
-	}
-	XPCIDispatchTest.nsXPCDispTestProperties = s 'nsXPCDispTestProperties Class'
-	{
-		CLSID = s '{D8B4265B-1768-4CA9-A285-7CCAEEB51C74}'
-	}
-	NoRemove CLSID
-	{
-		ForceRemove {D8B4265B-1768-4CA9-A285-7CCAEEB51C74} = s 'nsXPCDispTestProperties Class'
-		{
-			ProgID = s 'XPCIDispatchTest.nsXPCDispTestProperties.1'
-			VersionIndependentProgID = s 'XPCIDispatchTest.nsXPCDispTestProperties'
-			InprocServer32 = s '%MODULE%'
-			{
-				val ThreadingModel = s 'both'
-			}
-		}
-	}
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOff.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// nsXPCDispTestScriptOff.cpp : Implementation of CXPCIDispatchTestApp and DLL registration.
-
-#include "stdafx.h"
-#include "XPCIDispatchTest.h"
-#include "nsXPCDispTestScriptOff.h"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-
-STDMETHODIMP nsXPCDispTestScriptOff::InterfaceSupportsErrorInfo(REFIID riid)
-{
-    static const IID* arr[] = 
-    {
-        &IID_nsIXPCDispTestScriptOff,
-    };
-
-    for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
-    {
-        if (InlineIsEqualGUID(*arr[i],riid))
-            return S_OK;
-    }
-    return S_FALSE;
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOff.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// nsXPCDispTestScriptOff.h: Definition of the nsXPCDispTestScriptOff class
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_NSXPCDISPTESTSCRIPTOFF_H__EEC88DE0_F502_4893_9918_4E435DBC9815__INCLUDED_)
-#define AFX_NSXPCDISPTESTSCRIPTOFF_H__EEC88DE0_F502_4893_9918_4E435DBC9815__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "resource.h"       // main symbols
-#include <ATLCTL.H>
-
-/////////////////////////////////////////////////////////////////////////////
-// nsXPCDispTestScriptOff
-
-class nsXPCDispTestScriptOff : 
-    public IDispatchImpl<nsIXPCDispTestScriptOff, &IID_nsIXPCDispTestScriptOff, &LIBID_IDispatchTestLib>, 
-    public ISupportErrorInfo,
-    public CComObjectRoot,
-    public CComCoClass<nsXPCDispTestScriptOff,&CLSID_nsXPCDispTestScriptOff>,
-    public IObjectSafetyImpl<nsXPCDispTestScriptOff, 0>
-{
-public:
-    nsXPCDispTestScriptOff() {}
-BEGIN_COM_MAP(nsXPCDispTestScriptOff)
-    COM_INTERFACE_ENTRY(IDispatch)
-    COM_INTERFACE_ENTRY(nsIXPCDispTestScriptOff)
-    COM_INTERFACE_ENTRY(IObjectSafety)
-    COM_INTERFACE_ENTRY(ISupportErrorInfo)
-END_COM_MAP()
-DECLARE_NOT_AGGREGATABLE(nsXPCDispTestScriptOff) 
-
-DECLARE_REGISTRY_RESOURCEID(IDR_nsXPCDispTestScriptOff)
-// ISupportsErrorInfo
-    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
-
-// nsIXPCDispTestScriptOff
-public:
-};
-
-#endif // !defined(AFX_NSXPCDISPTESTSCRIPTOFF_H__EEC88DE0_F502_4893_9918_4E435DBC9815__INCLUDED_)
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOff.rgs
+++ /dev/null
@@ -1,23 +0,0 @@
-HKCR
-{
-	XPCIDispatchTest.nsXPCDispTestScriptOff.1 = s 'nsXPCDispTestScriptOff Class'
-	{
-		CLSID = s '{959CD122-9826-4757-BA09-DE327D55F9E7}'
-	}
-	XPCIDispatchTest.nsXPCDispTestScriptOff = s 'nsXPCDispTestScriptOff Class'
-	{
-		CLSID = s '{959CD122-9826-4757-BA09-DE327D55F9E7}'
-	}
-	NoRemove CLSID
-	{
-		ForceRemove {959CD122-9826-4757-BA09-DE327D55F9E7} = s 'nsXPCDispTestScriptOff Class'
-		{
-			ProgID = s 'XPCIDispatchTest.nsXPCDispTestScriptOff.1'
-			VersionIndependentProgID = s 'XPCIDispatchTest.nsXPCDispTestScriptOff'
-			InprocServer32 = s '%MODULE%'
-			{
-				val ThreadingModel = s 'both'
-			}
-		}
-	}
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOn.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-// nsXPCDispTestScriptOn.cpp : Implementation of CXPCIDispatchTestApp and DLL registration.
-
-#include "stdafx.h"
-#include "XPCIDispatchTest.h"
-#include "nsXPCDispTestScriptOn.h"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-
-STDMETHODIMP nsXPCDispTestScriptOn::InterfaceSupportsErrorInfo(REFIID riid)
-{
-    static const IID* arr[] = 
-    {
-        &IID_nsIXPCDispTestScriptOn,
-    };
-
-    for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
-    {
-        if (InlineIsEqualGUID(*arr[i],riid))
-            return S_OK;
-    }
-    return S_FALSE;
-}
-
-nsXPCDispTestScriptOn::nsXPCDispTestScriptOn()
-{
-    m_dwCurrentSafety = INTERFACESAFE_FOR_UNTRUSTED_CALLER |
-        INTERFACESAFE_FOR_UNTRUSTED_DATA;
-}
\ No newline at end of file
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOn.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// nsXPCDispTestScriptOn.h: Definition of the nsXPCDispTestScriptOn class
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_NSXPCDISPTESTSCRIPTON_H__C037D462_C403_48FF_A02F_6C36544F0833__INCLUDED_)
-#define AFX_NSXPCDISPTESTSCRIPTON_H__C037D462_C403_48FF_A02F_6C36544F0833__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "resource.h"       // main symbols
-#include <ATLCTL.H>
-
-/////////////////////////////////////////////////////////////////////////////
-// nsXPCDispTestScriptOn
-
-class nsXPCDispTestScriptOn : 
-    public IDispatchImpl<nsIXPCDispTestScriptOn, &IID_nsIXPCDispTestScriptOn, &LIBID_IDispatchTestLib>, 
-    public ISupportErrorInfo,
-    public CComObjectRoot,
-    public CComCoClass<nsXPCDispTestScriptOn,&CLSID_nsXPCDispTestScriptOn>,
-    public IObjectSafetyImpl<nsXPCDispTestScriptOn,
-                             INTERFACESAFE_FOR_UNTRUSTED_CALLER | 
-                                 INTERFACESAFE_FOR_UNTRUSTED_DATA>
-{
-public:
-    nsXPCDispTestScriptOn();
-BEGIN_COM_MAP(nsXPCDispTestScriptOn)
-    COM_INTERFACE_ENTRY(IDispatch)
-    COM_INTERFACE_ENTRY(nsIXPCDispTestScriptOn)
-    COM_INTERFACE_ENTRY(IObjectSafety)
-    COM_INTERFACE_ENTRY(ISupportErrorInfo)
-END_COM_MAP()
-DECLARE_NOT_AGGREGATABLE(nsXPCDispTestScriptOn) 
-
-DECLARE_REGISTRY_RESOURCEID(IDR_nsXPCDispTestScriptOn)
-// ISupportsErrorInfo
-    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
-
-// nsIXPCDispTestScriptOn
-public:
-};
-
-#endif // !defined(AFX_NSXPCDISPTESTSCRIPTON_H__C037D462_C403_48FF_A02F_6C36544F0833__INCLUDED_)
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOn.rgs
+++ /dev/null
@@ -1,23 +0,0 @@
-HKCR
-{
-	XPCIDispatchTest.nsXPCDispTestScriptOn.1 = s 'nsXPCDispTestScriptOn Class'
-	{
-		CLSID = s '{2A06373F-3E61-4882-A3D7-A104F70B09ED}'
-	}
-	XPCIDispatchTest.nsXPCDispTestScriptOn = s 'nsXPCDispTestScriptOn Class'
-	{
-		CLSID = s '{2A06373F-3E61-4882-A3D7-A104F70B09ED}'
-	}
-	NoRemove CLSID
-	{
-		ForceRemove {2A06373F-3E61-4882-A3D7-A104F70B09ED} = s 'nsXPCDispTestScriptOn Class'
-		{
-			ProgID = s 'XPCIDispatchTest.nsXPCDispTestScriptOn.1'
-			VersionIndependentProgID = s 'XPCIDispatchTest.nsXPCDispTestScriptOn'
-			InprocServer32 = s '%MODULE%'
-			{
-				val ThreadingModel = s 'both'
-			}
-		}
-	}
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestWrappedJS.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-// nsXPCDispTestWrappedJS.cpp : Implementation of CXPCIDispatchTestApp and DLL registration.
-
-#include "stdafx.h"
-#include "XPCIDispatchTest.h"
-#include "nsXPCDispTestWrappedJS.h"
-#include <string>
-#include <sstream>
-
-/////////////////////////////////////////////////////////////////////////////
-//
-
-STDMETHODIMP nsXPCDispTestWrappedJS::InterfaceSupportsErrorInfo(REFIID riid)
-{
-	static const IID* arr[] = 
-	{
-		&IID_nsIXPCDispTestWrappedJS,
-	};
-
-	for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
-	{
-		if (InlineIsEqualGUID(*arr[i],riid))
-			return S_OK;
-	}
-	return S_FALSE;
-}
-
-struct TestData
-{
-    typedef bool (*CompFunc)(const _variant_t & left, const _variant_t & right);
-    TestData(const char * name, const _variant_t & value, CompFunc cf) : 
-        mName(name), mValue(value), mCompFunc(cf) {}
-    const char * mName;
-    _variant_t mValue;
-    CompFunc mCompFunc;
-    
-};
-
-bool CompareVariant(const _variant_t & left, const _variant_t & right)
-{
-    return left == right;
-}
-
-// These should be a template but VC++6 is brain dead in this area
-#define CompareFunction(type)                                               \
-bool CompareVariant##type(const _variant_t & left, const _variant_t & right)     \
-{                                                                           \
-    return static_cast<type>(left) == static_cast<type>(right);             \
-}
-
-CompareFunction(long);
-CompareFunction(float);
-CompareFunction(double);
-CompareFunction(_bstr_t);
-
-DISPID GetIDsOfNames(IDispatch * pIDispatch , char const * i_Method)
-{
-    DISPID dispid;
-    CComBSTR method(i_Method);
-    OLECHAR * pMethod = method;
-    HRESULT hresult = pIDispatch->GetIDsOfNames(
-        IID_NULL,
-        &pMethod,
-        1, 
-        LOCALE_SYSTEM_DEFAULT,
-        &dispid);
-    if (!SUCCEEDED(hresult))
-    {
-        dispid = 0;
-    }
-    return dispid;
-}
-
-namespace
-{
-
-inline
-_bstr_t ConvertVariantFromBSTR(_variant_t & variant)
-{
-    VARIANT temp = variant;
-    if (SUCCEEDED(VariantChangeType(&temp, &temp, 0, VT_BSTR)))
-    {
-        variant.Attach(temp);
-        return static_cast<_bstr_t>(variant);
-    }
-    return "**Type Conversion failed";
-}
-
-std::string DispInvoke(IDispatch * obj, const TestData & testData)
-{
-    // Perform a put on the property
-    ITypeInfo * pTypeInfo;
-    obj->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &pTypeInfo);
-    DISPID dispID = ::GetIDsOfNames(obj, testData.mName);
-    DISPPARAMS dispParams;
-    dispParams.cArgs = 1;
-    dispParams.rgvarg = const_cast<VARIANT*>(&reinterpret_cast<const VARIANT&>(testData.mValue));
-    dispParams.cNamedArgs = 1;
-    DISPID propPut = DISPID_PROPERTYPUT;
-    dispParams.rgdispidNamedArgs = &propPut;
-    _variant_t result1;
-    HRESULT hResult = obj->Invoke(dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT, &dispParams, &result1, 0, 0);
-    if (FAILED(hResult))
-    {
-        std::ostringstream msg;
-        msg << "IDispatch::Invoke on " << testData.mName << " failed to set property with result " << hResult;
-        return msg.str();
-    }
-    dispParams.cArgs = 1;
-    dispParams.rgvarg = const_cast<VARIANT*>(&reinterpret_cast<const VARIANT&>(testData.mValue));
-    dispParams.cNamedArgs = 0;
-    dispParams.rgdispidNamedArgs = 0;
-    _variant_t result2;
-    hResult = obj->Invoke(dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET, &dispParams, &result2, 0, 0);
-    if (FAILED(hResult))
-    {
-        std::ostringstream msg;
-        msg << "IDispatch::Invoke on " << testData.mName << " failed to retrieve property with result " << hResult;
-        return msg.str();
-    }
-    if (!testData.mCompFunc(result2,testData.mValue))
-    {
-        std::ostringstream msg;
-        VARIANT temp = testData.mValue;
-        char const * const desired = SUCCEEDED(VariantChangeType(&temp, &temp, 0, VT_BSTR)) ? 0 : "**Conversion Failed";
-        char const * const actual = SUCCEEDED(VariantChangeType(&result2, &result2, 0, VT_BSTR)) ? 0 : "**Conversion Failed";
-
-        msg << testData.mName << " ["
-            << (desired ? desired : static_cast<char const *>(static_cast<_bstr_t>(testData.mValue))) << "] [" 
-            << (actual ? actual : static_cast<char const *>(static_cast<_bstr_t>(result2))) << "]";
-        return msg.str();
-    }
-    return std::string();
-}
-
-}
-
-STDMETHODIMP nsXPCDispTestWrappedJS::TestParamTypes(IDispatch *obj, BSTR *errMsg)
-{
-    CComPtr<IDispatch> ptr;
-    CComBSTR progID("XPCIDispatchTest.nsXPCDispSimple.1");
-    ptr.CoCreateInstance(progID);
-    _variant_t dispatchPtr;
-    dispatchPtr = static_cast<IDispatch*>(ptr);
-    CURRENCY currency;
-    currency.int64 = 55555;
-    _variant_t date(3000.0, VT_DATE);
-    _variant_t nullVariant;
-    nullVariant.ChangeType(VT_NULL);
-    const TestData tests[] =
-    {
-        TestData("Boolean", _variant_t(true), CompareVariant),
-        TestData("Short", _variant_t(short(4200)), reinterpret_cast<TestData::CompFunc>(CompareVariantlong)),
-        TestData("Long", _variant_t(long(-42000000)), CompareVariantlong),
-        TestData("Float", _variant_t(float(4.5)), CompareVariantfloat),
-        TestData("Double", _variant_t(-11111.11), CompareVariant),
-//        TestData("Currency", _variant_t(currency), CompareVariantdouble),
-        TestData("Date", date, CompareVariant_bstr_t),
-        TestData("String", _variant_t("A String"), CompareVariant),
-        TestData("DispatchPtr", dispatchPtr, CompareVariant),
-//        TestData("SCode", _variant_t(long(5), VT_ERROR), CompareVariant_bstr_t),
-        TestData("Variant", nullVariant, CompareVariant),
-        TestData("Char", _variant_t(BYTE('x')), CompareVariant_bstr_t)
-    };
-    std::string errors;
-    for (size_t index = 0; index < sizeof(tests) / sizeof(TestData); ++index)
-    {
-        std::string msg = DispInvoke(obj, tests[index]);
-        if (!msg.empty())
-        {
-            errors += msg;
-            errors += "\r\n";
-        }
-    }
-    CComBSTR errorMsg(errors.c_str());
-    *errMsg = errorMsg.Detach();
-    return S_OK;
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestWrappedJS.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// nsXPCDispTestWrappedJS.h: Definition of the nsXPCDispTestWrappedJS class
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_NSXPCDISPTESTWRAPPEDJS_H__DAAB3C99_1894_40C2_B12B_A360739F8977__INCLUDED_)
-#define AFX_NSXPCDISPTESTWRAPPEDJS_H__DAAB3C99_1894_40C2_B12B_A360739F8977__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "resource.h"       // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// nsXPCDispTestWrappedJS
-
-class nsXPCDispTestWrappedJS : 
-	public IDispatchImpl<nsIXPCDispTestWrappedJS, &IID_nsIXPCDispTestWrappedJS, &LIBID_IDispatchTestLib>, 
-	public ISupportErrorInfo,
-	public CComObjectRoot,
-	public CComCoClass<nsXPCDispTestWrappedJS,&CLSID_nsXPCDispTestWrappedJS>
-{
-public:
-	nsXPCDispTestWrappedJS() {}
-BEGIN_CATEGORY_MAP(nsXPCDispTestWrappedJS)
-    IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
-END_CATEGORY_MAP()
-BEGIN_COM_MAP(nsXPCDispTestWrappedJS)
-	COM_INTERFACE_ENTRY(IDispatch)
-	COM_INTERFACE_ENTRY(nsIXPCDispTestWrappedJS)
-	COM_INTERFACE_ENTRY(ISupportErrorInfo)
-END_COM_MAP()
-DECLARE_NOT_AGGREGATABLE(nsXPCDispTestWrappedJS) 
-
-DECLARE_REGISTRY_RESOURCEID(IDR_nsXPCDispTestWrappedJS)
-// ISupportsErrorInfo
-	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
-
-// nsIXPCDispTestWrappedJS
-public:
-    /**
-     * This tests interacting with JS Objects via IDispatch
-     * @param obj the object being tested
-     * @param errMsg string receiving any error message, blank if no error
-     */
-	STDMETHOD(TestParamTypes)(/*[in]*/ IDispatch * obj, 
-                              /*[out]*/BSTR * errMsg);
-};
-
-#endif // !defined(AFX_NSXPCDISPTESTWRAPPEDJS_H__DAAB3C99_1894_40C2_B12B_A360739F8977__INCLUDED_)
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestWrappedJS.rgs
+++ /dev/null
@@ -1,23 +0,0 @@
-HKCR
-{
-	XPCIDispatchTest.nsXPCDispTestWrappedJS.1 = s 'nsXPCDispTestWrappedJS Class'
-	{
-		CLSID = s '{EAEE6BB2-C005-4B91-BCA7-6613236F6F69}'
-	}
-	XPCIDispatchTest.nsXPCDispTestWrappedJS = s 'nsXPCDispTestWrappedJS Class'
-	{
-		CLSID = s '{EAEE6BB2-C005-4B91-BCA7-6613236F6F69}'
-	}
-	NoRemove CLSID
-	{
-		ForceRemove {EAEE6BB2-C005-4B91-BCA7-6613236F6F69} = s 'nsXPCDispTestWrappedJS Class'
-		{
-			ProgID = s 'XPCIDispatchTest.nsXPCDispTestWrappedJS.1'
-			VersionIndependentProgID = s 'XPCIDispatchTest.nsXPCDispTestWrappedJS'
-			InprocServer32 = s '%MODULE%'
-			{
-				val ThreadingModel = s 'both'
-			}
-		}
-	}
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/COM/resource.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by XPCIDispatchTest.rc
-//
-#define IDS_PROJNAME                    100
-#define IDS_NSXPCDISPTTESTMETHODS_DESC  101
-#define IDR_nsXPCDisptTestMethods       102
-#define IDS_NSXPCDISPTESTMETHODS_DESC   103
-#define IDR_nsXPCDispTestMethods        104
-#define IDS_NSXPCDISPSIMPLE_DESC        105
-#define IDR_nsXPCDispSimple             106
-#define IDS_NSXPCDISPTESTNOIDISPATCH_DESC 107
-#define IDR_nsXPCDispTestNoIDispatch    108
-#define IDS_NSXPCDISPTESTNOSCRIPT_DESC  109
-#define IDR_nsXPCDispTestNoScript       110
-#define IDS_NSXPCDISPTESTPROPERTIES_DESC 111
-#define IDR_nsXPCDispTestProperties     112
-#define IDS_NSXPCDISPTESTARRAYS_DESC    113
-#define IDR_nsXPCDispTestArrays         114
-#define IDS_NSXPCDISPTESTSCRIPTON_DESC  115
-#define IDR_nsXPCDispTestScriptOn       116
-#define IDS_NSXPCDISPTESTSCRIPTOFF_DESC 117
-#define IDR_nsXPCDispTestScriptOff      118
-#define IDS_NSXPCDISPTESTWRAPPEDJS_DESC 119
-#define IDR_nsXPCDispTestWrappedJS      120
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        204
-#define _APS_NEXT_COMMAND_VALUE         32768
-#define _APS_NEXT_CONTROL_VALUE         201
-#define _APS_NEXT_SYMED_VALUE           121
-#endif
-#endif
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/Arrays/XPCIDispatchArrayTests.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * Verify that we can access but not overwrite the values of read-only 
- * attributes.
- */
-
-test();
-
-function test()
-{
-    printStatus("Testing arrays");  
-    var obj = COMObject(CLSID_nsXPCDispTestArrays);
-    var anArray = [ 0, 1, 2, 3];
-    obj.TakesSafeArray(anArray);
-    var strArray = [ "0", "1", "2", "3"];
-    obj.TakesSafeArrayBSTR(strArray);
-	return 0;
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/Attributes/XPCIDispatchAttributeTests.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * \file XPCIDispatchAttributeTests.js
- * Test IDispatch properties and also type conversion
- */
-
-try
-{
-	// Test object used to test IDispatch property.
-    testObject = { one : 1, two : 2, three : 'three' };
-    test();
-}
-catch (e)
-{
-    reportFailure("Unhandled exception encountered: " + e.toString());
-}
-
-/**
- * Main function to perform test
- */
-function test()
-{
-    printStatus("Read-Write Attributes");
-
-    /*
-    * These values come from xpctest_attributes.idl and xpctest_attributes.cpp
-    */
-
-    o = COMObject(CLSID_nsXPCDispTestProperties);
-
-    // Check the class an interface to make sure they're ok
-    reportCompare(
-        "object",
-        typeof o,
-        "typeof COMObject(CLSID_nsXPCDispTestProperties)");
-    // Make sure we can read the values
-    testProperty("o.Boolean", ["true", "1","testObject", "'T'", "'F'", "'true'","'false'"], false);
-    testProperty("o.Char", ["32"], true);
-    testProperty("o.COMPtr", ["0"], true);
-    testProperty("o.Currency", ["0", "0.5", "10000.00"], true);
-    testProperty("o.Date", ["'04/01/03'"], false);
-    testProperty("o.DispatchPtr", ["testObject"], false);
-    testProperty("o.Double", ["5.555555555555555555555", "5.555555555555555555555", "5", "-5"], true);
-    testProperty("o.Float", ["-5.55555555", "5.5555555", "5", "-5"], true);
-    testProperty("o.Long", ["-5", "1073741823", "-1073741824", "1073741824", "-1073741825", "5.5"], true);
-    testProperty("o.SCode", ["5"], true);
-    testProperty("o.Short", ["5", "-5", "32767", "-32768"], true);
-    testProperty("o.String", ["'A String'", "'c'", "5", "true"], false);
-    testProperty("o.Variant", ["'A Variant String'", "testObject", "10", "5.5"], false);
-    
-    // Parameterized property tests
-    for (index = 0; index < o.ParameterizedPropertyCount; ++index)
-        compareExpression(
-            "o.ParameterizedProperty(index)",
-            index + 1,
-            "Reading initial value from parameterized property " + index);
-    for (index = 0; index < o.ParameterizedPropertyCount; ++index)
-        compareExpression(
-            "o.ParameterizedProperty(index) = index + 5",
-            index + 5,
-            "Assigning parameterized property " + index);
-
-    for (index = 0; index < o.ParameterizedPropertyCount; ++index)
-        compareExpression(
-            "o.ParameterizedProperty(index)",
-            index + 5,
-            "Reading new value from parameterized property " + index);
-}
-
-/**
- * Tests retrieving a value from a property and setting multiple values on
- * the property
- */
-function testProperty(propertyExpression, values, tryString)
-{
-    print(propertyExpression);
-    try
-    {
-        reportCompare(
-            eval(propertyExpression),
-            eval(propertyExpression),
-            propertyExpression);
-    }
-    catch (e)
-    {
-        reportFailure("Testing initial value of " + propertyExpression + " Exception: " + e.toString());
-    }
-    for (i = 0; i < values.length; ++i)
-    {
-        var value = values[i];
-        var expression = propertyExpression + "=" + value;
-        print(expression);
-        try
-        {
-            reportCompare(
-                eval(expression),
-                eval(value),
-                expression);
-            if (tryString)
-            {
-                expression = propertyExpression + "='" + value + "'";
-                print(expression);
-                reportCompare(
-                    eval(expression),
-                    eval("'" + value + "'"),
-                    expression);
-            }
-        }
-        catch (e)
-        {
-            reportFailure("Testing assignment: " + expression + " Exception: " + e.toString());
-        }
-    }
-}
\ No newline at end of file
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/General/XPCIDispatchInstantiations.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * Verify that we can access but not overwrite the values of read-only 
- * attributes.
- */
-
-test();
-
-function testInstantiate(name, id, scriptable, methods)
-{
-    var IDISPATCH_TEXT = "[xpconnect wrapped IDispatch";
-    var obj = COMObject(id);
-    var value = obj.toString().substr(0, IDISPATCH_TEXT.length);
-    reportCompare(
-        IDISPATCH_TEXT,
-        value,
-        "var obj = COMObject(" + id + ");");
-    try
-    {
-        obj = COMObject(id);
-    }
-    catch (e)
-    {
-        if (scriptable)
-        {
-            reportFailure("COMObject('" + id + "') generated an exception");
-        }
-        return;
-    }
-    value = obj.toString().substr(0, IDISPATCH_TEXT.length);
-    reportCompare(
-        scriptable ? IDISPATCH_TEXT : undefined,
-        scriptable ? value : obj,
-        "var obj = COMObject(" + id + ");");
-}
-
-function testEnumeration(compInfo)
-{
-    var obj = COMObject(compInfo.cid);
-    compareObject(obj, compInfo, "Enumeration Test");
-}
-
-function test()
-{
-    try
-    {
-
-        printStatus("Instantiation Tests - " + objectsDesc.length + " objects to test");
-        for (index = 0; index < objectsDesc.length; ++index)
-        {
-            compInfo = objectsDesc[index];
-            printStatus("Testing " + compInfo.name);
-            testInstantiate(compInfo.name, compInfo.cid, compInfo.scriptable);
-            testInstantiate(compInfo.name, compInfo.progid, compInfo.scriptable);
-        }
-        // Test a nonexistent COM object
-        var obj;
-        try
-        {
-            obj = COMObject("dwbnonexistentobject");
-            printFailure("var obj = COMObject('dwbnonexistentobject'); did not throw an exception");
-        }
-        catch (e)
-        {
-        }
-        try
-        {
-            obj = COMObject("dwbnonexistentobject");
-            printFailure("obj = COMObject('dwbnonexistentobject'); did not throw an exception");
-        }
-        catch (e)
-        {
-        }
-        printStatus("Enumeration Tests - testing " + objectsDesc.length + " objects");
-        for (var index = 0; index < objectsDesc.length; ++index)
-        {
-            printStatus("Enumerating " + objectsDesc[index].name);
-            testEnumeration(objectsDesc[index]);
-        }
-
-    } 
-    catch (e)
-    {
-        reportFailure("Unhandled exception occurred:" + e.toString());
-    }
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/General/XPCStress.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * Make repeated calls so GC kicks in and we can check for memory leaks.
- */
-
-test();
-
-function test()
-{
-	printStatus("Stress testing");	
-	for (index = 0; index < 10000; ++index)
-	{
-		for (x = 0; x < objectsDesc.length; ++x)
-		{
-			var obj = COMObject(objectsDesc[x].cid);
-			for (prop in obj)
-			{
-				print(index + ":" +objectsDesc[x].name + ":" + prop);
-			}
-		}
-	}
-}
deleted file mode 100644
--- a/js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/Methods/XPCIDispatchMethodTests.js
+++ /dev/null
@@ -1,376 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the IDispatch implementation for XPConnect.
- *
- * The Initial Developer of the Original Code is
- * David Bradley.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * Verify that we can access but not overwrite the values of read-only 
- * attributes.
- */
-
-test();
-
-function TestOutMethod(obj, method, value)
-{
-    printDebug("TestOutMethod - " + method);
-    var x = new Object();
-    try
-    {
-        obj[method](x);
-        reportCompare(value, x.value, "Testing output parameter: " + method);
-    }
-    catch (e)
-    {
-        reportFailure("Testing output parameter failed: " + method + ": " + e.toString());
-    }
-}
-
-function TestReturnMethod(obj, method, value)
-{
-    printDebug("TestReturnMethod - " + method);
-    try
-    {
-        reportCompare(value, obj[method](), "Testing output parameter: " + method);
-    }
-    catch (e)
-    {
-        reportFailure("Testing return value failed: " + method + ": " + e.toString());
-    }
-}
-
-function TestInputMethod(obj, method, value)
-{
-    printDebug("TestInputMethod - " + method);
-    try
-    {
-        obj[method.toLowerCase()](value);
-    }
-    catch (e)
-    {
-        reportFailure("Testing input parameter failed: " + method + ": " + e.toString());
-    }
-}
-
-function TestInOutMethod(obj, method, inValue, outValue)
-{
-    printDebug("TestInOutMethod - " + method);
-    try
-    {
-        var param = { value : inValue };
-        obj[method](param);
-        reportCompare(outValue, param.value, "Testing in/out parameter: " + method);
-    }
-    catch (e)
-    {
-        reportFailure("Testing in/out parameter failed: " + method + ": " + e.toString());
-    }
-}
-
-function test()
-{
-    printStatus("Testing methods"); 
-    var obj = COMObject(CLSID_nsXPCDispTestMethods);    
-    try
-    {
-        obj.NoParameters();
-    }
-    catch (e)
-    {
-        reportFailure("NoParameters failed: " + e.toString());
-    }
-    printStatus("Test method - Return values"); 
-    TestReturnMethod(obj, "ReturnBSTR", "Boo");
-    TestReturnMethod(obj, "ReturnI4",99999);
-    TestReturnMethod(obj, "ReturnUI1", 99);
-    TestReturnMethod(obj, "ReturnI2",9999);
-    TestReturnMethod(obj, "ReturnR4",99999.1);
-    TestReturnMethod(obj, "ReturnR8", 99999999999.99);
-    TestReturnMethod(obj, "ReturnBool", true);
-
-    printStatus("TestReturnMethod - ReturnIDispatch");
-    compareObject(obj.ReturnIDispatch(), nsXPCDispSimpleDesc, "Test method - Return IDispatch"); 
-    var E_FAIL= -2147467259;
-    TestReturnMethod(obj, "ReturnError", E_FAIL);
-    TestReturnMethod(obj, "ReturnDate", "5/2/2002");
-    // TestReturnMethod(obj, ReturnIUnknown(IUnknown * * result)
-    TestReturnMethod(obj, "ReturnI1", 120);
-    TestReturnMethod(obj, "ReturnUI2", 9999);
-    TestReturnMethod(obj, "ReturnUI4", 3000000000);
-    TestReturnMethod(obj, "ReturnInt", -999999);
-    TestReturnMethod(obj, "ReturnUInt", 3000000000);
-
-    printStatus("Test method - Input params");
-    TestInputMethod(obj, "TakesBSTR", "TakesBSTR");
-    TestInputMethod(obj, "TakesI4", 999999);
-    TestInputMethod(obj, "TakesUI1", 42);
-    TestInputMethod(obj, "TakesI2", 32000);
-    TestInputMethod(obj, "TakesR4", 99999.99);
-    TestInputMethod(obj, "TakesR8", 999999999.99);
-    TestInputMethod(obj, "TakesBool", true);
-    var x = { Number : 5, ClassName : "nsXPCDispSimple" };
-    TestInputMethod(obj, "TakesIDispatch", x);
-    // This would always fail, type mismatch (no way to indicate this is going
-    // to an error, and there's no automatic conversion from integers to error
-    // codes
-    // TestInputMethod(obj, "TakesError", E_FAIL);
-    TestInputMethod(obj, "TakesDate", "5/2/2002");
-    // TestInputMethod(obj, TakesIUnknown, );
-    TestInputMethod(obj, "TakesI1", 42);
-    TestInputMethod(obj, "TakesUI2", 50000);
-    TestInputMethod(obj, "TakesUI4", 4026531840);
-    TestInputMethod(obj, "TakesInt", -10000000);
-    TestInputMethod(obj, "TakesUInt", 3758096384);
-
-    printStatus("Test method - Output params");
-    TestOutMethod(obj, "OutputsBSTR", "Boo");
-    TestOutMethod(obj, "OutputsI4",99999);
-    TestOutMethod(obj, "OutputsUI1", 99);
-    TestOutMethod(obj, "OutputsI2",9999);
-    TestOutMethod(obj, "OutputsR4",999999.1);
-    TestOutMethod(obj, "OutputsR8", 99999999999.99);
-    TestOutMethod(obj, "OutputsBool", true);
-
-    var outParam = new Object();
-    obj.OutputsIDispatch(outParam);
-    compareObject(outParam.value, nsXPCDispSimpleDesc, "Test method - Output params"); 
-    TestOutMethod(obj, "OutputsError", E_FAIL);
-    TestOutMethod(obj, "OutputsDate", "5/2/2002");
-    // TestOutMethod(obj, OutputsIUnknown(IUnknown * * result)
-    TestOutMethod(obj, "OutputsI1", 120);
-    TestOutMethod(obj, "OutputsUI2", 9999);
-    TestOutMethod(obj, "OutputsUI4", 3000000000);
-
-    printStatus("Test method - In/out params");
-    TestInOutMethod(obj, "InOutsBSTR", "String", "StringAppended");
-    TestInOutMethod(obj, "InOutsI4", 2000000, -2000000);
-    TestInOutMethod(obj, "InOutsUI1", 50, 8);
-    TestInOutMethod(obj, "InOutsI2", -1000, 9000);
-    TestInOutMethod(obj, "InOutsR4", -2.05, 3.0);
-    TestInOutMethod(obj, "InOutsR8", -5.5, 49999994.50000005);
-    TestInOutMethod(obj, "InOutsBool", true, false);
-    TestInOutMethod(obj, "InOutsBool", false, true);
-    var inoutParam = { value : {ClassName : "InOutTest", Number : 10 } };
-    try
-    {
-        obj.InOutsIDispatch(inoutParam);
-        if (inoutParam.value.Number != 15)
-            reportFailure("Testing in/out parameter failed: IDispatch");
-    }
-    catch (e)
-    {
-        reportFailure("Testing in/out parameter failed: IDispatch - " + e.toString());
-    }
-    // See the TakesError case
-    //TestInOutMethod(obj, "InOutsError", E_FAIL, E_FAIL + 1);
-    TestInOutMethod(obj, "InOutsDate", "5/23/2001", "5/24/2001");
-    //TestInOutMethod(obj, InOutsIUnknown(IUnknown * * result)