* List implementation relying on an array or if supported on a Set to hold values.
*
* @author Alexander Ebert
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/List
*/
*/
function List() {
this._set = (_hasSet) ? new Set() : [];
- };
+ }
List.prototype = {
/**
* Appends an element to the list, silently rejects adding an already existing value.
*
- * @param {*} value unique element
+ * @param {?} value unique element
*/
add: function(value) {
if (_hasSet) {
/**
* Removes an element from the list, returns true if the element was in the list.
*
- * @param {*} value element
- * @return {boolean} true if element was in the list
+ * @param {?} value element
+ * @return {boolean} true if element was in the list
*/
'delete': function(value) {
if (_hasSet) {
/**
* Returns true if the list contains the element.
*
- * @param {*} value element
- * @return {boolean} true if element is in the list
+ * @param {?} value element
+ * @return {boolean} true if element is in the list
*/
has: function(value) {
if (_hasSet) {
enumerable: false,
configurable: true,
get: function() {
- if (_hasMap) {
+ if (_hasSet) {
return this._set.size;
}
else {