Skip to content

Releases: sebastienros/jint

v4.5.0

07 Jan 19:40
c2cc835

Choose a tag to compare

This is a significant milestone as this release graduates generators functionality from experimental and contains proper suspension and resume logic for both generators and async/await logic. There are a lot of changes to internals so make sure you test thoroughly.

Task interop is still marked as experimental and requires enabling explicitly in Engine options, but it also has had improvements to make it work better in Engine's event loop.

For background work to complete without engine interaction (evaluation) you need to manually process the tasks (for example if you have a timeout pending after script has been run).

engine.Execute(script);
for (var i = 0; i < 100; ++i)
{
    engine.Advanced.ProcessTasks();
    await Task.Delay(100);
}

What's Changed

  • Allows the conversion of primses to tasks when pasing an async function as argument by @REscobar in #2197
  • Bump the all-dependencies group with 3 updates by @dependabot[bot] in #2198
  • Fix missing control characters in Json Parse Key by @H4ad in #2202
  • Use NET 10 SDK to build and test by @lahma in #2185
  • Upgrade packages by @lahma in #2212
  • Convert solution to slnx format by @lahma in #2213
  • Defer iterator next method check until actually iterating by @lahma in #2214
  • Add ArrayExpression and ObjectExpression to computed property key types by @lahma in #2215
  • Fix parameter TDZ and eval-var-scope handling by @lahma in #2216
  • ES6 Generators by @lahma in #824
  • Bump the all-dependencies group with 1 update by @dependabot[bot] in #2217
  • Refactor generator control flow from exceptions to flags by @lahma in #2218
  • Implement Iterator Helpers by @lahma in #2032
  • Implement Iterator Sequencing by @lahma in #2031
  • Update test262 test suite and fix issues by @lahma in #2219
  • Implement RegExp.escape() by @lahma in #2220
  • Implement Immutable ArrayBuffers by @lahma in #2222
  • Implement Joint Iteration by @lahma in #2221
  • Improve REPL for AI usage by @lahma in #2224
  • Implement JSON.parse source text access by @lahma in #2223
  • Rename IsGeneratorSuspended to IsSuspended by @lahma in #2226
  • ECMAScript-compliant async/await with proper suspension by @lahma in #2225
  • Filter TypeReference constructors using TypeResolver.MemberFilter by @lahma in #2227
  • Implement async-iteration by @lahma in #2228
  • Implement Array.fromAsync by @lahma in #2229
  • Add agent support to test262 testing by @lahma in #2231
  • Bump the all-dependencies group with 2 updates by @dependabot[bot] in #2232
  • Implement Atomics by @lahma in #2230
  • ValueTask and IAsyncEnumerable interop support by @lahma in #2233
  • Disable fail-fast in GitHub Actions workflow by @lahma in #2235
  • Add jsValue.UnwrapIfPromise(CancellationToken cancellationToken) by @lahma in #2234
  • Fix Test262Test setTimeout concurrency issue by @lahma in #2236
  • Type resolution should use runtime type when declared type has indexer by @lahma in #2237
  • JSE.GetBaseException() shouldn't return JavaScriptErrorWrapperException by @lahma in #2238
  • Enable decorator tests by @lahma in #2239
  • Fix Final_Sigma_U180E issue by @lahma in #2240
  • Improve TypeReference method parameter scoring by @lahma in #2241
  • Add test coverage for async functions by @lahma in #2242
  • Fall back to non-generic list wrapper on error by @lahma in #2244
  • Update VersionPrefix from 4.0.0 to 4.5.0 by @lahma in #2245
  • Cleanup suspend logic by @lahma in #2246

New Contributors

Full Changelog: v4.4.2...v4.5.0

v4.4.2

09 Nov 19:00
215d1cd

Choose a tag to compare

What's Changed

Full Changelog: v4.4.1...v4.4.2

v4.4.1

26 Jul 13:43
feeab47

Choose a tag to compare

What's Changed

  • Add Options.Constraints.PromiseTimeout To Control timeout for DisposeHint.Async and JintAwaitExpression by @rocklau in #2150
  • Fix iterating a clr list proxy and length property by @martinbu in #2151
  • Fix MethodAccessor property flags by @lahma in #2153

New Contributors

Full Changelog: v4.4.0...v4.4.1

v4.4.0

12 Jul 18:39
0b03f8e

Choose a tag to compare

This release brings both using and await using statements available to both native JS usage and NET interop. Interop will automatically wrap IDisposable and IAsyncDisposable to have handlers that will be called after using scope ends. Read more about the proposal.

What's Changed

  • Fix default parameter handling under interop by @lahma in #2134
  • Support writing length to IList under interop by @lahma in #2135
  • Passing space arg to Options.Interop.SerializeToJson by @Zaitonn in #2142
  • Add explicit resource management supporting types by @lahma in #2143
  • Upgrade to Acornima v1.2.0 by @adams85 in #2145
  • Add support for using and await using by @lahma in #2139

New Contributors

Full Changelog: v4.3.0...v4.4.0

v4.3.0

30 Jun 18:56
17f6a71

Choose a tag to compare

What's Changed

  • Fix ObjectAccessBenchmark test by @mac-michael in #2100
  • Add default 10 second timeout for promise unwrapping by @lahma in #2103
  • Fix erroneous caching by providing each function instance with it own interop variant by @warappa in #2105
  • Fix calling pop on generic list of value types by @Genteure in #2112
  • Fix NRE in BuildTargetBinderDelegate by @warappa in #2116
  • Improve Half interop handling by @lahma in #2121
  • Make eval syntax checks not descend into function declarations by @rg1 in #2123
  • Update test262 harness and fix issues by @lahma in #2126
  • Implement Upsert by @lahma in #2127
  • Implement V8-styled stacktraces by @Guichaguri in #2129
  • Improve interop member resolution when enum indexer present by @lahma in #2131

New Contributors

Full Changelog: v4.2.2...v4.3.0

v4.2.2

04 Apr 08:58
e4800fa

Choose a tag to compare

This release improves interop performance when you target CLR methods with lambda functions, like List<string>.Find(x => x === "test").

What's Changed

Full Changelog: v4.2.1...v4.2.2

v4.2.1

09 Mar 18:06
a4a51e3

Choose a tag to compare

What's Changed

  • Add fast paths for object Get/Set for simple objects by @lahma in #2050
  • Bump YantraJS.Core from 1.2.246 to 1.2.261 in the all-dependencies group by @dependabot in #2051
  • Upgrade to new Microsoft Test Platform when using NUnit by @lahma in #2052
  • Add support for object return values in Func callbacks by @martinbu in #2053
  • Create global alias for JsValue[] arguments by @lahma in #2055
  • Bump the all-dependencies group with 3 updates by @dependabot in #2056
  • Remove apparently-redundant DateFlags calculation in JsDate constructor by @nil4 in #2058
  • Avoid creating context for eval if eval is not present by @lahma in #2059
  • Improve function arguments parameter expression detection by @lahma in #2060
  • Bump the all-dependencies group with 5 updates by @dependabot in #2061
  • Check against long.MaxValue in memory limit configuration by @lahma in #2068

New Contributors

Full Changelog: v4.2.0...v4.2.1

v4.2.0

28 Jan 19:07
7ab17c5

Choose a tag to compare

What's Changed

  • Improve interop conversion logic between numeric types by @lahma in #1995
  • Use Array.Resize when growing ArrayInstance by @lahma in #1997
  • Improve infinity detection when parsing numbers on full framework by @lahma in #2003
  • Use net472 to run full framework tests by @lahma in #2026
  • Implement Error.isError by @lahma in #2030
  • Fix statement counting code in MaxStatementsConstraint by @nicolay-f in #2035
  • Cleanup custom dictionary implementations by @lahma in #2036
  • Create ExpressionCache to unify constant lookups by @lahma in #2037
  • Remove closure allocations from JintFunctionDefinition by @lahma in #2039
  • Flatten declarative record instance creation lookups by @lahma in #2040
  • Support running DromaeoBenchmark with modern JS syntax by @lahma in #2041
  • Use NET 9 to run tests and benchmarks, remove NET 6 target by @lahma in #2042
  • Add extension point for custom Function.toString() logic by @lahma in #2043
  • Improve environment initialization performance by @lahma in #2045
  • Add configurable limit for Atomics.pause iterations by @lahma in #2047
  • Add support for block statement preparation by @lahma in #2048

New Contributors

Full Changelog: v4.1.0...v4.2.0

v4.1.0

27 Oct 13:23
04466d0

Choose a tag to compare

This release contains a breaking change for interop for static fields and properties. They are no longer exposed as part of interop wrapper by default. You read more about the reasoning here.

To access public static fields or properties you should use registered TypeReferences.

Following example shows the new behavior:

[Fact]
public void StaticFieldsShouldFollowJsSemantics()
{
    _engine.Evaluate("Number.MAX_SAFE_INTEGER").AsNumber().Should().Be(NumberConstructor.MaxSafeInteger);
    _engine.Evaluate("new Number().MAX_SAFE_INTEGER").Should().Be(JsValue.Undefined);

    _engine.Execute("class MyJsClass { static MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER; }");
    _engine.Evaluate("MyJsClass.MAX_SAFE_INTEGER").AsNumber().Should().Be(NumberConstructor.MaxSafeInteger);
    _engine.Evaluate("new MyJsClass().MAX_SAFE_INTEGER").Should().Be(JsValue.Undefined);

    _engine.SetValue("MyCsClass", typeof(MyClass));
    _engine.Evaluate("MyCsClass.MAX_SAFE_INTEGER").AsNumber().Should().Be(NumberConstructor.MaxSafeInteger);
    // NEW BEHAVIOR, NOW UNDEFINED
    _engine.Evaluate("new MyCsClass().MAX_SAFE_INTEGER").Should().Be(JsValue.Undefined);
}

private class MyClass
{
    public static JsNumber MAX_SAFE_INTEGER = new JsNumber(NumberConstructor.MaxSafeInteger);
}

If you want to expose static instance fields and properties as part of instance wrappers, you need to configure the engine to do so:

var engine = new Engine(options =>
{
    options.Interop.ObjectWrapperReportedFieldBindingFlags |= BindingFlags.Static;
    options.Interop.ObjectWrapperReportedPropertyBindingFlags |= BindingFlags.Static;
});

Static methods can still be accessed as before, but you could limit exposing them too if you wish to do so:

var engine = new Engine(options =>
{
    options.Interop.ObjectWrapperReportedMethodBindingFlags = BindingFlags.Instance | BindingFlags.Public;
});

What's Changed

  • Fix Array.prototype.toString() stackoverflow by @xBaank in #1976
  • Promise.withResolvers() returned object had resolve and reject functions swapped by @tomatosalat0 in #1983
  • Made test of cancellation of engine execution more robust by @tomatosalat0 in #1984
  • Early out in ObjectPool to avoid loop execution by @tomatosalat0 in #1985
  • Optimize some character checks and ValueStringBuilder by @lahma in #1986
  • Make JsSet public by @kenlyon in #1987
  • Make JsMap public by @lahma in #1988
  • Exclude static fields and properties from ObjectWrapper by default by @lahma in #1981
  • Add Options.InteropOptions.BuildCallStackHandler by @scgm0 in #1793
  • Revert back to favoring SearchValues<char> by @lahma in #1990

New Contributors

Full Changelog: v4.0.3...v4.1.0

v4.0.3

23 Sep 17:36
e67e58a

Choose a tag to compare

What's Changed

  • Update test262 test suite and fix issues by @lahma in #1958
  • Don't find hidden property instead of the hiding property by @mspertus in #1963
  • Implement Math.sumPrecise by @lahma in #1966
  • Address Interop having difficulty finding properties in derived types by @mspertus in #1969

New Contributors

Full Changelog: v4.0.2...v4.0.3