File tree Expand file tree Collapse file tree 4 files changed +108
-14
lines changed Expand file tree Collapse file tree 4 files changed +108
-14
lines changed Original file line number Diff line number Diff line change @@ -268,11 +268,18 @@ export class Context {
268
268
}
269
269
270
270
const builtInSymbolRegExp = / ^ _ _ @ ( \w + ) $ / ;
271
+ const uniqueSymbolRegExp = / ^ _ _ @ ( .* ) @ \d + $ / ;
271
272
272
273
function getHumanName ( name : string ) {
273
- const match = builtInSymbolRegExp . exec ( name ) ;
274
+ let match = builtInSymbolRegExp . exec ( name ) ;
274
275
if ( match ) {
275
276
return `[Symbol.${ match [ 1 ] } ]` ;
276
277
}
278
+
279
+ match = uniqueSymbolRegExp . exec ( name ) ;
280
+ if ( match ) {
281
+ return `[${ match [ 1 ] } ]` ;
282
+ }
283
+
277
284
return name ;
278
285
}
Original file line number Diff line number Diff line change 1374
1374
},
1375
1375
{
1376
1376
"id" : 99 ,
1377
- "name" : " variable " ,
1377
+ "name" : " symbols " ,
1378
1378
"kind" : 1 ,
1379
1379
"kindString" : " Module" ,
1380
1380
"flags" : {},
1381
1381
"children" : [
1382
+ {
1383
+ "id" : 101 ,
1384
+ "name" : " ComputedUniqueName" ,
1385
+ "kind" : 256 ,
1386
+ "kindString" : " Interface" ,
1387
+ "flags" : {},
1388
+ "children" : [
1389
+ {
1390
+ "id" : 102 ,
1391
+ "name" : " [UNIQUE_SYMBOL]" ,
1392
+ "kind" : 1024 ,
1393
+ "kindString" : " Property" ,
1394
+ "flags" : {},
1395
+ "type" : {
1396
+ "type" : " intrinsic" ,
1397
+ "name" : " string"
1398
+ }
1399
+ }
1400
+ ],
1401
+ "groups" : [
1402
+ {
1403
+ "title" : " Properties" ,
1404
+ "kind" : 1024 ,
1405
+ "children" : [
1406
+ 102
1407
+ ]
1408
+ }
1409
+ ]
1410
+ },
1382
1411
{
1383
1412
"id" : 100 ,
1413
+ "name" : " UNIQUE_SYMBOL" ,
1414
+ "kind" : 32 ,
1415
+ "kindString" : " Variable" ,
1416
+ "flags" : {
1417
+ "isConst" : true
1418
+ },
1419
+ "type" : {
1420
+ "type" : " query" ,
1421
+ "queryType" : {
1422
+ "type" : " reference" ,
1423
+ "id" : 100 ,
1424
+ "name" : " UNIQUE_SYMBOL"
1425
+ }
1426
+ },
1427
+ "defaultValue" : " ..."
1428
+ }
1429
+ ],
1430
+ "groups" : [
1431
+ {
1432
+ "title" : " Interfaces" ,
1433
+ "kind" : 256 ,
1434
+ "children" : [
1435
+ 101
1436
+ ]
1437
+ },
1438
+ {
1439
+ "title" : " Variables" ,
1440
+ "kind" : 32 ,
1441
+ "children" : [
1442
+ 100
1443
+ ]
1444
+ }
1445
+ ]
1446
+ },
1447
+ {
1448
+ "id" : 103 ,
1449
+ "name" : " variable" ,
1450
+ "kind" : 1 ,
1451
+ "kindString" : " Module" ,
1452
+ "flags" : {},
1453
+ "children" : [
1454
+ {
1455
+ "id" : 104 ,
1384
1456
"name" : " myConst" ,
1385
1457
"kind" : 32 ,
1386
1458
"kindString" : " Variable" ,
1394
1466
"defaultValue" : " 15"
1395
1467
},
1396
1468
{
1397
- "id" : 101 ,
1469
+ "id" : 105 ,
1398
1470
"name" : " myLet" ,
1399
1471
"kind" : 32 ,
1400
1472
"kindString" : " Variable" ,
1408
1480
"defaultValue" : " 15"
1409
1481
},
1410
1482
{
1411
- "id" : 102 ,
1483
+ "id" : 106 ,
1412
1484
"name" : " myVar" ,
1413
1485
"kind" : 32 ,
1414
1486
"kindString" : " Variable" ,
1420
1492
"defaultValue" : " 15"
1421
1493
},
1422
1494
{
1423
- "id" : 103 ,
1495
+ "id" : 107 ,
1424
1496
"name" : " x" ,
1425
1497
"kind" : 32 ,
1426
1498
"kindString" : " Variable" ,
1433
1505
}
1434
1506
},
1435
1507
{
1436
- "id" : 104 ,
1508
+ "id" : 108 ,
1437
1509
"name" : " y" ,
1438
1510
"kind" : 32 ,
1439
1511
"kindString" : " Variable" ,
1452
1524
}
1453
1525
},
1454
1526
{
1455
- "id" : 105 ,
1527
+ "id" : 109 ,
1456
1528
"name" : " z" ,
1457
1529
"kind" : 32 ,
1458
1530
"kindString" : " Variable" ,
1476
1548
"title" : " Variables" ,
1477
1549
"kind" : 32 ,
1478
1550
"children" : [
1479
- 100 ,
1480
- 101 ,
1481
- 102 ,
1482
- 103 ,
1483
1551
104 ,
1484
- 105
1552
+ 105 ,
1553
+ 106 ,
1554
+ 107 ,
1555
+ 108 ,
1556
+ 109
1485
1557
]
1486
1558
}
1487
1559
]
1495
1567
1 ,
1496
1568
15 ,
1497
1569
30 ,
1498
- 99
1570
+ 99 ,
1571
+ 103
1499
1572
]
1500
1573
}
1501
1574
]
Original file line number Diff line number Diff line change 414
414
},
415
415
{
416
416
"id" : 24 ,
417
+ "name" : " symbols" ,
418
+ "kind" : 1 ,
419
+ "kindString" : " Module" ,
420
+ "flags" : {}
421
+ },
422
+ {
423
+ "id" : 25 ,
417
424
"name" : " variable" ,
418
425
"kind" : 1 ,
419
426
"kindString" : " Module" ,
428
435
1 ,
429
436
15 ,
430
437
19 ,
431
- 24
438
+ 24 ,
439
+ 25
432
440
]
433
441
}
434
442
]
Original file line number Diff line number Diff line change
1
+ export const UNIQUE_SYMBOL = Symbol ( ) ;
2
+
3
+ export interface ComputedUniqueName {
4
+ // GH#1514
5
+ [ UNIQUE_SYMBOL ] : string ;
6
+ }
You can’t perform that action at this time.
0 commit comments