Skip to content

[Implement] Buffer.compare - #7

Open
jtenner wants to merge 2 commits into
mainfrom
compare
Open

[Implement] Buffer.compare#7
jtenner wants to merge 2 commits into
mainfrom
compare

Conversation

@jtenner

@jtenner jtenner commented Jul 19, 2019

Copy link
Copy Markdown
Contributor

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

jtenner commented Jul 23, 2019

Copy link
Copy Markdown
Contributor Author

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

@jtenner

jtenner commented Aug 1, 2019

Copy link
Copy Markdown
Contributor Author

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

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

enhancement 新建 feature or request

项目

None yet

Development

Successfully merging this pull request may close these issues.

1 participant