Add non enumable property to push* function of the Array prototype
This commit is contained in:
parent
9b731d3a58
commit
3a9e652175
|
|
@ -21,17 +21,21 @@ var Util = {};
|
|||
Array.prototype.push8 = function (num) {
|
||||
this.push(num & 0xFF);
|
||||
};
|
||||
Object.defineProperty(Array.prototype, 'push8', {enumerable: false});
|
||||
|
||||
Array.prototype.push16 = function (num) {
|
||||
this.push((num >> 8) & 0xFF,
|
||||
(num ) & 0xFF );
|
||||
};
|
||||
Object.defineProperty(Array.prototype, 'push16', {enumerable: false});
|
||||
|
||||
Array.prototype.push32 = function (num) {
|
||||
this.push((num >> 24) & 0xFF,
|
||||
(num >> 16) & 0xFF,
|
||||
(num >> 8) & 0xFF,
|
||||
(num ) & 0xFF );
|
||||
};
|
||||
Object.defineProperty(Array.prototype, 'push32', {enumerable: false});
|
||||
|
||||
// IE does not support map (even in IE9)
|
||||
//This prototype is provided by the Mozilla foundation and
|
||||
|
|
|
|||
Loading…
Reference in New Issue