nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java
changeset 16226 0e4f37e6cc40
parent 16185 893aabe8c800
child 16522 d643e3ee819c
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java	Sat Feb 09 16:58:48 2013 +0100
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java	Mon Feb 11 21:26:06 2013 +0530
@@ -46,7 +46,7 @@
  *
  */
 @ScriptClass("Debug")
-public class NativeDebug extends ScriptObject {
+public final class NativeDebug extends ScriptObject {
     NativeDebug() {
         this.setProto(Global.objectPrototype());
     }
@@ -64,6 +64,10 @@
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
     public static Object getContext(final Object self) {
+        final SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new RuntimePermission("getNashornContext"));
+        }
         return Global.getThisContext();
     }