home *** CD-ROM | disk | FTP | other *** search
- package com.netscape.javascript;
-
- import java.lang.reflect.Method;
-
- public class NativeWith implements Scriptable {
- private Scriptable prototype;
- private Scriptable parent;
- private Scriptable constructor;
- // $FF: synthetic field
- private static Class class$com$netscape$javascript$NativeWith;
-
- public boolean hasInstance(Scriptable var1) {
- return this.prototype.hasInstance(var1);
- }
-
- public Object get(String var1, Scriptable var2) {
- if (var2 == this) {
- var2 = this.prototype;
- }
-
- return this.prototype.get(var1, var2);
- }
-
- public Object get(int var1, Scriptable var2) {
- if (var2 == this) {
- var2 = this.prototype;
- }
-
- return this.prototype.get(var1, var2);
- }
-
- public void put(String var1, Scriptable var2, Object var3) {
- if (var2 == this) {
- var2 = this.prototype;
- }
-
- this.prototype.put(var1, var2, var3);
- }
-
- public void put(int var1, Scriptable var2, Object var3) {
- if (var2 == this) {
- var2 = this.prototype;
- }
-
- this.prototype.put(var1, var2, var3);
- }
-
- public Object getDefaultValue(Class var1) {
- return this.prototype.getDefaultValue(var1);
- }
-
- public NativeWith() {
- }
-
- public NativeWith(Scriptable var1, Scriptable var2) {
- this.parent = var1;
- this.prototype = var2;
- }
-
- public Scriptable getPrototype() {
- return this.prototype;
- }
-
- public void setPrototype(Scriptable var1) {
- this.prototype = var1;
- }
-
- public Scriptable getParentScope() {
- return this.parent;
- }
-
- public void setParentScope(Scriptable var1) {
- this.parent = var1;
- }
-
- public static Object With(Context var0, Object[] var1, Function var2, boolean var3) {
- Object[] var4 = new Object[]{"With"};
- throw Context.reportRuntimeError(Context.getMessage("msg.cant.call.indirect", var4));
- }
-
- // $FF: synthetic method
- private static Class class$(String var0) {
- try {
- return Class.forName(var0);
- } catch (ClassNotFoundException var2) {
- throw new NoClassDefFoundError(((Throwable)var2).getMessage());
- }
- }
-
- public boolean has(String var1, Scriptable var2) {
- if (var2 == this) {
- var2 = this.prototype;
- }
-
- return this.prototype.has(var1, var2);
- }
-
- public boolean has(int var1, Scriptable var2) {
- if (var2 == this) {
- var2 = this.prototype;
- }
-
- return this.prototype.has(var1, var2);
- }
-
- public void delete(String var1) {
- this.prototype.delete(var1);
- }
-
- public void delete(int var1) {
- this.prototype.delete(var1);
- }
-
- public Object[] getIds() {
- return this.prototype.getIds();
- }
-
- public static void init(Scriptable var0) {
- NativeWith var1 = new NativeWith();
- var1.setPrototype(ScriptableObject.getObjectPrototype(var0));
- Method[] var2 = FunctionObject.findMethods(class$com$netscape$javascript$NativeWith != null ? class$com$netscape$javascript$NativeWith : (class$com$netscape$javascript$NativeWith = class$("com.netscape.javascript.NativeWith")), "With");
- FunctionObject var3 = new FunctionObject("With", var2[0], var0);
- var3.addAsConstructor(var0, var1);
- }
-
- public static Object newWithSpecial(Context var0, Object[] var1, Function var2, boolean var3) {
- if (!var3) {
- Object[] var6 = new Object[]{"With"};
- throw Context.reportRuntimeError(Context.getMessage("msg.only.from.new", var6));
- } else {
- ScriptRuntime.checkDeprecated(var0, "With");
- Scriptable var4 = ScriptableObject.getTopLevelScope(var2);
- NativeWith var5 = new NativeWith();
- var5.setPrototype(var1.length == 0 ? ScriptableObject.getClassPrototype(var4, "Object") : ScriptRuntime.toObject(var4, var1[0]));
- var5.setParentScope(var4);
- return var5;
- }
- }
-
- public String getClassName() {
- return "With";
- }
- }
-