facebook / facebook/flow

String substr/substring first argument should be optional

オープン
#2,802 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Library definitions
主要言語
Rust
スター
22.3k
フォーク
1.9k
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。