Justin Ridgewell
c2ed9de7fb
Flip default parameter template ( #4515 )
...
* Flip default parameter template
YMMV, I saved ~10b on a 2kb library. Not noticeable at the small scale, by why not do it anyway?
I've (unscientifically) found that flipping the default parameter conditional yields better gzip results. I think this is due to the slightly longer string it can now repeatedly match:
```js
// old
var param = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0]
--------------------------------------------------------------^
// new
var param = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null
------------------------------------------------------------------------^
```
Though it's entirely likely gzip will also choose up to the index of the arguments if you many default parameters at different indexes.
* Update tests
2016-09-25 14:05:53 -07:00
..
2016-02-12 11:29:58 -05:00
2016-09-20 14:04:15 -04:00
2016-09-03 12:03:34 -04:00
2016-09-25 14:05:53 -07:00
2016-09-21 10:52:59 +02:00
2016-05-02 19:43:49 -04:00
2016-09-01 11:03:06 -04:00
2016-05-02 19:43:49 -04:00
2016-05-17 14:49:17 -04:00
2016-05-02 19:43:49 -04:00
2016-05-17 14:49:17 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-17 14:49:17 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-17 14:49:17 -04:00
2016-06-28 23:14:43 -07:00
2016-09-17 22:47:52 -04:00
2016-09-24 11:46:08 -04:00
2016-09-25 13:57:59 -07:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-08-04 19:34:51 -04:00
2016-05-02 19:43:49 -04:00
2016-06-28 19:16:44 -07:00
2016-06-28 19:16:44 -07:00
2016-05-02 19:43:49 -04:00
2016-08-23 15:08:44 -04:00
2016-08-04 19:34:51 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-09-25 14:05:53 -07:00
2016-05-02 19:43:49 -04:00
2016-09-01 11:03:06 -04:00
2016-08-31 14:55:38 -04:00
2016-05-02 19:43:49 -04:00
2016-09-25 14:05:53 -07:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-09-20 11:04:07 +02:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-09-22 12:00:18 -04:00
2016-09-25 14:05:53 -07:00
2016-09-21 10:52:59 +02:00
2016-09-22 12:00:18 -04:00
2016-08-23 15:08:44 -04:00
2016-09-25 14:05:53 -07:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-09-20 12:19:09 -04:00
2016-06-26 20:21:26 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-09-12 08:27:49 -04:00
2016-09-21 10:52:59 +02:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-09-09 18:38:50 -04:00
2016-05-02 19:43:49 -04:00
2016-05-17 14:49:17 -04:00
2016-07-27 10:54:21 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-05-02 19:43:49 -04:00
2016-06-26 20:21:26 -04:00
2016-05-17 14:49:17 -04:00
2016-09-07 11:24:57 -04:00
2016-09-01 11:03:06 -04:00
2016-07-12 22:33:58 -04:00
2016-05-02 19:43:49 -04:00
2016-09-13 09:09:11 -04:00
2016-09-25 12:27:32 -07:00
2016-09-25 12:27:32 -07:00
2016-09-25 12:27:32 -07:00
2016-09-25 12:27:32 -07:00
2016-09-25 12:27:32 -07:00
2016-09-25 12:27:32 -07:00
2016-09-25 12:27:32 -07:00
2016-09-25 12:27:32 -07:00
2016-09-25 12:27:32 -07:00
2016-09-03 12:12:34 -04:00
2016-07-26 18:12:25 -04:00
2016-09-01 11:03:06 -04:00
2016-09-25 13:59:43 -07:00
2016-09-17 22:46:45 -04:00
2015-10-29 17:51:24 +00:00