diff --git a/js/rhino/org/mozilla/javascript/Context.java b/js/rhino/org/mozilla/javascript/Context.java index b7e95f7acf5a..8997bb53eb1b 100644 --- a/js/rhino/org/mozilla/javascript/Context.java +++ b/js/rhino/org/mozilla/javascript/Context.java @@ -1645,14 +1645,16 @@ public final class Context { private static boolean requireSecurityDomain = true; static { + final String securityResourceName = + "org.mozilla.javascript.resources.Security"; try { - ResourceBundle rb = ResourceBundle.getBundle( - "org.mozilla.javascript.resources.Security"); + ResourceBundle rb = ResourceBundle.getBundle(securityResourceName); String s = rb.getString("security.requireSecurityDomain"); requireSecurityDomain = s.equals("true"); } catch (java.util.MissingResourceException mre) { - // Assume stricter policy. requireSecurityDomain = true; + throw new SecurityException("Resource \"" + securityResourceName + + "\" not found."); } } diff --git a/js/rhino/src/org/mozilla/javascript/Context.java b/js/rhino/src/org/mozilla/javascript/Context.java index b7e95f7acf5a..8997bb53eb1b 100644 --- a/js/rhino/src/org/mozilla/javascript/Context.java +++ b/js/rhino/src/org/mozilla/javascript/Context.java @@ -1645,14 +1645,16 @@ public final class Context { private static boolean requireSecurityDomain = true; static { + final String securityResourceName = + "org.mozilla.javascript.resources.Security"; try { - ResourceBundle rb = ResourceBundle.getBundle( - "org.mozilla.javascript.resources.Security"); + ResourceBundle rb = ResourceBundle.getBundle(securityResourceName); String s = rb.getString("security.requireSecurityDomain"); requireSecurityDomain = s.equals("true"); } catch (java.util.MissingResourceException mre) { - // Assume stricter policy. requireSecurityDomain = true; + throw new SecurityException("Resource \"" + securityResourceName + + "\" not found."); } }