String.split() method's separator argument should allow undefined

オープン 初心者向け
#63,456 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
javascript, typescript
領域
tooling

調査の方向性

リンク先のECMAScript仕様に照らしてString.splitの宣言を確認し、separator引数と提示されたサンプルに焦点を当てます。TypeScript定義がundefinedを受け入れ、別のコードパスを必要とせずにサンプルの型チェックが通れば完了です。

索引モデルが issue の本文から書いたものです。

説明

Awaiting More Feedback Suggestion
⚙ Compilation target

ES2024

⚙ Library

6.0.2

Missing / Incorrect Definition

String.split should allow undefined as its separator argument, resulting in an array containing the entire string.

Unlike the case of omitting the separator (#38331), this is a useful feature, since separator may be a variable, and it can be desirable to get an array with the entire string in the case that separator is not set, in order to not need a different code path for this case.

This feature is explicitly defined in the spec. It is not something that just 'happens to work', like using null or a number.

Sample Code
console.log("string,that could/split:but-should;not".split(undefined));
Documentation Link

https://tc39.es/ecma262/multipage/text-processing.html#sec-string.prototype.split

主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 15時間
マージ済み PR(30日)
106

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/TypeScript のほかの issue

microsoft/TypeScript の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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