Commit 4d921c20 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

More fixes to JS builtin classes docs.

- Remove trailing whitespace.
- Document types of properties.
- More corrections to constructor docs.
parent 9b6f7c58
Loading
Loading
Loading
Loading
+164 −164
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@
// Properties

/**
 * @property length
 * @property {Number} length
 * Reflects the number of elements in an array.
 *
 * The value of the `length` property is an integer with a positive sign and a value less than 2 to the 32
+376 −370
Original line number Diff line number Diff line
@@ -87,28 +87,31 @@
 * @method constructor
 * Creates new Date object.
 *
 * @param {Number} milliseconds
 * Integer value representing the number of milliseconds since 1 January 1970 
 * @param {Number/String} [year]
 * Either UNIX timestamp, date string, or year (when month and day parameters also provided):
 *
 * - Integer value representing the number of milliseconds since 1 January 1970
 *   00:00:00 UTC (Unix Epoch).
 * @param {String} dateString
 * String value representing a date. The string should be in a format recognized 
 *
 * - String value representing a date. The string should be in a format recognized
 *   by the parse method (IETF-compliant RFC 1123 timestamps).
 * @param {Number} year
 * Integer value representing the year. For compatibility (in order to avoid the
 *
 * - Integer value representing the year. For compatibility (in order to avoid the
 *   Y2K problem), you should always specify the year in full; use 1998, rather
 *   than 98.
 * @param {Number} month
 *
 * @param {Number} [month]
 * Integer value representing the month, beginning with 0 for January to 11
 * for December.
 * @param {Number} day
 * @param {Number} [day]
 * Integer value representing the day of the month (1-31).
 * @param {Number} hour
 * @param {Number} [hour]
 * Integer value representing the hour of the day (0-23).
 * @param {Number} minute
 * @param {Number} [minute]
 * Integer value representing the minute segment (0-59) of a time reading.
 * @param {Number} second
 * @param {Number} [second]
 * Integer value representing the second segment (0-59) of a time reading.
 * @param {Number} millisecond
 * @param {Number} [millisecond]
 * Integer value representing the millisecond segment (0-999) of a time reading.
 */

@@ -117,6 +120,7 @@

/**
 * @method now
 * @static
 * Returns the numeric value corresponding to the current time.
 *
 * The `now` method returns the milliseconds elapsed since 1 January 1970 00:00:00 UTC up until now as
@@ -131,6 +135,7 @@

/**
 * @method parse
 * @static
 * Parses a string representation of a date, and returns the number of milliseconds
 * since January 1, 1970, 00:00:00, local time.
 *
@@ -183,6 +188,7 @@

/**
 * @method UTC
 * @static
 * Accepts the same parameters as the longest form of the constructor, and returns
 * the number of milliseconds in a `Date` object since January 1, 1970, 00:00:00,
 * universal time.
+175 −175
Original line number Diff line number Diff line
@@ -37,11 +37,11 @@
 * @method constructor
 * Creates new Function object.
 *
 * @param arg1, arg2, ... argN
 * @param {String...} args
 * Names to be used by the function as formal argument names. Each must be a
 * string that corresponds to a valid JavaScript identifier or a list of such
 * strings separated with a comma; for example "`x`", "`theValue`", or "`a,b`".
 * @param functionBody
 * @param {String} functionBody
 * A string containing the JavaScript statements comprising the function
 * definition.
 */
@@ -49,7 +49,7 @@
// Properties

/**
 * @property length
 * @property {Number} length
 * Specifies the number of arguments expected by the function.
 */

+116 −113
Original line number Diff line number Diff line
@@ -45,7 +45,8 @@
//Properties

/**
 * @property MAX_VALUE
 * @property {Number} MAX_VALUE
 * @static
 * The largest positive representable number. The largest negative representable
 * number is `-MAX_VALUE`.
 *
@@ -65,7 +66,8 @@
 */

/**
 * @property MIN_VALUE
 * @property {Number} MIN_VALUE
 * @static
 * The smallest positive representable number -- that is, the positive number
 * closest to zero (without actually being zero). The smallest negative
 * representable number is `-MIN_VALUE`.
@@ -89,12 +91,13 @@
 */

/**
 * @property NaN
 * @property {Number} NaN
 * @static
 * Special "not a number" value.
 */

/**
 * @property NEGATIVE_INFINITY
 * @property {Number} NEGATIVE_INFINITY
 * Special value representing negative infinity; returned on overflow.
 *
 * The value of `Number.NEGATIVE_INFINITY` is the same as the negative value of the global object's
@@ -132,7 +135,7 @@
 */

/**
 * @property POSITIVE_INFINITY
 * @property {Number} POSITIVE_INFINITY
 * Special value representing infinity; returned on overflow.
 *
 * The value of `Number.POSITIVE_INFINITY` is the same as the value of the global object's Infinity
+235 −233
Original line number Diff line number Diff line
@@ -206,16 +206,14 @@
 * @method constructor
 * Creates new regular expression object.
 *
 * @param pattern
 * @param {String} pattern
 * The text of the regular expression.
 * @param flags
 * @param {String} flags
 * If specified, flags can have any combination of the following values:
 * @param g
 * global match
 * @param i
 * ignore case
 * @param m
 * Treat beginning and end characters (^ and $) as working over multiple lines 
 *
 * - "g" - global match
 * - "i" - ignore case
 * - "m" - Treat beginning and end characters (^ and $) as working over multiple lines
 *   (i.e., match the beginning or end of _each_ line (delimited by \n or \r), not
 *   only the very beginning or end of the whole input string)
 */
@@ -332,10 +330,12 @@

//Properties

// Note that several of the RegExp properties have both long and short (Perl-like) names. Both names always refer to the same value. Perl is the programming language from which JavaScript modeled its regular expressions.
// Note that several of the RegExp properties have both long and short (Perl-like) names.
// Both names always refer to the same value. Perl is the programming language from which
// JavaScript modeled its regular expressions.

/**
 * @property global
 * @property {Boolean} global
 * Whether to test the regular expression against all possible matches in a
 * string, or only against the first.
 *
@@ -348,18 +348,19 @@
 */

/**
 * @property ignoreCase
 * @property {Boolean} ignoreCase
 * Whether to ignore case while attempting a match in a string.
 *
 * `ignoreCase` is a property of an individual regular expression object.

The value of `ignoreCase` is true if the "`i`" flag was used; otherwise, false. The "`i`" flag indicates that case should be ignored while attempting a match in a string. 

You cannot change this property directly.
 *
 * The value of `ignoreCase` is true if the "`i`" flag was used; otherwise, false. The "`i`" flag indicates
 * that case should be ignored while attempting a match in a string.
 *
 * You cannot change this property directly.
 */

/**
 * @property lastIndex
 * @property {Number} lastIndex
 * The index at which to start the next match. A read/write integer property that specifies the index
 * at which to start the next match.
 *
@@ -367,24 +368,25 @@ You cannot change this property directly.
 *
 * This property is set only if the regular expression used the "`g`" flag to indicate a global search.
 * The following rules apply:
 * *   If `lastIndex` is greater than the length of the string, `regexp.test` and `regexp.exec` fail, 
 *
 * -   If `lastIndex` is greater than the length of the string, `regexp.test` and `regexp.exec` fail,
 *     and `lastIndex` is set to 0.
 * *   If `lastIndex` is equal to the length of the string and if the regular expression matches the 
 * -   If `lastIndex` is equal to the length of the string and if the regular expression matches the
 *     empty string, then the regular expression matches input starting at `lastIndex`.
 * *   If `lastIndex` is equal to the length of the string and if the regular expression does not match 
 * -   If `lastIndex` is equal to the length of the string and if the regular expression does not match
 *     the empty string, then the regular expression mismatches input, and `lastIndex` is reset to 0.
 * *   Otherwise, `lastIndex` is set to the next position following the most recent match. 
 * -   Otherwise, `lastIndex` is set to the next position following the most recent match.
 *
 * For example, consider the following sequence of statements:
 *
 * *   `re = /(hi)?/g` Matches the empty string. 
 * *   `re("hi")` Returns `["hi", "hi"]` with `lastIndex` equal to 2. 
 * *   `re("hi")` Returns `[""]`, an empty array whose zeroth element is the match string. In this 
 * -   `re = /(hi)?/g` Matches the empty string.
 * -   `re("hi")` Returns `["hi", "hi"]` with `lastIndex` equal to 2.
 * -   `re("hi")` Returns `[""]`, an empty array whose zeroth element is the match string. In this
 *     case, the empty string because `lastIndex` was 2 (and still is 2) and "`hi`" has length 2.
 */

/**
 * @property multiline
 * @property {Boolean} multiline
 * Whether or not to search in strings across multiple lines.
 *
 * `multiline` is a property of an individual regular expression object..
@@ -398,7 +400,7 @@ You cannot change this property directly.
 */

/**
 * @property source
 * @property {String} source
 * The text of the pattern.
 *
 * A read-only property that contains the text of the pattern, excluding the forward slashes.
Loading