Skip to content

Commit

Permalink
fix: spelling in deserializer errors
Browse files Browse the repository at this point in the history
Edits "to long" -> "too long", "to short" -> "too short"
  • Loading branch information
robmcl4 committed Aug 9, 2020
1 parent 1fb53f3 commit 4c6f2e4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/parser/deserializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ function deserializeObject(buffer, index, options, isArray) {
if (binarySize < 0)
throw new Error('Negative binary type element size found for subtype 0x02');
if (binarySize > totalBinarySize - 4)
throw new Error('Binary type with subtype 0x02 contains to long binary size');
throw new Error('Binary type with subtype 0x02 contains too long binary size');
if (binarySize < totalBinarySize - 4)
throw new Error('Binary type with subtype 0x02 contains to short binary size');
throw new Error('Binary type with subtype 0x02 contains too short binary size');
}

if (promoteBuffers && promoteValues) {
Expand All @@ -312,9 +312,9 @@ function deserializeObject(buffer, index, options, isArray) {
if (binarySize < 0)
throw new Error('Negative binary type element size found for subtype 0x02');
if (binarySize > totalBinarySize - 4)
throw new Error('Binary type with subtype 0x02 contains to long binary size');
throw new Error('Binary type with subtype 0x02 contains too long binary size');
if (binarySize < totalBinarySize - 4)
throw new Error('Binary type with subtype 0x02 contains to short binary size');
throw new Error('Binary type with subtype 0x02 contains too short binary size');
}

// Copy the data
Expand Down Expand Up @@ -508,14 +508,14 @@ function deserializeObject(buffer, index, options, isArray) {
// Adjust the index
index = index + objectSize;

// Check if field length is to short
// Check if field length is too short
if (totalSize < 4 + 4 + objectSize + stringSize) {
throw new Error('code_w_scope total size is to short, truncating scope');
throw new Error('code_w_scope total size is too short, truncating scope');
}

// Check if totalSize field is to long
// Check if totalSize field is too long
if (totalSize > 4 + 4 + objectSize + stringSize) {
throw new Error('code_w_scope total size is to long, clips outer document');
throw new Error('code_w_scope total size is too long, clips outer document');
}

// If we are evaluating the functions
Expand Down

0 comments on commit 4c6f2e4

Please sign in to comment.