Fix for bug 74482(Calling top.window.close() doe not work)

Work done by Nikolay Igotti and me
r=beard, sr=brendan, a =asa
This commit is contained in:
Xiaobin.Lu%eng.Sun.com 2001-06-13 01:01:59 +00:00
Родитель 3e788efb44
Коммит e95583d1e3
1 изменённых файлов: 12 добавлений и 1 удалений

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

@ -491,7 +491,7 @@ enter_js_from_java_impl(JNIEnv *jEnv, char **errp,
} }
JS_STATIC_DLL_CALLBACK(void) JS_STATIC_DLL_CALLBACK(void)
exit_js_impl(JNIEnv *jEnv) exit_js_impl(JNIEnv *jEnv, JSContext *cx)
{ {
//TODO: //TODO:
//LM_UnlockJS(); //LM_UnlockJS();
@ -518,7 +518,18 @@ exit_js_impl(JNIEnv *jEnv)
delete top; delete top;
} }
} }
// The main idea is to execute terminate function if have any;
if (cx)
{
nsISupports* supports = NS_REINTERPRET_CAST(nsIScriptContext*,
JS_GetContextPrivate(cx));
nsCOMPtr<nsIScriptContext> scriptContext = do_QueryInterface(supports);
if (scriptContext)
{
scriptContext->ScriptEvaluated(PR_TRUE);
}
}
return; return;
} }