From eeea79ca0c992d70b1f2757a5d2d337b604c6939 Mon Sep 17 00:00:00 2001 From: "Michael[tm] Smith" Date: Sat, 27 Feb 2021 03:49:50 +0900 Subject: [PATCH 1/3] =?UTF-8?q?Push=20the=20=E2=80=9Cfixable=20flaws?= =?UTF-8?q?=E2=80=9D=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/javascript/reference/global_objects/regexp/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/index.html b/files/en-us/web/javascript/reference/global_objects/regexp/index.html index f6b3e22577056f6..190c3c500be9b4c 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/index.html +++ b/files/en-us/web/javascript/reference/global_objects/regexp/index.html @@ -50,7 +50,7 @@

Flags in constructor

Perl-like RegExp properties

-

Note that several of the {{JSxRef("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.). See also deprecated RegExp properties.

+

Note that several of the {{JSxRef("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.). See also deprecated RegExp properties.

Constructor

From 294757b89f6e4c32af6842f9d60a030ba61ca32e Mon Sep 17 00:00:00 2001 From: "Michael[tm] Smith" Date: Sat, 27 Feb 2021 03:50:07 +0900 Subject: [PATCH 2/3] Clarify: lastIndex is RegExp instance property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change updates the RegExp article to correct a misclassification of lastIndex as a static property; it’s not a static property, but instead an instance property. However, it’s not a property of RegExp.prototype but instead is only exposed from RegExp instances — so this change adds some special-casing for that in the article for lastIndex itself, as well as in the RegExp article. Fixes https://github.com/mdn/content/issues/2708 --- .../javascript/reference/global_objects/regexp/index.html | 4 ++-- .../reference/global_objects/regexp/lastindex/index.html | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/index.html b/files/en-us/web/javascript/reference/global_objects/regexp/index.html index 190c3c500be9b4c..99bc395407f3b8c 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/index.html +++ b/files/en-us/web/javascript/reference/global_objects/regexp/index.html @@ -64,8 +64,6 @@

Static properties

{{jsxref("RegExp.@@species", "get RegExp[@@species]")}}
The constructor function that is used to create derived objects.
-
{{jsxref("RegExp.lastIndex")}}
-
The index at which to start the next match.

Instance properties

@@ -87,6 +85,8 @@

Instance properties

Whether or not the search is sticky.
{{JSxRef("RegExp.prototype.unicode")}}
Whether or not Unicode features are enabled.
+
{{jsxref("RegExp.lastIndex", "regExp.lastIndex")}}
+
The index at which to start the next match.

Instance methods

diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/lastindex/index.html b/files/en-us/web/javascript/reference/global_objects/regexp/lastindex/index.html index 365ae708cd1836f..b0f65ffdbbd51bc 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/lastindex/index.html +++ b/files/en-us/web/javascript/reference/global_objects/regexp/lastindex/index.html @@ -1,5 +1,5 @@ --- -title: RegExpInstance.lastIndex +title: 'RegExp: lastIndex' slug: Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex tags: - JavaScript @@ -10,7 +10,9 @@ ---
{{JSRef}}
-

The lastIndex is a read/write integer property of regular expression instances that specifies the index at which to start the next match.

+

lastIndex is a read/write integer property of {{jsXref("RegExp")}} instances that specifies the index at which to start the next match.

+ +

Note that lastIndex is not a property of the {{jsXref("RegExp")}} prototype but is instead only exposed from {{jsXref("RegExp")}} instances.

{{EmbedInteractiveExample("pages/js/regexp-lastindex.html")}}
@@ -60,7 +62,7 @@

Specifications

- {{SpecName('ESDraft', '#sec-properties-of-regexp-instances', 'RegExp.lastIndex')}} + {{SpecName('ESDraft', '#sec-properties-of-regexp-instances', 'lastIndex')}} From 6daf22ffe215b3447d717efc281c9c20a1d4744c Mon Sep 17 00:00:00 2001 From: "Michael[tm] Smith" Date: Mon, 8 Mar 2021 20:50:10 +0900 Subject: [PATCH 3/3] Use "RegExp: lastIndex" in list --- .../web/javascript/reference/global_objects/regexp/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/index.html b/files/en-us/web/javascript/reference/global_objects/regexp/index.html index 99bc395407f3b8c..dbd8ee8661395d2 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/index.html +++ b/files/en-us/web/javascript/reference/global_objects/regexp/index.html @@ -85,7 +85,7 @@

Instance properties

Whether or not the search is sticky.
{{JSxRef("RegExp.prototype.unicode")}}
Whether or not Unicode features are enabled.
-
{{jsxref("RegExp.lastIndex", "regExp.lastIndex")}}
+
{{jsxref("RegExp.lastIndex", "RegExp: lastIndex")}}
The index at which to start the next match.