Skip to content
This repository was archived by the owner on Mar 9, 2025. It is now read-only.
This repository was archived by the owner on Mar 9, 2025. It is now read-only.

Standard library features for v1.0 #7

@emillaine

Description

@emillaine

This issue lists standard library features to be implemented for the v1.0 release.

Note that ts-llvm will not attempt to implement all of the JavaScript standard library, only those features that are used the most and are compatible with strict typing. Language features not in this list will be implemented later.

See e.g. this JavaScript reference for a full list of JS standard library features:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects

Standard library APIs implemented currently in ts-llvm can be seen in: https://github.com/ts-llvm/ts-llvm/blob/master/lib/lib.ts-llvm.d.ts. Their implementations are in https://github.com/ts-llvm/ts-llvm/tree/master/lib/runtime.


Array:

  • constructor from array literal
  • length (get only)
  • push (single parameter only)
  • element access via subscript
  • includes
  • join
  • indexOf
  • lastIndexOf
  • slice
  • toString
  • every
  • filter
  • find
  • findIndex
  • map
  • reduce
  • some

String:

  • constructor from string literal
  • length
  • concat (single parameter only)
  • includes
  • endsWith
  • startsWith
  • indexOf
  • lastIndexOf
  • replace (no regex)
  • split
  • slice
  • substring
  • toLowerCase
  • toUpperCase
  • trim
  • toString

Map:

  • constructor
  • size
  • clear
  • delete
  • get
  • has
  • set
  • keys
  • values

Set:

  • constructor
  • size
  • add
  • clear
  • delete
  • has
  • keys
  • values

console:

  • log

Global functions:

  • parseFloat
  • parseInt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions