Moved LiveConnect initialization calls to end of lm_ReallyInitMocha, so that the rest of libmocha will be initialized properly.

This commit is contained in:
beard%netscape.com 1998-09-28 22:59:08 +00:00
Родитель 26692e6416
Коммит f75844e8d8
1 изменённых файлов: 16 добавлений и 15 удалений

Просмотреть файл

@ -729,21 +729,6 @@ lm_ReallyInitMocha(void)
crippled_decoder = lm_new_decoder(lm_runtime, &lm_dummy_class);
crippled_context = crippled_decoder->js_context;
#if defined(OJI)
if (JVM_MaybeStartupLiveConnect())
JSJ_InitJSContext(LM_GetCrippledContext(),
JS_GetGlobalObject(LM_GetCrippledContext()), NULL);
#elif defined(JAVA)
LJ_JSJ_Init();
/*
* Get liveconnect functions defined for the crippled context
* so we can pass error messages to the JavaConsole
*/
JSJ_InitContext(crippled_context, JS_GetGlobalObject(crippled_context));
#endif
/* Initialize a dummy object used for unreflectable applets and embeds. */
lm_DummyObject = crippled_decoder->window_object;
@ -774,6 +759,22 @@ lm_ReallyInitMocha(void)
lm_InitJSDebug(lm_runtime);
#endif
/* beard: move this to end, to ensure complete initialization before initing LiveConnect. */
#if defined(OJI)
if (JVM_MaybeStartupLiveConnect())
JSJ_InitJSContext(LM_GetCrippledContext(),
JS_GetGlobalObject(LM_GetCrippledContext()), NULL);
#elif defined(JAVA)
LJ_JSJ_Init();
/*
* Get liveconnect functions defined for the crippled context
* so we can pass error messages to the JavaConsole
*/
JSJ_InitContext(crippled_context, JS_GetGlobalObject(crippled_context));
#endif
return;
}