prop)) {
      arr.push(prop);
    }
  }
  return arr;
}

function getEnumerableOwnProps2(obj) {
  return Object.getOwnPropertyNames(obj).filter(
    function (name) { return Object.getOwnPropertyDescriptor(obj, name).enumerable; })
}

test(function() {
  var el = document.createElement("div");
  el.setAttribute("a", "");
  el.setAttribute("b", "");
  assert_array_equals(getEnumerableOwnProps1(el.attributes),
                      ["0", "1"])
  assert_array_equals(getEnumerableOwnProps2(el.attributes),
    