This is an automated email from the ASF dual-hosted git repository.
nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git
The following commit(s) were added to refs/heads/master by this push:
new 72cf96e Lucene.Net.Expressions.JS.JavascriptCompiler: fixed doc
comment code example (removed Put() and PutAll() references, which are internal)
72cf96e is described below
commit 72cf96e48a631a30d087c0b06b53b9de8aa91f83
Author: Shad Storhaug <[email protected]>
AuthorDate: Sat Feb 12 13:59:02 2022 +0700
Lucene.Net.Expressions.JS.JavascriptCompiler: fixed doc comment code
example (removed Put() and PutAll() references, which are internal)
---
src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
b/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
index 0ea571e..3f09261 100644
--- a/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
+++ b/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
@@ -49,11 +49,10 @@ namespace Lucene.Net.Expressions.JS
/// You can compile with an alternate set of functions via <see
cref="Compile(string, IDictionary{string, MethodInfo})"/>.
/// For example:
/// <code>
- /// IDictionary<string, MethodInfo> functions = new
Dictionary<string, MethodInfo>();
- /// // add all the default functions
- /// functions.PutAll(JavascriptCompiler.DEFAULT_FUNCTIONS);
+ /// // instantiate and add all the default functions
+ /// IDictionary<string, MethodInfo> functions = new
Dictionary<string, MethodInfo>(JavascriptCompiler.DEFAULT_FUNCTIONS);
/// // add sqrt()
- /// functions.Put("sqrt", (typeof(Math)).GetMethod("Sqrt", new Type[] {
typeof(double) }));
+ /// functions["sqrt"] = (typeof(Math)).GetMethod("Sqrt", new Type[] {
typeof(double) });
/// // call compile with customized function map
/// Expression foo =
JavascriptCompiler.Compile("sqrt(score)+ln(popularity)", functions);
/// </code>