Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "bufrw", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Buffer Reading and Writing", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -68,5 +68,5 @@ // Copyright (c) 2015 Uber Technologies, Inc. | ||
SeriesRW.prototype.poolReadFrom = function poolReadFrom(destResult, buffer, offset) { | ||
if (!Array.isArray(destResult.value)) { | ||
destResult.value = new Array(this.rws.length); | ||
} | ||
// The prior value cannot be reused, even if it is already an array of the right size. | ||
// The array may have been captured by reference by the prior consumer. | ||
var values = new Array(this.rws.length); | ||
for (var i = 0; i < this.rws.length; i++) { | ||
@@ -76,5 +76,7 @@ this.rws[i].poolReadFrom(readResult, buffer, offset); | ||
offset = readResult.offset; | ||
destResult.value[i] = readResult.value; | ||
values[i] = readResult.value; | ||
} | ||
// The values must be assigned to the result last so reading a series is reentrant. | ||
destResult.value = values; | ||
return destResult.reset(null, offset, destResult.value); | ||
}; |
@@ -66,2 +66,6 @@ // Copyright (c) 2015 Uber Technologies, Inc. | ||
var duduple = SeriesRW( | ||
SeriesRW(atoms.UInt8, atoms.UInt8), | ||
SeriesRW(atoms.UInt8, atoms.UInt8)); | ||
test('SeriesRW: tinyShortWord', testRW.cases(tinyShortWord, [ | ||
@@ -120,1 +124,7 @@ [[0, 0, 0], [0x00, | ||
])); | ||
test('SeriesRW: duple of duples', testRW.cases(duduple, [ | ||
[[[0, 1], [2, 3]], [ | ||
0x00, 0x01, 0x02, 0x03 | ||
]] | ||
])); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
192143
58
4668
0