Update autosize, which should fix stack overflow error (#1560)

* Update to the latest version of autosize.js

* gitignore: Restrict 'dist' matches to the root dist folder

The global search for 'dist' caused problems when updateing bower
components.

* A couple minor version updates: ByteBuffer, filesize, intlTel

moment-with-localse, ProtoBuf
This commit is contained in:
Scott Nonnenberg 2017-10-13 11:44:35 -07:00 committed by GitHub
parent 3dc3667b45
commit fb7701576e
10 changed files with 398 additions and 202 deletions

View file

@ -16,7 +16,8 @@
/**
* @license ByteBuffer.js (c) 2013-2014 Daniel Wirtz <dcode@dcode.io>
* This version of ByteBuffer.js uses an ArrayBuffer (AB) as its backing buffer and is compatible with modern browsers.
* This version of ByteBuffer.js uses an ArrayBuffer as its backing buffer which is accessed through a DataView and is
* compatible with modern browsers.
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/ByteBuffer.js for details
*/ //
@ -116,7 +117,7 @@
* @const
* @expose
*/
ByteBuffer.VERSION = "3.5.4";
ByteBuffer.VERSION = "3.5.5";
/**
* Little endian constant that can be used instead of its boolean value. Evaluates to `true`.
@ -752,6 +753,8 @@
if (!this.noAssert) {
if (typeof value === 'number')
value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0)
@ -762,6 +765,8 @@
}
if (typeof value === 'number')
value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
offset += 8;
var capacity6 = this.buffer.byteLength;
if (offset > capacity6)
@ -831,6 +836,8 @@
if (!this.noAssert) {
if (typeof value === 'number')
value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0)
@ -841,6 +848,8 @@
}
if (typeof value === 'number')
value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
offset += 8;
var capacity7 = this.buffer.byteLength;
if (offset > capacity7)
@ -1237,6 +1246,8 @@
ByteBuffer.calculateVarint64 = function(value) {
if (typeof value === 'number')
value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
// ref: src/google/protobuf/io/coded_stream.cc
var part0 = value.toInt() >>> 0,
part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
@ -1266,6 +1277,8 @@
ByteBuffer.zigZagEncode64 = function(value) {
if (typeof value === 'number')
value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned();
// ref: src/google/protobuf/wire_format_lite.h
return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();
@ -1280,6 +1293,8 @@
ByteBuffer.zigZagDecode64 = function(value) {
if (typeof value === 'number')
value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned();
// ref: src/google/protobuf/wire_format_lite.h
return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();
@ -1299,6 +1314,8 @@
if (!this.noAssert) {
if (typeof value === 'number')
value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0)
@ -1309,6 +1326,8 @@
}
if (typeof value === 'number')
value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned();
var size = ByteBuffer.calculateVarint64(value),
part0 = value.toInt() >>> 0,
@ -1449,7 +1468,6 @@
if (offset < 0 || offset + 0 > this.buffer.byteLength)
throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
}
var start = offset;
// UTF8 strings do not contain zero bytes in between except for the zero character, so:
k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
offset += k+1;
@ -1462,7 +1480,7 @@
}.bind(this));
this.view.setUint8(offset++, 0);
if (relative) {
this.offset = offset - start;
this.offset = offset;
return this;
}
return k;
@ -1901,8 +1919,8 @@
};
/**
* Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents behind the specified
* offset up to the length of this ByteBuffer's data.
* Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents at and after the
specified offset up to the length of this ByteBuffer's data.
* @param {!ByteBuffer} target Target ByteBuffer
* @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
* read if omitted.