react 0.13.0-rc2 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/JSXTransformer.js +236 -209
- package/dist/react-with-addons.js +24 -13
- package/dist/react-with-addons.min.js +3 -3
- package/dist/react.js +24 -13
- package/dist/react.min.js +3 -3
- package/lib/React.js +1 -1
- package/lib/ReactComponent.js +2 -1
- package/lib/ReactCompositeComponent.js +14 -0
- package/lib/ReactDefaultPerf.js +4 -9
- package/lib/ReactPropTypes.js +2 -1
- package/package.json +1 -1
package/dist/JSXTransformer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* JSXTransformer v0.13.0
|
|
2
|
+
* JSXTransformer v0.13.0
|
|
3
3
|
*/
|
|
4
4
|
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.JSXTransformer = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
|
5
5
|
/**
|
|
@@ -503,33 +503,30 @@ Buffer.TYPED_ARRAY_SUPPORT = (function () {
|
|
|
503
503
|
* prototype.
|
|
504
504
|
*/
|
|
505
505
|
function Buffer (subject, encoding, noZero) {
|
|
506
|
-
if (!(this instanceof Buffer))
|
|
507
|
-
return new Buffer(subject, encoding, noZero)
|
|
506
|
+
if (!(this instanceof Buffer)) return new Buffer(subject, encoding, noZero)
|
|
508
507
|
|
|
509
508
|
var type = typeof subject
|
|
510
|
-
|
|
511
|
-
// Find the length
|
|
512
509
|
var length
|
|
510
|
+
|
|
513
511
|
if (type === 'number') {
|
|
514
512
|
length = +subject
|
|
515
513
|
} else if (type === 'string') {
|
|
516
514
|
length = Buffer.byteLength(subject, encoding)
|
|
517
|
-
} else if (type === 'object' && subject !== null) {
|
|
518
|
-
|
|
519
|
-
|
|
515
|
+
} else if (type === 'object' && subject !== null) {
|
|
516
|
+
// assume object is array-like
|
|
517
|
+
if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data
|
|
520
518
|
length = +subject.length
|
|
521
519
|
} else {
|
|
522
520
|
throw new TypeError('must start with number, buffer, array or string')
|
|
523
521
|
}
|
|
524
522
|
|
|
525
|
-
if (length > kMaxLength)
|
|
526
|
-
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
|
|
527
|
-
|
|
523
|
+
if (length > kMaxLength) {
|
|
524
|
+
throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +
|
|
525
|
+
kMaxLength.toString(16) + ' bytes')
|
|
526
|
+
}
|
|
528
527
|
|
|
529
|
-
if (length < 0)
|
|
530
|
-
|
|
531
|
-
else
|
|
532
|
-
length >>>= 0 // Coerce to uint32.
|
|
528
|
+
if (length < 0) length = 0
|
|
529
|
+
else length >>>= 0 // coerce to uint32
|
|
533
530
|
|
|
534
531
|
var self = this
|
|
535
532
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
@@ -550,11 +547,13 @@ function Buffer (subject, encoding, noZero) {
|
|
|
550
547
|
} else if (isArrayish(subject)) {
|
|
551
548
|
// Treat array-ish objects as a byte array
|
|
552
549
|
if (Buffer.isBuffer(subject)) {
|
|
553
|
-
for (i = 0; i < length; i++)
|
|
550
|
+
for (i = 0; i < length; i++) {
|
|
554
551
|
self[i] = subject.readUInt8(i)
|
|
552
|
+
}
|
|
555
553
|
} else {
|
|
556
|
-
for (i = 0; i < length; i++)
|
|
554
|
+
for (i = 0; i < length; i++) {
|
|
557
555
|
self[i] = ((subject[i] % 256) + 256) % 256
|
|
556
|
+
}
|
|
558
557
|
}
|
|
559
558
|
} else if (type === 'string') {
|
|
560
559
|
self.write(subject, 0, encoding)
|
|
@@ -564,28 +563,27 @@ function Buffer (subject, encoding, noZero) {
|
|
|
564
563
|
}
|
|
565
564
|
}
|
|
566
565
|
|
|
567
|
-
if (length > 0 && length <= Buffer.poolSize)
|
|
568
|
-
self.parent = rootParent
|
|
566
|
+
if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent
|
|
569
567
|
|
|
570
568
|
return self
|
|
571
569
|
}
|
|
572
570
|
|
|
573
571
|
function SlowBuffer (subject, encoding, noZero) {
|
|
574
|
-
if (!(this instanceof SlowBuffer))
|
|
575
|
-
return new SlowBuffer(subject, encoding, noZero)
|
|
572
|
+
if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding, noZero)
|
|
576
573
|
|
|
577
574
|
var buf = new Buffer(subject, encoding, noZero)
|
|
578
575
|
delete buf.parent
|
|
579
576
|
return buf
|
|
580
577
|
}
|
|
581
578
|
|
|
582
|
-
Buffer.isBuffer = function (b) {
|
|
579
|
+
Buffer.isBuffer = function isBuffer (b) {
|
|
583
580
|
return !!(b != null && b._isBuffer)
|
|
584
581
|
}
|
|
585
582
|
|
|
586
|
-
Buffer.compare = function (a, b) {
|
|
587
|
-
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b))
|
|
583
|
+
Buffer.compare = function compare (a, b) {
|
|
584
|
+
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
|
|
588
585
|
throw new TypeError('Arguments must be Buffers')
|
|
586
|
+
}
|
|
589
587
|
|
|
590
588
|
if (a === b) return 0
|
|
591
589
|
|
|
@@ -601,7 +599,7 @@ Buffer.compare = function (a, b) {
|
|
|
601
599
|
return 0
|
|
602
600
|
}
|
|
603
601
|
|
|
604
|
-
Buffer.isEncoding = function (encoding) {
|
|
602
|
+
Buffer.isEncoding = function isEncoding (encoding) {
|
|
605
603
|
switch (String(encoding).toLowerCase()) {
|
|
606
604
|
case 'hex':
|
|
607
605
|
case 'utf8':
|
|
@@ -620,7 +618,7 @@ Buffer.isEncoding = function (encoding) {
|
|
|
620
618
|
}
|
|
621
619
|
}
|
|
622
620
|
|
|
623
|
-
Buffer.concat = function (list, totalLength) {
|
|
621
|
+
Buffer.concat = function concat (list, totalLength) {
|
|
624
622
|
if (!isArray(list)) throw new TypeError('Usage: Buffer.concat(list[, length])')
|
|
625
623
|
|
|
626
624
|
if (list.length === 0) {
|
|
@@ -647,7 +645,7 @@ Buffer.concat = function (list, totalLength) {
|
|
|
647
645
|
return buf
|
|
648
646
|
}
|
|
649
647
|
|
|
650
|
-
Buffer.byteLength = function (str, encoding) {
|
|
648
|
+
Buffer.byteLength = function byteLength (str, encoding) {
|
|
651
649
|
var ret
|
|
652
650
|
str = str + ''
|
|
653
651
|
switch (encoding || 'utf8') {
|
|
@@ -683,7 +681,7 @@ Buffer.prototype.length = undefined
|
|
|
683
681
|
Buffer.prototype.parent = undefined
|
|
684
682
|
|
|
685
683
|
// toString(encoding, start=0, end=buffer.length)
|
|
686
|
-
Buffer.prototype.toString = function (encoding, start, end) {
|
|
684
|
+
Buffer.prototype.toString = function toString (encoding, start, end) {
|
|
687
685
|
var loweredCase = false
|
|
688
686
|
|
|
689
687
|
start = start >>> 0
|
|
@@ -719,45 +717,84 @@ Buffer.prototype.toString = function (encoding, start, end) {
|
|
|
719
717
|
return utf16leSlice(this, start, end)
|
|
720
718
|
|
|
721
719
|
default:
|
|
722
|
-
if (loweredCase)
|
|
723
|
-
throw new TypeError('Unknown encoding: ' + encoding)
|
|
720
|
+
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
|
|
724
721
|
encoding = (encoding + '').toLowerCase()
|
|
725
722
|
loweredCase = true
|
|
726
723
|
}
|
|
727
724
|
}
|
|
728
725
|
}
|
|
729
726
|
|
|
730
|
-
Buffer.prototype.equals = function (b) {
|
|
727
|
+
Buffer.prototype.equals = function equals (b) {
|
|
731
728
|
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
|
|
732
729
|
if (this === b) return true
|
|
733
730
|
return Buffer.compare(this, b) === 0
|
|
734
731
|
}
|
|
735
732
|
|
|
736
|
-
Buffer.prototype.inspect = function () {
|
|
733
|
+
Buffer.prototype.inspect = function inspect () {
|
|
737
734
|
var str = ''
|
|
738
735
|
var max = exports.INSPECT_MAX_BYTES
|
|
739
736
|
if (this.length > 0) {
|
|
740
737
|
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
|
|
741
|
-
if (this.length > max)
|
|
742
|
-
str += ' ... '
|
|
738
|
+
if (this.length > max) str += ' ... '
|
|
743
739
|
}
|
|
744
740
|
return '<Buffer ' + str + '>'
|
|
745
741
|
}
|
|
746
742
|
|
|
747
|
-
Buffer.prototype.compare = function (b) {
|
|
743
|
+
Buffer.prototype.compare = function compare (b) {
|
|
748
744
|
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
|
|
749
745
|
if (this === b) return 0
|
|
750
746
|
return Buffer.compare(this, b)
|
|
751
747
|
}
|
|
752
748
|
|
|
749
|
+
Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
|
|
750
|
+
if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff
|
|
751
|
+
else if (byteOffset < -0x80000000) byteOffset = -0x80000000
|
|
752
|
+
byteOffset >>= 0
|
|
753
|
+
|
|
754
|
+
if (this.length === 0) return -1
|
|
755
|
+
if (byteOffset >= this.length) return -1
|
|
756
|
+
|
|
757
|
+
// Negative offsets start from the end of the buffer
|
|
758
|
+
if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0)
|
|
759
|
+
|
|
760
|
+
if (typeof val === 'string') {
|
|
761
|
+
if (val.length === 0) return -1 // special case: looking for empty string always fails
|
|
762
|
+
return String.prototype.indexOf.call(this, val, byteOffset)
|
|
763
|
+
}
|
|
764
|
+
if (Buffer.isBuffer(val)) {
|
|
765
|
+
return arrayIndexOf(this, val, byteOffset)
|
|
766
|
+
}
|
|
767
|
+
if (typeof val === 'number') {
|
|
768
|
+
if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {
|
|
769
|
+
return Uint8Array.prototype.indexOf.call(this, val, byteOffset)
|
|
770
|
+
}
|
|
771
|
+
return arrayIndexOf(this, [ val ], byteOffset)
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
function arrayIndexOf (arr, val, byteOffset) {
|
|
775
|
+
var foundIndex = -1
|
|
776
|
+
for (var i = 0; byteOffset + i < arr.length; i++) {
|
|
777
|
+
if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) {
|
|
778
|
+
if (foundIndex === -1) foundIndex = i
|
|
779
|
+
if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex
|
|
780
|
+
} else {
|
|
781
|
+
foundIndex = -1
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
return -1
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
throw new TypeError('val must be string, number or Buffer')
|
|
788
|
+
}
|
|
789
|
+
|
|
753
790
|
// `get` will be removed in Node 0.13+
|
|
754
|
-
Buffer.prototype.get = function (offset) {
|
|
791
|
+
Buffer.prototype.get = function get (offset) {
|
|
755
792
|
console.log('.get() is deprecated. Access using array indexes instead.')
|
|
756
793
|
return this.readUInt8(offset)
|
|
757
794
|
}
|
|
758
795
|
|
|
759
796
|
// `set` will be removed in Node 0.13+
|
|
760
|
-
Buffer.prototype.set = function (v, offset) {
|
|
797
|
+
Buffer.prototype.set = function set (v, offset) {
|
|
761
798
|
console.log('.set() is deprecated. Access using array indexes instead.')
|
|
762
799
|
return this.writeUInt8(v, offset)
|
|
763
800
|
}
|
|
@@ -782,9 +819,9 @@ function hexWrite (buf, string, offset, length) {
|
|
|
782
819
|
length = strLen / 2
|
|
783
820
|
}
|
|
784
821
|
for (var i = 0; i < length; i++) {
|
|
785
|
-
var
|
|
786
|
-
if (isNaN(
|
|
787
|
-
buf[offset + i] =
|
|
822
|
+
var parsed = parseInt(string.substr(i * 2, 2), 16)
|
|
823
|
+
if (isNaN(parsed)) throw new Error('Invalid hex string')
|
|
824
|
+
buf[offset + i] = parsed
|
|
788
825
|
}
|
|
789
826
|
return i
|
|
790
827
|
}
|
|
@@ -813,7 +850,7 @@ function utf16leWrite (buf, string, offset, length) {
|
|
|
813
850
|
return charsWritten
|
|
814
851
|
}
|
|
815
852
|
|
|
816
|
-
Buffer.prototype.write = function (string, offset, length, encoding) {
|
|
853
|
+
Buffer.prototype.write = function write (string, offset, length, encoding) {
|
|
817
854
|
// Support both (string, offset, length, encoding)
|
|
818
855
|
// and the legacy (string, encoding, offset, length)
|
|
819
856
|
if (isFinite(offset)) {
|
|
@@ -830,8 +867,9 @@ Buffer.prototype.write = function (string, offset, length, encoding) {
|
|
|
830
867
|
|
|
831
868
|
offset = Number(offset) || 0
|
|
832
869
|
|
|
833
|
-
if (length < 0 || offset < 0 || offset > this.length)
|
|
870
|
+
if (length < 0 || offset < 0 || offset > this.length) {
|
|
834
871
|
throw new RangeError('attempt to write outside buffer bounds')
|
|
872
|
+
}
|
|
835
873
|
|
|
836
874
|
var remaining = this.length - offset
|
|
837
875
|
if (!length) {
|
|
@@ -874,7 +912,7 @@ Buffer.prototype.write = function (string, offset, length, encoding) {
|
|
|
874
912
|
return ret
|
|
875
913
|
}
|
|
876
914
|
|
|
877
|
-
Buffer.prototype.toJSON = function () {
|
|
915
|
+
Buffer.prototype.toJSON = function toJSON () {
|
|
878
916
|
return {
|
|
879
917
|
type: 'Buffer',
|
|
880
918
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
@@ -948,29 +986,26 @@ function utf16leSlice (buf, start, end) {
|
|
|
948
986
|
return res
|
|
949
987
|
}
|
|
950
988
|
|
|
951
|
-
Buffer.prototype.slice = function (start, end) {
|
|
989
|
+
Buffer.prototype.slice = function slice (start, end) {
|
|
952
990
|
var len = this.length
|
|
953
991
|
start = ~~start
|
|
954
992
|
end = end === undefined ? len : ~~end
|
|
955
993
|
|
|
956
994
|
if (start < 0) {
|
|
957
995
|
start += len
|
|
958
|
-
if (start < 0)
|
|
959
|
-
start = 0
|
|
996
|
+
if (start < 0) start = 0
|
|
960
997
|
} else if (start > len) {
|
|
961
998
|
start = len
|
|
962
999
|
}
|
|
963
1000
|
|
|
964
1001
|
if (end < 0) {
|
|
965
1002
|
end += len
|
|
966
|
-
if (end < 0)
|
|
967
|
-
end = 0
|
|
1003
|
+
if (end < 0) end = 0
|
|
968
1004
|
} else if (end > len) {
|
|
969
1005
|
end = len
|
|
970
1006
|
}
|
|
971
1007
|
|
|
972
|
-
if (end < start)
|
|
973
|
-
end = start
|
|
1008
|
+
if (end < start) end = start
|
|
974
1009
|
|
|
975
1010
|
var newBuf
|
|
976
1011
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
@@ -983,8 +1018,7 @@ Buffer.prototype.slice = function (start, end) {
|
|
|
983
1018
|
}
|
|
984
1019
|
}
|
|
985
1020
|
|
|
986
|
-
if (newBuf.length)
|
|
987
|
-
newBuf.parent = this.parent || this
|
|
1021
|
+
if (newBuf.length) newBuf.parent = this.parent || this
|
|
988
1022
|
|
|
989
1023
|
return newBuf
|
|
990
1024
|
}
|
|
@@ -993,62 +1027,58 @@ Buffer.prototype.slice = function (start, end) {
|
|
|
993
1027
|
* Need to make sure that buffer isn't trying to write out of bounds.
|
|
994
1028
|
*/
|
|
995
1029
|
function checkOffset (offset, ext, length) {
|
|
996
|
-
if ((offset % 1) !== 0 || offset < 0)
|
|
997
|
-
|
|
998
|
-
if (offset + ext > length)
|
|
999
|
-
throw new RangeError('Trying to access beyond buffer length')
|
|
1030
|
+
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
|
|
1031
|
+
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
|
|
1000
1032
|
}
|
|
1001
1033
|
|
|
1002
|
-
Buffer.prototype.readUIntLE = function (offset, byteLength, noAssert) {
|
|
1034
|
+
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
|
|
1003
1035
|
offset = offset >>> 0
|
|
1004
1036
|
byteLength = byteLength >>> 0
|
|
1005
|
-
if (!noAssert)
|
|
1006
|
-
checkOffset(offset, byteLength, this.length)
|
|
1037
|
+
if (!noAssert) checkOffset(offset, byteLength, this.length)
|
|
1007
1038
|
|
|
1008
1039
|
var val = this[offset]
|
|
1009
1040
|
var mul = 1
|
|
1010
1041
|
var i = 0
|
|
1011
|
-
while (++i < byteLength && (mul *= 0x100))
|
|
1042
|
+
while (++i < byteLength && (mul *= 0x100)) {
|
|
1012
1043
|
val += this[offset + i] * mul
|
|
1044
|
+
}
|
|
1013
1045
|
|
|
1014
1046
|
return val
|
|
1015
1047
|
}
|
|
1016
1048
|
|
|
1017
|
-
Buffer.prototype.readUIntBE = function (offset, byteLength, noAssert) {
|
|
1049
|
+
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
|
|
1018
1050
|
offset = offset >>> 0
|
|
1019
1051
|
byteLength = byteLength >>> 0
|
|
1020
|
-
if (!noAssert)
|
|
1052
|
+
if (!noAssert) {
|
|
1021
1053
|
checkOffset(offset, byteLength, this.length)
|
|
1054
|
+
}
|
|
1022
1055
|
|
|
1023
1056
|
var val = this[offset + --byteLength]
|
|
1024
1057
|
var mul = 1
|
|
1025
|
-
while (byteLength > 0 && (mul *= 0x100))
|
|
1058
|
+
while (byteLength > 0 && (mul *= 0x100)) {
|
|
1026
1059
|
val += this[offset + --byteLength] * mul
|
|
1060
|
+
}
|
|
1027
1061
|
|
|
1028
1062
|
return val
|
|
1029
1063
|
}
|
|
1030
1064
|
|
|
1031
|
-
Buffer.prototype.readUInt8 = function (offset, noAssert) {
|
|
1032
|
-
if (!noAssert)
|
|
1033
|
-
checkOffset(offset, 1, this.length)
|
|
1065
|
+
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
|
|
1066
|
+
if (!noAssert) checkOffset(offset, 1, this.length)
|
|
1034
1067
|
return this[offset]
|
|
1035
1068
|
}
|
|
1036
1069
|
|
|
1037
|
-
Buffer.prototype.readUInt16LE = function (offset, noAssert) {
|
|
1038
|
-
if (!noAssert)
|
|
1039
|
-
checkOffset(offset, 2, this.length)
|
|
1070
|
+
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
|
|
1071
|
+
if (!noAssert) checkOffset(offset, 2, this.length)
|
|
1040
1072
|
return this[offset] | (this[offset + 1] << 8)
|
|
1041
1073
|
}
|
|
1042
1074
|
|
|
1043
|
-
Buffer.prototype.readUInt16BE = function (offset, noAssert) {
|
|
1044
|
-
if (!noAssert)
|
|
1045
|
-
checkOffset(offset, 2, this.length)
|
|
1075
|
+
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
|
|
1076
|
+
if (!noAssert) checkOffset(offset, 2, this.length)
|
|
1046
1077
|
return (this[offset] << 8) | this[offset + 1]
|
|
1047
1078
|
}
|
|
1048
1079
|
|
|
1049
|
-
Buffer.prototype.readUInt32LE = function (offset, noAssert) {
|
|
1050
|
-
if (!noAssert)
|
|
1051
|
-
checkOffset(offset, 4, this.length)
|
|
1080
|
+
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
|
|
1081
|
+
if (!noAssert) checkOffset(offset, 4, this.length)
|
|
1052
1082
|
|
|
1053
1083
|
return ((this[offset]) |
|
|
1054
1084
|
(this[offset + 1] << 8) |
|
|
@@ -1056,117 +1086,104 @@ Buffer.prototype.readUInt32LE = function (offset, noAssert) {
|
|
|
1056
1086
|
(this[offset + 3] * 0x1000000)
|
|
1057
1087
|
}
|
|
1058
1088
|
|
|
1059
|
-
Buffer.prototype.readUInt32BE = function (offset, noAssert) {
|
|
1060
|
-
if (!noAssert)
|
|
1061
|
-
checkOffset(offset, 4, this.length)
|
|
1089
|
+
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
|
|
1090
|
+
if (!noAssert) checkOffset(offset, 4, this.length)
|
|
1062
1091
|
|
|
1063
1092
|
return (this[offset] * 0x1000000) +
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1093
|
+
((this[offset + 1] << 16) |
|
|
1094
|
+
(this[offset + 2] << 8) |
|
|
1095
|
+
this[offset + 3])
|
|
1067
1096
|
}
|
|
1068
1097
|
|
|
1069
|
-
Buffer.prototype.readIntLE = function (offset, byteLength, noAssert) {
|
|
1098
|
+
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
|
|
1070
1099
|
offset = offset >>> 0
|
|
1071
1100
|
byteLength = byteLength >>> 0
|
|
1072
|
-
if (!noAssert)
|
|
1073
|
-
checkOffset(offset, byteLength, this.length)
|
|
1101
|
+
if (!noAssert) checkOffset(offset, byteLength, this.length)
|
|
1074
1102
|
|
|
1075
1103
|
var val = this[offset]
|
|
1076
1104
|
var mul = 1
|
|
1077
1105
|
var i = 0
|
|
1078
|
-
while (++i < byteLength && (mul *= 0x100))
|
|
1106
|
+
while (++i < byteLength && (mul *= 0x100)) {
|
|
1079
1107
|
val += this[offset + i] * mul
|
|
1108
|
+
}
|
|
1080
1109
|
mul *= 0x80
|
|
1081
1110
|
|
|
1082
|
-
if (val >= mul)
|
|
1083
|
-
val -= Math.pow(2, 8 * byteLength)
|
|
1111
|
+
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
|
|
1084
1112
|
|
|
1085
1113
|
return val
|
|
1086
1114
|
}
|
|
1087
1115
|
|
|
1088
|
-
Buffer.prototype.readIntBE = function (offset, byteLength, noAssert) {
|
|
1116
|
+
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
|
|
1089
1117
|
offset = offset >>> 0
|
|
1090
1118
|
byteLength = byteLength >>> 0
|
|
1091
|
-
if (!noAssert)
|
|
1092
|
-
checkOffset(offset, byteLength, this.length)
|
|
1119
|
+
if (!noAssert) checkOffset(offset, byteLength, this.length)
|
|
1093
1120
|
|
|
1094
1121
|
var i = byteLength
|
|
1095
1122
|
var mul = 1
|
|
1096
1123
|
var val = this[offset + --i]
|
|
1097
|
-
while (i > 0 && (mul *= 0x100))
|
|
1124
|
+
while (i > 0 && (mul *= 0x100)) {
|
|
1098
1125
|
val += this[offset + --i] * mul
|
|
1126
|
+
}
|
|
1099
1127
|
mul *= 0x80
|
|
1100
1128
|
|
|
1101
|
-
if (val >= mul)
|
|
1102
|
-
val -= Math.pow(2, 8 * byteLength)
|
|
1129
|
+
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
|
|
1103
1130
|
|
|
1104
1131
|
return val
|
|
1105
1132
|
}
|
|
1106
1133
|
|
|
1107
|
-
Buffer.prototype.readInt8 = function (offset, noAssert) {
|
|
1108
|
-
if (!noAssert)
|
|
1109
|
-
|
|
1110
|
-
if (!(this[offset] & 0x80))
|
|
1111
|
-
return (this[offset])
|
|
1134
|
+
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
|
|
1135
|
+
if (!noAssert) checkOffset(offset, 1, this.length)
|
|
1136
|
+
if (!(this[offset] & 0x80)) return (this[offset])
|
|
1112
1137
|
return ((0xff - this[offset] + 1) * -1)
|
|
1113
1138
|
}
|
|
1114
1139
|
|
|
1115
|
-
Buffer.prototype.readInt16LE = function (offset, noAssert) {
|
|
1116
|
-
if (!noAssert)
|
|
1117
|
-
checkOffset(offset, 2, this.length)
|
|
1140
|
+
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
|
|
1141
|
+
if (!noAssert) checkOffset(offset, 2, this.length)
|
|
1118
1142
|
var val = this[offset] | (this[offset + 1] << 8)
|
|
1119
1143
|
return (val & 0x8000) ? val | 0xFFFF0000 : val
|
|
1120
1144
|
}
|
|
1121
1145
|
|
|
1122
|
-
Buffer.prototype.readInt16BE = function (offset, noAssert) {
|
|
1123
|
-
if (!noAssert)
|
|
1124
|
-
checkOffset(offset, 2, this.length)
|
|
1146
|
+
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
|
|
1147
|
+
if (!noAssert) checkOffset(offset, 2, this.length)
|
|
1125
1148
|
var val = this[offset + 1] | (this[offset] << 8)
|
|
1126
1149
|
return (val & 0x8000) ? val | 0xFFFF0000 : val
|
|
1127
1150
|
}
|
|
1128
1151
|
|
|
1129
|
-
Buffer.prototype.readInt32LE = function (offset, noAssert) {
|
|
1130
|
-
if (!noAssert)
|
|
1131
|
-
checkOffset(offset, 4, this.length)
|
|
1152
|
+
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
|
|
1153
|
+
if (!noAssert) checkOffset(offset, 4, this.length)
|
|
1132
1154
|
|
|
1133
1155
|
return (this[offset]) |
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1156
|
+
(this[offset + 1] << 8) |
|
|
1157
|
+
(this[offset + 2] << 16) |
|
|
1158
|
+
(this[offset + 3] << 24)
|
|
1137
1159
|
}
|
|
1138
1160
|
|
|
1139
|
-
Buffer.prototype.readInt32BE = function (offset, noAssert) {
|
|
1140
|
-
if (!noAssert)
|
|
1141
|
-
checkOffset(offset, 4, this.length)
|
|
1161
|
+
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
|
|
1162
|
+
if (!noAssert) checkOffset(offset, 4, this.length)
|
|
1142
1163
|
|
|
1143
1164
|
return (this[offset] << 24) |
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1165
|
+
(this[offset + 1] << 16) |
|
|
1166
|
+
(this[offset + 2] << 8) |
|
|
1167
|
+
(this[offset + 3])
|
|
1147
1168
|
}
|
|
1148
1169
|
|
|
1149
|
-
Buffer.prototype.readFloatLE = function (offset, noAssert) {
|
|
1150
|
-
if (!noAssert)
|
|
1151
|
-
checkOffset(offset, 4, this.length)
|
|
1170
|
+
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
|
|
1171
|
+
if (!noAssert) checkOffset(offset, 4, this.length)
|
|
1152
1172
|
return ieee754.read(this, offset, true, 23, 4)
|
|
1153
1173
|
}
|
|
1154
1174
|
|
|
1155
|
-
Buffer.prototype.readFloatBE = function (offset, noAssert) {
|
|
1156
|
-
if (!noAssert)
|
|
1157
|
-
checkOffset(offset, 4, this.length)
|
|
1175
|
+
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
|
|
1176
|
+
if (!noAssert) checkOffset(offset, 4, this.length)
|
|
1158
1177
|
return ieee754.read(this, offset, false, 23, 4)
|
|
1159
1178
|
}
|
|
1160
1179
|
|
|
1161
|
-
Buffer.prototype.readDoubleLE = function (offset, noAssert) {
|
|
1162
|
-
if (!noAssert)
|
|
1163
|
-
checkOffset(offset, 8, this.length)
|
|
1180
|
+
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
|
|
1181
|
+
if (!noAssert) checkOffset(offset, 8, this.length)
|
|
1164
1182
|
return ieee754.read(this, offset, true, 52, 8)
|
|
1165
1183
|
}
|
|
1166
1184
|
|
|
1167
|
-
Buffer.prototype.readDoubleBE = function (offset, noAssert) {
|
|
1168
|
-
if (!noAssert)
|
|
1169
|
-
checkOffset(offset, 8, this.length)
|
|
1185
|
+
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
|
|
1186
|
+
if (!noAssert) checkOffset(offset, 8, this.length)
|
|
1170
1187
|
return ieee754.read(this, offset, false, 52, 8)
|
|
1171
1188
|
}
|
|
1172
1189
|
|
|
@@ -1176,43 +1193,42 @@ function checkInt (buf, value, offset, ext, max, min) {
|
|
|
1176
1193
|
if (offset + ext > buf.length) throw new RangeError('index out of range')
|
|
1177
1194
|
}
|
|
1178
1195
|
|
|
1179
|
-
Buffer.prototype.writeUIntLE = function (value, offset, byteLength, noAssert) {
|
|
1196
|
+
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
|
|
1180
1197
|
value = +value
|
|
1181
1198
|
offset = offset >>> 0
|
|
1182
1199
|
byteLength = byteLength >>> 0
|
|
1183
|
-
if (!noAssert)
|
|
1184
|
-
checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
|
|
1200
|
+
if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
|
|
1185
1201
|
|
|
1186
1202
|
var mul = 1
|
|
1187
1203
|
var i = 0
|
|
1188
1204
|
this[offset] = value & 0xFF
|
|
1189
|
-
while (++i < byteLength && (mul *= 0x100))
|
|
1205
|
+
while (++i < byteLength && (mul *= 0x100)) {
|
|
1190
1206
|
this[offset + i] = (value / mul) >>> 0 & 0xFF
|
|
1207
|
+
}
|
|
1191
1208
|
|
|
1192
1209
|
return offset + byteLength
|
|
1193
1210
|
}
|
|
1194
1211
|
|
|
1195
|
-
Buffer.prototype.writeUIntBE = function (value, offset, byteLength, noAssert) {
|
|
1212
|
+
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
|
|
1196
1213
|
value = +value
|
|
1197
1214
|
offset = offset >>> 0
|
|
1198
1215
|
byteLength = byteLength >>> 0
|
|
1199
|
-
if (!noAssert)
|
|
1200
|
-
checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
|
|
1216
|
+
if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
|
|
1201
1217
|
|
|
1202
1218
|
var i = byteLength - 1
|
|
1203
1219
|
var mul = 1
|
|
1204
1220
|
this[offset + i] = value & 0xFF
|
|
1205
|
-
while (--i >= 0 && (mul *= 0x100))
|
|
1221
|
+
while (--i >= 0 && (mul *= 0x100)) {
|
|
1206
1222
|
this[offset + i] = (value / mul) >>> 0 & 0xFF
|
|
1223
|
+
}
|
|
1207
1224
|
|
|
1208
1225
|
return offset + byteLength
|
|
1209
1226
|
}
|
|
1210
1227
|
|
|
1211
|
-
Buffer.prototype.writeUInt8 = function (value, offset, noAssert) {
|
|
1228
|
+
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
|
|
1212
1229
|
value = +value
|
|
1213
1230
|
offset = offset >>> 0
|
|
1214
|
-
if (!noAssert)
|
|
1215
|
-
checkInt(this, value, offset, 1, 0xff, 0)
|
|
1231
|
+
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
|
|
1216
1232
|
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
|
|
1217
1233
|
this[offset] = value
|
|
1218
1234
|
return offset + 1
|
|
@@ -1226,27 +1242,29 @@ function objectWriteUInt16 (buf, value, offset, littleEndian) {
|
|
|
1226
1242
|
}
|
|
1227
1243
|
}
|
|
1228
1244
|
|
|
1229
|
-
Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) {
|
|
1245
|
+
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
|
|
1230
1246
|
value = +value
|
|
1231
1247
|
offset = offset >>> 0
|
|
1232
|
-
if (!noAssert)
|
|
1233
|
-
checkInt(this, value, offset, 2, 0xffff, 0)
|
|
1248
|
+
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
|
|
1234
1249
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1235
1250
|
this[offset] = value
|
|
1236
1251
|
this[offset + 1] = (value >>> 8)
|
|
1237
|
-
} else
|
|
1252
|
+
} else {
|
|
1253
|
+
objectWriteUInt16(this, value, offset, true)
|
|
1254
|
+
}
|
|
1238
1255
|
return offset + 2
|
|
1239
1256
|
}
|
|
1240
1257
|
|
|
1241
|
-
Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) {
|
|
1258
|
+
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
|
|
1242
1259
|
value = +value
|
|
1243
1260
|
offset = offset >>> 0
|
|
1244
|
-
if (!noAssert)
|
|
1245
|
-
checkInt(this, value, offset, 2, 0xffff, 0)
|
|
1261
|
+
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
|
|
1246
1262
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1247
1263
|
this[offset] = (value >>> 8)
|
|
1248
1264
|
this[offset + 1] = value
|
|
1249
|
-
} else
|
|
1265
|
+
} else {
|
|
1266
|
+
objectWriteUInt16(this, value, offset, false)
|
|
1267
|
+
}
|
|
1250
1268
|
return offset + 2
|
|
1251
1269
|
}
|
|
1252
1270
|
|
|
@@ -1257,139 +1275,144 @@ function objectWriteUInt32 (buf, value, offset, littleEndian) {
|
|
|
1257
1275
|
}
|
|
1258
1276
|
}
|
|
1259
1277
|
|
|
1260
|
-
Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) {
|
|
1278
|
+
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
|
|
1261
1279
|
value = +value
|
|
1262
1280
|
offset = offset >>> 0
|
|
1263
|
-
if (!noAssert)
|
|
1264
|
-
checkInt(this, value, offset, 4, 0xffffffff, 0)
|
|
1281
|
+
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
|
|
1265
1282
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1266
1283
|
this[offset + 3] = (value >>> 24)
|
|
1267
1284
|
this[offset + 2] = (value >>> 16)
|
|
1268
1285
|
this[offset + 1] = (value >>> 8)
|
|
1269
1286
|
this[offset] = value
|
|
1270
|
-
} else
|
|
1287
|
+
} else {
|
|
1288
|
+
objectWriteUInt32(this, value, offset, true)
|
|
1289
|
+
}
|
|
1271
1290
|
return offset + 4
|
|
1272
1291
|
}
|
|
1273
1292
|
|
|
1274
|
-
Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) {
|
|
1293
|
+
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
|
|
1275
1294
|
value = +value
|
|
1276
1295
|
offset = offset >>> 0
|
|
1277
|
-
if (!noAssert)
|
|
1278
|
-
checkInt(this, value, offset, 4, 0xffffffff, 0)
|
|
1296
|
+
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
|
|
1279
1297
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1280
1298
|
this[offset] = (value >>> 24)
|
|
1281
1299
|
this[offset + 1] = (value >>> 16)
|
|
1282
1300
|
this[offset + 2] = (value >>> 8)
|
|
1283
1301
|
this[offset + 3] = value
|
|
1284
|
-
} else
|
|
1302
|
+
} else {
|
|
1303
|
+
objectWriteUInt32(this, value, offset, false)
|
|
1304
|
+
}
|
|
1285
1305
|
return offset + 4
|
|
1286
1306
|
}
|
|
1287
1307
|
|
|
1288
|
-
Buffer.prototype.writeIntLE = function (value, offset, byteLength, noAssert) {
|
|
1308
|
+
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
|
|
1289
1309
|
value = +value
|
|
1290
1310
|
offset = offset >>> 0
|
|
1291
1311
|
if (!noAssert) {
|
|
1292
|
-
checkInt(
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
-Math.pow(2, 8 * byteLength - 1))
|
|
1312
|
+
checkInt(
|
|
1313
|
+
this, value, offset, byteLength,
|
|
1314
|
+
Math.pow(2, 8 * byteLength - 1) - 1,
|
|
1315
|
+
-Math.pow(2, 8 * byteLength - 1)
|
|
1316
|
+
)
|
|
1298
1317
|
}
|
|
1299
1318
|
|
|
1300
1319
|
var i = 0
|
|
1301
1320
|
var mul = 1
|
|
1302
1321
|
var sub = value < 0 ? 1 : 0
|
|
1303
1322
|
this[offset] = value & 0xFF
|
|
1304
|
-
while (++i < byteLength && (mul *= 0x100))
|
|
1323
|
+
while (++i < byteLength && (mul *= 0x100)) {
|
|
1305
1324
|
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
|
|
1325
|
+
}
|
|
1306
1326
|
|
|
1307
1327
|
return offset + byteLength
|
|
1308
1328
|
}
|
|
1309
1329
|
|
|
1310
|
-
Buffer.prototype.writeIntBE = function (value, offset, byteLength, noAssert) {
|
|
1330
|
+
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
|
|
1311
1331
|
value = +value
|
|
1312
1332
|
offset = offset >>> 0
|
|
1313
1333
|
if (!noAssert) {
|
|
1314
|
-
checkInt(
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
-Math.pow(2, 8 * byteLength - 1))
|
|
1334
|
+
checkInt(
|
|
1335
|
+
this, value, offset, byteLength,
|
|
1336
|
+
Math.pow(2, 8 * byteLength - 1) - 1,
|
|
1337
|
+
-Math.pow(2, 8 * byteLength - 1)
|
|
1338
|
+
)
|
|
1320
1339
|
}
|
|
1321
1340
|
|
|
1322
1341
|
var i = byteLength - 1
|
|
1323
1342
|
var mul = 1
|
|
1324
1343
|
var sub = value < 0 ? 1 : 0
|
|
1325
1344
|
this[offset + i] = value & 0xFF
|
|
1326
|
-
while (--i >= 0 && (mul *= 0x100))
|
|
1345
|
+
while (--i >= 0 && (mul *= 0x100)) {
|
|
1327
1346
|
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
|
|
1347
|
+
}
|
|
1328
1348
|
|
|
1329
1349
|
return offset + byteLength
|
|
1330
1350
|
}
|
|
1331
1351
|
|
|
1332
|
-
Buffer.prototype.writeInt8 = function (value, offset, noAssert) {
|
|
1352
|
+
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
|
|
1333
1353
|
value = +value
|
|
1334
1354
|
offset = offset >>> 0
|
|
1335
|
-
if (!noAssert)
|
|
1336
|
-
checkInt(this, value, offset, 1, 0x7f, -0x80)
|
|
1355
|
+
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
|
|
1337
1356
|
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
|
|
1338
1357
|
if (value < 0) value = 0xff + value + 1
|
|
1339
1358
|
this[offset] = value
|
|
1340
1359
|
return offset + 1
|
|
1341
1360
|
}
|
|
1342
1361
|
|
|
1343
|
-
Buffer.prototype.writeInt16LE = function (value, offset, noAssert) {
|
|
1362
|
+
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
|
|
1344
1363
|
value = +value
|
|
1345
1364
|
offset = offset >>> 0
|
|
1346
|
-
if (!noAssert)
|
|
1347
|
-
checkInt(this, value, offset, 2, 0x7fff, -0x8000)
|
|
1365
|
+
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
|
|
1348
1366
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1349
1367
|
this[offset] = value
|
|
1350
1368
|
this[offset + 1] = (value >>> 8)
|
|
1351
|
-
} else
|
|
1369
|
+
} else {
|
|
1370
|
+
objectWriteUInt16(this, value, offset, true)
|
|
1371
|
+
}
|
|
1352
1372
|
return offset + 2
|
|
1353
1373
|
}
|
|
1354
1374
|
|
|
1355
|
-
Buffer.prototype.writeInt16BE = function (value, offset, noAssert) {
|
|
1375
|
+
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
|
|
1356
1376
|
value = +value
|
|
1357
1377
|
offset = offset >>> 0
|
|
1358
|
-
if (!noAssert)
|
|
1359
|
-
checkInt(this, value, offset, 2, 0x7fff, -0x8000)
|
|
1378
|
+
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
|
|
1360
1379
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1361
1380
|
this[offset] = (value >>> 8)
|
|
1362
1381
|
this[offset + 1] = value
|
|
1363
|
-
} else
|
|
1382
|
+
} else {
|
|
1383
|
+
objectWriteUInt16(this, value, offset, false)
|
|
1384
|
+
}
|
|
1364
1385
|
return offset + 2
|
|
1365
1386
|
}
|
|
1366
1387
|
|
|
1367
|
-
Buffer.prototype.writeInt32LE = function (value, offset, noAssert) {
|
|
1388
|
+
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
|
|
1368
1389
|
value = +value
|
|
1369
1390
|
offset = offset >>> 0
|
|
1370
|
-
if (!noAssert)
|
|
1371
|
-
checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
|
|
1391
|
+
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
|
|
1372
1392
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1373
1393
|
this[offset] = value
|
|
1374
1394
|
this[offset + 1] = (value >>> 8)
|
|
1375
1395
|
this[offset + 2] = (value >>> 16)
|
|
1376
1396
|
this[offset + 3] = (value >>> 24)
|
|
1377
|
-
} else
|
|
1397
|
+
} else {
|
|
1398
|
+
objectWriteUInt32(this, value, offset, true)
|
|
1399
|
+
}
|
|
1378
1400
|
return offset + 4
|
|
1379
1401
|
}
|
|
1380
1402
|
|
|
1381
|
-
Buffer.prototype.writeInt32BE = function (value, offset, noAssert) {
|
|
1403
|
+
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
|
|
1382
1404
|
value = +value
|
|
1383
1405
|
offset = offset >>> 0
|
|
1384
|
-
if (!noAssert)
|
|
1385
|
-
checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
|
|
1406
|
+
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
|
|
1386
1407
|
if (value < 0) value = 0xffffffff + value + 1
|
|
1387
1408
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1388
1409
|
this[offset] = (value >>> 24)
|
|
1389
1410
|
this[offset + 1] = (value >>> 16)
|
|
1390
1411
|
this[offset + 2] = (value >>> 8)
|
|
1391
1412
|
this[offset + 3] = value
|
|
1392
|
-
} else
|
|
1413
|
+
} else {
|
|
1414
|
+
objectWriteUInt32(this, value, offset, false)
|
|
1415
|
+
}
|
|
1393
1416
|
return offset + 4
|
|
1394
1417
|
}
|
|
1395
1418
|
|
|
@@ -1400,37 +1423,39 @@ function checkIEEE754 (buf, value, offset, ext, max, min) {
|
|
|
1400
1423
|
}
|
|
1401
1424
|
|
|
1402
1425
|
function writeFloat (buf, value, offset, littleEndian, noAssert) {
|
|
1403
|
-
if (!noAssert)
|
|
1426
|
+
if (!noAssert) {
|
|
1404
1427
|
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
|
|
1428
|
+
}
|
|
1405
1429
|
ieee754.write(buf, value, offset, littleEndian, 23, 4)
|
|
1406
1430
|
return offset + 4
|
|
1407
1431
|
}
|
|
1408
1432
|
|
|
1409
|
-
Buffer.prototype.writeFloatLE = function (value, offset, noAssert) {
|
|
1433
|
+
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
|
|
1410
1434
|
return writeFloat(this, value, offset, true, noAssert)
|
|
1411
1435
|
}
|
|
1412
1436
|
|
|
1413
|
-
Buffer.prototype.writeFloatBE = function (value, offset, noAssert) {
|
|
1437
|
+
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
|
|
1414
1438
|
return writeFloat(this, value, offset, false, noAssert)
|
|
1415
1439
|
}
|
|
1416
1440
|
|
|
1417
1441
|
function writeDouble (buf, value, offset, littleEndian, noAssert) {
|
|
1418
|
-
if (!noAssert)
|
|
1442
|
+
if (!noAssert) {
|
|
1419
1443
|
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
|
|
1444
|
+
}
|
|
1420
1445
|
ieee754.write(buf, value, offset, littleEndian, 52, 8)
|
|
1421
1446
|
return offset + 8
|
|
1422
1447
|
}
|
|
1423
1448
|
|
|
1424
|
-
Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) {
|
|
1449
|
+
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
|
|
1425
1450
|
return writeDouble(this, value, offset, true, noAssert)
|
|
1426
1451
|
}
|
|
1427
1452
|
|
|
1428
|
-
Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) {
|
|
1453
|
+
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
|
|
1429
1454
|
return writeDouble(this, value, offset, false, noAssert)
|
|
1430
1455
|
}
|
|
1431
1456
|
|
|
1432
1457
|
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
|
|
1433
|
-
Buffer.prototype.copy = function (target, target_start, start, end) {
|
|
1458
|
+
Buffer.prototype.copy = function copy (target, target_start, start, end) {
|
|
1434
1459
|
var self = this // source
|
|
1435
1460
|
|
|
1436
1461
|
if (!start) start = 0
|
|
@@ -1444,16 +1469,17 @@ Buffer.prototype.copy = function (target, target_start, start, end) {
|
|
|
1444
1469
|
if (target.length === 0 || self.length === 0) return 0
|
|
1445
1470
|
|
|
1446
1471
|
// Fatal error conditions
|
|
1447
|
-
if (target_start < 0)
|
|
1472
|
+
if (target_start < 0) {
|
|
1448
1473
|
throw new RangeError('targetStart out of bounds')
|
|
1474
|
+
}
|
|
1449
1475
|
if (start < 0 || start >= self.length) throw new RangeError('sourceStart out of bounds')
|
|
1450
1476
|
if (end < 0) throw new RangeError('sourceEnd out of bounds')
|
|
1451
1477
|
|
|
1452
1478
|
// Are we oob?
|
|
1453
|
-
if (end > this.length)
|
|
1454
|
-
|
|
1455
|
-
if (target.length - target_start < end - start)
|
|
1479
|
+
if (end > this.length) end = this.length
|
|
1480
|
+
if (target.length - target_start < end - start) {
|
|
1456
1481
|
end = target.length - target_start + start
|
|
1482
|
+
}
|
|
1457
1483
|
|
|
1458
1484
|
var len = end - start
|
|
1459
1485
|
|
|
@@ -1469,7 +1495,7 @@ Buffer.prototype.copy = function (target, target_start, start, end) {
|
|
|
1469
1495
|
}
|
|
1470
1496
|
|
|
1471
1497
|
// fill(value, start=0, end=buffer.length)
|
|
1472
|
-
Buffer.prototype.fill = function (value, start, end) {
|
|
1498
|
+
Buffer.prototype.fill = function fill (value, start, end) {
|
|
1473
1499
|
if (!value) value = 0
|
|
1474
1500
|
if (!start) start = 0
|
|
1475
1501
|
if (!end) end = this.length
|
|
@@ -1503,7 +1529,7 @@ Buffer.prototype.fill = function (value, start, end) {
|
|
|
1503
1529
|
* Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
|
|
1504
1530
|
* Added in Node 0.12. Only available in browsers that support ArrayBuffer.
|
|
1505
1531
|
*/
|
|
1506
|
-
Buffer.prototype.toArrayBuffer = function () {
|
|
1532
|
+
Buffer.prototype.toArrayBuffer = function toArrayBuffer () {
|
|
1507
1533
|
if (typeof Uint8Array !== 'undefined') {
|
|
1508
1534
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
1509
1535
|
return (new Buffer(this)).buffer
|
|
@@ -1527,7 +1553,7 @@ var BP = Buffer.prototype
|
|
|
1527
1553
|
/**
|
|
1528
1554
|
* Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
|
|
1529
1555
|
*/
|
|
1530
|
-
Buffer._augment = function (arr) {
|
|
1556
|
+
Buffer._augment = function _augment (arr) {
|
|
1531
1557
|
arr.constructor = Buffer
|
|
1532
1558
|
arr._isBuffer = true
|
|
1533
1559
|
|
|
@@ -1545,6 +1571,7 @@ Buffer._augment = function (arr) {
|
|
|
1545
1571
|
arr.toJSON = BP.toJSON
|
|
1546
1572
|
arr.equals = BP.equals
|
|
1547
1573
|
arr.compare = BP.compare
|
|
1574
|
+
arr.indexOf = BP.indexOf
|
|
1548
1575
|
arr.copy = BP.copy
|
|
1549
1576
|
arr.slice = BP.slice
|
|
1550
1577
|
arr.readUIntLE = BP.readUIntLE
|
|
@@ -1732,8 +1759,7 @@ function base64ToBytes (str) {
|
|
|
1732
1759
|
|
|
1733
1760
|
function blitBuffer (src, dst, offset, length) {
|
|
1734
1761
|
for (var i = 0; i < length; i++) {
|
|
1735
|
-
if ((i + offset >= dst.length) || (i >= src.length))
|
|
1736
|
-
break
|
|
1762
|
+
if ((i + offset >= dst.length) || (i >= src.length)) break
|
|
1737
1763
|
dst[i + offset] = src[i]
|
|
1738
1764
|
}
|
|
1739
1765
|
return i
|
|
@@ -2259,6 +2285,7 @@ process.browser = true;
|
|
|
2259
2285
|
process.env = {};
|
|
2260
2286
|
process.argv = [];
|
|
2261
2287
|
process.version = ''; // empty string to avoid regexp issues
|
|
2288
|
+
process.versions = {};
|
|
2262
2289
|
|
|
2263
2290
|
function noop() {}
|
|
2264
2291
|
|
|
@@ -3178,7 +3205,7 @@ process.umask = function() { return 0; };
|
|
|
3178
3205
|
|
|
3179
3206
|
// 3-character punctuators: === !== >>> <<= >>=
|
|
3180
3207
|
|
|
3181
|
-
if (ch1 === '>' && ch2 === '>' && ch3 === '>') {
|
|
3208
|
+
if (ch1 === '>' && ch2 === '>' && ch3 === '>' && !state.inType) {
|
|
3182
3209
|
index += 3;
|
|
3183
3210
|
return {
|
|
3184
3211
|
type: Token.Punctuator,
|
|
@@ -6575,7 +6602,7 @@ process.umask = function() { return 0; };
|
|
|
6575
6602
|
|
|
6576
6603
|
expect('<');
|
|
6577
6604
|
while (!match('>')) {
|
|
6578
|
-
paramTypes.push(
|
|
6605
|
+
paramTypes.push(parseTypeAnnotatableIdentifier());
|
|
6579
6606
|
if (!match('>')) {
|
|
6580
6607
|
expect(',');
|
|
6581
6608
|
}
|
|
@@ -9956,7 +9983,7 @@ process.umask = function() { return 0; };
|
|
|
9956
9983
|
}
|
|
9957
9984
|
|
|
9958
9985
|
// Sync with *.json manifests.
|
|
9959
|
-
exports.version = '13001.
|
|
9986
|
+
exports.version = '13001.1001.0-dev-harmony-fb';
|
|
9960
9987
|
|
|
9961
9988
|
exports.tokenize = tokenize;
|
|
9962
9989
|
|