Components.utils.createObjectIn

Components.utils.createObjectIn creates a new JavaScript object in the scope of the specified object's compartment.

This function is made available as a global in sandboxes which have the wantExportHelpers option set in the Sandbox() constructor.

Note that this function is now mostly obsolete when you are using Sandbox, because you can create an object in a different compartment using new. For example, to create a new object in the compartment identified by contentWindow: