Zev Benjamin
3f95e54dc1
dict: Add setdefault method
...
This is like Python's dict.setdefault. I don't love the name, but
the consistency is nice.
We have lots of places where we do things like:
if (! dict.has('foo')) {
dict.set('foo', []);
}
var arr = dict.get('foo');
arr.push(3);
We can now write:
var arr = dict.setdefault('foo', []);
arr.push(3);
(imported from commit b8933809c69ba47ec346ed51d53966793403e56c)
2013-08-21 14:11:39 -04:00
..
2013-08-21 11:10:31 -04:00
2013-08-13 14:20:18 -04:00
2013-07-29 12:11:26 -04:00
2013-08-01 11:47:54 -04:00
2013-08-15 13:16:40 -04:00
2013-07-29 12:11:26 -04:00
2013-08-01 11:47:54 -04:00
2013-08-15 18:26:36 -04:00
2013-08-21 10:37:50 -04:00
2013-08-19 12:17:55 -04:00
2013-07-30 12:12:58 -04:00
2013-08-21 14:11:39 -04:00
2013-07-30 12:12:58 -04:00
2013-08-19 16:29:30 -04:00
2013-08-20 14:27:43 -04:00
2013-08-13 14:20:18 -04:00
2013-08-13 14:12:28 -04:00
2013-07-30 12:12:58 -04:00
2013-08-19 12:17:55 -04:00
2013-07-30 12:12:58 -04:00
2013-08-20 12:00:11 -04:00
2013-08-19 12:17:56 -04:00
2013-08-19 16:29:30 -04:00
2013-07-29 12:11:26 -04:00
2013-07-29 12:11:26 -04:00
2013-08-20 14:27:44 -04:00
2013-08-05 16:10:01 -04:00
2013-08-01 11:47:54 -04:00
2013-08-14 17:30:16 -04:00
2013-08-08 17:23:27 -04:00
2013-08-19 12:17:55 -04:00
2013-08-15 18:04:43 -04:00
2013-08-13 18:09:19 -04:00
2013-08-14 17:08:47 -04:00
2013-08-20 15:37:08 -04:00
2013-08-02 17:28:04 -04:00
2013-08-08 13:03:09 -04:00
2013-07-29 12:11:26 -04:00
2013-07-29 12:11:26 -04:00
2013-08-09 12:29:02 -04:00
2013-08-20 14:27:42 -04:00
2013-08-19 12:17:55 -04:00
2013-08-20 17:15:56 -04:00
2013-08-13 11:26:12 -04:00
2013-08-19 12:17:55 -04:00
2013-08-13 14:28:47 -04:00
2013-07-30 12:12:58 -04:00
2013-08-20 15:35:53 -04:00
2013-08-01 11:47:54 -04:00
2013-08-21 11:10:31 -04:00
2013-08-20 11:10:18 -04:00
2013-08-09 17:12:23 -04:00
2013-08-14 17:08:32 -04:00
2013-08-20 15:37:08 -04:00