Skip to content

Commit

Permalink
add test with += operator
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaIT committed Oct 31, 2023
1 parent 6211069 commit 5a3ee73
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions test/parser/next/public-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,79 @@ describe('Next - Public fields', () => {
end: 21,
range: [0, 21]
}
],
[
`class A { a = b += c }`,
Context.OptionsNext | Context.OptionsRanges,
{
body: [
{
body: {
body: [
{
computed: false,
decorators: [],
end: 20,
key: {
end: 11,
name: 'a',
range: [10, 11],
start: 10,
type: 'Identifier'
},
range: [10, 20],
start: 10,
static: false,
type: 'PropertyDefinition',
value: {
end: 20,
left: {
end: 15,
name: 'b',
range: [14, 15],
start: 14,
type: 'Identifier'
},
operator: '+=',
range: [14, 20],
right: {
end: 20,
name: 'c',
range: [19, 20],
start: 19,
type: 'Identifier'
},
start: 14,
type: 'AssignmentExpression'
}
}
],
end: 22,
range: [8, 22],
start: 8,
type: 'ClassBody'
},
decorators: [],
end: 22,
id: {
end: 7,
name: 'A',
range: [6, 7],
start: 6,
type: 'Identifier'
},
range: [0, 22],
start: 0,
superClass: null,
type: 'ClassDeclaration'
}
],
end: 22,
range: [0, 22],
sourceType: 'script',
start: 0,
type: 'Program'
}
]
]);
});

0 comments on commit 5a3ee73

Please sign in to comment.