summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/harness/compare-array-symbol.js
blob: 24108342a110f2a43c6f3e6d92ac9fabc8a1645f (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
// Copyright (C) 2019 Alexey Shvayka. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: >
  compareArray correctly formats Symbols in error message.
includes: [compareArray.js]
features: [Symbol]
---*/

var threw = false;

try {
  assert.compareArray([Symbol()], [Symbol('desc')]);
} catch (err) {
  threw = true;

  assert.sameValue(err.constructor, Test262Error);
  assert(err.message.indexOf('[Symbol()]') !== -1);
  assert(err.message.indexOf('[Symbol(desc)]') !== -1);
}

assert(threw);

reportCompare(0, 0);