private ModuleSpaceHost createModuleSpaceHost(CompilationState compilationState,
ModuleDef moduleDef) {
try {
ModuleSpaceHost moduleSpaceHost = new GwtTestModuleSpaceHost(GwtTreeLogger.get(),
compilationState, moduleDef, null, ARTIFACT_ACCEPTOR, REBIND_CACHE);
ModuleSpace moduleSpace = createModuleSpace(moduleSpaceHost);
moduleSpaceHost.onModuleReady(moduleSpace);
return moduleSpaceHost;
} catch (UnableToCompleteException e) {
throw new GwtTestConfigurationException("Error while creating global ModuleSpaceHost :", e);