Skip to content

Comparison typeof with undefined (not "undefined" string) in commandParser #16660

Closed
@mihailik

Description

@mihailik

Recent PR #12336 Use parser to parse tsconfig json instead of using Json.parse contained an apparent bug:

if (typeof keyText !== undefined && typeof value !== undefined) {

typeof operator can never produce undefined, it's guaranteed to return a string for any value.

@Andy-MS have noticed it, but it's got lost in the large review.

Here is the link to that place on the master branch for convenience. It still compares typeof to undefined: commandLineParser.ts#L1056

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions