Array constructor contains copies of methods on Array.prototype
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
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"]
Comment 1•5 years ago
|
||
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.
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Array generics, a very old SpiderMonkey extension. We're in the process of removing them, bug 1222547.
Updated•5 years ago
|
Description
•