B2G/gecko/dom/payment/tests/unit/header_helper.js
/**
 * Start a new payment module.
 *
 * @param custom_ns
 *        Namespace with symbols to be injected into the new payment module
 *        namespace.
 *
 * @return an object that represents the payment module's namespace.
 */
Start a new payment module.
@param custom_ns
Namespace with symbols to be injected into the new payment module
namespace.

@return an object that represents the payment module's namespace.
Start a new payment module . @param custom_ns Namespace with symbols to be injected into the new payment module namespace . @return an object that represents the payment module ' s namespace .
function newPaymentModule(custom_ns) {
  let payment_ns = {
    importScripts: function fakeImportScripts() {
      Array.slice(arguments).forEach(function (script) {
        subscriptLoader.loadSubScript("resource://gre/modules/" + script, this);
      }, this);
    },
  };
  for (let key in custom_ns) {
    payment_ns[key] = custom_ns[key];
  }
  payment_ns.importScripts("Payment.jsm");
  return payment_ns;
}
function newPaymentModule ( custom_ns ) { let payment_ns = { importScripts : function fakeImportScripts ( ) { Array . slice ( arguments ) . forEach ( function ( script ) { subscriptLoader . loadSubScript ( "resource://gre/modules/" + script , this ) ; } , this ) ; } , } ; for ( let key in custom_ns ) { payment_ns [ key ] = custom_ns [ key ] ; } payment_ns . importScripts ( "Payment.jsm" ) ; return payment_ns ; }
Start a new payment module.
Start a new payment module .
// Copy the custom definitions over. // Load the payment module itself.