Hi,
> At Adobe, the policy was GIGO (Garbage In, Garbage Out). If you provide
> values outside of the allowed values, we did not promise anything
> reasonable would happen and we generally did no check the values assigned.
> Do we want to switch to a policy to fatten and slow down the SDK with
> input checking?
In this case doing a check against undefined is probable faster and IMO more
clearly states what is going on.
if (c.headerWordWrap == undefined)
return headerWordWrap;
else
return c.headerWordWrap;
That's one check and one property lookup if it's undefined or one check and two
property lookups if not.
if (c.wordWrap == true)
return true;
if (c.wordWrap == false)
return false;
return wordWrap;
That's two checks and two property lookups if it's undefined or one or two
checks and one or two property lookups if not.
Thanks,
Justin