summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js
blob: 104ca1114d4779640e51564fe451484aebc74f0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-array.prototype.concat
description: >
    Array.prototype.concat will concat an Array when index property
    (read-only) exists in Array.prototype (Step 5.c.i)
includes: [propertyHelper.js]
---*/

Object.defineProperty(Array.prototype, "0", {
  value: 100,
  writable: false,
  configurable: true
});

var newArrayFromConcat = Array.prototype.concat.call(101);

assert(
  newArrayFromConcat[0] instanceof Number,
  'The result of evaluating (newArrayFromConcat[0] instanceof Number) is expected to be true'
);
verifyProperty(newArrayFromConcat, "0", {
  writable: true,
  enumerable: true,
  configurable: true,
});

reportCompare(0, 0);