Closed Bug 1559576 Opened 5 years ago Closed 5 years ago

Array constructor contains copies of methods on Array.prototype

Categories

(Core :: JavaScript Engine, defect)

67 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1222547

People

(Reporter: dberry02jr, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

Steps to reproduce:

In Firefox the Array constructor contains copies of helper methods that are in Array.prototype such as pop, push, map, etc.

Object.getOwnPropertyNames(Array); // Returns array length 25

Array.pop; // function pop()

Array.prototype.pop // function pop()

Array.pop === Array.prototype.pop // false

Actual results:

Result from Firefox (67.0.2 (64-bit)):

Object.getOwnPropertyNames(Array);
Array(25) [ "isArray", "concat", "lastIndexOf", "indexOf", "forEach", "map", "filter", "every", "some", "reduce", … ]

Expected results:

Array constructor should not contain copies of methods in Array.prototype.

Result when ran in Chrome (Version 75.0.3770.90 (Official Build) (64-bit)):

Object.getOwnPropertyNames(Array);
(6) ["length", "name", "prototype", "isArray", "from", "of"]

Hi @dberry02jr, please provide a TC, link, accurate steps to reproducing in order to test the issue.
For the moment I guess that the component settled is a proper one, but if isn't please fell free to change it.
Thanks.

Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Flags: needinfo?(dberry02jr)

Array generics, a very old SpiderMonkey extension. We're in the process of removing them, bug 1222547.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(dberry02jr)
You need to log in before you can comment on or make changes to this bug.