node icon indicating copy to clipboard operation
node copied to clipboard

[Implement] Buffer.compare

Open jtenner opened this issue 4 years ago • 2 comments

Notes:

  • this function works really nicely with memory.compare()
  • ~Currently, the compiler doesn't like using static functions as function parameters (Will open an issue in the AssemblyScript repo)~
ERROR AS218: Cannot access method 'compare' without calling it as it requires 'this' to be set.

     actual.sort(Buffer.compare);
                 ~~~~~~~~~~~~~~
 in tests/buffer.spec.ts(60,16)

Edit:

  • ~Switching to static readonly function expression causes this to compile~

jtenner avatar Jul 19 '19 19:07 jtenner

With the static function fix, everything seems to look nice. Thoughts? @dcodeIO

jtenner avatar Jul 23 '19 18:07 jtenner

TODO: Implement Buffer#compare. TODO: Return 1, 0, or -1

jtenner avatar Aug 01 '19 14:08 jtenner