docs: private Object[] getObjectIdsImpl(Context cx, Object object) {
          if (!(object instanceof Scriptable) || object == Undefined.instance) {
              return Context.emptyArgs;
          }
  
          Object[] ids;
          Scriptable scriptable = (Scriptable)object;
          if (scriptable instanceof DebuggableObject) {
              ids = ((DebuggableObject)scriptable).getAllIds();
          } else {
              ids = scriptable.getIds();
          }
  
          Scriptable proto = scriptable.getPrototype();
          Scriptable parent = scriptable.getParentScope();
          int extra = 0;
          if (proto != null) {
              ++extra;
          }
          if (parent != null) {
              ++extra;
          }
          if (extra != 0) {
              Object[] tmp = new Object[extra + ids.length];
              System.arraycopy(ids, 0, tmp, extra, ids.length);
              ids = tmp;
              extra = 0;
              if (proto != null) {
                  ids[extra++] = "__proto__";
              }
              if (parent != null) {
                  ids[extra++] = "__parent__";
              }
          }
  
          return ids;
      }