Java Javascript Mozilla Library isPrototypePropertyGet(PropertyGet pg)

Here you can find the source of isPrototypePropertyGet(PropertyGet pg)

Description

is Prototype Property Get

License

BSD License

Declaration

public static final boolean isPrototypePropertyGet(PropertyGet pg) 

Method Source Code

//package com.java2s;
/*/*from   w  w w.  ja va 2  s .  c  om*/
 * 06/05/2014
 *
 * Copyright (C) 2014 Robert Futrell
 * robert_futrell at users.sourceforge.net
 * http://fifesoft.com/rsyntaxtextarea
 *
 * This library is distributed under a modified BSD license.  See the included
 * RSTALanguageSupport.License.txt file for details.
 */

import org.mozilla.javascript.ast.AstNode;

import org.mozilla.javascript.ast.Name;
import org.mozilla.javascript.ast.PropertyGet;

public class Main {
    public static final boolean isPrototypePropertyGet(PropertyGet pg) {
        return pg != null && pg.getLeft() instanceof Name && isPrototypeNameNode(pg.getRight());
    }

    public static final boolean isPrototypeNameNode(AstNode node) {
        return node instanceof Name && "prototype".equals(((Name) node).getIdentifier());
    }
}

Related

  1. isContained(AstNode mayAncestor, AstNode filial)
  2. isDefined(final Object object)
  3. isName(AstNode node, String value)
  4. isNullNativeObject(Object val)
  5. isPrototypeNameNode(AstNode node)
  6. isSimplePropertyGet(PropertyGet pg, String expectedObj, String expectedField)
  7. isStaticProperty(Scriptable property)
  8. isValid(Object[] args)
  9. isVariable(Name name)