Package org.mozilla.javascript

Examples of org.mozilla.javascript.PropertyDescriptor


  @Override
  public boolean observe(Map object, Object key, PropertyObserver observer) {
    if (object instanceof ScriptableObject) {
      ScriptableObject obj = (ScriptableObject) object;
      Context cx = Context.getCurrentContext();
      PropertyDescriptor desc = obj.getOwnPropertyDescriptor(cx, key);
      if (desc != null && desc.isDataDescriptor()) {
        ObserverGetterSetter getterSetter =
            new ObserverGetterSetter(obj, key, desc, observer);
        obj.defineOwnProperty(cx, key, new PropertyDescriptor(
            getterSetter,
            getterSetter,
            desc.isEnumerable(),
            desc.isConfigurable(),
            true));
      }
      return true;
    }
    return false;
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.PropertyDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.