jsdom-se
Version:
jsdom fork for silent errors - A JavaScript implementation of the DOM and HTML standards
22 lines (19 loc) • 514 B
JavaScript
;
const filelistSymbols = require("./filelist-symbols");
module.exports = function (core) {
class FileList {
constructor() {
if (!(this instanceof FileList)) {
throw new TypeError("DOM object constructor cannot be called as a function.");
}
this[filelistSymbols.list] = [];
}
item(index) {
return this[filelistSymbols.list][index] || null;
}
get length() {
return this[filelistSymbols.list].length;
}
}
core.FileList = FileList;
};