Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Symbol/uniqueness.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-symbol-constructor
5 es6id: 19.4.1
6 description: The Symbol constructor returns a unique value
7 info: |
8 1. If NewTarget is not undefined, throw a TypeError exception.
9 2. If description is undefined, let descString be undefined.
10 2. Else, let descString be ? ToString(description).
11 3. Return a new unique Symbol value whose [[Description]] value is
12 descString.
13 features: [Symbol]
14 ---*/
15
16 assert.notSameValue(Symbol(''), Symbol(''), 'empty string');
17 assert.notSameValue(Symbol(), Symbol(), 'undefined');
18 assert.notSameValue(Symbol(null), Symbol(null), 'null value');
19 assert.notSameValue(Symbol('x'), Symbol('x'), 'string "x"');