Skip to content

Parser should reject new import(...).prop syntax #23458

Description

@camc314

Summary

After the Test262 update in #23451, parser_test262.snap shows 63 new failing negative tests. These cases expect SyntaxError for new <ImportCall>.prop, but Oxc currently accepts them.

Examples:

new import('').prop
new import.source('<module source>').prop
new import.defer('./empty_FIXTURE.js').prop

Test262’s rationale is that ImportCall is a CallExpression, not a NewExpression. Property access on an ImportCall remains in the CallExpression grammar, so it cannot be used as the operand of new NewExpression.

Snapshot Evidence

From tasks/coverage/snapshots/parser_test262.snap in #23451:

commit: 05bb0329 -> de8e621c
Negative Passed: 4588/4588 (100.00%) -> 4588/4651 (98.65%)

The added failures are under:

tasks/coverage/test262/test/language/expressions/dynamic-import/syntax/invalid/*-no-new-call-expression-prop-access.js

References

Metadata

Metadata

Assignees

Labels

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions