Fix the Stream.HALT warning's condition

Previously, it warned on all *but* the first use, which is obviously
wrong. This corrects it to correctly fire on only the first use.
This commit is contained in:
Isiah Meadows 2019-02-05 11:03:50 -05:00
parent b91a10a233
commit 2a9b3964ca
2 changed files with 17 additions and 22 deletions

View file

@ -13,7 +13,7 @@ Stream["fantasy-land/of"] = Stream
var warnedHalt = false
Object.defineProperty(Stream, "HALT", {
get: function() {
warnedHalt && console.log("HALT is deprecated and has been renamed to SKIP");
warnedHalt || console.log("HALT is deprecated and has been renamed to SKIP");
warnedHalt = true
return Stream.SKIP
}