Commit 1994bdc1 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Document constructors of builtin JS classes.

For all classes except Object, remove docs for prototype and constructor
properties.  These make more sense when documented only at Object level.
parent 7281f2ec
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -134,16 +134,16 @@
 *
 */

// Properties

/**
 * @property constructor
 * Specifies the function that creates an object's prototype.
 * @method constructor
 * Creates new Array object.
 * 
 * Returns a reference to the Array function that created the instance's prototype. Note that the value of 
 * this property is a reference to the function itself, not a string containing the function's name.
 * @param {Number/Object...} items Either a number that specifies the length of array or any number of items
 * for the array.
 */

// Properties

/**
 * @property length
 * Reflects the number of elements in an array.
+3 −9
Original line number Diff line number Diff line
@@ -60,16 +60,10 @@
 *
 */
 
//Properties

/**
 * @property prototype
 * Defines a property that is shared by all Boolean objects.
 */
 
/**
 * @property constructor
 * Returns the function that created an instance's prototype. This is the `Boolean` function by default.
 * @method constructor
 * Creates a new boolean object.
 * @param {Object} value Either a truthy or falsy value to create the corresponding Boolean object.
 */
 
//Methods
+35 −67
Original line number Diff line number Diff line
@@ -83,6 +83,36 @@
 *     print(ISODateString(d)); // prints something like 2009-09-28T19:03:12Z
 */

/**
 * @method constructor
 * Creates new Date object.
 *
 * @param {Number} milliseconds
 * 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 
 * by the parse method (IETF-compliant RFC 1123 timestamps).
 * @param {Number} year
 * 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
 * Integer value representing the month, beginning with 0 for January to 11 
 * for December.
 * @param {Number} day
 * Integer value representing the day of the month (1-31).
 * @param {Number} hour
 * Integer value representing the hour of the day (0-23).
 * @param {Number} minute
 * Integer value representing the minute segment (0-59) of a time reading.
 * @param {Number} second
 * Integer value representing the second segment (0-59) of a time reading.
 * @param {Number} millisecond
 * Integer value representing the millisecond segment (0-999) of a time reading.
 */


//Methods

/**
@@ -189,68 +219,6 @@
 * @return {Date} Number of milliseconds since January 1, 1970, 00:00:00, universal time.
 */
 
//Parameters
 
/**
 * @param {Number} milliseconds
 * 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 
 * by the parse method (IETF-compliant RFC 1123 timestamps).
 */
  
/**
 * @param {Number} year
 * 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
 * Integer value representing the month, beginning with 0 for January to 11 
 * for December.
 */
  
/**
 * @param {Number} day
 * Integer value representing the day of the month (1-31).
 */
  
/**
 * @param {Number} hour
 * Integer value representing the hour of the day (0-23).
 */
  
/**
 * @param {Number} minute
 * Integer value representing the minute segment (0-59) of a time reading.
 */
  
/**
 * @param {Number} second
 * Integer value representing the second segment (0-59) of a time reading.
 */
  
/**
 * @param {Number} millisecond
 * Integer value representing the millisecond segment (0-999) of a time reading.
 */

//Properties

/**
 * @property constructor
 * Returns the function that created an instance. This is the `Date` constructor by default.
 *
 * Note that the value of this property is a reference to the function itself, not a string containing 
 * the function's name.
 */

//Methods

/**
+3 −10
Original line number Diff line number Diff line
@@ -33,16 +33,14 @@
 * function body, "return a + b".
 */
 
//Parameters
 
/**
 * @method constructor
 * Creates new Function object.
 * 
 * @param arg1, arg2, ... argN
 * 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
 * A string containing the JavaScript statements comprising the function 
 * definition.
@@ -50,11 +48,6 @@

// Properties

/**
 * @property constructor
 * Specifies the function that creates an object's prototype.
 */

/**
 * @property length
 * Specifies the number of arguments expected by the function.
+6 −22
Original line number Diff line number Diff line
@@ -35,12 +35,12 @@
 * `Number` as a function:
 */

//Parameters

///**
// * @param value
// * The numeric value of the object being created.
// */
/**
 * @method constructor
 * Creates new Number object.
 * @param value
 * The numeric value of the object being created.
 */

//Properties

@@ -170,22 +170,6 @@
 *     }
 */
 
/**
 * @property prototype
 * Allows the addition of properties to a `Number` object.
 *
 * All `Number` instances inherit from `Number.prototype`. The prototype object of the `Number` 
 * constructor can be modified to affect all `Number` instances.
 */

//Properties

/**
 * @property constructor
 * Returns the function that created this object's instance. By default this is 
 * the `Number` object.
 */

//Methods
 
/**
Loading