From 97a5d335d78e78e793529233f5aac58440ff1155 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Thu, 24 Jan 2019 17:53:35 +0100 Subject: [PATCH] =?UTF-8?q?Replace=20rare=20{!=E2=80=A6}=20and=20{=3F?= =?UTF-8?q?=E2=80=A6}=20JSDoc=20syntax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is documented at http://usejsdoc.org/tags-type.html, but not in many other places, especially not in the JSDuck documentation. The {!…} syntax means "can not be null". This is the default anyway. The {?…} syntax means nullable. In a few situation is was used when a parameter can be undefined. I decided to remove it everywhere and replace it with {…|null} when appropriate, because this is much more explicit. Less syntax to remember. Note I'm intentionally not using the […] syntax when a parameter is followed by non-optional parameters. Actually skipping a parameter in such a situation would mess the parameter order up. Having optional parameters not at the end is sometimes used as a feature in JavaScript code, but not in this codebase, as far as I can see. Change-Id: Ie370cfe08c32d1af5b0341951bed044fc3511c57 --- resources/dist/index.js.map.json | Bin 190027 -> 190050 bytes src/preview/model.js | 18 +++++++++--------- src/reducers/preview.js | 6 +++--- tests/node-qunit/stubs.js | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/resources/dist/index.js.map.json b/resources/dist/index.js.map.json index 8e008d3400fe0d215d8effdc6e0a065368f76cd5..6c3e95577c8af35ee63bcaf6fdbf0897d18f619e 100644 GIT binary patch delta 155 zcmX?ohWpVO?hV$z_#KOi5-V#;^HNgNGV@YXHaq^}Wt{B)TYGc$Z)L`*t&GZ(!~gJ4 zpUT82INg306UXE`eNF6*5Bp@oT!3t{?n@lGbC>FWd-Ii@%4W@4M}(a97rz0aMAefr_aOh(%;buv}P F001w3Kbiml delta 129 zcmaEKhWqpx?hV$z*z6sPiV`a~d;Q{NWVD|g{#%>Tesj}rWk#sP