diff --git a/components/script/window_named_properties.rs b/components/script/window_named_properties.rs index cccc42750cc..0165e2de625 100644 --- a/components/script/window_named_properties.rs +++ b/components/script/window_named_properties.rs @@ -117,14 +117,14 @@ unsafe extern "C" fn get_own_property_descriptor( jsstr_to_string(*cx, id.to_string()) } else if id.is_int() { // If the property key is an integer index, convert it to a String too. - // TODO(delan) will this interfere with indexed access on the Window object - // (window[index]), which should only return document-tree child navigables? - // https://html.spec.whatwg.org/multipage/#accessing-other-browsing-contexts + // For indexed access on the window object, which may shadow this, see + // the getOwnPropertyDescriptor trap in dom/windowproxy.rs. id.to_int().to_string() } else if id.is_symbol() { + // Symbol properties were already handled above. unreachable!() } else { - unreachable!() + unimplemented!() }; if s.is_empty() { return true; diff --git a/tests/wpt/web-platform-tests/html/browsers/the-window-object/window-indexed-access-vs-named-access.html b/tests/wpt/web-platform-tests/html/browsers/the-window-object/window-indexed-access-vs-named-access.html new file mode 100644 index 00000000000..4918d7a5031 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/the-window-object/window-indexed-access-vs-named-access.html @@ -0,0 +1,49 @@ + + +