Skip to content

Commit

Permalink
TTS v13 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-Dobell committed Jan 30, 2021
1 parent d023ec2 commit d1a0d81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/MoonSharp.Interpreter/MoonSharp.Interpreter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Title>MoonSharp.Interpreter</Title>
<SignAssembly>true</SignAssembly>
<PackageVersion>2.0.0</PackageVersion>
<AssemblyName>MoonsharpDef</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
34 changes: 16 additions & 18 deletions src/MoonSharp.Interpreter/Script.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,29 +329,27 @@ public DynValue LoadFile(string filename, Table globalContext = null, string fri
/// <returns>
/// A DynValue containing the result of the processing of the loaded chunk.
/// </returns>
public DynValue DoString(string code, Table globalContext, string codeFriendlyName)
public DynValue DoString(string code, Table globalContext = null, string codeFriendlyName = null)
{
DynValue func = LoadString(code, globalContext, codeFriendlyName);
return Call(func);
}

public DynValue DoString(string code, Table globalContext = null)
{
string codeFriendlyName = null;

try
{
codeFriendlyName = TtsDebugger.OnDoString(this);
DynValue result = DoString(code, globalContext, codeFriendlyName);
return result;
}
finally
if (codeFriendlyName == null)
{
if (codeFriendlyName != null)
try
{
codeFriendlyName = TtsDebugger.OnDoString(this);
DynValue result = DoString(code, globalContext, codeFriendlyName);
return result;
}
finally
{
TtsDebugger.OnStringDone(this);
if (codeFriendlyName != null)
{
TtsDebugger.OnStringDone(this);
}
}
}

DynValue func = LoadString(code, globalContext, codeFriendlyName);
return Call(func);
}

/// <summary>
Expand Down

0 comments on commit d1a0d81

Please sign in to comment.