Open
Description
(originally posted by @gibson042 in #293 (comment))
function pathological(x, undefined, NaN, Infinity) {
return match (x) {
when undefined: "undefined";
when NaN: "NaN";
when Infinity: "Infinity";
}
}
Such bizarre bindings are honored elsewhere in the language (e.g., (NaN => [][NaN])("length")
evaluates to 0
rather than undefined
) and I believe discouraging the pattern via linters etc. is better than trumping explicit developer intent in match contexts where they are overridden.
Metadata
Metadata
Assignees
Labels
No labels