You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: Cannot access child value on Newtonsoft.Json.Linq.JValue.
at Jint.Runtime.Descriptors.Specialized.IndexDescriptor.get_CustomValue()
at Jint.Native.Object.ObjectInstance.UnwrapJsValue(PropertyDescriptor desc, JsValue thisObject)
at Jint.Native.Object.ObjectInstance.Get(JsValue property, JsValue receiver)
at Jint.Runtime.TypeConverter.OrdinaryToPrimitive(ObjectInstance input, Types hint)
at Jint.Runtime.TypeConverter.ToPrimitive(JsValue input, Types preferredType)
at Jint.Runtime.Interpreter.Expressions.JintExpression.EqualUnlikely(JsValue x, JsValue y)
at Jint.Runtime.Interpreter.Expressions.JintExpression.Equal(JsValue x, JsValue y)
at Jint.Runtime.Interpreter.Expressions.JintBinaryExpression.EqualBinaryExpression.EvaluateInternal()
at Jint.Runtime.Interpreter.Expressions.JintBinaryExpression.GetValue()
at Jint.Runtime.Interpreter.Statements.JintIfStatement.ExecuteInternal()
at Jint.Runtime.Interpreter.JintStatementList.Execute()
at Jint.Engine.Execute(Script program)
at OrchardCore.Scripting.JavaScript.JavaScriptEngine.Evaluate(IScriptingScope scope, String script) in C:\projects\orchardcore\src\OrchardCore\OrchardCore.Scripting.JavaScript\JavaScriptEngine.cs:line 47
at OrchardCore.Scripting.DefaultScriptingManager.Evaluate(String directive, IFileProvider fileProvider, String basePath, IEnumerable`1 scopedMethodProviders) in C:\projects\orchardcore\src\OrchardCore\OrchardCore.Infrastructure\Scripting\DefaultScriptingManager.cs:line 45
The text was updated successfully, but these errors were encountered:
jptissot
changed the title
Issue with Newtonsoft.Json in OrchardCore
Cannot access child value on Newtonsoft.Json.Linq.JValue in OrchardCore
Nov 3, 2020
We used to swallow this kind of exception and just return Undefined. So probably wasn't working correctly before, now just manifesting the the error. And the root cause is Jint's ToPrimitive handling when it tries to find Symbol from object attributes and JValue doesn't like that at all.
See OrchardCMS/OrchardCore#7452
and OrchardCMS/OrchardCore#7485
The text was updated successfully, but these errors were encountered: