` element found in
+ * the first `` of each row. The generated id follows the pattern:
+ * `ask262-internal-method-` where `` is the text
+ * content of the `` element with surrounding brackets stripped.
+ *
+ * @param $ - The Cheerio parsing instance.
+ */
+function addInternalMethodIds($: CheerioAPI): void {
+ // Find the first inside the first of each row
+ // in the two internal‑method tables and add a unique `id` attribute.
+ $(
+ "#table-essential-internal-methods tr > td:first-child, " +
+ "#table-additional-essential-internal-methods-of-function-objects tr > td:first-child",
+ ).each((_, td: any) => {
+ const $td = $(td);
+ const $var = $td.find("var.field").first();
+ if ($var.length) {
+ const rawText = $var.text().trim();
+ // Remove any square brackets from the extracted text
+ const text = rawText.replace(/[[\]]/g, "");
+ const id = `ask262-internal-method-${text}`;
+ $var.attr("id", id);
+ }
+ });
+}
+
+// Execute core logic
+addInternalMethodIds(htmlCheerioApi);
+
+// Write the updated HTML back
+writeFileSync(htmlPath, htmlCheerioApi.html(), "utf-8");
+console.log(
+ `Updated ${htmlPath} – added id attributes to elements.`,
+);
diff --git a/spec-built/multipage/ecmascript-data-types-and-values.html b/spec-built/multipage/ecmascript-data-types-and-values.html
index e6caac4..0e4fc03 100644
--- a/spec-built/multipage/ecmascript-data-types-and-values.html
+++ b/spec-built/multipage/ecmascript-data-types-and-values.html
@@ -1212,7 +1212,7 @@
|
- [[GetPrototypeOf]]
+ [[GetPrototypeOf]]
|
( ) → Object | Null
@@ -1223,7 +1223,7 @@
|
|
- [[SetPrototypeOf]]
+ [[SetPrototypeOf]]
|
(Object | Null) → Boolean
@@ -1234,7 +1234,7 @@
|
|
- [[IsExtensible]]
+ [[IsExtensible]]
|
( ) → Boolean
@@ -1245,7 +1245,7 @@
|
|
- [[PreventExtensions]]
+ [[PreventExtensions]]
|
( ) → Boolean
@@ -1256,7 +1256,7 @@
|
|
- [[GetOwnProperty]]
+ [[GetOwnProperty]]
|
(propertyKey) → Undefined | Property Descriptor
@@ -1267,7 +1267,7 @@
|
|
- [[DefineOwnProperty]]
+ [[DefineOwnProperty]]
|
(propertyKey, PropertyDescriptor) → Boolean
@@ -1278,7 +1278,7 @@
|
|
- [[HasProperty]]
+ [[HasProperty]]
|
(propertyKey) → Boolean
@@ -1289,7 +1289,7 @@
|
|
- [[Get]]
+ [[Get]]
|
(propertyKey, Receiver) → any
@@ -1300,7 +1300,7 @@
|
|
- [[Set]]
+ [[Set]]
|
(propertyKey, value, Receiver) → Boolean
@@ -1311,7 +1311,7 @@
|
|
- [[Delete]]
+ [[Delete]]
|
(propertyKey) → Boolean
@@ -1322,7 +1322,7 @@
|
|
- [[OwnPropertyKeys]]
+ [[OwnPropertyKeys]]
|
( ) → List of property keys
@@ -1351,7 +1351,7 @@
|
|
- [[Call]]
+ [[Call]]
|
(any, a List of any) → any
@@ -1362,7 +1362,7 @@
|
|
- [[Construct]]
+ [[Construct]]
|
(a List of any, Object) → Object
| | |