Skip to content

Commit

Permalink
Remove obsolete members and bump version to 4 (#1834)
Browse files Browse the repository at this point in the history
* update packages
  • Loading branch information
lahma authored Apr 13, 2024
1 parent 6d866a2 commit 65a5ba3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageLicenseExpression>BSD-2-Clause</PackageLicenseExpression>

<BuildNumber Condition="'$(BuildNumber)' == ''">0</BuildNumber>
<VersionPrefix>3.1.0</VersionPrefix>
<VersionPrefix>4.0.0</VersionPrefix>
<VersionSuffix>beta-$(BuildNumber)</VersionSuffix>
<FileVersion>$(VersionPrefix).$(BuildNumber)</FileVersion>

Expand Down
14 changes: 7 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Flurl.Http.Signed" Version="3.2.4" />
<PackageVersion Include="Jurassic" Version="3.2.7" />
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.141" />
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.147" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="MongoDB.Bson.signed" Version="2.19.0" />
<PackageVersion Include="NiL.JS" Version="2.5.1677" />
<PackageVersion Include="NodaTime" Version="3.1.9" />
<PackageVersion Include="NUnit" Version="4.0.1" />
<PackageVersion Include="NodaTime" Version="3.1.11" />
<PackageVersion Include="NUnit" Version="4.1.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="SharpZipLib" Version="1.4.0" />
<PackageVersion Include="Spectre.Console.Cli" Version="0.45.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.3" />
<PackageVersion Include="Test262Harness" Version="1.0.0" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" PrivateAssets="all" />
<PackageVersion Include="YantraJS.Core" Version="1.2.206" />
<PackageVersion Include="xunit" Version="2.7.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.8" PrivateAssets="all" />
<PackageVersion Include="YantraJS.Core" Version="1.2.209" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
Expand Down
2 changes: 1 addition & 1 deletion Jint.Tests/Runtime/EngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ public void ShouldNotAllowModifyingSharedUndefinedDescriptor()
var e = new Engine();
e.Evaluate("var x = { literal: true };");

var pd = e.GetValue("x").AsObject().GetProperty("doesNotExist");
var pd = e.GetValue("x").AsObject().GetOwnProperty("doesNotExist");
Assert.Throws<InvalidOperationException>(() => pd.Value = "oh no, assigning this breaks things");
}

Expand Down
20 changes: 0 additions & 20 deletions Jint/Native/Object/ObjectInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,6 @@ private List<JsValue> GetOwnPropertyKeysSorted(List<JsValue> initialOwnPropertyK

internal virtual IEnumerable<JsValue> GetInitialOwnStringPropertyKeys() => System.Linq.Enumerable.Empty<JsValue>();

[Obsolete("Will be removed")]
protected virtual void AddProperty(JsValue property, PropertyDescriptor descriptor)
{
SetProperty(property, descriptor);
}

protected virtual bool TryGetProperty(JsValue property, [NotNullWhen(true)] out PropertyDescriptor? descriptor)
{
descriptor = null;
Expand Down Expand Up @@ -447,20 +441,6 @@ protected internal virtual void SetOwnProperty(JsValue property, PropertyDescrip
SetProperty(property, desc);
}

[Obsolete("Use Get or GetOwnProperty")]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public PropertyDescriptor GetProperty(JsValue property)
{
var prop = GetOwnProperty(property);

if (prop != PropertyDescriptor.Undefined)
{
return prop;
}

return Prototype?.GetProperty(property) ?? PropertyDescriptor.Undefined;
}

public bool TryGetValue(JsValue property, out JsValue value)
{
value = Undefined;
Expand Down
2 changes: 0 additions & 2 deletions Jint/Runtime/Interop/ObjectWrapper.Specialized.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ namespace Jint.Runtime.Interop;

internal abstract class ArrayLikeWrapper : ObjectWrapper
{
#pragma warning disable CS0618 // Type or member is obsolete
protected ArrayLikeWrapper(
Engine engine,
object obj,
Type itemType,
Type? type = null) : base(engine, obj, type)
#pragma warning restore CS0618 // Type or member is obsolete
{
ItemType = itemType;
if (engine.Options.Interop.AttachArrayPrototype)
Expand Down
5 changes: 1 addition & 4 deletions Jint/Runtime/Interop/ObjectWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public class ObjectWrapper : ObjectInstance, IObjectWrapper, IEquatable<ObjectWr
{
internal readonly TypeDescriptor _typeDescriptor;

[Obsolete("Use ObjectWrapper.Create instead of calling constructor directly")]
public ObjectWrapper(
internal ObjectWrapper(
Engine engine,
object obj,
Type? type = null)
Expand Down Expand Up @@ -72,9 +71,7 @@ public static ObjectInstance Create(Engine engine, object target, Type? type = n
return wrapper;
}

#pragma warning disable CS0618 // Type or member is obsolete
return new ObjectWrapper(engine, target, type);
#pragma warning restore CS0618 // Type or member is obsolete
}

private static bool TryBuildArrayLikeWrapper(
Expand Down

0 comments on commit 65a5ba3

Please sign in to comment.