You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

XMLDOMStringList.js 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Generated by CoffeeScript 2.4.1
  2. (function() {
  3. // Represents a list of string entries
  4. var XMLDOMStringList;
  5. module.exports = XMLDOMStringList = (function() {
  6. class XMLDOMStringList {
  7. // Initializes a new instance of `XMLDOMStringList`
  8. // This is just a wrapper around an ordinary
  9. // JS array.
  10. // `arr` the array of string values
  11. constructor(arr) {
  12. this.arr = arr || [];
  13. }
  14. // Returns the indexth item in the collection.
  15. // `index` index into the collection
  16. item(index) {
  17. return this.arr[index] || null;
  18. }
  19. // Test if a string is part of this DOMStringList.
  20. // `str` the string to look for
  21. contains(str) {
  22. return this.arr.indexOf(str) !== -1;
  23. }
  24. };
  25. // Returns the number of strings in the list.
  26. Object.defineProperty(XMLDOMStringList.prototype, 'length', {
  27. get: function() {
  28. return this.arr.length;
  29. }
  30. });
  31. return XMLDOMStringList;
  32. }).call(this);
  33. }).call(this);