Problem
The packaged Code OSS editor smoke now passes, but its runtime diagnostics show toolbar and action-list failures:
this.actionBar.getContainer(...).firstElementChild?.children.item is not a function
this.actionsList.children.item is not a function
These exceptions prevent some workbench actions and views from updating even though the editor surface is present.
Root cause
WebScene currently returns plain V8 arrays for Element.children and Node.childNodes. The arrays expose numeric indexing and length, but not the DOM collection item(index) contract. WebScene's attribute collection already installs the existing bounded collection_item callback, and the specialized document.links collection has a native item implementation.
Proposed fix
Install the existing collection_item callback on child collections so both children.item(index) and childNodes.item(index) return the indexed wrapper or null when out of range. Add a native V8 regression contract covering element-only filtering, text-node ordering, wrapper identity, and out-of-range results.
A later standards-completeness change can replace snapshot arrays with live HTMLCollection and NodeList wrapper types. This issue's acceptance requires the callable method Code OSS uses while preserving the existing indexed and length behavior.
Acceptance
- Native V8 contracts pass on all packaged RIDs.
- Code OSS toolbar/action-list updates no longer throw because
children.item is absent.
- No unbounded allocation or extra tree traversal is added to a collection access.
Problem
The packaged Code OSS editor smoke now passes, but its runtime diagnostics show toolbar and action-list failures:
These exceptions prevent some workbench actions and views from updating even though the editor surface is present.
Root cause
WebScene currently returns plain V8 arrays for
Element.childrenandNode.childNodes. The arrays expose numeric indexing andlength, but not the DOM collectionitem(index)contract. WebScene's attribute collection already installs the existing boundedcollection_itemcallback, and the specializeddocument.linkscollection has a nativeitemimplementation.Proposed fix
Install the existing
collection_itemcallback on child collections so bothchildren.item(index)andchildNodes.item(index)return the indexed wrapper ornullwhen out of range. Add a native V8 regression contract covering element-only filtering, text-node ordering, wrapper identity, and out-of-range results.A later standards-completeness change can replace snapshot arrays with live
HTMLCollectionandNodeListwrapper types. This issue's acceptance requires the callable method Code OSS uses while preserving the existing indexed and length behavior.Acceptance
children.itemis absent.