Skip to content

Extend standard library with ES6 methods #179

Description

@sbstp

There's a couple of methods from the ES6 draft that I believe can be implemented without modifying the VM. This issue is a list of them. I'd like to try and tackle some of them. Most of the algorithms are described in the draft. MDN also has examples and polyfills that could be useful while trying to implement some of these functions. I've intentionally left out the methods that cannot be implemented at the moment.

Object

  • Object.assign
  • Object.is
  • Object.setPrototypeOf (__proto__ does not seem to be mutable)

String

  • String.fromCodePoint
  • String.prototype.codePointAt
  • String.prototype.normalize (unicode normalization)
  • String.prototype.repeat
  • String.prototype.startsWith
  • String.prototype.endsWith
  • String.prototype.includes

Array

  • Array.from
  • Array.of
  • Array.prototype.copyWithin
  • Array.prototype.find
  • Array.prototype.findIndex
  • Array.prototype.fill
  • Array.prototype.keys
  • Array.prototype.values
  • Array.prototype.entries

Number

  • Number.isFinite
  • Number.isInteger
  • Number.isSafeInteger (might need discussion)
  • Number.isNaN
  • Number.EPSILON
  • Number.MIN_SAFE_INTEGER (might need discussion)
  • Number.MAX_SAFE_INTEGER (might need discussion)

Math

  • Math.clz32
  • Math.imul
  • Math.sign
  • Math.log10
  • Math.log2
  • Math.log1p
  • Math.expm1
  • Math.cosh
  • Math.sinh
  • Math.tanh
  • Math.acosh
  • Math.asinh
  • Math.atanh
  • Math.trunc
  • Math.fround
  • Math.cbrt
  • Math.hypot

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions