Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

Edited Feature: Enable simplified syntax for accessing default members [50]

0
0
ClearScript doesn't provide any syntactic shortcuts for accessing default members.

This is particularly noticeable with indexers, which currently must be accessed by name. For example, host dictionary indexers are actually named "Item" and support the following syntax (JavaScript):

``` JavaScript
value = dict.Item(key);
value = dict.Item.get(key);
dict.Item.set(key, value);
```

Because `Item` is a default property, it might also make sense to support one or more of the following:

``` JavaScript
value = dict(key)
value = dict.get(key)
dict.set(key, value)
```

Default methods, though rarely used, might also benefit from special handling.

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images