Commit 3caeeb1
authored
Memoize class binding when compiling private methods and static elements (#15701)
* add test cases
* fix: memoise class binding when lowering static elements and private methods
* update test fixtures
* update test fixtures1 parent 2290647 commit 3caeeb1
333 files changed
Lines changed: 1755 additions & 863 deletions
File tree
- packages
- babel-helper-create-class-features-plugin
- src
- test/fixtures/replace-supers/method
- babel-plugin-proposal-decorators/test/fixtures
- 2021-12-accessors--to-es2015
- private
- public
- static-private
- static-public
- undecorated-static-private
- 2021-12-classes--to-es2015
- expressions-static-blocks
- inheritance
- initializers
- replacement-static-installed-on-correct-class
- replacement-static-this
- replacement
- 2021-12-duplicated-keys--to-es2015
- computed-keys-same-ast
- computed-keys-same-value
- method-and-field
- methods-with-same-key
- 2021-12-fields--to-es2015
- private
- public
- static-private
- static-public
- 2021-12-getters--to-es2015
- private
- public
- static-private
- static-public
- 2021-12-getters-and-setters--to-es2015
- private
- public
- static-private
- static-public
- 2021-12-methods--to-es2015
- private
- public
- static-private
- static-public
- 2021-12-misc--to-es2015
- initProto-existing-derived-constructor
- valid-expression-formats
- 2021-12-setters--to-es2015
- private
- public
- static-private
- static-public
- 2022-03-accessors--to-es2015
- private
- public
- static-private
- static-public
- undecorated-static-private
- 2022-03-classes--to-es2015
- decorator-access-modified-fields
- decorator-access-modified-methods
- expressions-static-blocks
- inheritance
- initializers
- replacement-static-installed-on-correct-class
- replacement-static-this
- replacement
- 2022-03-duplicated-keys--to-es2015
- computed-keys-same-ast
- computed-keys-same-value
- method-and-field
- methods-with-same-key
- 2022-03-fields--to-es2015
- private
- public
- static-private
- static-public
- 2022-03-getters--to-es2015
- private
- public
- static-private
- static-public
- 2022-03-getters-and-setters--to-es2015
- private
- public
- static-private
- static-public
- 2022-03-methods--to-es2015
- private
- public
- static-private
- static-public
- 2022-03-misc--to-es2015
- initProto-existing-derived-constructor
- valid-expression-formats
- 2022-03-setters--to-es2015
- private
- public
- static-private
- static-public
- 2023-01-accessors--to-es2015
- private
- public
- static-private
- static-public
- undecorated-static-private
- 2023-01-classes--to-es2015
- decorator-access-modified-fields
- decorator-access-modified-methods
- expressions-static-blocks
- inheritance
- initializers
- replacement-static-installed-on-correct-class
- replacement-static-this
- replacement
- 2023-01-duplicated-keys--to-es2015
- computed-keys-same-ast
- computed-keys-same-value
- method-and-field
- methods-with-same-key
- 2023-01-fields--to-es2015
- private
- public
- static-private
- static-public
- 2023-01-getters--to-es2015
- private
- public
- static-private
- static-public
- 2023-01-getters-and-setters--to-es2015
- private
- public
- static-private
- static-public
- 2023-01-methods--to-es2015
- private
- public
- static-private
- static-public
- 2023-01-misc--to-es2015
- initProto-existing-derived-constructor
- valid-expression-formats
- 2023-01-setters--to-es2015
- private
- public
- static-private
- static-public
- 2023-05-accessors--to-es2015
- private
- public
- static-private
- static-public
- undecorated-static-private
- 2023-05-classes--to-es2015
- decorator-access-modified-fields
- decorator-access-modified-methods
- expressions-static-blocks
- inheritance
- initializers
- replacement-static-installed-on-correct-class
- replacement-static-this
- replacement
- 2023-05-duplicated-keys--to-es2015
- computed-keys-same-ast
- computed-keys-same-value
- method-and-field
- methods-with-same-key
- 2023-05-fields--to-es2015
- private
- public
- static-private
- static-public
- 2023-05-getters--to-es2015
- private
- public
- static-private
- static-public
- 2023-05-getters-and-setters--to-es2015
- private
- public
- static-private
- static-public
- 2023-05-methods--to-es2015
- private
- public
- static-private
- static-public
- 2023-05-misc--to-es2015
- initProto-existing-derived-constructor
- super-in-decorator
- this
- valid-expression-formats
- 2023-05-setters--to-es2015
- private
- public
- static-private
- static-public
- babel-plugin-proposal-destructuring-private/test/fixtures
- assignment--es2015
- array-rest-destructuring-middle
- array-rest-only
- array-rest
- basic
- completion-do-expression
- member-expression
- nested-under-array-pattern
- nested
- object-rest-and-keys
- object-rest-and-private-keys
- object-rest-under-private
- object-rest
- under-param-initializer
- assumption-objectRestNoSymbols/variable-declaration
- catch-param--es2015/no-shadowed-params
- for-init--es2015
- lhs-with-assign
- lhs
- variable-declaration-with-assign
- variable-declaration
- for-of--es2015
- lhs-with-shadowed-block-scoped
- lhs
- variable-declaration-block-scoped
- variable-declaration
- variable-declaration--es2015
- array-rest-only
- array-rest
- basic
- nested-under-array-pattern
- nested
- object-rest-and-keys
- object-rest-and-private-keys
- object-rest-under-private
- object-rest
- babel-plugin-transform-class-properties/test/fixtures
- assumption-noDocumentAll/optional-chain-before-member-call
- assumption-setPublicClassFields
- static-class-binding
- static-super
- static-this
- nested-class
- super-call-in-decorator
- super-property-in-decorator
- private-loose
- nested-class-extends-computed-redeclared
- nested-class-extends-computed
- optional-chain-before-member-call-with-transform
- optional-chain-before-member-call
- optional-chain-before-property-with-transform
- optional-chain-before-property
- optional-chain-delete-property-with-transform
- optional-chain-delete-property
- optional-chain-in-function-param-with-transform
- optional-chain-in-function-param
- optional-chain-member-optional-call-with-transform
- optional-chain-member-optional-call
- optional-chain-optional-member-call-with-transform
- optional-chain-optional-member-call
- optional-chain-optional-property-with-transform
- optional-chain-optional-property
- parenthesized-optional-member-call-with-transform
- parenthesized-optional-member-call
- static-class-binding
- static-this
- private
- nested-class-extends-computed-redeclared
- nested-class-extends-computed
- optional-chain-before-member-call-with-transform
- optional-chain-before-member-call
- optional-chain-before-property-with-transform
- optional-chain-before-property
- optional-chain-delete-property-with-transform
- optional-chain-delete-property
- optional-chain-in-function-param-with-transform
- optional-chain-in-function-param
- optional-chain-member-optional-call-with-transform
- optional-chain-member-optional-call
- optional-chain-optional-member-call-with-transform
- optional-chain-optional-member-call
- optional-chain-optional-property-with-transform
- optional-chain-optional-property
- parenthesized-optional-member-call-with-transform
- parenthesized-optional-member-call
- static-class-binding
- static-this
- public-loose
- static-class-binding
- static-super
- static-this
- public
- static-class-binding
- static-super
- static-this
- regression
- 6153
- 6154
- babel-plugin-transform-class-static-block/test
- fixtures
- class-static-block/class-binding
- integration-loose
- class-binding
- class-declaration
- in-class-heritage
- multiple-static-initializers
- name-conflict
- preserve-comments
- super-static-block
- integration
- class-binding
- class-declaration
- in-class-heritage
- multiple-static-initializers
- name-conflict
- preserve-comments
- babel-plugin-transform-new-target/test/fixtures/general
- class-properties-loose
- class-properties
- babel-plugin-transform-private-methods/test/fixtures
- accessors-loose/class-binding
- accessors-privateFieldsAsProperties/class-binding
- accessors-privateFieldsAsSymbols/class-binding
- accessors/class-binding
- private-method-loose/class-binding
- private-method-privateFieldsAsProperties
- class-binding
- super
- private-method-privateFieldsAsSymbols
- class-binding
- super
- private-method
- class-binding
- super
- private-static-method-privateFieldsAsProperties
- super
- this
- private-static-method-privateFieldsAsSymbols
- super
- this
- private-static-method
- super
- tagged-template
- this
- static-accessors-loose
- basic
- destructure-set
- get-only-setter
- updates
- static-accessors-privateFieldsAsProperties
- basic
- destructure-set
- get-only-setter
- updates
- static-accessors-privateFieldsAsSymbols
- basic
- destructure-set
- get-only-setter
- updates
- static-accessors
- basic
- destructure-set
- get-only-setter
- set-only-getter
- updates
- babel-preset-env/test/fixtures/shipped-proposals/new-class-features-firefox-70
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 94 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
956 | 956 | | |
957 | 957 | | |
958 | 958 | | |
| 959 | + | |
| 960 | + | |
959 | 961 | | |
960 | 962 | | |
961 | 963 | | |
| |||
984 | 986 | | |
985 | 987 | | |
986 | 988 | | |
987 | | - | |
| 989 | + | |
988 | 990 | | |
989 | 991 | | |
990 | 992 | | |
| |||
998 | 1000 | | |
999 | 1001 | | |
1000 | 1002 | | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | 1003 | | |
1006 | 1004 | | |
1007 | 1005 | | |
1008 | 1006 | | |
1009 | 1007 | | |
1010 | 1008 | | |
1011 | 1009 | | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
| 1010 | + | |
| 1011 | + | |
1029 | 1012 | | |
1030 | 1013 | | |
1031 | 1014 | | |
1032 | 1015 | | |
1033 | 1016 | | |
1034 | 1017 | | |
1035 | 1018 | | |
1036 | | - | |
| 1019 | + | |
1037 | 1020 | | |
1038 | 1021 | | |
1039 | 1022 | | |
| |||
1075 | 1058 | | |
1076 | 1059 | | |
1077 | 1060 | | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
1078 | 1084 | | |
1079 | | - | |
| 1085 | + | |
1080 | 1086 | | |
1081 | 1087 | | |
1082 | 1088 | | |
1083 | | - | |
| 1089 | + | |
1084 | 1090 | | |
1085 | 1091 | | |
1086 | 1092 | | |
1087 | | - | |
| 1093 | + | |
1088 | 1094 | | |
1089 | | - | |
| 1095 | + | |
1090 | 1096 | | |
1091 | 1097 | | |
1092 | 1098 | | |
1093 | 1099 | | |
1094 | 1100 | | |
| 1101 | + | |
1095 | 1102 | | |
1096 | 1103 | | |
1097 | 1104 | | |
| |||
1101 | 1108 | | |
1102 | 1109 | | |
1103 | 1110 | | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1104 | 1115 | | |
1105 | 1116 | | |
1106 | 1117 | | |
| |||
1113 | 1124 | | |
1114 | 1125 | | |
1115 | 1126 | | |
| 1127 | + | |
| 1128 | + | |
1116 | 1129 | | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1117 | 1149 | | |
1118 | 1150 | | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
| 1151 | + | |
1124 | 1152 | | |
1125 | 1153 | | |
1126 | | - | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
1127 | 1157 | | |
1128 | 1158 | | |
1129 | 1159 | | |
| |||
1149 | 1179 | | |
1150 | 1180 | | |
1151 | 1181 | | |
1152 | | - | |
1153 | 1182 | | |
1154 | 1183 | | |
1155 | 1184 | | |
1156 | 1185 | | |
1157 | 1186 | | |
1158 | 1187 | | |
1159 | | - | |
1160 | 1188 | | |
1161 | 1189 | | |
1162 | 1190 | | |
| |||
1170 | 1198 | | |
1171 | 1199 | | |
1172 | 1200 | | |
1173 | | - | |
1174 | 1201 | | |
1175 | 1202 | | |
1176 | 1203 | | |
1177 | 1204 | | |
1178 | 1205 | | |
1179 | 1206 | | |
1180 | | - | |
1181 | 1207 | | |
1182 | 1208 | | |
1183 | | - | |
| 1209 | + | |
1184 | 1210 | | |
1185 | 1211 | | |
1186 | 1212 | | |
| |||
1196 | 1222 | | |
1197 | 1223 | | |
1198 | 1224 | | |
1199 | | - | |
| 1225 | + | |
1200 | 1226 | | |
1201 | 1227 | | |
1202 | 1228 | | |
| |||
1225 | 1251 | | |
1226 | 1252 | | |
1227 | 1253 | | |
1228 | | - | |
| 1254 | + | |
1229 | 1255 | | |
1230 | 1256 | | |
1231 | 1257 | | |
| |||
1238 | 1264 | | |
1239 | 1265 | | |
1240 | 1266 | | |
1241 | | - | |
1242 | 1267 | | |
1243 | 1268 | | |
1244 | 1269 | | |
| |||
1253 | 1278 | | |
1254 | 1279 | | |
1255 | 1280 | | |
1256 | | - | |
1257 | 1281 | | |
1258 | 1282 | | |
1259 | 1283 | | |
1260 | 1284 | | |
1261 | 1285 | | |
1262 | | - | |
| 1286 | + | |
1263 | 1287 | | |
1264 | 1288 | | |
1265 | 1289 | | |
| |||
1279 | 1303 | | |
1280 | 1304 | | |
1281 | 1305 | | |
1282 | | - | |
| 1306 | + | |
1283 | 1307 | | |
1284 | 1308 | | |
1285 | 1309 | | |
1286 | 1310 | | |
1287 | 1311 | | |
1288 | 1312 | | |
1289 | 1313 | | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
1290 | 1324 | | |
1291 | 1325 | | |
1292 | 1326 | | |
1293 | 1327 | | |
| 1328 | + | |
1294 | 1329 | | |
1295 | 1330 | | |
1296 | 1331 | | |
| |||
1310 | 1345 | | |
1311 | 1346 | | |
1312 | 1347 | | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
1323 | 1363 | | |
1324 | 1364 | | |
1325 | 1365 | | |
| |||
0 commit comments