Skip to content

Commit

Permalink
1.0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xanathar committed Oct 23, 2015
1 parent 4d17749 commit 18d9e07
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<Argument Key="maxVersionParts" Value="" xmlns="" />
</TransformComponentArguments>
<BuildAssemblerVerbosity>OnlyErrors</BuildAssemblerVerbosity>
<HelpFileFormat>HtmlHelp1, Website</HelpFileFormat>
<HelpFileFormat>HtmlHelp1</HelpFileFormat>
<IndentHtml>False</IndentHtml>
<KeepLogFile>True</KeepLogFile>
<DisableCodeBlockComponent>False</DisableCodeBlockComponent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using MoonSharp.Interpreter.Interop;
using MoonSharp.Interpreter.Loaders;
using NUnit.Framework;

namespace MoonSharp.Interpreter.Tests.EndToEnd
Expand All @@ -19,6 +21,13 @@ public static string Method3(this UserDataOverloadsTests.OverloadsTestClass obj)
return "X" + obj.Method1(0.17);
}
}
public static class OverloadsExtMethods2
{
public static string MethodXXX(this UserDataOverloadsTests.OverloadsTestClass obj, string x, bool b)
{
return "X!";
}
}


[TestFixture]
Expand Down Expand Up @@ -191,6 +200,28 @@ public void Interop_Overloads_ExtMethods()
RunTestOverload("o:method3()", "X3");
}

[Test]
public void Interop_Overloads_Twice_ExtMethods1()
{
UserData.RegisterExtensionType(typeof(OverloadsExtMethods));

RunTestOverload("o:method1('xx', true)", "X1");

UserData.RegisterExtensionType(typeof(OverloadsExtMethods2));

RunTestOverload("o:methodXXX('xx', true)", "X!");
}

[Test]
public void Interop_Overloads_Twice_ExtMethods2()
{
UserData.RegisterExtensionType(typeof(OverloadsExtMethods));
UserData.RegisterExtensionType(typeof(OverloadsExtMethods2));

RunTestOverload("o:method1('xx', true)", "X1");
RunTestOverload("o:methodXXX('xx', true)", "X!");
}

[Test]
[ExpectedException(typeof(ScriptRuntimeException))]
public void Interop_Overloads_ExtMethods2()
Expand Down Expand Up @@ -289,6 +320,5 @@ public void OverloadTest_WithoutObjects()




}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ sealed partial class Processor
{
private class DebugContext
{
public bool DebuggerEnabled = true;
public IDebugger DebuggerAttached = null;
public DebuggerAction.ActionType DebuggerCurrentAction = DebuggerAction.ActionType.None;
public int DebuggerCurrentActionTarget = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ private void LeaveProcessor()
m_Parent.m_CoroutinesStack.RemoveAt(m_Parent.m_CoroutinesStack.Count - 1);
}

if (m_ExecutionNesting == 0 && m_Debug != null && m_Debug.DebuggerAttached != null)
if (m_ExecutionNesting == 0 && m_Debug != null && m_Debug.DebuggerEnabled
&& m_Debug.DebuggerAttached != null)
{
m_Debug.DebuggerAttached.SignalExecutionEnded();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ internal void AttachDebugger(IDebugger debugger)
m_Debug.DebuggerAttached = debugger;
}

internal bool DebuggerEnabled
{
get { return m_Debug.DebuggerEnabled; }
set { m_Debug.DebuggerEnabled = value; }
}


private void ListenDebugger(Instruction instr, int instructionPtr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ internal static DynValue TryObjectToSimpleDynValue(Script script, object obj)
if (obj is DynValue)
return (DynValue)obj;


var converter = Script.GlobalOptions.CustomConverters.GetClrToScriptCustomConversion(obj.GetType());
if (converter != null)
{
Expand Down
5 changes: 5 additions & 0 deletions src/MoonSharp.Interpreter/Platforms/PlatformAutoDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public static bool IsRunningOnAOT
// We do a lazy eval here, so we can wire out this code by not calling it, if necessary..
get
{
#if UNITY_WEBGL
return false;
#else

if (!m_IsRunningOnAOT.HasValue)
{
try
Expand All @@ -59,6 +63,7 @@ public static bool IsRunningOnAOT
}

return m_IsRunningOnAOT.Value;
#endif
}
}

Expand Down
17 changes: 16 additions & 1 deletion src/MoonSharp.Interpreter/Script.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Script : IScriptPrivateResource
/// <summary>
/// The version of the MoonSharp engine
/// </summary>
public const string VERSION = "0.9.9.0";
public const string VERSION = "1.0.0.0";

/// <summary>
/// The Lua version being supported
Expand Down Expand Up @@ -557,12 +557,27 @@ public DynValue GetMainChunk()
return MakeClosure(0);
}

/// <summary>
/// Gets or sets a value indicating whether the debugger is enabled.
/// Note that unless a debugger attached, this property returns a
/// value which might not reflect the real status of the debugger.
/// Use this property if you want to disable the debugger for some
/// executions.
/// </summary>
public bool DebuggerEnabled
{
get { return m_MainProcessor.DebuggerEnabled; }
set { m_MainProcessor.DebuggerEnabled = value; }
}


/// <summary>
/// Attaches a debugger. This usually should be called by the debugger itself and not by user code.
/// </summary>
/// <param name="debugger">The debugger object.</param>
public void AttachDebugger(IDebugger debugger)
{
DebuggerEnabled = true;
m_Debugger = debugger;
m_MainProcessor.AttachDebugger(debugger);

Expand Down

0 comments on commit 18d9e07

Please sign in to comment.