Skip to content

v2.7.0 - Wasm: String slice & search methods

Choose a tag to compare

@gmpassos gmpassos released this 18 Jul 08:09
· 141 commits to master since this release
dd05561

Wasm: String slice & search methods

The on-the-fly WebAssembly compiler now supports the common String slice/search methods over its [len][utf8] layout:

  • substring(start, [end]) — a fresh-buffer memory.copy slice
  • codeUnitAt(i)
  • startsWith / endsWith — OOB-guarded byte compare
  • indexOf (returns -1 when absent) / contains

These join the already-supported length / isEmpty / isNotEmpty getters and toUpperCase / toLowerCase. Methods are byte-indexed, so results are exact for ASCII text.

Still to come: trim, split, replaceAll / replaceFirst, padLeft / padRight, compareTo, index []; and chaining a method onto a method result (the receiver must be a named local).

Full changelog: https://github.com/ApolloVM/apollovm_dart/blob/v2.7.0/CHANGELOG.md