private_field_worker.js (293B)
1 class A { 2 #x; 3 4 g(o) { 5 return #x in o; 6 } 7 } 8 9 let objects = []; 10 11 self.onmessage = function (e) { 12 if (e.data === 'allocate') { 13 objects.push(new A); 14 return; 15 } 16 if (e.data == 'count') { 17 postMessage(objects.length); 18 return; 19 } 20 postMessage('Unknown message type.'); 21 }