Skip to content

Commit

Permalink
Normative: Change default function length value to not include option…
Browse files Browse the repository at this point in the history
…al arguments.

Fixes #264.

 - A few legacy methods that have deviating lengths are documented explicitly.
 - Any unneeded explicit lengths are removed.
 - Needed legacy explicit lengths are added.
 - Spacing inside optional argument brackets is made consistent
 - Fixed a bug with a `DataView` note having the wrong argument name

The DataView prototype get/set methods have inconsistent lengths across all browsers, so rather than select one of them as legacy, I decided to let them fall into the default category, which hopefully implementations will align with. Here are the changes:
 - DataView.prototype.getFloat32 (sometimes 0 or 2, now 1)
 - DataView.prototype.getFloat64 (sometimes 0 or 2, now 1)
 - DataView.prototype.getInt16 (sometimes 0 or 2, now 1)
 - DataView.prototype.getInt32 (sometimes 0 or 2, now 1)
 - DataView.prototype.getUint16 (sometimes 0 or 2, now 1)
 - DataView.prototype.getUint32 (sometimes 0 or 2, now 1)
 - DataView.prototype.setFloat32 (sometimes 0 or 3, now 2)
 - DataView.prototype.setFloat64 (sometimes 0 or 3, now 2)
 - DataView.prototype.setInt16 (sometimes 0 or 3, now 2)
 - DataView.prototype.setInt32 (sometimes 0 or 3, now 2)
 - DataView.prototype.setUint16 (sometimes 0 or 3, now 2)
 - DataView.prototype.setUint32 (sometimes 0 or 3, now 2)

Note that the "int 8" methods had no optional arguments, and thus were always 1 or 2 - this brings all the DataView get and set methods into alignment with 1 for get, and 2 for set - since they all have the same number of required arguments respectively.
  • Loading branch information
ljharb committed Dec 20, 2015
1 parent 166ab2b commit 5512445
Showing 1 changed file with 37 additions and 82 deletions.

0 comments on commit 5512445

Please sign in to comment.