File tree Expand file tree Collapse file tree
src/JavaScriptEngineSwitcher.Jint Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 <PackageIconFullPath >../../Icons/JavaScriptEngineSwitcher_Jint_Logo128x128.png</PackageIconFullPath >
2323 <Description >JavaScriptEngineSwitcher.Jint contains a `JintJsEngine` adapter (wrapper for the Jint).</Description >
2424 <PackageTags >$(PackageCommonTags);Jint</PackageTags >
25- <PackageReleaseNotes >Jint was updated to version 4.10.1.</PackageReleaseNotes >
25+ <PackageReleaseNotes >1. Jint was updated to version 4.11.0;
26+ 2. In configuration settings of the Jint JS engine was added one new property - `RetainFunctionSourceText` (default `false`).</PackageReleaseNotes >
2627 </PropertyGroup >
2728
2829 <ItemGroup >
29- <PackageReference Include =" Jint" Version =" 4.10.1 " />
30+ <PackageReference Include =" Jint" Version =" 4.11.0 " />
3031
3132 <ProjectReference Include =" ../JavaScriptEngineSwitcher.Core/JavaScriptEngineSwitcher.Core.csproj" />
3233 </ItemGroup >
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public sealed class JintJsEngine : JsEngineBase
5959 /// <summary>
6060 /// Version of original JS engine
6161 /// </summary>
62- private const string EngineVersion = "4.10.1 " ;
62+ private const string EngineVersion = "4.11.0 " ;
6363
6464 /// <summary>
6565 /// Jint JS engine
@@ -152,6 +152,7 @@ public JintJsEngine(JintSettings settings)
152152 . MaxArraySize ( jintSettings . MaxArraySize )
153153 . MaxJsonParseDepth ( jintSettings . MaxJsonParseDepth )
154154 . MaxStatements ( jintSettings . MaxStatements )
155+ . RetainFunctionSourceText ( jintSettings . RetainFunctionSourceText )
155156 . Strict ( jintSettings . StrictMode )
156157 . TimeoutInterval ( jintSettings . TimeoutInterval )
157158 ;
@@ -170,7 +171,8 @@ public JintJsEngine(JintSettings settings)
170171 ParsingOptions = new OriginalParsingOptions
171172 {
172173 CompileRegex = settings . CompileRegex ,
173- RegexTimeout = settings . RegexTimeoutInterval
174+ RegexTimeout = settings . RegexTimeoutInterval ,
175+ RetainFunctionSourceText = jintSettings . RetainFunctionSourceText
174176 }
175177 } ;
176178 _cancellationConstraint = _jsEngine . Constraints . Find < OriginalCancellationConstraint > ( ) ;
Original file line number Diff line number Diff line change @@ -172,6 +172,20 @@ public TimeSpan? RegexTimeoutInterval
172172 set ;
173173 }
174174
175+ /// <summary>
176+ /// Gets or sets a flag for whether to retain the full source text of parsed functions
177+ /// </summary>
178+ /// <remarks>
179+ /// When this property is set to <c>true</c>, <c>Function.prototype.toString()</c> returns the original source;
180+ /// otherwise, <c>toString()</c> returns a <c>function name() { [native code] }</c> placeholder and the script
181+ /// source is not kept in memory.
182+ /// </remarks>
183+ public bool RetainFunctionSourceText
184+ {
185+ get ;
186+ set ;
187+ }
188+
175189 /// <summary>
176190 /// Gets or sets a flag for whether to allow run the script in strict mode
177191 /// </summary>
@@ -221,6 +235,7 @@ public JintSettings()
221235 MaxStatements = 0 ;
222236 MemoryLimit = 0 ;
223237 RegexTimeoutInterval = null ;
238+ RetainFunctionSourceText = false ;
224239 StrictMode = false ;
225240 TimeoutInterval = TimeSpan . Zero ;
226241 }
Original file line number Diff line number Diff line change 1- JavaScriptEngineSwitcher.Jint contains a ` JintJsEngine ` adapter (wrapper for the [ Jint] ( http://github.com/sebastienros/jint ) version 4.10.1 ).
1+ JavaScriptEngineSwitcher.Jint contains a ` JintJsEngine ` adapter (wrapper for the [ Jint] ( http://github.com/sebastienros/jint ) version 4.11.0 ).
Original file line number Diff line number Diff line change 1212 DESCRIPTION
1313 ===========
1414 JavaScriptEngineSwitcher.Jint contains a `JintJsEngine` adapter (wrapper for the
15- Jint (http://github.com/sebastienros/jint) version 4.10.1 ).
15+ Jint (http://github.com/sebastienros/jint) version 4.11.0 ).
1616
1717 =============
1818 RELEASE NOTES
1919 =============
20- Jint was updated to version 4.10.1.
20+ 1. Jint was updated to version 4.11.0;
21+ 2. In configuration settings of the Jint JS engine was added one new property -
22+ `RetainFunctionSourceText` (default `false`).
2123
2224 =============
2325 DOCUMENTATION
You can’t perform that action at this time.
0 commit comments