From e2859294b47522a67fdea04c17bfb0cc301cf8fc Mon Sep 17 00:00:00 2001 From: "nboyd%atg.com" Date: Tue, 10 Apr 2001 01:47:50 +0000 Subject: [PATCH] Remove SecuritySupport code that doesn't apply to the Invoker case. git-svn-id: svn://10.0.0.236/trunk@91811 18797224-902f-48f8-a5cc-f745e15eee43 --- .../js/rhino/org/mozilla/javascript/Invoker.java | 16 ++-------------- .../src/org/mozilla/javascript/Invoker.java | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/mozilla/js/rhino/org/mozilla/javascript/Invoker.java b/mozilla/js/rhino/org/mozilla/javascript/Invoker.java index 3a07fda6180..ae9bd698cda 100644 --- a/mozilla/js/rhino/org/mozilla/javascript/Invoker.java +++ b/mozilla/js/rhino/org/mozilla/javascript/Invoker.java @@ -270,20 +270,8 @@ public abstract class Invoker { byte[] bytes = bos.toByteArray(); Context cx = Context.getCurrentContext(); - SecuritySupport ss = cx == null ? null : cx.getSecuritySupport(); - Class c; - if (ss != null) { - // This will be compiled using the security domain of the - // first class making a call. Then the result will be cached - // and used by subsequent calls (which may not necessarily - // be from the same security domain). Since Rhino generates - // the code, this shouldn't be a security hole. - Object securityDomain = cx.getSecurityDomainForStackDepth(-1); - c = ss.defineClass(className, bytes, securityDomain); - } else { - classLoader.defineClass(className, bytes); - c = classLoader.loadClass(className, true); - } + classLoader.defineClass(className, bytes); + Class c = classLoader.loadClass(className, true); result = (Invoker)c.newInstance(); if (false) { diff --git a/mozilla/js/rhino/src/org/mozilla/javascript/Invoker.java b/mozilla/js/rhino/src/org/mozilla/javascript/Invoker.java index 3a07fda6180..ae9bd698cda 100644 --- a/mozilla/js/rhino/src/org/mozilla/javascript/Invoker.java +++ b/mozilla/js/rhino/src/org/mozilla/javascript/Invoker.java @@ -270,20 +270,8 @@ public abstract class Invoker { byte[] bytes = bos.toByteArray(); Context cx = Context.getCurrentContext(); - SecuritySupport ss = cx == null ? null : cx.getSecuritySupport(); - Class c; - if (ss != null) { - // This will be compiled using the security domain of the - // first class making a call. Then the result will be cached - // and used by subsequent calls (which may not necessarily - // be from the same security domain). Since Rhino generates - // the code, this shouldn't be a security hole. - Object securityDomain = cx.getSecurityDomainForStackDepth(-1); - c = ss.defineClass(className, bytes, securityDomain); - } else { - classLoader.defineClass(className, bytes); - c = classLoader.loadClass(className, true); - } + classLoader.defineClass(className, bytes); + Class c = classLoader.loadClass(className, true); result = (Invoker)c.newInstance(); if (false) {