Page MenuHomePhabricator

"Watch" fails to autocomplete in Search due to non-standard reserved keys in Object.prototype in Firefox's JavaScript engine
Closed, InvalidPublic

Description

In Phabricator's search, in Firefox (but not Chromium), if I type watc or watchl it will successfully autocomplete to "mediawiki-watchlist", but if I only type "watch" it doesn't match anything.
Confirmed in private window, as well as logged-in.

Very odd!
(No time to look upstream).

Event Timeline

Quiddity raised the priority of this task from to Needs Triage.
Quiddity updated the task description. (Show Details)
Quiddity added a project: Phabricator.
Quiddity subscribed.

I've seen similar behavior in Google Chrome's omnibar (not at all related to this).

Very aggravating.

greg set Security to None.
greg subscribed.

Probably because the JavaScript code in Phabricator treats an object as supporting arbitrary keys. watch is a non-standard reserved key in Object.prototype in Firefox's JavaScript engine.

The standard reserved keys are all in CamelCase such as toString, valueOf, hasOwnProperty. But Phabricator's script converts the value to lowercase before it searches, so those are fine.

Upstream bug! They need to use if hasOwnProperty.call( obj, key ) instead of if obj[key].

Aklapper renamed this task from "Watch" fails to autocomplete in phabricator's search, in Firefox to "Watch" fails to autocomplete in Search due to non-standard reserved keys in Object.prototype in Firefox's JavaScript engine.May 23 2016, 5:34 PM
Aklapper changed the task status from Open to Stalled.Nov 14 2023, 11:13 AM

I think (?) I cannot reproduce this anymore in Firefox 119 as I see no difference in results (see screenshots below).
But maybe I perform the wrong steps? Would be great if someone could provide a full URL which exact "Search" this is about.

Screenshot from 2023-11-14 12-02-08.png (618×1 px, 154 KB)

Screenshot from 2023-11-14 12-08-19.png (618×1 px, 154 KB)

Screenshot from 2023-11-14 12-01-36.png (531×1 px, 62 KB)

Screenshot from 2023-11-14 12-08-31.png (531×1 px, 86 KB)

Yup, seems to be resolved, somehow. Closing as no longer valid. Thanks!