Releases: sebastienros/jint
v4.4.1
What's Changed
- Add
Options.Constraints.PromiseTimeout
To Control timeout forDisposeHint.Async
andJintAwaitExpression
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
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 toOptions.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
andawait using
by @lahma in #2139
New Contributors
Full Changelog: v4.3.0...v4.4.0
v4.3.0
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
- @mac-michael made their first contribution in #2100
- @warappa made their first contribution in #2105
- @rg1 made their first contribution in #2123
- @Guichaguri made their first contribution in #2129
Full Changelog: v4.2.2...v4.3.0
v4.2.2
This release improves interop performance when you target CLR methods with lambda functions, like List<string>.Find(x => x === "test")
.
What's Changed
- Update bug_report.md by @lahma in #2070
- Remove unused usings by @lahma in #2072
- Use collection expressions by @lahma in #2073
- Enforce code style on build and fix issues by @lahma in #2074
- Use matrix to run PR builds, add ARM runner by @lahma in #2075
- Create config.yml for issues templates by @lahma in #2077
- Bump the all-dependencies group with 3 updates by @dependabot in #2079
- Bump the all-dependencies group with 2 updates by @dependabot in #2080
- Improve interop performance against dictionary by @lahma in #2088
Full Changelog: v4.2.1...v4.2.2
v4.2.1
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 inJsDate
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
What's Changed
- Improve interop conversion logic between numeric types by @lahma in #1995
- Use
Array.Resize
when growingArrayInstance
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
- @nicolay-f made their first contribution in #2035
Full Changelog: v4.1.0...v4.2.0
v4.1.0
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 TypeReference
s.
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
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
v4.0.2
With this release you will start to see CLR methods also reported as object members under interop when calling functions like Object.getOwnPropertyNames(x)
. You can revert back to old behavior by configuring an option options.Interop.ObjectWrapperReportedMemberTypes = MemberTypes.Field | MemberTypes.Property;
.
What's Changed
- Bump the all-dependencies group with 2 updates by @dependabot in #1941
- Update test262 test suite and fix issues by @lahma in #1944
- Add
ObjectWrapperReportedMemberTypes
toOptions
by @lofcz in #1947 - Make
ObjectWrapper
ClrType
public by @lofcz in #1946 - Fix throwing on accessing CLR
FunctionDeclaration
by @lofcz in #1949 - Make own properties for declared only fields and properties configurable by @lahma in #1948
- Bump the all-dependencies group with 3 updates by @dependabot in #1950
- Don't overwrite default export from
SourceTextModule
by @viceice in #1952 - Tweak object wrapper reported members logic by @lahma in #1956
New Contributors
Full Changelog: v4.0.1...v4.0.2
v4.0.1
What's Changed
- Update benchmarks results and
README.md
against v4 by @lahma in #1928 - Upgrade
NUnit3TestAdapter
to version 4.6.0 by @lahma in #1920 - Implement
Atomics.pause
by @lahma in #1929 - Bump
Meziantou.Analyzer
from 2.0.161 to 2.0.162 in the all-dependencies group by @dependabot in #1930 - Convert to using file-scoped namespaces by @lahma in #1931
- Add
.git-blame-ignore-revs
by @lahma in #1932 - Bump
Meziantou.Analyzer
from 2.0.162 to 2.0.163 in the all-dependencies group by @dependabot in #1933 - Update test262 test suite and fix
TypedArray.set
issues by @lahma in #1934 - Fix dynamic object member access logic by @lahma in #1937
- Fix custom reference resolver argument by @lahma in #1938
Full Changelog: v4.0.0...v4.0.1