tc39/test262 — pull request #69 by smikes (2014-08-01 15:25:41+00:00)
Title: ES5.S15: new tests to clarify Array.prototype.concat

[ES5.1 Spec 15.4.4.4](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.4) defines the algorithm for `Array.prototype.concat`.

When `concat` operates on an Array (on an object whose [[Class]] internal property is "Array"), it iterates over that object's indexed properties from `0` to `length-1`.

When extending an array `a` by setting `length`, there will be indices where `a.getOwnProperty()` returns `false`.

When copying elements to the target array, however, `concat` 5.b.iii.2 says to use "the [[HasProperty]] internal method" which will search up the prototype chain. ([[HasProperty]] is implemented in terms of ([[GetProperty]])[http://www.ecma-international.org/ecma-262/5.1/#sec-8.12.2]).

Then if a property with that index is found, either on the object or in its prototype chain, 5.b.iii.3.b states 'Call the [[DefineOwnProperty]] internal method of A'

This means that the result of Array.prototype.concat should return `true` from `hasOwnProperty` for every property
created by `concat`, up to `length`, as long as that property was defined on either the source object or some object in its prototype chain.

These tests check with Array.prototype and Object.prototype, separately.