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: 1 addition & 1 deletion .github/actions/clone-submodules/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ runs:
show-progress: false
repository: oxc-project/acorn-test262
path: tasks/coverage/acorn-test262
ref: e6d4a8915d6825132e03b4e517b51f97a1536a3a # Latest main at 28/5/25
ref: 359faaadce848c92efcf19dcaf7446740f8e27f4 # Latest main at 30/5/25
4 changes: 0 additions & 4 deletions crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,6 @@ pub struct Class<'a> {
/// @Bar() // <-- Decorator
/// class Foo {}
/// ```
#[ts]
pub decorators: Vec<'a, Decorator<'a>>,
/// Class identifier, AKA the name
pub id: Option<BindingIdentifier<'a>>,
Expand Down Expand Up @@ -2045,7 +2044,6 @@ pub struct MethodDefinition<'a> {
///
/// This will always be true when an `abstract` modifier is used on the method.
pub r#type: MethodDefinitionType,
#[ts]
pub decorators: Vec<'a, Decorator<'a>>,
#[estree(via = MethodDefinitionKey)]
pub key: PropertyKey<'a>,
Expand Down Expand Up @@ -2085,7 +2083,6 @@ pub struct PropertyDefinition<'a> {
/// Decorators applied to the property.
///
/// See [`Decorator`] for more information.
#[ts]
pub decorators: Vec<'a, Decorator<'a>>,
/// The expression used to declare the property.
pub key: PropertyKey<'a>,
Expand Down Expand Up @@ -2308,7 +2305,6 @@ pub struct AccessorProperty<'a> {
/// Decorators applied to the accessor property.
///
/// See [`Decorator`] for more information.
#[ts]
pub decorators: Vec<'a, Decorator<'a>>,
/// The expression used to declare the property.
pub key: PropertyKey<'a>,
Expand Down
8 changes: 4 additions & 4 deletions crates/oxc_ast/src/generated/derive_estree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ impl ESTree for Class<'_> {
state.serialize_field("type", &self.r#type);
state.serialize_field("start", &self.span.start);
state.serialize_field("end", &self.span.end);
state.serialize_ts_field("decorators", &self.decorators);
state.serialize_field("decorators", &self.decorators);
state.serialize_field("id", &self.id);
state.serialize_ts_field("typeParameters", &self.type_parameters);
state.serialize_field("superClass", &self.super_class);
Expand Down Expand Up @@ -1506,7 +1506,7 @@ impl ESTree for MethodDefinition<'_> {
state.serialize_field("type", &self.r#type);
state.serialize_field("start", &self.span.start);
state.serialize_field("end", &self.span.end);
state.serialize_ts_field("decorators", &self.decorators);
state.serialize_field("decorators", &self.decorators);
state.serialize_field("key", &crate::serialize::js::MethodDefinitionKey(self));
state.serialize_field("value", &self.value);
state.serialize_field("kind", &self.kind);
Expand Down Expand Up @@ -1536,7 +1536,7 @@ impl ESTree for PropertyDefinition<'_> {
state.serialize_field("type", &self.r#type);
state.serialize_field("start", &self.span.start);
state.serialize_field("end", &self.span.end);
state.serialize_ts_field("decorators", &self.decorators);
state.serialize_field("decorators", &self.decorators);
state.serialize_field("key", &self.key);
state.serialize_ts_field("typeAnnotation", &self.type_annotation);
state.serialize_field("value", &self.value);
Expand Down Expand Up @@ -1626,7 +1626,7 @@ impl ESTree for AccessorProperty<'_> {
state.serialize_field("type", &self.r#type);
state.serialize_field("start", &self.span.start);
state.serialize_field("end", &self.span.end);
state.serialize_ts_field("decorators", &self.decorators);
state.serialize_field("decorators", &self.decorators);
state.serialize_field("key", &self.key);
state.serialize_ts_field("typeAnnotation", &self.type_annotation);
state.serialize_field("value", &self.value);
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ submodules:
just clone-submodule tasks/coverage/babel https://github.com/babel/babel.git 1d4546bcb80009303aab386b59f4df1fd335c1d5
just clone-submodule tasks/coverage/typescript https://github.com/microsoft/TypeScript.git 81c951894e93bdc37c6916f18adcd80de76679bc
just clone-submodule tasks/prettier_conformance/prettier https://github.com/prettier/prettier.git 7584432401a47a26943dd7a9ca9a8e032ead7285
just clone-submodule tasks/coverage/acorn-test262 https://github.com/oxc-project/acorn-test262 e6d4a8915d6825132e03b4e517b51f97a1536a3a
just clone-submodule tasks/coverage/acorn-test262 https://github.com/oxc-project/acorn-test262 359faaadce848c92efcf19dcaf7446740f8e27f4
just update-transformer-fixtures

# Install git pre-commit to format files
Expand Down
1 change: 1 addition & 0 deletions napi/parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ If you need all ASTs in the same with-TS-properties format, use the `astType: 't

The only differences between Oxc's AST and ESTree / TS-ESTree are:

- Support for Stage 3 [decorators](https://github.com/tc39/proposal-decorators).
- Support for Stage 3 ECMA features [`import defer`](https://github.com/tc39/proposal-defer-import-eval)
and [`import source`](https://github.com/tc39/proposal-source-phase-imports).
- In TS-ESTree AST, `import.defer(...)` and `import.source(...)` are represented as an `ImportExpression`
Expand Down
4 changes: 4 additions & 0 deletions napi/parser/generated/deserialize/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ function deserializeClass(pos) {
type: deserializeClassType(pos + 132),
start: deserializeU32(pos),
end: deserializeU32(pos + 4),
decorators: deserializeVecDecorator(pos + 8),
id: deserializeOptionBindingIdentifier(pos + 32),
superClass: deserializeOptionExpression(pos + 72),
body: deserializeBoxClassBody(pos + 120),
Expand All @@ -853,6 +854,7 @@ function deserializeMethodDefinition(pos) {
type: deserializeMethodDefinitionType(pos + 56),
start: deserializeU32(pos),
end: deserializeU32(pos + 4),
decorators: deserializeVecDecorator(pos + 8),
key: deserializePropertyKey(pos + 32),
value: deserializeBoxFunction(pos + 48),
kind: deserializeMethodDefinitionKind(pos + 57),
Expand All @@ -866,6 +868,7 @@ function deserializePropertyDefinition(pos) {
type: deserializePropertyDefinitionType(pos + 72),
start: deserializeU32(pos),
end: deserializeU32(pos + 4),
decorators: deserializeVecDecorator(pos + 8),
key: deserializePropertyKey(pos + 32),
value: deserializeOptionExpression(pos + 56),
computed: deserializeBool(pos + 73),
Expand Down Expand Up @@ -896,6 +899,7 @@ function deserializeAccessorProperty(pos) {
type: deserializeAccessorPropertyType(pos + 72),
start: deserializeU32(pos),
end: deserializeU32(pos + 4),
decorators: deserializeVecDecorator(pos + 8),
key: deserializePropertyKey(pos + 32),
value: deserializeOptionExpression(pos + 56),
computed: deserializeBool(pos + 73),
Expand Down
8 changes: 4 additions & 4 deletions npm/oxc-types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ export interface YieldExpression extends Span {

export interface Class extends Span {
type: ClassType;
decorators?: Array<Decorator>;
decorators: Array<Decorator>;
id: BindingIdentifier | null;
typeParameters?: TSTypeParameterDeclaration | null;
superClass: Expression | null;
Expand All @@ -669,7 +669,7 @@ export type ClassElement = StaticBlock | MethodDefinition | PropertyDefinition |

export interface MethodDefinition extends Span {
type: MethodDefinitionType;
decorators?: Array<Decorator>;
decorators: Array<Decorator>;
key: PropertyKey;
value: Function;
kind: MethodDefinitionKind;
Expand All @@ -684,7 +684,7 @@ export type MethodDefinitionType = 'MethodDefinition' | 'TSAbstractMethodDefinit

export interface PropertyDefinition extends Span {
type: PropertyDefinitionType;
decorators?: Array<Decorator>;
decorators: Array<Decorator>;
key: PropertyKey;
typeAnnotation?: TSTypeAnnotation | null;
value: Expression | null;
Expand Down Expand Up @@ -724,7 +724,7 @@ export type AccessorPropertyType = 'AccessorProperty' | 'TSAbstractAccessorPrope

export interface AccessorProperty extends Span {
type: AccessorPropertyType;
decorators?: Array<Decorator>;
decorators: Array<Decorator>;
key: PropertyKey;
typeAnnotation?: TSTypeAnnotation | null;
value: Expression | null;
Expand Down
2 changes: 1 addition & 1 deletion tasks/coverage/snapshots/estree_acorn_jsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
commit: e6d4a891
commit: 359faaad

estree_acorn_jsx Summary:
AST Parsed : 39/39 (100.00%)
Expand Down
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/estree_test262.snap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
commit: 4b5d36ab

estree_test262 Summary:
AST Parsed : 44179/44179 (100.00%)
Positive Passed: 44170/44179 (99.98%)
AST Parsed : 44201/44201 (100.00%)
Positive Passed: 44192/44201 (99.98%)
Mismatch: tasks/coverage/test262/test/language/expressions/assignment/fn-name-lhs-cover.js

Mismatch: tasks/coverage/test262/test/language/expressions/assignment/target-cover-id.js
Expand Down
Loading