Skip to content

Commit

Permalink
Fixed #44; version bump; update Closure Compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
calebsander committed Dec 20, 2016
1 parent ecc19f2 commit 0f2ecb7
Show file tree
Hide file tree
Showing 33 changed files with 687 additions and 426 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ const type = new sb.StructType({
3 /*3 characters in first field's name*/, 0x6f /*o*/, 0x6e /*n*/, 0x65 /*e*/,
0x50 /*TupleType*/,
0x20 /*FloatType*/,
0, 0, 0, 3 /*3 floats in the tuple*/,
3 /*3 floats in the tuple*/,
3 /*3 characters in second field's name*/, 0x74 /*t*/, 0x77 /*w*/, 0x6f /*o*/,
0xff, /*type is defined previously*/
0, 11 /*type is defined 11 bytes before the 0 on this line*/
Expand All @@ -327,14 +327,14 @@ In the following definitions, `type` means the binary type format.
- `DoubleType`: identifier `0x21`
- `BooleanType`: identifier `0x30`
- `BooleanTupleType`: identifier `0x31`, payload:
- `length` - `uint32_t`
- `length` - `uint8_t`
- `BooleanArrayType`: identifier `0x32`
- `CharType`: identifier `0x40`
- `StringType`: identifier `0x41`
- `OctetsType`: identifier `0x42`
- `TupleType`: identifier `0x50`, payload:
- `elementType` - `type`
- `length` - `uint32_t`
- `length` - `uint8_t`
- `StructType`: identifier `0x51`, payload:
- `fieldCount` - `uint8_t`
- `fieldCount` instances of `field`:
Expand Down
235 changes: 118 additions & 117 deletions compiled/download.js

Large diffs are not rendered by default.

237 changes: 119 additions & 118 deletions compiled/upload-download.js

Large diffs are not rendered by default.

189 changes: 95 additions & 94 deletions compiled/upload.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
//For use with browserify
if (__dirname === '/') __dirname = ''

const assert = require(__dirname + '/lib/assert.js')
const base64 = require('base64-js')

const VERSION = 9
assert.between(0, VERSION, 65536)
const VERSION = 10
const VERSION_BYTES = 2
const VERSION_BUFFER = new ArrayBuffer(VERSION_BYTES)
new DataView(VERSION_BUFFER).setUint16(0, VERSION)
Expand Down
4 changes: 2 additions & 2 deletions docs/ArrayType.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1007">line 1007</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1009">line 1009</a>
</li></ul></dd>


Expand Down Expand Up @@ -1152,7 +1152,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1048">line 1048</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1050">line 1050</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/BooleanArrayType.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h4 class="name" id="BooleanArrayType"><span class="type-signature"></span>new B

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line758">line 758</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line760">line 760</a>
</li></ul></dd>


Expand Down Expand Up @@ -1102,7 +1102,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line768">line 768</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line770">line 770</a>
</li></ul></dd>


Expand Down
10 changes: 6 additions & 4 deletions docs/BooleanTupleType.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ <h1 class="page-title">Class: BooleanTupleType</h1>

<h2>BooleanTupleType</h2>

<div class="class-description">A type storing a fixed-length array of <code>Boolean</code> values</div>
<div class="class-description">A type storing a fixed-length array of <code>Boolean</code> values.
The length must be less than 256.</div>


</header>
Expand Down Expand Up @@ -99,7 +100,8 @@ <h5>Parameters:</h5>



<td class="description last">The number of <code>Boolean</code>s in each value of this type</td>
<td class="description last">The number of <code>Boolean</code>s in each value of this type.
Must fit in a 1-byte unsigned integer.</td>
</tr>


Expand Down Expand Up @@ -140,7 +142,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line724">line 724</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line725">line 725</a>
</li></ul></dd>


Expand Down Expand Up @@ -1153,7 +1155,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line745">line 745</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line747">line 747</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/CharType.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h4 class="name" id="CharType"><span class="type-signature"></span>new CharType<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line781">line 781</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line783">line 783</a>
</li></ul></dd>


Expand Down Expand Up @@ -1095,7 +1095,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line791">line 791</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line793">line 793</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/ChoiceType.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1224">line 1224</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1226">line 1226</a>
</li></ul></dd>


Expand Down Expand Up @@ -1159,7 +1159,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1258">line 1258</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1260">line 1260</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/EnumType.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1156">line 1156</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1158">line 1158</a>
</li></ul></dd>


Expand Down Expand Up @@ -1232,7 +1232,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1201">line 1201</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1203">line 1203</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/MapType.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1094">line 1094</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1096">line 1096</a>
</li></ul></dd>


Expand Down Expand Up @@ -1178,7 +1178,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1127">line 1127</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1129">line 1129</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/NamedChoiceType.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1307">line 1307</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1309">line 1309</a>
</li></ul></dd>


Expand Down Expand Up @@ -1189,7 +1189,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1373">line 1373</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1375">line 1375</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/OctetsType.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h4 class="name" id="OctetsType"><span class="type-signature"></span>new OctetsT

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line828">line 828</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line830">line 830</a>
</li></ul></dd>


Expand Down Expand Up @@ -1097,7 +1097,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line838">line 838</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line840">line 840</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/OptionalType.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1527">line 1527</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1529">line 1529</a>
</li></ul></dd>


Expand Down Expand Up @@ -1162,7 +1162,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1560">line 1560</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1562">line 1562</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/PointerType.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1593">line 1593</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1595">line 1595</a>
</li></ul></dd>


Expand Down Expand Up @@ -1165,7 +1165,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1635">line 1635</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1637">line 1637</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/RecursiveType.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1410">line 1410</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1412">line 1412</a>
</li></ul></dd>


Expand Down Expand Up @@ -1163,7 +1163,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1484">line 1484</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1486">line 1486</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/SetType.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h4 class="name" id="SetType"><span class="type-signature"></span>new SetType<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1064">line 1064</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1066">line 1066</a>
</li></ul></dd>


Expand Down Expand Up @@ -1104,7 +1104,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1076">line 1076</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line1078">line 1078</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/StringType.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h4 class="name" id="StringType"><span class="type-signature"></span>new StringT

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line803">line 803</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line805">line 805</a>
</li></ul></dd>


Expand Down Expand Up @@ -1095,7 +1095,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line813">line 813</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line815">line 815</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions docs/StructType.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line913">line 913</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line915">line 915</a>
</li></ul></dd>


Expand Down Expand Up @@ -1156,7 +1156,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line981">line 981</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line983">line 983</a>
</li></ul></dd>


Expand Down
10 changes: 5 additions & 5 deletions docs/TupleType.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1 class="page-title">Class: TupleType</h1>
<h2>TupleType</h2>

<div class="class-description">A type storing a fixed-length array of values of the same type.
The length must fit in a 4-byte unsigned integer.</div>
The length must be less than 256.</div>


</header>
Expand Down Expand Up @@ -165,8 +165,8 @@ <h6>Properties</h6>



<td class="description last">The number of elements in the tuple
Must fit in a 4-byte unsigned integer.</td>
<td class="description last">The number of elements in the tuple.
Must fit in a 1-byte unsigned integer.</td>
</tr>


Expand Down Expand Up @@ -214,7 +214,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line856">line 856</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line858">line 858</a>
</li></ul></dd>


Expand Down Expand Up @@ -1224,7 +1224,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line887">line 887</a>
<a href="structure-types.js.html">structure-types.js</a>, <a href="structure-types.js.html#line889">line 889</a>
</li></ul></dd>


Expand Down
Loading

0 comments on commit 0f2ecb7

Please sign in to comment.