Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/oxc_ast/src/ast_impl/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ impl<'a> Expression<'a> {
/// Is identifier or `a.b` expression where `a` is an identifier.
pub fn is_entity_name_expression(&self) -> bool {
matches!(self.without_parentheses(), Expression::Identifier(_))
// Special case: treat `this.B` like `this` was an identifier
|| matches!(self.without_parentheses(), Expression::ThisExpression(_))
|| self.is_property_access_entity_name_expression()
}

Expand Down
24 changes: 4 additions & 20 deletions tasks/coverage/snapshots/parser_babel.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ commit: 1d4546bc

parser_babel Summary:
AST Parsed : 2351/2362 (99.53%)
Positive Passed: 2329/2362 (98.60%)
Negative Passed: 1601/1698 (94.29%)
Positive Passed: 2330/2362 (98.65%)
Negative Passed: 1600/1698 (94.23%)
Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/categorized/invalid-startindex-and-startline-specified-without-startcolumn/input.js

Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/categorized/startline-and-startcolumn-specified/input.js
Expand Down Expand Up @@ -134,6 +134,8 @@ Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/ty

Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-property/input.ts

Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/regression/keyword-qualified-type-2/input.ts

Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/regression/keyword-qualified-type-disallowed/input.ts

Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/regression/keyword-qualified-type-disallowed-babel-7/input.ts
Expand Down Expand Up @@ -644,16 +646,6 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
· ──
╰────

Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/regression/keyword-qualified-type-2-babel-7/input.ts

× TS(2499): An interface can only extend an identifier/qualified-name with optional type arguments.
╭─[babel/packages/babel-parser/test/fixtures/typescript/regression/keyword-qualified-type-2-babel-7/input.ts:3:21]
2 │ // but they are always type-checking errors.
3 │ interface A extends this.B {}
· ──────
4 │ type T = typeof var.bar;
╰────

Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/regression/nested-extends-in-arrow-type-param/input.ts

× Expected `,` but found `extends`
Expand Down Expand Up @@ -12825,14 +12817,6 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
3 │ }
╰────

× TS(2499): An interface can only extend an identifier/qualified-name with optional type arguments.
╭─[babel/packages/babel-parser/test/fixtures/typescript/regression/keyword-qualified-type-2/input.ts:3:21]
2 │ // but they are always type-checking errors.
3 │ interface A extends this.B {}
· ──────
4 │ type T = typeof var.bar;
╰────

× Identifier `A` has already been declared
╭─[babel/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/input.ts:1:7]
1 │ class A {}
Expand Down
1 change: 0 additions & 1 deletion tasks/coverage/snapshots/semantic_babel.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,6 @@ after transform: ["this"]
rebuilt : []

semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/regression/keyword-qualified-type-2-babel-7/input.ts
An interface can only extend an identifier/qualified-name with optional type arguments.
Scope children mismatch:
after transform: ScopeId(0): [ScopeId(1), ScopeId(2)]
rebuilt : ScopeId(0): []
Expand Down
Loading