Changed JavaPackage_resolve so that it doesn't return immediately if quiet_resolve_failure is true. Otherwise, pre_define_java_packages fails.

This commit is contained in:
beard%netscape.com 1998-08-31 23:39:04 +00:00
Родитель ebc5720c9d
Коммит 603876aec5
1 изменённых файлов: 6 добавлений и 17 удалений

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

@ -118,16 +118,12 @@ JavaPackage_resolve(JSContext *cx, JSObject *obj, jsval id)
const char *path; const char *path;
JNIEnv *jEnv; JNIEnv *jEnv;
/* Painful hack for pre_define_java_packages() */
if (quiet_resolve_failure)
return JS_FALSE;
package = (JavaPackage_Private *)JS_GetPrivate(cx, obj); package = (JavaPackage_Private *)JS_GetPrivate(cx, obj);
if (!package) if (!package)
return JS_TRUE; return JS_TRUE;
if (!JSVAL_IS_STRING(id)) if (!JSVAL_IS_STRING(id))
return JS_TRUE; return JS_TRUE;
subPath = JS_GetStringBytes(JSVAL_TO_STRING(id)); subPath = JS_GetStringBytes(JSVAL_TO_STRING(id));
/* /*
@ -191,6 +187,11 @@ JavaPackage_resolve(JSContext *cx, JSObject *obj, jsval id)
the exception type and make sure that it's NoClassDefFoundError */ the exception type and make sure that it's NoClassDefFoundError */
(*jEnv)->ExceptionClear(jEnv); (*jEnv)->ExceptionClear(jEnv);
/* beard: this has to be done here, so built-in classes will be defined. */
/* Painful hack for pre_define_java_packages() */
if (quiet_resolve_failure)
return JS_FALSE;
/* /*
* If there's no class of the given name, then we must be referring to * If there's no class of the given name, then we must be referring to
* a package. However, don't allow bogus sub-packages of pre-defined * a package. However, don't allow bogus sub-packages of pre-defined
@ -203,12 +204,6 @@ JavaPackage_resolve(JSContext *cx, JSObject *obj, jsval id)
if (package->flags & PKG_SYSTEM) { if (package->flags & PKG_SYSTEM) {
char *msg, *cp; char *msg, *cp;
#if 0
/* Painful hack for pre_define_java_packages() */
if (quiet_resolve_failure)
return JS_FALSE;
#endif
msg = PR_smprintf("No Java system package with name \"%s\" was identified " msg = PR_smprintf("No Java system package with name \"%s\" was identified "
"and no Java class with that name exists either", "and no Java class with that name exists either",
newPath); newPath);
@ -227,12 +222,6 @@ JavaPackage_resolve(JSContext *cx, JSObject *obj, jsval id)
} }
} }
#if 0
/* Painful hack for pre_define_java_packages() */
if (quiet_resolve_failure)
return JS_FALSE;
#endif
if (!define_JavaPackage(cx, obj, subPath, newPath, 0)) { if (!define_JavaPackage(cx, obj, subPath, newPath, 0)) {
ok = JS_FALSE; ok = JS_FALSE;
goto out; goto out;