/** * @see org.mozilla.javascript.Scriptable#getClassName */ public String getClassName() { return obj.getClassName(); } /**
/** * @see org.mozilla.javascript.Scriptable#getClassName */ public String getClassName() { return obj.getClassName(); } /**
@Override public String getClassName() { return child.getClassName(); }
static String defaultObjectToString(Scriptable obj) { return "[object " + obj.getClassName() + ']'; }
/** * @see org.mozilla.javascript.Scriptable#getClassName */ public String getClassName() { return obj.getClassName(); } /**
/** * @see org.mozilla.javascript.Scriptable#getClassName */ public String getClassName() { return obj.getClassName(); } /**
/** * @see org.mozilla.javascript.Scriptable#getClassName */ public String getClassName() { return obj.getClassName(); } /**
/** * @see org.mozilla.javascript.Scriptable#getClassName */ public String getClassName() { return obj.getClassName(); } /**
static String defaultObjectToString(Scriptable obj) { return "[object " + obj.getClassName() + ']'; }
static String defaultObjectToString(Scriptable obj) { return "[object " + obj.getClassName() + ']'; }
static String defaultObjectToString(Scriptable obj) { return "[object " + obj.getClassName() + ']'; }
static String defaultObjectToString(Scriptable obj) { return "[object " + obj.getClassName() + ']'; }
static String defaultObjectToString(Scriptable obj) { return "[object " + obj.getClassName() + ']'; }
private static boolean js_isArray(Object o) { if (!(o instanceof Scriptable)) { return false; } return "Array".equals(((Scriptable)o).getClassName()); }
private static boolean js_isArray(Object o) { if (!(o instanceof Scriptable)) { return false; } return "Array".equals(((Scriptable)o).getClassName()); }
@Override String decompile(int indent, int flags) { StringBuffer sb = new StringBuffer(); boolean justbody = (0 != (flags & Decompiler.ONLY_BODY_FLAG)); if (!justbody) { sb.append("function "); sb.append(getFunctionName()); sb.append("() { "); } sb.append("[native code for "); if (idcall instanceof Scriptable) { Scriptable sobj = (Scriptable)idcall; sb.append(sobj.getClassName()); sb.append('.'); } sb.append(getFunctionName()); sb.append(", arity="); sb.append(getArity()); sb.append(justbody ? "]\n" : "] }\n"); return sb.toString(); }
String decompile(int indent, int flags) { StringBuffer sb = new StringBuffer(); boolean justbody = (0 != (flags & Decompiler.ONLY_BODY_FLAG)); if (!justbody) { sb.append("function "); sb.append(getFunctionName()); sb.append("() { "); } sb.append("[native code for "); if (idcall instanceof Scriptable) { Scriptable sobj = (Scriptable)idcall; sb.append(sobj.getClassName()); sb.append('.'); } sb.append(getFunctionName()); sb.append(", arity="); sb.append(getArity()); sb.append(justbody ? "]\n" : "] }\n"); return sb.toString(); }
@Override String decompile(int indent, int flags) { StringBuffer sb = new StringBuffer(); boolean justbody = (0 != (flags & Decompiler.ONLY_BODY_FLAG)); if (!justbody) { sb.append("function "); sb.append(getFunctionName()); sb.append("() { "); } sb.append("[native code for "); if (idcall instanceof Scriptable) { Scriptable sobj = (Scriptable)idcall; sb.append(sobj.getClassName()); sb.append('.'); } sb.append(getFunctionName()); sb.append(", arity="); sb.append(getArity()); sb.append(justbody ? "]\n" : "] }\n"); return sb.toString(); }
static public List<?> optArray(Object o, String attributeName){ Object obj = opt(o, attributeName); if( null == obj ){ return null; } if( obj instanceof Scriptable ){ Scriptable s = (Scriptable)obj; if( "Array".equals(s.getClassName()) ){ int length = optInteger(s,"length",0); List<Object> result = new Vector<Object>(); for(int i=0; i<length; ++i){ Object elem = opt(s, i); result.add(elem); } return result; } } return null; }
/** * Define this function as a JavaScript constructor. * <p> * Sets up the "prototype" and "constructor" properties. Also * calls setParent and setPrototype with appropriate values. * Then adds the function object as a property of the given scope, using * <code>prototype.getClassName()</code> * as the name of the property. * * @param scope the scope in which to define the constructor (typically * the global object) * @param prototype the prototype object * @see org.mozilla.javascript.Scriptable#setParentScope * @see org.mozilla.javascript.Scriptable#setPrototype * @see org.mozilla.javascript.Scriptable#getClassName */ public void addAsConstructor(Scriptable scope, Scriptable prototype) { initAsConstructor(scope, prototype); defineProperty(scope, prototype.getClassName(), this, ScriptableObject.DONTENUM); }