Or `!.`, which unfortunately is now being used by TypeScript?
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
TypeScript can change if it has to, and it's done so before (ES modules are
a good example of this). They try their best to be a strict superset of
ECMAScript, and this even goes as far as making type errors early warnings,
not early errors, by default (the latter would technically be a violation
o
> Le 13 oct. 2016 à 14:37, Kagami Rosylight a écrit :
>
>
> Or `!.`, which unfortunately is now being used by TypeScript?
What is exactly the issue you're trying to solve? The token `?.` works fine
(technically with a simple lookahead for excluding digit after it). —Claude
_
>The token ?. works fine
I think more than half of this thread is about syntactic ambiguity, regardless
of whether the ambiguity is real or not. For example, from [an earlier post of
this
thread](https://esdiscuss.org/topic/existential-operator-null-propagation-operator#content-44):
>But what
IIRC the proposed syntax for computed properties was `x?.[y]`, to avoid the
ambiguity.
On Thu, Oct 13, 2016, 10:24 Kagami Rosylight wrote:
>
>
> >The token ?. works fine
>
>
>
> I think more than half of this thread is about syntactic ambiguity,
> regardless of whether the ambiguity is real or n
>IIRC the proposed syntax for computed properties was x?.[y],
Yes you’re right, sorry :/
IMO it still seems the syntax problem is the main reason why this proposal has
stalled. If not, what is the problem here? I’m curious why this proposal is not
even listed in stage 0 proposal list.
It may be a good idea to create a pull request for it if it isn't listed
yet (search "null propagation JavaScript"). I know there's a proposal
written out (I've seen it), I just don't recall the exact URL offhand nor
if there's a champion or not, but I thought it did. It could be one of
those looki
> Le 13 oct. 2016 à 17:14, Kagami Rosylight a écrit :
>
>
> >IIRC the proposed syntax for computed properties was x?.[y],
>
> Yes you’re right, sorry :/
>
> IMO it still seems the syntax problem is the main reason why this proposal
> has stalled. If not, what is the problem here?
The iss
> Le 13 oct. 2016 à 17:32, Isiah Meadows a écrit :
>
> It may be a good idea to create a pull request for it if it isn't listed yet
>
I've already tried some time ago: https://github.com/tc39/ecma262/pull/340
—Claude___
es-discuss mailing list
es-dis
Why is this needed? Why are people trying to get the property of an object
which is null? Why is the object null in the first place? This can probably
be considered poor program design. It's sort of like trying to dereference
a null pointer. In addition, parameter defaults and defaults in
destructu
>Why is this needed? Why are people trying to get the property of an object
>which is null?
I will appreciate null propagation when a function receives an “option bag”
```js
function someFunction(options) {
if(options?.foo) {
doSomething();
};
}
someFunction();
someFunction({ foo: true
I think the point is that people would like to write something like this:
if (person?.address?.zipcode)
instead of this:
if (person && person.address && person.address.zipcode)
That appeals to me.
On Thu, Oct 13, 2016 at 12:20 PM, Bob Myers wrote:
> Why is this needed? Why are people trying
> Le 13 oct. 2016 à 19:20, Bob Myers a écrit :
>
> Why is this needed? Why are people trying to get the property of an object
> which is null? Why is the object null in the first place?
This is not about trying to get something from null, but about taking different
paths according to when a
On Thu, Oct 13, 2016, 12:07 Claude Pache wrote:
Le 13 oct. 2016 à 17:14, Kagami Rosylight a écrit :
>IIRC the proposed syntax for computed properties was x?.[y],
Yes you’re right, sorry :/
IMO it still seems the syntax problem is the main reason why this proposal
has stalled. If not, what is
>From a technical point of view, using ![ instead of ?.[ may work only if you
>forbid a line terminator before the !
I tried this on [TS
Playground](http://www.typescriptlang.org/play/#src=var%20a%20%3D%20%7B%7D%3B%0D%0A%0D%0Aa!%5B3%5D%3B%0D%0Aa%0D%0A!%5B3%5D%3B)
and it interestingly changes be
15 matches
Mail list logo