Skip to content

Commit 59a4561

Browse files
committed
actually cant detect collection polyfills
1 parent c919970 commit 59a4561

File tree

9 files changed

+118
-137
lines changed

9 files changed

+118
-137
lines changed

cli/test/smokehouse/test-definitions/legacy-javascript.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const expectations = {
3131
items: [
3232
{
3333
url: 'http://localhost:10200/legacy-javascript.js',
34-
wastedBytes: '134000 +/- 2000',
34+
wastedBytes: '127000 +/- 2000',
3535
subItems: {
3636
items: [
3737
{signal: 'Object.getOwnPropertyDescriptor'},
@@ -115,7 +115,6 @@ const expectations = {
115115
{signal: 'String.prototype.trimEnd'},
116116
{signal: 'String.prototype.trimStart'},
117117
{signal: 'String.prototype.trim'},
118-
{signal: 'WeakSet'},
119118
{signal: 'Promise.any'},
120119
{signal: 'String.prototype.replaceAll'},
121120
{signal: '@babel/plugin-transform-classes'},

core/audits/byte-efficiency/legacy-javascript.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ class LegacyJavascript extends ByteEfficiencyAudit {
181181
// {target:"Array",proto:true,forced:!HAS_SPECIES_SUPPORT||!USES_TO_LENGTH},{filter:
182182
expression += `|{target:${qt(objectWithoutPrototype)}\\S*},{${property}:`;
183183
} else {
184-
// WeakSet, etc.
185-
expression += `|function ${property}\\(`;
184+
// Map, Set, WeakSet, etc.
185+
// collection("Map",
186+
// Currently not used. See create-polyfill-module-data.js
187+
// expression += `|collection\\(${qt(property)},`;
186188
}
187189

188190
return expression;
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,96 @@
11
{
2-
"moduleSizes": [26070, 498, 282, 294, 281, 467, 161, 227, 236, 229, 765, 546, 339, 1608, 723, 729, 1545, 438, 214, 657, 111, 759, 537, 209, 281, 685, 217, 757, 3015, 3401, 631, 293, 182, 475, 79, 407, 140, 366, 792, 191, 269, 222, 158, 280, 188, 137, 158, 105, 189, 543, 160, 742, 1436, 88, 904, 146, 314, 375, 183, 1083, 195, 503, 269, 208, 334, 350, 460, 568, 229, 1155, 334, 266, 30, 120, 309, 370, 480, 358, 1952, 1638, 304, 153, 274, 1288, 192, 543, 74, 144, 137, 33, 336, 457, 2122, 535, 711, 1323, 117, 1961, 244, 557, 318, 119, 124, 108, 144, 96, 133, 441, 210, 1627, 1956, 693, 1426, 863, 637, 301, 51, 708, 583, 119, 600, 221, 370, 728, 1085, 552, 629, 125, 1746, 97, 441, 543, 2756, 371, 447, 548, 243, 266, 217, 99, 440, 183, 546, 137, 464, 207, 983, 171, 992, 503, 237, 382, 249, 675, 402, 254, 223, 164, 214, 191, 831, 218, 202, 232, 124, 249, 160, 251, 217, 717, 78, 561, 1627, 256, 386, 225, 432, 499, 394, 364, 445, 634, 667, 177, 346, 470, 663, 142, 588, 414, 617, 1559, 380, 2520, 1040, 417, 289, 238, 220, 214, 303, 163, 141, 510, 397, 137, 137, 133, 133, 390, 266, 137, 183, 215, 191, 485, 328, 575, 799, 533, 148, 215, 589, 589, 130, 362, 562, 471, 179, 186, 1266, 1456, 521, 1536, 427, 444, 406, 912, 150, 283, 144, 485, 470, 1787, 205, 1268, 796, 658, 306, 3751, 321, 331, 814, 146, 2328, 1226, 922, 237, 206, 198, 250, 283, 261, 58, 46, 59, 53, 52, 60, 49, 54, 56, 3000],
2+
"moduleSizes": [26070, 498, 282, 294, 281, 467, 161, 236, 229, 765, 546, 339, 1608, 723, 729, 1545, 438, 214, 657, 111, 759, 537, 209, 281, 685, 217, 757, 631, 293, 182, 475, 79, 407, 140, 366, 792, 269, 222, 158, 280, 188, 137, 158, 105, 189, 543, 160, 742, 1436, 88, 904, 146, 314, 375, 183, 1083, 195, 503, 269, 208, 334, 350, 460, 568, 229, 1155, 334, 266, 30, 120, 309, 370, 358, 1952, 1638, 304, 153, 274, 1288, 192, 543, 74, 144, 137, 33, 336, 457, 2122, 535, 711, 1323, 117, 1961, 244, 557, 318, 119, 124, 108, 144, 96, 133, 441, 210, 1627, 1956, 693, 1426, 863, 637, 301, 51, 708, 583, 119, 600, 221, 370, 728, 1085, 552, 629, 125, 1746, 97, 441, 543, 2756, 371, 447, 548, 243, 266, 217, 99, 440, 183, 546, 137, 464, 207, 983, 171, 992, 503, 237, 382, 249, 675, 402, 254, 223, 164, 214, 191, 831, 218, 202, 232, 124, 249, 160, 251, 217, 717, 78, 561, 1627, 256, 386, 225, 432, 499, 394, 364, 445, 634, 667, 177, 346, 470, 663, 142, 588, 414, 617, 1559, 380, 2520, 1040, 417, 289, 238, 220, 214, 303, 163, 141, 510, 397, 137, 137, 133, 133, 390, 266, 137, 183, 215, 191, 485, 328, 575, 799, 533, 148, 215, 589, 589, 130, 362, 562, 471, 179, 186, 1266, 1456, 521, 1536, 427, 444, 406, 912, 150, 283, 144, 485, 470, 1787, 205, 1268, 796, 658, 306, 3751, 321, 331, 814, 146, 2328, 1226, 922, 237, 206, 198, 250, 283, 46, 59, 53, 52, 60, 49, 54, 56, 3000],
33
"dependencies": {
4-
"Array.prototype.at": [0, 5, 73, 110, 111, 121, 171, 264],
5-
"Array.prototype.concat": [0, 17, 22, 23, 27, 37, 44, 81, 83, 162, 172],
6-
"Array.prototype.copyWithin": [0, 5, 10, 41, 73, 110, 111, 121, 173],
7-
"Array.prototype.every": [0, 16, 18, 22, 23, 27, 57, 63, 81, 83, 162, 174],
8-
"Array.prototype.fill": [0, 5, 11, 73, 110, 111, 121, 175],
9-
"Array.prototype.filter": [0, 16, 17, 22, 23, 27, 57, 63, 81, 83, 162, 176],
10-
"Array.prototype.find": [0, 5, 16, 22, 23, 27, 57, 63, 73, 81, 83, 110, 111, 121, 162, 180],
11-
"Array.prototype.findIndex": [0, 5, 16, 22, 23, 27, 57, 63, 73, 81, 83, 110, 111, 121, 162, 177],
12-
"Array.prototype.findLast": [0, 5, 15, 57, 63, 73, 110, 111, 121, 179, 266],
13-
"Array.prototype.findLastIndex": [0, 5, 15, 57, 63, 73, 110, 111, 121, 178, 265],
14-
"Array.prototype.flat": [0, 22, 23, 27, 44, 54, 57, 63, 81, 83, 162, 182],
15-
"Array.prototype.flatMap": [0, 22, 23, 27, 44, 54, 57, 63, 81, 83, 162, 181],
16-
"Array.prototype.forEach": [0, 12, 16, 18, 22, 23, 27, 57, 63, 81, 83, 162, 183],
17-
"Array.from": [0, 13, 24, 25, 27, 37, 57, 63, 66, 67, 80, 83, 93, 162, 184],
18-
"Array.prototype.includes": [0, 5, 73, 110, 111, 121, 185],
19-
"Array.prototype.indexOf": [0, 18, 63, 186],
20-
"Array.isArray": [0, 81, 187],
21-
"Array.prototype.join": [0, 18, 188],
22-
"Array.prototype.map": [0, 16, 17, 22, 23, 27, 57, 63, 81, 83, 162, 189],
23-
"Array.of": [0, 27, 37, 83, 162, 190],
24-
"Array.prototype.slice": [0, 17, 20, 27, 37, 81, 83, 162, 191],
25-
"Array.prototype.some": [0, 16, 18, 22, 23, 27, 57, 63, 81, 83, 162, 192],
26-
"Array.prototype.sort": [0, 18, 20, 21, 27, 41, 46, 47, 50, 162, 163, 193],
27-
"Array.prototype.unshift": [0, 19, 41, 44, 81, 194],
28-
"Math.acosh": [0, 102, 195],
29-
"Math.asinh": [0, 196],
30-
"Math.atanh": [0, 197],
31-
"Math.cbrt": [0, 105, 198],
32-
"Math.clz32": [0, 199],
33-
"Math.cosh": [0, 98, 200],
34-
"Math.expm1": [0, 98, 201],
35-
"Math.fround": [0, 99, 100, 104, 105, 202],
36-
"Math.hypot": [0, 203],
37-
"Math.imul": [0, 204],
38-
"Math.log10": [0, 101, 205],
39-
"Math.log1p": [0, 102, 206],
40-
"Math.log2": [0, 103, 207],
41-
"Math.sign": [0, 105, 208],
42-
"Math.sinh": [0, 98, 209],
43-
"Math.tanh": [0, 98, 210],
44-
"Math.trunc": [0, 211],
45-
"Object.assign": [0, 109, 121, 212],
46-
"Object.create": [0, 73, 110, 111, 121, 213],
47-
"Object.entries": [0, 32, 117, 121, 124, 214],
48-
"Object.freeze": [0, 9, 20, 55, 78, 114, 118, 215],
49-
"Object.fromEntries": [0, 27, 37, 57, 63, 66, 67, 80, 92, 93, 162, 216],
50-
"Object.getOwnPropertyDescriptor": [0, 217],
51-
"Object.getOwnPropertyDescriptors": [0, 37, 218],
52-
"Object.getPrototypeOf": [0, 32, 117, 219],
53-
"Object.hasOwn": [0, 220, 267],
54-
"Object.is": [0, 139, 224],
55-
"Object.isExtensible": [0, 9, 118, 221],
56-
"Object.isFrozen": [0, 9, 222],
57-
"Object.isSealed": [0, 9, 223],
58-
"Object.keys": [0, 121, 225],
59-
"Object.preventExtensions": [0, 9, 20, 55, 78, 114, 118, 226],
60-
"Object.seal": [0, 9, 20, 55, 78, 114, 118, 227],
61-
"Object.setPrototypeOf": [0, 4, 62, 88, 123, 228],
62-
"Object.values": [0, 32, 117, 121, 124, 229],
63-
"Promise.any": [0, 25, 27, 51, 57, 63, 66, 67, 80, 92, 93, 107, 127, 128, 129, 130, 162, 231, 269],
64-
"Reflect.apply": [0, 56, 232],
65-
"Reflect.construct": [0, 3, 20, 27, 56, 59, 73, 83, 110, 111, 121, 162, 233],
66-
"Reflect.deleteProperty": [0, 234],
67-
"Reflect.get": [0, 32, 84, 117, 237],
68-
"Reflect.getOwnPropertyDescriptor": [0, 235],
69-
"Reflect.getPrototypeOf": [0, 32, 117, 236],
70-
"Reflect.has": [0, 238],
71-
"Reflect.isExtensible": [0, 9, 118, 239],
72-
"Reflect.ownKeys": [0, 240],
73-
"Reflect.preventExtensions": [0, 55, 241],
74-
"Reflect.set": [0, 32, 84, 117, 243],
75-
"Reflect.setPrototypeOf": [0, 4, 62, 88, 123, 242],
76-
"String.prototype.codePointAt": [0, 27, 146, 162, 163, 244],
77-
"String.prototype.endsWith": [0, 27, 31, 63, 90, 108, 162, 163, 245],
78-
"String.fromCodePoint": [0, 246],
79-
"String.prototype.includes": [0, 27, 31, 90, 108, 162, 163, 247],
80-
"String.prototype.matchAll": [0, 3, 6, 27, 32, 34, 63, 73, 83, 90, 94, 95, 110, 111, 117, 121, 131, 132, 133, 134, 135, 136, 137, 140, 144, 146, 162, 163, 249, 270],
81-
"String.prototype.padEnd": [0, 27, 147, 148, 149, 162, 163, 250],
82-
"String.prototype.padStart": [0, 27, 147, 148, 149, 162, 163, 251],
83-
"String.raw": [0, 27, 162, 163, 252],
84-
"String.prototype.repeat": [0, 27, 149, 162, 163, 253],
85-
"String.prototype.replaceAll": [0, 27, 69, 90, 133, 134, 162, 163, 254, 271],
86-
"String.prototype.startsWith": [0, 27, 31, 63, 90, 108, 162, 163, 255],
87-
"String.prototype.substr": [0, 27, 162, 163, 256],
88-
"String.prototype.trim": [0, 27, 151, 153, 162, 163, 170, 261],
89-
"String.prototype.trimEnd": [0, 27, 150, 151, 153, 162, 163, 170, 257, 259],
90-
"String.prototype.trimStart": [0, 27, 151, 152, 153, 162, 163, 170, 258, 260],
91-
"String.prototype.link": [0, 27, 33, 145, 162, 163, 248],
92-
"WeakSet": [0, 4, 7, 9, 16, 20, 22, 23, 25, 27, 28, 29, 39, 55, 57, 62, 63, 66, 67, 76, 78, 80, 81, 83, 88, 92, 93, 114, 118, 123, 140, 162, 262, 263],
93-
"Promise.allSettled": [0, 25, 27, 51, 57, 63, 66, 67, 80, 92, 93, 107, 127, 128, 129, 130, 162, 230, 268],
94-
"focus-visible": [272]
4+
"Array.prototype.at": [0, 5, 69, 105, 106, 116, 166, 257],
5+
"Array.prototype.concat": [0, 16, 21, 22, 26, 34, 40, 76, 78, 157, 167],
6+
"Array.prototype.copyWithin": [0, 5, 9, 37, 69, 105, 106, 116, 168],
7+
"Array.prototype.every": [0, 15, 17, 21, 22, 26, 53, 59, 76, 78, 157, 169],
8+
"Array.prototype.fill": [0, 5, 10, 69, 105, 106, 116, 170],
9+
"Array.prototype.filter": [0, 15, 16, 21, 22, 26, 53, 59, 76, 78, 157, 171],
10+
"Array.prototype.find": [0, 5, 15, 21, 22, 26, 53, 59, 69, 76, 78, 105, 106, 116, 157, 175],
11+
"Array.prototype.findIndex": [0, 5, 15, 21, 22, 26, 53, 59, 69, 76, 78, 105, 106, 116, 157, 172],
12+
"Array.prototype.findLast": [0, 5, 14, 53, 59, 69, 105, 106, 116, 174, 259],
13+
"Array.prototype.findLastIndex": [0, 5, 14, 53, 59, 69, 105, 106, 116, 173, 258],
14+
"Array.prototype.flat": [0, 21, 22, 26, 40, 50, 53, 59, 76, 78, 157, 177],
15+
"Array.prototype.flatMap": [0, 21, 22, 26, 40, 50, 53, 59, 76, 78, 157, 176],
16+
"Array.prototype.forEach": [0, 11, 15, 17, 21, 22, 26, 53, 59, 76, 78, 157, 178],
17+
"Array.from": [0, 12, 23, 24, 26, 34, 53, 59, 62, 63, 75, 78, 88, 157, 179],
18+
"Array.prototype.includes": [0, 5, 69, 105, 106, 116, 180],
19+
"Array.prototype.indexOf": [0, 17, 59, 181],
20+
"Array.isArray": [0, 76, 182],
21+
"Array.prototype.join": [0, 17, 183],
22+
"Array.prototype.map": [0, 15, 16, 21, 22, 26, 53, 59, 76, 78, 157, 184],
23+
"Array.of": [0, 26, 34, 78, 157, 185],
24+
"Array.prototype.slice": [0, 16, 19, 26, 34, 76, 78, 157, 186],
25+
"Array.prototype.some": [0, 15, 17, 21, 22, 26, 53, 59, 76, 78, 157, 187],
26+
"Array.prototype.sort": [0, 17, 19, 20, 26, 37, 42, 43, 46, 157, 158, 188],
27+
"Array.prototype.unshift": [0, 18, 37, 40, 76, 189],
28+
"Math.acosh": [0, 97, 190],
29+
"Math.asinh": [0, 191],
30+
"Math.atanh": [0, 192],
31+
"Math.cbrt": [0, 100, 193],
32+
"Math.clz32": [0, 194],
33+
"Math.cosh": [0, 93, 195],
34+
"Math.expm1": [0, 93, 196],
35+
"Math.fround": [0, 94, 95, 99, 100, 197],
36+
"Math.hypot": [0, 198],
37+
"Math.imul": [0, 199],
38+
"Math.log10": [0, 96, 200],
39+
"Math.log1p": [0, 97, 201],
40+
"Math.log2": [0, 98, 202],
41+
"Math.sign": [0, 100, 203],
42+
"Math.sinh": [0, 93, 204],
43+
"Math.tanh": [0, 93, 205],
44+
"Math.trunc": [0, 206],
45+
"Object.assign": [0, 104, 116, 207],
46+
"Object.create": [0, 69, 105, 106, 116, 208],
47+
"Object.entries": [0, 29, 112, 116, 119, 209],
48+
"Object.freeze": [0, 8, 19, 51, 73, 109, 113, 210],
49+
"Object.fromEntries": [0, 26, 34, 53, 59, 62, 63, 75, 87, 88, 157, 211],
50+
"Object.getOwnPropertyDescriptor": [0, 212],
51+
"Object.getOwnPropertyDescriptors": [0, 34, 213],
52+
"Object.getPrototypeOf": [0, 29, 112, 214],
53+
"Object.hasOwn": [0, 215, 260],
54+
"Object.is": [0, 134, 219],
55+
"Object.isExtensible": [0, 8, 113, 216],
56+
"Object.isFrozen": [0, 8, 217],
57+
"Object.isSealed": [0, 8, 218],
58+
"Object.keys": [0, 116, 220],
59+
"Object.preventExtensions": [0, 8, 19, 51, 73, 109, 113, 221],
60+
"Object.seal": [0, 8, 19, 51, 73, 109, 113, 222],
61+
"Object.setPrototypeOf": [0, 4, 58, 83, 118, 223],
62+
"Object.values": [0, 29, 112, 116, 119, 224],
63+
"Promise.any": [0, 24, 26, 47, 53, 59, 62, 63, 75, 87, 88, 102, 122, 123, 124, 125, 157, 226, 262],
64+
"Reflect.apply": [0, 52, 227],
65+
"Reflect.construct": [0, 3, 19, 26, 52, 55, 69, 78, 105, 106, 116, 157, 228],
66+
"Reflect.deleteProperty": [0, 229],
67+
"Reflect.get": [0, 29, 79, 112, 232],
68+
"Reflect.getOwnPropertyDescriptor": [0, 230],
69+
"Reflect.getPrototypeOf": [0, 29, 112, 231],
70+
"Reflect.has": [0, 233],
71+
"Reflect.isExtensible": [0, 8, 113, 234],
72+
"Reflect.ownKeys": [0, 235],
73+
"Reflect.preventExtensions": [0, 51, 236],
74+
"Reflect.set": [0, 29, 79, 112, 238],
75+
"Reflect.setPrototypeOf": [0, 4, 58, 83, 118, 237],
76+
"String.prototype.codePointAt": [0, 26, 141, 157, 158, 239],
77+
"String.prototype.endsWith": [0, 26, 28, 59, 85, 103, 157, 158, 240],
78+
"String.fromCodePoint": [0, 241],
79+
"String.prototype.includes": [0, 26, 28, 85, 103, 157, 158, 242],
80+
"String.prototype.matchAll": [0, 3, 6, 26, 29, 31, 59, 69, 78, 85, 89, 90, 105, 106, 112, 116, 126, 127, 128, 129, 130, 131, 132, 135, 139, 141, 157, 158, 244, 263],
81+
"String.prototype.padEnd": [0, 26, 142, 143, 144, 157, 158, 245],
82+
"String.prototype.padStart": [0, 26, 142, 143, 144, 157, 158, 246],
83+
"String.raw": [0, 26, 157, 158, 247],
84+
"String.prototype.repeat": [0, 26, 144, 157, 158, 248],
85+
"String.prototype.replaceAll": [0, 26, 65, 85, 128, 129, 157, 158, 249, 264],
86+
"String.prototype.startsWith": [0, 26, 28, 59, 85, 103, 157, 158, 250],
87+
"String.prototype.substr": [0, 26, 157, 158, 251],
88+
"String.prototype.trim": [0, 26, 146, 148, 157, 158, 165, 256],
89+
"String.prototype.trimEnd": [0, 26, 145, 146, 148, 157, 158, 165, 252, 254],
90+
"String.prototype.trimStart": [0, 26, 146, 147, 148, 157, 158, 165, 253, 255],
91+
"String.prototype.link": [0, 26, 30, 140, 157, 158, 243],
92+
"Promise.allSettled": [0, 24, 26, 47, 53, 59, 62, 63, 75, 87, 88, 102, 122, 123, 124, 125, 157, 225, 261],
93+
"focus-visible": [265]
9594
},
96-
"maxSize": 167439
95+
"maxSize": 159806
9796
}

core/audits/byte-efficiency/polyfill-module-data.json

-7
Original file line numberDiff line numberDiff line change
@@ -627,13 +627,6 @@
627627
],
628628
"corejs": true
629629
},
630-
{
631-
"name": "WeakSet",
632-
"modules": [
633-
"es.weak-set"
634-
],
635-
"corejs": true
636-
},
637630
{
638631
"name": "Array.prototype.at",
639632
"modules": [

core/scripts/legacy-javascript/create-polyfill-module-data.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ const modulesToSkip = [
6666
'es.string.sub',
6767
'es.string.sup',
6868

69+
// Internals of core-js@3 currently emit the code for these polyfills even if not needed
70+
// by the target environment.
71+
// Example: https://github.com/zloirock/core-js/blob/2da152ff2b23d483be6e2e30e4fcb93582bd9be7/packages/core-js/internals/composite-key.js#L2-L3
72+
'es.map',
73+
'es.set',
74+
'es.weak-map',
75+
'es.weak-set',
76+
6977
// Skip some tricky stuff. Would be good to reduce this array.
7078
'es.symbol',
7179
'es.symbol.description',
@@ -113,7 +121,6 @@ const modulesToSkip = [
113121
'es.global-this',
114122
'es.json.stringify',
115123
'es.json.to-string-tag',
116-
'es.map',
117124
'es.math.to-string-tag',
118125
'es.number.constructor',
119126
'es.number.epsilon',
@@ -150,7 +157,6 @@ const modulesToSkip = [
150157
'es.regexp.sticky',
151158
'es.regexp.test',
152159
'es.regexp.to-string',
153-
'es.set',
154160
'es.string.at-alternative',
155161
'es.string.iterator',
156162
'es.string.match',
@@ -195,7 +201,6 @@ const modulesToSkip = [
195201
'es.typed-array.to-locale-string',
196202
'es.typed-array.to-string',
197203
'es.unescape',
198-
'es.weak-map',
199204
'esnext.aggregate-error',
200205
'esnext.global-this',
201206
'esnext.typed-array.at',

core/scripts/legacy-javascript/summary-signals-nomaps.json

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"totalSignals": 270,
2+
"totalSignals": 267,
33
"variantsMissingSignals": [
44
"baseline_true_bugfixes_false",
55
"baseline_true_bugfixes_true"
@@ -98,8 +98,7 @@
9898
"String.prototype.substr",
9999
"String.prototype.trimEnd",
100100
"String.prototype.trimStart",
101-
"String.prototype.trim",
102-
"WeakSet"
101+
"String.prototype.trim"
103102
]
104103
},
105104
{
@@ -814,14 +813,6 @@
814813
"String.raw"
815814
]
816815
},
817-
{
818-
"group": "core-js-3-only-polyfill",
819-
"name": "WeakSet",
820-
"dir": "core-js-3-only-polyfill/WeakSet",
821-
"signals": [
822-
"WeakSet"
823-
]
824-
},
825816
{
826817
"group": "core-js-3-preset-env",
827818
"name": "baseline_false_bugfixes_false",
@@ -910,7 +901,6 @@
910901
"String.prototype.trimEnd",
911902
"String.prototype.trimStart",
912903
"String.prototype.trim",
913-
"WeakSet",
914904
"@babel/plugin-transform-classes",
915905
"@babel/plugin-transform-regenerator",
916906
"@babel/plugin-transform-spread"

core/scripts/legacy-javascript/summary-signals.json

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"totalSignals": 270,
2+
"totalSignals": 267,
33
"variantsMissingSignals": [
44
"baseline_true_bugfixes_false",
55
"baseline_true_bugfixes_true"
@@ -98,8 +98,7 @@
9898
"String.prototype.substr",
9999
"String.prototype.trimEnd",
100100
"String.prototype.trimStart",
101-
"String.prototype.trim",
102-
"WeakSet"
101+
"String.prototype.trim"
103102
]
104103
},
105104
{
@@ -814,14 +813,6 @@
814813
"String.raw"
815814
]
816815
},
817-
{
818-
"group": "core-js-3-only-polyfill",
819-
"name": "WeakSet",
820-
"dir": "core-js-3-only-polyfill/WeakSet",
821-
"signals": [
822-
"WeakSet"
823-
]
824-
},
825816
{
826817
"group": "core-js-3-preset-env",
827818
"name": "baseline_false_bugfixes_false",
@@ -910,7 +901,6 @@
910901
"String.prototype.trimEnd",
911902
"String.prototype.trimStart",
912903
"String.prototype.trim",
913-
"WeakSet",
914904
"@babel/plugin-transform-classes",
915905
"@babel/plugin-transform-regenerator",
916906
"@babel/plugin-transform-spread"

core/scripts/legacy-javascript/summary-sizes.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
all-legacy-polyfills
2-
191735 all-legacy-polyfills-core-js-3/main.bundle.min.js
2+
182535 all-legacy-polyfills-core-js-3/main.bundle.min.js
33

44
core-js-3-only-polyfill
5-
62600 WeakSet/main.bundle.min.js
65
59387 String-prototype-matchAll/main.bundle.min.js
76
48198 Promise-any/main.bundle.min.js
87
48015 Promise-allSettled/main.bundle.min.js

core/test/audits/byte-efficiency/legacy-javascript-test.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,18 @@ Map {
175175
'Object.defineProperty(String.prototype, "repeat", function() {})',
176176
'Object.defineProperty(String.prototype, "repeat", function() {})',
177177
'String.raw = function() {}',
178+
178179
// es-shims (object.entries)
179180
'no(Object,{entries:r},{entries:function',
180181
'no(Array.prototype,{findLast:r},{findLast:function',
182+
181183
// Class polyfills.
182-
'Object.defineProperty(window, \'WeakSet\', function() {})',
183-
'WeakSet = function() {}',
184-
'window.WeakSet = function() {}',
185-
'function WeakSet() {}',
184+
// Currently not used. See create-polyfill-module-data.js
185+
// 'Object.defineProperty(window, \'WeakSet\', function() {})',
186+
// 'WeakSet = function() {}',
187+
// 'window.WeakSet = function() {}',
188+
// Collection polyfills.
189+
// 'collection("WeakSet",(function(init){return',
186190
];
187191
const variants = createVariants(codeSnippets);
188192
const scripts = variants.map((code, i) => {

0 commit comments

Comments
 (0)