From 3a9e652175fc380a2ae9ca3ba98a982580d8058d Mon Sep 17 00:00:00 2001 From: Romain Date: Tue, 22 Jul 2014 11:58:30 +0200 Subject: [PATCH] Add non enumable property to push* function of the Array prototype --- include/util.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/util.js b/include/util.js index 05c1ac32..0e94537c 100644 --- a/include/util.js +++ b/include/util.js @@ -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