Proposal static type constraints features

YU HengChun achun.shx at qq.com
Mon Jun 4 05:27:21 UTC 2018


You mean this...

The original:

```js
function f(x) {
  return typeof x !== 'string' || typeof x === 'undefined'; 
}
```

The proposal:

```js
function f(x = void String) {
  void Boolean; // The complete code should be like this
  return typeof x !== 'string' || typeof x === 'undefined'; 
}
```

Thank you, you actually provided an example to prove that the proposal is conflict-free.

Test code is casually written, the results of these two versions will be consistent.


我得谢谢你的关注(真的, 这样才可以有更多的验证).
你刚好提供了一个例子证明我的提案是无冲突的.
随便写测试代码吧, 这两个版本的结果完全一致.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180604/a116cd80/attachment.html>


More information about the es-discuss mailing list