Exemplo n.º 1
0
  private ScriptableObject getBuiltInDescriptor(String name) {
    Object value = null;
    int attr = EMPTY;

    Scriptable scope = getParentScope();
    if (scope == null) {
      scope = this;
    }

    int info = findInstanceIdInfo(name);
    if (info != 0) {
      int id = (info & 0xFFFF);
      value = getInstanceIdValue(id);
      attr = (info >>> 16);
      return buildDataDescriptor(scope, value, attr);
    }
    if (prototypeValues != null) {
      int id = prototypeValues.findId(name);
      if (id != 0) {
        value = prototypeValues.get(id);
        attr = prototypeValues.getAttributes(id);
        return buildDataDescriptor(scope, value, attr);
      }
    }
    return null;
  }
Exemplo n.º 2
0
 @Override
 public Object get(String name, Scriptable start) {
   int info = findInstanceIdInfo(name);
   if (info != 0) {
     int id = (info & 0xFFFF);
     Object value = getInstanceIdValue(id);
     if (value != NOT_FOUND) return value;
   }
   if (prototypeValues != null) {
     int id = prototypeValues.findId(name);
     if (id != 0) {
       Object value = prototypeValues.get(id);
       if (value != NOT_FOUND) return value;
     }
   }
   return super.get(name, start);
 }