-
Notifications
You must be signed in to change notification settings - Fork 23.1k
Closed
Labels
Content:JSJavaScript docsJavaScript docs
Description
MDN URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
What information was incorrect, unhelpful, or incomplete?
The Static Properties section suggests the existence of a property, RegExp.lastIndex, that does not exist.
Specific section or headline?
What did you expect to see?
I expected to see .lastIndex listed in the Instance Properties section.
I'm not sure what the best notation would be. RegExp.lastIndex is clearly wrong because no such property exists. RegExp.prototype.lastIndex is also misleading, because that property does not exist either. Maybe it should just be listed as .lastIndex. In any case, however, clearly .lastIndex belongs in Instance Properties rather than Static Properties.
Did you test this? If so, how?
$ node
Welcome to Node.js v12.20.1.
Type ".help" for more information.
> Object.getOwnPropertyDescriptor(RegExp, 'lastIndex');
undefined
> Object.getOwnPropertyDescriptor(/foo/, 'lastIndex');
{ value: 0, writable: true, enumerable: false, configurable: false }
See also ECMA 262, §22.2.3.2.1:
- Perform ! DefinePropertyOrThrow(obj, "lastIndex", PropertyDescriptor { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false }).
MDN Content page report details
- Folder:
en-us/web/javascript/reference/global_objects/regexp - MDN URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
- GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/javascript/reference/global_objects/regexp/index.html
- Last commit: 3b80812
- Document last modified: 2021-02-19T19:57:02.000Z
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Content:JSJavaScript docsJavaScript docs