Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Acornima v1.1.0 #1898

Merged
merged 2 commits into from
Jun 23, 2024
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
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Acornima" Version="1.0.0" />
<PackageVersion Include="Acornima.Extras" Version="1.0.0" />
<PackageVersion Include="Acornima" Version="1.1.0" />
<PackageVersion Include="Acornima.Extras" Version="1.1.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
<PackageVersion Include="BenchmarkDotNet.TestAdapter" Version="0.13.12" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
Expand Down
6 changes: 3 additions & 3 deletions Jint.Tests.PublicInterface/RavenApiUsageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ public void CanBuildCustomScriptFunctionInstance()
{
var engine = new Engine();

var properties = new List<Node>
var properties = new Node[]
{
new ObjectProperty(PropertyKind.Init, new Identifier("field"),
new MemberExpression(new Identifier("self"), new Identifier("field"), computed: false, optional: false), false, false, false)
};

var functionExp = new FunctionExpression(
new Identifier("functionId"),
NodeList.Create<Node>(new List<Expression> { new Identifier("self") }),
new FunctionBody(NodeList.Create(new List<Statement> { new ReturnStatement(new ObjectExpression(NodeList.Create(properties))) }), strict: false),
NodeList.From<Node>(new Identifier("self")),
new FunctionBody(NodeList.From<Statement>(new ReturnStatement(new ObjectExpression(NodeList.From(properties)))), strict: false),
generator: false,
async: false);

Expand Down
2 changes: 1 addition & 1 deletion Jint/Engine.Ast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public AstAnalyzer(IPreparationOptions<IParsingOptions> preparationOptions)
_preparationOptions = preparationOptions;
}

public void NodeVisitor(Node node)
public void NodeVisitor(Node node, OnNodeContext _)
{
switch (node.Type)
{
Expand Down
2 changes: 1 addition & 1 deletion Jint/Native/Function/ClassDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private sealed class ClassFieldFunction : Node, IFunction

public ClassFieldFunction(Expression expression) : base(NodeType.ExpressionStatement)
{
var nodeList = NodeList.Create<Statement>(new [] { new ReturnStatement(expression) });
var nodeList = NodeList.From<Statement>(new ReturnStatement(expression));
_statement = new FunctionBody(nodeList, strict: true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected override void ProcessItem(JsValue[] arguments, JsValue currentValue)

internal sealed class JintEmptyArrayExpression : JintExpression
{
public static JintEmptyArrayExpression Instance = new(new ArrayExpression(NodeList.Create(System.Linq.Enumerable.Empty<Expression?>())));
public static JintEmptyArrayExpression Instance = new(new ArrayExpression(NodeList.From(Array.Empty<Expression?>())));

private JintEmptyArrayExpression(Expression expression) : base(expression)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private object BuildObjectNormal(EvaluationContext context)

internal sealed class JintEmptyObjectExpression : JintExpression
{
public static JintEmptyObjectExpression Instance = new(new ObjectExpression(NodeList.Create(System.Linq.Enumerable.Empty<Node>())));
public static JintEmptyObjectExpression Instance = new(new ObjectExpression(NodeList.From(Array.Empty<Node>())));

private JintEmptyObjectExpression(Expression expression) : base(expression)
{
Expand Down
2 changes: 1 addition & 1 deletion Jint/Runtime/Modules/ModuleBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ internal Prepared<AstModule> Parse()

if (_sourceRaw.Count <= 0)
{
return new Prepared<AstModule>(new AstModule(NodeList.Create(Array.Empty<Statement>())), parserOptions);
return new Prepared<AstModule>(new AstModule(NodeList.From(Array.Empty<Statement>())), parserOptions);
}

var parser = new Parser(parserOptions);
Expand Down