diff --git a/es2panda/parser/transformer/transformer.cpp b/es2panda/parser/transformer/transformer.cpp index a197a497e3018d67e603d8b9c2c8603da1ae9e50..759caa569d5f9e28b13194ca60cf6173c7af3e96 100644 --- a/es2panda/parser/transformer/transformer.cpp +++ b/es2panda/parser/transformer/transformer.cpp @@ -510,12 +510,12 @@ void Transformer::VisitTSParameterProperty(ir::ClassDefinition *node) } auto *parameter = it->AsTSParameterProperty()->Parameter(); util::StringView name; - // TSParameterPropert only can be identifier or assignment expression + // TSParameterPropert only can be identifier or assignment pattern if (parameter->IsIdentifier()) { name = parameter->AsIdentifier()->Name(); } else { - ASSERT(parameter->IsAssignmentExpression()); - auto *left = parameter->AsAssignmentExpression()->Left(); + ASSERT(parameter->IsAssignmentPattern()); + auto *left = parameter->AsAssignmentPattern()->Left(); ASSERT(left->IsIdentifier()); name = left->AsIdentifier()->Name(); } diff --git a/es2panda/test/parser/ts/test-export-function-expected.txt b/es2panda/test/parser/ts/test-export-function-expected.txt index 9af57e1b247fd9b5a9ae34bab7a52c224f3e9446..be32c13693cb0f303e7cfabd1b34bbaaffe58b6d 100644 --- a/es2panda/test/parser/ts/test-export-function-expected.txt +++ b/es2panda/test/parser/ts/test-export-function-expected.txt @@ -10,7 +10,6 @@ "id": { "type": "Identifier", "name": "f", - "decorators": [], "loc": { "start": { "line": 17, @@ -42,7 +41,6 @@ } } }, - "decorators": [], "loc": { "start": { "line": 17, @@ -97,7 +95,6 @@ "id": { "type": "Identifier", "name": "f", - "decorators": [], "loc": { "start": { "line": 18, @@ -129,7 +126,6 @@ } } }, - "decorators": [], "loc": { "start": { "line": 18, @@ -184,7 +180,6 @@ "id": { "type": "Identifier", "name": "f", - "decorators": [], "loc": { "start": { "line": 19, @@ -216,7 +211,6 @@ } } }, - "decorators": [], "loc": { "start": { "line": 19, diff --git a/es2panda/test/parser/ts/test-func-param9-expected.txt b/es2panda/test/parser/ts/test-func-param9-expected.txt index 06fded2548a802f40f7b9eed815202ae11f3c05e..12787e7c954dcebbbc6da62533cb63f0815b4e6c 100644 --- a/es2panda/test/parser/ts/test-func-param9-expected.txt +++ b/es2panda/test/parser/ts/test-func-param9-expected.txt @@ -8,7 +8,6 @@ "id": { "type": "Identifier", "name": "foo", - "decorators": [], "loc": { "start": { "line": 17, @@ -30,7 +29,6 @@ { "type": "Identifier", "name": "x", - "decorators": [], "loc": { "start": { "line": 17, @@ -126,7 +124,6 @@ "id": { "type": "Identifier", "name": "foo", - "decorators": [], "loc": { "start": { "line": 18, @@ -173,7 +170,6 @@ } } }, - "decorators": [], "loc": { "start": { "line": 18,