55
edits
Tlrobinson (talk | contribs) (Added args for some ByteArray methods) |
(Added notes section) |
||
| Line 237: | Line 237: | ||
* [http://github.com/tlrobinson/narwhal/tree/master/tests/serverjs ServerJS tests] compatible with [http://github.com/tlrobinson/narwhal/tree/master/lib/test this test framework]. | * [http://github.com/tlrobinson/narwhal/tree/master/tests/serverjs ServerJS tests] compatible with [http://github.com/tlrobinson/narwhal/tree/master/lib/test this test framework]. | ||
= Notes = | |||
* The '''indexOf''' and '''lastIndexOf''' methods described in this proposal should most definitely be able to handle a Binary object as first argument, like the corresponding String method, which also takes a String as argument. Being able to only search for single bytes seriously constrains the usefulness of these classes. | |||
* Calling ByteString methods '''charAt''' and '''charCodeAt''' when they only return single bytes is misguiding and not good practice. The [[ServerJS/Binary/C|Binary/C]] proposal defines a new '''valueAt''' method that is an alias for '''charAt''' on strings and for '''byteAt''' on blobs. | |||
* Having some common API with Strings and Arrays is certainly a good idea, but do we really have to replicate each and every method? For example, do we really need '''slice''', '''substr''' and '''substring''' on the ByteString, or wouldn't slice alone suffice? | |||
= Relevant Discussions = | = Relevant Discussions = | ||
edits