summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/mochitest/private_field_worker.js
blob: b62a8a9a605f5de13c67d7e7d212ca571820570c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class A {
  #x;
}

let objects = [];

self.onmessage = function(e) {
  if (e.data === 'allocate') {
    objects.push(new A);
    return;
  }
  if (e.data == 'count') {
    postMessage(objects.length);
    return;
  }
  postMessage('Unknown message type.');
}