guillermooo / dart-sublime-bundle

Sublime Text 3 Dart Package
BSD 3-Clause "New" or "Revised" License
265 stars 42 forks source link

New syntax: null-aware operators #558

Open sethladd opened 9 years ago

sethladd commented 9 years ago

Hi!

New syntax is coming in 1.12. Here's some samples:

print(exp ?? other); // prints other if exp is null

obj ??= 'hi';  // sets obj to hi if obj is null

obj?.method(); // calls method if obj is not null

The 1.12-dev SDK supports this now, if you want to try it out.

Hope that helps!