Page MenuHomePhabricator

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

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 created this task.Nov 13 2015, 1:06 AM
Quiddity raised the priority of this task from to Needs Triage.
Quiddity updated the task description. (Show Details)
Quiddity added a project: Phabricator.
Quiddity added a subscriber: Quiddity.
Restricted Application added subscribers: StudiesWorld, scfc, Aklapper. · View Herald TranscriptNov 13 2015, 1:06 AM

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

Very aggravating.

greg updated the task description. (Show Details)Nov 13 2015, 1:52 AM
greg set Security to None.
greg added a subscriber: greg.

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].

greg added a comment.Nov 13 2015, 2:07 AM

/me is upstreaming

Aklapper moved this task from Backlog to Upstreamed on the Phabricator (Upstream) board.
Aklapper triaged this task as Low priority.May 23 2016, 5:34 PM
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptMay 23 2016, 5:34 PM
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
Krinkle removed a subscriber: Krinkle.May 25 2016, 7:48 PM