1 // Starting with ProtoBuf.js 4.X we are no longer bundling any ES5 polyfills with the library.
\r
2 // It is now up to the user to provide these as needed. For reference, this is what we use:
\r
4 // ref: https://developer.mozilla.org/de/docs/JavaScript/Reference/Global_Objects/Object/create
\r
7 Object.create = function (o) {
\r
8 if (arguments.length > 1)
\r
9 throw Error('illegal number of arguments');
\r
15 // ref: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
\r
18 Array.isArray = function(o) {
\r
19 return Object.prototype.toString.call(o) === "[object Array]";
\r
22 // ref: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
\r
23 if (!Array.prototype.forEach)
\r
25 Array.prototype.forEach = function(callback, thisArg) {
\r
28 throw new TypeError('this is null or not defined');
\r
29 var O = Object(this);
\r
30 var len = O.length >>> 0;
\r
31 if (typeof callback !== "function")
\r
32 throw new TypeError(callback + ' is not a function');
\r
33 if (arguments.length > 1)
\r
40 callback.call(T, kValue, k, O);
\r