return CallQueryInterface(NS_STATIC_CAST(nsIScriptGlobalObject *, global), aResult); }
NS_NewScriptGlobalObject(PRBool aIsChrome, nsIScriptGlobalObject **aResult){  *aResult = nsnull;  GlobalWindowImpl *global;  if (aIsChrome) {    global = new nsGlobalChromeWindow();  } else {    global = new GlobalWindowImpl();  }  NS_ENSURE_TRUE(global, NS_ERROR_OUT_OF_MEMORY);  return CallQueryInterface(NS_STATIC_CAST(nsIScriptGlobalObject *, global),                            aResult);}