Peter Cornell
Peter Cornell
src/dom/Value.ts provides a clearer `uInt8ArrayValue(): Uint8Array | null` method; consider updating the `Reader` interface to follow suit.
Customers' desired use case is to read value `{a: ...}` and write `x::y::z::{a: ...}` using `Writer.writeValue(Reader)`, whereas the current implementation only [pulls annotations](https://github.com/amzn/ion-js/blob/master/src/AbstractWriter.ts#L86) from the `Reader` passed to that method....
Update the [Cookbook](https://amzn.github.io/ion-docs/guides/cookbook.html) so the ion-js examples can be executed within the browser. I'd suggest we do this sometime after use of the library within a browser is officially supported.
Without a `close()` method, is the library potentially holding on to resources that could be released?
`-0b100` produces the error: Error: invalid character after number after inspection there is no logic around parsing binary numbers.
`12_34.56_78e0` produces the error: Error: invalid character after number After inspection there is no logic flow for skipping over underscores in the parser.
Once closed, a writer should no longer be usable. ```javascript let ion = require("../../dist/commonjs/es6/Ion.js"); let writer = ion.makeTextWriter(); writer.writeInt(1, ["false"]); writer.close(); console.log(ion.decodeUtf8(writer.getBytes())); writer.writeInt(1, ["1"]); writer.close(); console.log(ion.decodeUtf8(writer.getBytes())); ``` produces: ``` 'false'::1...
```javascript let reader = ion.makeReader('$1 $2 $3 $4 $5 $6 $7 $8 $9'); while (true) { let type = reader.next(); if (!type) break; console.log(reader.value()); } ``` produces: ``` $ion $ion_1_0...
JavaScript tradition seems to be `throw Error`, but perhaps JavaScript/TypeScript provides some capabilities for defining custom error classes. Let's evaluate whether we should throw custom error classes for various error...