Debian Codegraph @

js/src/tests/test262/harness/compare-array-symbol.js

raw
1 // Copyright (C) 2019 Alexey Shvayka. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: >
6 compareArray correctly formats Symbols in error message.
7 includes: [compareArray.js]
8 features: [Symbol]
9 ---*/
10
11 var threw = false;
12
13 try {
14 assert.compareArray([Symbol()], [Symbol('desc')]);
15 } catch (err) {
16 threw = true;
17
18 assert.sameValue(err.constructor, Test262Error);
19 assert(err.message.indexOf('[Symbol()]') !== -1);
20 assert(err.message.indexOf('[Symbol(desc)]') !== -1);
21 }
22
23 assert(threw);
24
25 reportCompare(0, 0);