Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adams85 committed Jul 27, 2023
1 parent e491423 commit fcd176f
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,18 @@ partial class EmptyStatement

partial class ExportAllDeclaration
{
internal override Esprima.Ast.Node? NextChildNode(ref Esprima.Ast.ChildNodes.Enumerator enumerator) => enumerator.MoveNextNullableAt0(Exported, Source, Assertions);
internal override Esprima.Ast.Node? NextChildNode(ref Esprima.Ast.ChildNodes.Enumerator enumerator) => enumerator.MoveNextNullableAt0(Exported, Source, Attributes);

protected internal override object? Accept(Esprima.Utils.AstVisitor visitor) => visitor.VisitExportAllDeclaration(this);

public ExportAllDeclaration UpdateWith(Esprima.Ast.Expression? exported, Esprima.Ast.Literal source, in Esprima.Ast.NodeList<Esprima.Ast.ImportAttribute> assertions)
public ExportAllDeclaration UpdateWith(Esprima.Ast.Expression? exported, Esprima.Ast.Literal source, in Esprima.Ast.NodeList<Esprima.Ast.ImportAttribute> attributes)
{
if (ReferenceEquals(exported, Exported) && ReferenceEquals(source, Source) && assertions.IsSameAs(Assertions))
if (ReferenceEquals(exported, Exported) && ReferenceEquals(source, Source) && attributes.IsSameAs(Attributes))
{
return this;
}

return Rewrite(exported, source, assertions);
return Rewrite(exported, source, attributes);
}
}

Expand All @@ -393,18 +393,18 @@ public ExportDefaultDeclaration UpdateWith(Esprima.Ast.StatementListItem declara

partial class ExportNamedDeclaration
{
internal override Esprima.Ast.Node? NextChildNode(ref Esprima.Ast.ChildNodes.Enumerator enumerator) => enumerator.MoveNextNullableAt0_2(Declaration, Specifiers, Source, Assertions);
internal override Esprima.Ast.Node? NextChildNode(ref Esprima.Ast.ChildNodes.Enumerator enumerator) => enumerator.MoveNextNullableAt0_2(Declaration, Specifiers, Source, Attributes);

protected internal override object? Accept(Esprima.Utils.AstVisitor visitor) => visitor.VisitExportNamedDeclaration(this);

public ExportNamedDeclaration UpdateWith(Esprima.Ast.Declaration? declaration, in Esprima.Ast.NodeList<Esprima.Ast.ExportSpecifier> specifiers, Esprima.Ast.Literal? source, in Esprima.Ast.NodeList<Esprima.Ast.ImportAttribute> assertions)
public ExportNamedDeclaration UpdateWith(Esprima.Ast.Declaration? declaration, in Esprima.Ast.NodeList<Esprima.Ast.ExportSpecifier> specifiers, Esprima.Ast.Literal? source, in Esprima.Ast.NodeList<Esprima.Ast.ImportAttribute> attributes)
{
if (ReferenceEquals(declaration, Declaration) && specifiers.IsSameAs(Specifiers) && ReferenceEquals(source, Source) && assertions.IsSameAs(Assertions))
if (ReferenceEquals(declaration, Declaration) && specifiers.IsSameAs(Specifiers) && ReferenceEquals(source, Source) && attributes.IsSameAs(Attributes))
{
return this;
}

return Rewrite(declaration, specifiers, source, assertions);
return Rewrite(declaration, specifiers, source, attributes);
}
}

Expand Down Expand Up @@ -568,18 +568,18 @@ public ImportAttribute UpdateWith(Esprima.Ast.Expression key, Esprima.Ast.Litera

partial class ImportDeclaration
{
internal override Esprima.Ast.Node? NextChildNode(ref Esprima.Ast.ChildNodes.Enumerator enumerator) => enumerator.MoveNext(Specifiers, Source, Assertions);
internal override Esprima.Ast.Node? NextChildNode(ref Esprima.Ast.ChildNodes.Enumerator enumerator) => enumerator.MoveNext(Specifiers, Source, Attributes);

protected internal override object? Accept(Esprima.Utils.AstVisitor visitor) => visitor.VisitImportDeclaration(this);

public ImportDeclaration UpdateWith(in Esprima.Ast.NodeList<Esprima.Ast.ImportDeclarationSpecifier> specifiers, Esprima.Ast.Literal source, in Esprima.Ast.NodeList<Esprima.Ast.ImportAttribute> assertions)
public ImportDeclaration UpdateWith(in Esprima.Ast.NodeList<Esprima.Ast.ImportDeclarationSpecifier> specifiers, Esprima.Ast.Literal source, in Esprima.Ast.NodeList<Esprima.Ast.ImportAttribute> attributes)
{
if (specifiers.IsSameAs(Specifiers) && ReferenceEquals(source, Source) && assertions.IsSameAs(Assertions))
if (specifiers.IsSameAs(Specifiers) && ReferenceEquals(source, Source) && attributes.IsSameAs(Attributes))
{
return this;
}

return Rewrite(specifiers, source, assertions);
return Rewrite(specifiers, source, attributes);
}
}

Expand All @@ -602,18 +602,18 @@ public ImportDefaultSpecifier UpdateWith(Esprima.Ast.Identifier local)

partial class ImportExpression
{
internal override Esprima.Ast.Node? NextChildNode(ref Esprima.Ast.ChildNodes.Enumerator enumerator) => enumerator.MoveNextNullableAt1(Source, Attributes);
internal override Esprima.Ast.Node? NextChildNode(ref Esprima.Ast.ChildNodes.Enumerator enumerator) => enumerator.MoveNextNullableAt1(Source, Options);

protected internal override object? Accept(Esprima.Utils.AstVisitor visitor) => visitor.VisitImportExpression(this);

public ImportExpression UpdateWith(Esprima.Ast.Expression source, Esprima.Ast.Expression? attributes)
public ImportExpression UpdateWith(Esprima.Ast.Expression source, Esprima.Ast.Expression? options)
{
if (ReferenceEquals(source, Source) && ReferenceEquals(attributes, Attributes))
if (ReferenceEquals(source, Source) && ReferenceEquals(options, Options))
{
return this;
}

return Rewrite(source, attributes);
return Rewrite(source, options);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ partial class AstRewriter

var source = VisitAndConvert(exportAllDeclaration.Source);

VisitAndConvert(exportAllDeclaration.Assertions, out var assertions);
VisitAndConvert(exportAllDeclaration.Attributes, out var attributes);

return exportAllDeclaration.UpdateWith(exported, source, assertions);
return exportAllDeclaration.UpdateWith(exported, source, attributes);
}

protected internal override object? VisitExportDefaultDeclaration(Esprima.Ast.ExportDefaultDeclaration exportDefaultDeclaration)
Expand All @@ -205,9 +205,9 @@ partial class AstRewriter

var source = VisitAndConvert(exportNamedDeclaration.Source, allowNull: true);

VisitAndConvert(exportNamedDeclaration.Assertions, out var assertions);
VisitAndConvert(exportNamedDeclaration.Attributes, out var attributes);

return exportNamedDeclaration.UpdateWith(declaration, specifiers, source, assertions);
return exportNamedDeclaration.UpdateWith(declaration, specifiers, source, attributes);
}

protected internal override object? VisitExpressionStatement(Esprima.Ast.ExpressionStatement expressionStatement)
Expand Down Expand Up @@ -300,9 +300,9 @@ partial class AstRewriter

var source = VisitAndConvert(importDeclaration.Source);

VisitAndConvert(importDeclaration.Assertions, out var assertions);
VisitAndConvert(importDeclaration.Attributes, out var attributes);

return importDeclaration.UpdateWith(specifiers, source, assertions);
return importDeclaration.UpdateWith(specifiers, source, attributes);
}

protected internal override object? VisitImportDefaultSpecifier(Esprima.Ast.ImportDefaultSpecifier importDefaultSpecifier)
Expand All @@ -316,9 +316,9 @@ partial class AstRewriter
{
var source = VisitAndConvert(importExpression.Source);

var attributes = VisitAndConvert(importExpression.Attributes, allowNull: true);
var options = VisitAndConvert(importExpression.Options, allowNull: true);

return importExpression.UpdateWith(source, attributes);
return importExpression.UpdateWith(source, options);
}

protected internal override object? VisitImportNamespaceSpecifier(Esprima.Ast.ImportNamespaceSpecifier importNamespaceSpecifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@ partial class AstVisitor

Visit(exportAllDeclaration.Source);

ref readonly var assertions = ref exportAllDeclaration.Assertions;
for (var i = 0; i < assertions.Count; i++)
ref readonly var attributes = ref exportAllDeclaration.Attributes;
for (var i = 0; i < attributes.Count; i++)
{
Visit(assertions[i]);
Visit(attributes[i]);
}

return exportAllDeclaration;
Expand Down Expand Up @@ -300,10 +300,10 @@ partial class AstVisitor
Visit(exportNamedDeclaration.Source);
}

ref readonly var assertions = ref exportNamedDeclaration.Assertions;
for (var i = 0; i < assertions.Count; i++)
ref readonly var attributes = ref exportNamedDeclaration.Attributes;
for (var i = 0; i < attributes.Count; i++)
{
Visit(assertions[i]);
Visit(attributes[i]);
}

return exportNamedDeclaration;
Expand Down Expand Up @@ -434,10 +434,10 @@ partial class AstVisitor

Visit(importDeclaration.Source);

ref readonly var assertions = ref importDeclaration.Assertions;
for (var i = 0; i < assertions.Count; i++)
ref readonly var attributes = ref importDeclaration.Attributes;
for (var i = 0; i < attributes.Count; i++)
{
Visit(assertions[i]);
Visit(attributes[i]);
}

return importDeclaration;
Expand All @@ -454,9 +454,9 @@ partial class AstVisitor
{
Visit(importExpression.Source);

if (importExpression.Attributes is not null)
if (importExpression.Options is not null)
{
Visit(importExpression.Attributes);
Visit(importExpression.Options);
}

return importExpression;
Expand Down
1 change: 1 addition & 0 deletions test/Esprima.Tests.Test262/Test262Harness.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"Namespace": "Esprima.Tests.Test262",
"Parallel": true,
"ExcludedFeatures": [
"import-assertions",
"regexp-v-flag"
],
"ExcludedFlags": [],
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { x } from "foo" with;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "x" with;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { foo } from "foo.json" with { type: "json" };
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,24 @@
}
}
},
"assertions": [
"attributes": [
{
"type": "ImportAttribute",
"key": {
"type": "Identifier",
"name": "type",
"range": [
40,
44
38,
42
],
"loc": {
"start": {
"line": 1,
"column": 40
"column": 38
},
"end": {
"line": 1,
"column": 44
"column": 42
}
}
},
Expand All @@ -104,39 +104,39 @@
"value": "json",
"raw": "\"json\"",
"range": [
40,
52
38,
50
],
"loc": {
"start": {
"line": 1,
"column": 40
"column": 38
},
"end": {
"line": 1,
"column": 52
"column": 50
}
}
},
"range": [
40,
52
38,
50
],
"loc": {
"start": {
"line": 1,
"column": 40
"column": 38
},
"end": {
"line": 1,
"column": 52
"column": 50
}
}
}
],
"range": [
0,
55
53
],
"loc": {
"start": {
Expand All @@ -145,15 +145,15 @@
},
"end": {
"line": 1,
"column": 55
"column": 53
}
}
}
],
"sourceType": "module",
"range": [
0,
55
53
],
"loc": {
"start": {
Expand All @@ -162,7 +162,7 @@
},
"end": {
"line": 1,
"column": 55
"column": 53
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import foo from "foo.json" with { type: "json" };
Loading

0 comments on commit fcd176f

Please sign in to comment.