facebook / facebook/flow

String substr/substring first argument should be optional

Abierto
#2,802 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Library definitions
Lenguaje dominante
Rust
Estrellas
22.3k
Forks
1.9k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

https://github.com/facebook/flow/blob/master/lib/core.js#L262-L263

```typescript
substr(from: number, length?: number): string;
substring(start: number, end?: number): string;
```

As I understand it, [ES5 B.2.3](http://www.ecma-international.org/ecma-262/5.1/#sec-B.2.3) and [15.5.4.15](http://www.ecma-international.org/ecma-262/5.1/#sec-15.5.4.15) do not require the first argument to be defined. Step 2 of substr (step 4 of substring) converts the argument to integer, and an undefined value will converted to zero.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.