List of utility methods to do Javascript Mozilla Library
Object | getStaticProperty(Scriptable mixin, String name) Replies the static property with name Object property = mixin.get(name, mixin); if (property != Scriptable.NOT_FOUND && property instanceof Scriptable) { if (isStaticProperty((Scriptable) property)) { return (Scriptable) property; return Scriptable.NOT_FOUND; |
String | getStringArgument(Object[] args, int pos, boolean allowNull) Get an argument as string if (pos >= args.length || args[pos] == null || args[pos] == Undefined.instance) { if (allowNull) return null; throw new IllegalArgumentException("Argument " + (pos + 1) + " must not be null"); return ScriptRuntime.toString(args[pos].toString()); |
String | getStringValue(AstNode element) get String Value if (element instanceof StringLiteral) return ((StringLiteral) element).getValue(); if (element instanceof KeywordLiteral) return ((KeywordLiteral) element).toSource(); if (element instanceof Name) return ((Name) element).getIdentifier(); return ""; |
String[] | getXhtmlLinks(Object xhtml) get Xhtml Links if (xhtml instanceof Scriptable) { Scriptable sxhtml = (Scriptable) xhtml; String classname = sxhtml.getClassName().toLowerCase(); if ("xml".equals(classname) || "xmllist".equals(classname)) { final String XHTML_LINKS_EVAL = "xhtml..*.@href + xhtml..*.@src"; Context cx = Context.getCurrentContext(); ImporterTopLevel itl = new ImporterTopLevel(cx); itl.put("xhtml", itl, sxhtml); ... |
void | grabContextFactoryGlobalSetter() grab Context Factory Global Setter if (globalSetter == null) {
globalSetter = ContextFactory.getGlobalSetter();
|
boolean | isContained(AstNode mayAncestor, AstNode filial) is Contained AstNode node = filial; while (node != null) { if (node.equals(mayAncestor)) return true; node = node.getParent(); return false; |
boolean | isDefined(final Object object) Returns whether or not the object is defined. return object != null && object != Scriptable.NOT_FOUND && object != Undefined.instance;
|
boolean | isName(AstNode node, String value) Returns whether an AST node is a Name with the specified value.
return node instanceof Name && value.equals(((Name) node).getIdentifier()); |
boolean | isNullNativeObject(Object val) is Null Native Object if (val instanceof UniqueTag) { if (UniqueTag.NOT_FOUND.equals(val)) { return true; } else if (UniqueTag.NULL_VALUE.equals(val)) { return true; } else if (val instanceof Undefined) { return true; ... |
boolean | isPrototypeNameNode(AstNode node) is Prototype Name Node return node instanceof Name && "prototype".equals(((Name) node).getIdentifier()); |