@@ -969,9 +969,7 @@ function validate_no_const_assignment(node, argument, scope, is_binding) {
969
969
function validate_assignment ( node , argument , state ) {
970
970
validate_no_const_assignment ( node , argument , state . scope , false ) ;
971
971
972
- if ( ! state . analysis . runes ) return ;
973
-
974
- if ( argument . type === 'Identifier' ) {
972
+ if ( state . analysis . runes && argument . type === 'Identifier' ) {
975
973
const binding = state . scope . get ( argument . name ) ;
976
974
if ( binding ?. kind === 'derived' ) {
977
975
error ( node , 'invalid-derived-assignment' ) ;
@@ -982,17 +980,17 @@ function validate_assignment(node, argument, state) {
982
980
}
983
981
}
984
982
985
- let obj = /** @type {import('estree').Expression | import('estree').Super } */ ( argument ) ;
983
+ let object = /** @type {import('estree').Expression | import('estree').Super } */ ( argument ) ;
986
984
987
985
/** @type {import('estree').Expression | import('estree').PrivateIdentifier | null } */
988
986
let property = null ;
989
987
990
- while ( obj . type === 'MemberExpression' ) {
991
- property = obj . property ;
992
- obj = obj . object ;
988
+ while ( object . type === 'MemberExpression' ) {
989
+ property = object . property ;
990
+ object = object . object ;
993
991
}
994
992
995
- if ( obj . type === 'ThisExpression' && property ?. type === 'PrivateIdentifier' ) {
993
+ if ( object . type === 'ThisExpression' && property ?. type === 'PrivateIdentifier' ) {
996
994
if ( state . private_derived_state . includes ( property . name ) ) {
997
995
error ( node , 'invalid-derived-assignment' ) ;
998
996
}
0 commit comments