Skip to content

Commit

Permalink
More improvements for CLR Interop (#1616)
Browse files Browse the repository at this point in the history
  • Loading branch information
viruscamp authored Aug 9, 2023
1 parent e9ace1a commit f4982ee
Show file tree
Hide file tree
Showing 15 changed files with 431 additions and 201 deletions.
20 changes: 9 additions & 11 deletions Jint.Repl/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,20 @@ private static void Main(string[] args)
try
{
var result = engine.Evaluate(input, parserOptions);
JsValue str = result;
if (!result.IsPrimitive() && result is not IPrimitiveInstance)
{
var str = serializer.Serialize(result, JsValue.Undefined, " ");
Console.WriteLine(str);
}
else
{
if (result.IsString())
{
Console.WriteLine(serializer.Serialize(result, JsValue.Undefined, JsValue.Undefined));
}
else
str = serializer.Serialize(result, JsValue.Undefined, " ");
if (str == JsValue.Undefined)
{
Console.WriteLine(result);
str = result;
}
}
else if (result.IsString())
{
str = serializer.Serialize(result, JsValue.Undefined, JsValue.Undefined);
}
Console.WriteLine(str);
}
catch (JavaScriptException je)
{
Expand Down
Loading

0 comments on commit f4982ee

Please sign in to comment.