< prev index next >

## src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java

Print this page

      41 import java.util.Map;
      42 import java.util.Objects;
      43 import java.util.Set;
      44 import java.util.concurrent.Callable;
      45 import javax.script.Bindings;
      46 import jdk.nashorn.internal.objects.Global;
      47 import jdk.nashorn.internal.runtime.ConsString;
      48 import jdk.nashorn.internal.runtime.Context;
      49 import jdk.nashorn.internal.runtime.ECMAException;
      50 import jdk.nashorn.internal.runtime.JSONListAdapter;
      51 import jdk.nashorn.internal.runtime.JSType;
      52 import jdk.nashorn.internal.runtime.ScriptFunction;
      53 import jdk.nashorn.internal.runtime.ScriptObject;
      54 import jdk.nashorn.internal.runtime.ScriptRuntime;
      55 import jdk.nashorn.internal.runtime.arrays.ArrayData;
      56 import jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor;
      57
      58 /**
      59  * Mirror object that wraps a given Nashorn Script object.
      60  *

      61  * @since 1.8u40
      62  */

      63 public final class ScriptObjectMirror extends AbstractJSObject implements Bindings {
      64     private static AccessControlContext getContextAccCtxt() {
      65         final Permissions perms = new Permissions();
      66         perms.add(new RuntimePermission(Context.NASHORN_GET_CONTEXT));
      67         return new AccessControlContext(new ProtectionDomain[] { new ProtectionDomain(null, perms) });
      68     }
      69
      70     private static final AccessControlContext GET_CONTEXT_ACC_CTXT = getContextAccCtxt();
      71
      72     private final ScriptObject sobj;
      73     private final Global  global;
      74     private final boolean strict;
      75     private final boolean jsonCompatible;
      76
      77     @Override
      78     public boolean equals(final Object other) {
      79         if (other instanceof ScriptObjectMirror) {
      80             return sobj.equals(((ScriptObjectMirror)other).sobj);
      81         }
      82
      41 import java.util.Map;
      42 import java.util.Objects;
      43 import java.util.Set;
      44 import java.util.concurrent.Callable;
      45 import javax.script.Bindings;
      46 import jdk.nashorn.internal.objects.Global;
      47 import jdk.nashorn.internal.runtime.ConsString;
      48 import jdk.nashorn.internal.runtime.Context;
      49 import jdk.nashorn.internal.runtime.ECMAException;
      50 import jdk.nashorn.internal.runtime.JSONListAdapter;
      51 import jdk.nashorn.internal.runtime.JSType;
      52 import jdk.nashorn.internal.runtime.ScriptFunction;
      53 import jdk.nashorn.internal.runtime.ScriptObject;
      54 import jdk.nashorn.internal.runtime.ScriptRuntime;
      55 import jdk.nashorn.internal.runtime.arrays.ArrayData;
      56 import jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor;
      57
      58 /**
      59  * Mirror object that wraps a given Nashorn Script object.
      60  *
      61  * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool
      62  * are deprecated with the intent to remove them in a future release.
      63  *
      64  * @since 1.8u40
      65  */
      66 @Deprecated(since="11", forRemoval=true)
      67 public final class ScriptObjectMirror extends AbstractJSObject implements Bindings {
      68     private static AccessControlContext getContextAccCtxt() {
      69         final Permissions perms = new Permissions();
      70         perms.add(new RuntimePermission(Context.NASHORN_GET_CONTEXT));
      71         return new AccessControlContext(new ProtectionDomain[] { new ProtectionDomain(null, perms) });
      72     }
      73
      74     private static final AccessControlContext GET_CONTEXT_ACC_CTXT = getContextAccCtxt();
      75
      76     private final ScriptObject sobj;
      77     private final Global  global;
      78     private final boolean strict;
      79     private final boolean jsonCompatible;
      80
      81     @Override
      82     public boolean equals(final Object other) {
      83         if (other instanceof ScriptObjectMirror) {
      84             return sobj.equals(((ScriptObjectMirror)other).sobj);
      85         }
      86

< prev index next >