Re: Function Overloading or Pattern Matching of functions in Ecma

2019-02-24 Thread kai zhu
if it helps, you can already "pattern-match" using string-concat like this full-working-demo [1] derived from a closed-source real-world example. ```html *, *:after, *:before { box-sizing: border-box; } body { background: #eee; display: flex; flex-flow: column; font-family: Arial,

Proposal: switch expressions

2019-02-24 Thread David Koblas
After looking at a bunch of code in our system noted that there are many cases where our code base has a pattern similar to this:     let category = data.category;     if (category === undefined) {   // Even if Tax is not enabled, we have defaults for incomeCode   switch

Re: Proposal: throw null operator

2019-02-24 Thread Isiah Meadows
Not sure what the benefit is over just `if (value != null) throw value`, especially for this niche of a use case. On Sun, Feb 24, 2019 at 09:46 IdkGoodName Vilius < viliuskubilius...@gmail.com> wrote: > I am proposing a syntatic sugar, which would check if throw value is not > null, or not

Proposal: throw null operator

2019-02-24 Thread IdkGoodName Vilius
I am proposing a syntatic sugar, which would check if throw value is not null, or not undefined. It would make less typing and no if, for throw statements. Syntax is simple. Here's an example of it: ```js throw? e ``` This is basically equivalent to: ```js if(e !== null && e !== undefined) throw e