> Le 25 août 2016 à 16:05, Alexander Mekhonoshin <[email protected]> a 
> écrit :
> 
> 
> 2. unary ?.
> 
> window?.navigator?.toString()
> 
> browser: "[object Navigator]"
> node: ReferenceError: window is not defined
> 
> here i suggest syntax for exception-slient accesing globals:
> 
> ?.a === hostGlobalObject?.a
> ?.a?.b === hostGlobalObject?.a?.b

For accessing the global object, I think that the current System.global 
proposal is a better call, because it adds no syntax. See:

https://github.com/tc39/proposal-global

`System.global?.navigator.toString()` is somewhat lengthy, but it is 
nevertheless simple and clear.

—Claude
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to