Ecma 262

Page 207

The global property of the newly constructed object is set to a Boolean value that is true if F contains the character "g" and false otherwise. The ignoreCase property of the newly constructed object is set to a Boolean value that is true if F contains the character "i" and false otherwise. The multiline property of the newly constructed object is set to a Boolean value that is true if F contains the character "m" and false otherwise. The lastIndex property of the newly constructed object is set to 0. The [[Prototype]] internal property of the newly constructed object is set to the standard built-in RegExp prototype object as specified in 15.10.6. The [[Class]] internal property of the newly constructed object is set to "RegExp". NOTE If pattern is a StringLiteral, the usual escape sequence substitutions are performed before the String is processed by RegExp. If pattern must contain an escape sequence to be recognised by RegExp, any backslash \ characters must be escaped within the StringLiteral to prevent them being removed when the contents of the StringLiteral are formed.

15.10.5

Properties of the RegExp Constructor

The value of the [[Prototype]] internal property of the RegExp constructor is the standard built-in Function prototype object (15.3.4). Besides the internal properties and the length property (whose value is 2), the RegExp constructor has the following properties: 15.10.5.1 RegExp.prototype The initial value of RegExp.prototype is the RegExp prototype object (15.10.6). This property shall have the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 15.10.6

Properties of the RegExp Prototype Object

The value of the [[Prototype]] internal property of the RegExp prototype object is the standard built-in Object prototype object (15.2.4). The RegExp prototype object is itself a regular expression object; its [[Class]] is "RegExp". The initial values of the RegExp prototype object‘s data properties (15.10.7) are set as if the object was created by the expression new RegExp() where RegExp is that standard built-in constructor with that name. The RegExp prototype object does not have a valueOf property of its own; however, it inherits the valueOf property from the Object prototype object. In the following descriptions of functions that are properties of the RegExp prototype object, the phrase ―this RegExp object‖ refers to the object that is the this value for the invocation of the function; a TypeError exception is thrown if the this value is not an object or an object for which the value of the [[Class]] internal property is not "RegExp". 15.10.6.1 RegExp.prototype.constructor The initial value of RegExp.prototype.constructor is the standard built-in RegExp constructor.

© Ecma International 2011

195


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.