Xanathar 10 gadi atpakaļ
vecāks
revīzija
18d9e07073

+ 1 - 1
src/MoonSharp.Documentation/MoonSharp.Documentation.shfbproj

@@ -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>

+ 31 - 1
src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataOverloadsTests.cs

@@ -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
@@ -19,6 +21,13 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
 			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]
@@ -191,6 +200,28 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
 			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()
@@ -289,6 +320,5 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
 
 
 
-
 	}
 }

+ 1 - 0
src/MoonSharp.Interpreter/Execution/VM/Processor/DebugContext.cs

@@ -10,6 +10,7 @@ namespace MoonSharp.Interpreter.Execution.VM
 	{
 		private class DebugContext
 		{
+			public bool DebuggerEnabled = true;
 			public IDebugger DebuggerAttached = null;
 			public DebuggerAction.ActionType DebuggerCurrentAction = DebuggerAction.ActionType.None;
 			public int DebuggerCurrentActionTarget = -1;

+ 2 - 1
src/MoonSharp.Interpreter/Execution/VM/Processor/Processor.cs

@@ -126,7 +126,8 @@ namespace MoonSharp.Interpreter.Execution.VM
 				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();
 			}

+ 5 - 0
src/MoonSharp.Interpreter/Execution/VM/Processor/Processor_Debugger.cs

@@ -17,6 +17,11 @@ namespace MoonSharp.Interpreter.Execution.VM
 			m_Debug.DebuggerAttached = debugger;
 		}
 
+		internal bool DebuggerEnabled
+		{
+			get { return m_Debug.DebuggerEnabled; }
+			set { m_Debug.DebuggerEnabled = value; }
+		}
 
 
 		private void ListenDebugger(Instruction instr, int instructionPtr)

+ 1 - 0
src/MoonSharp.Interpreter/Interop/Converters/ClrToScriptConversions.cs

@@ -20,6 +20,7 @@ namespace MoonSharp.Interpreter.Interop.Converters
 			if (obj is DynValue)
 				return (DynValue)obj;
 
+
 			var converter = Script.GlobalOptions.CustomConverters.GetClrToScriptCustomConversion(obj.GetType());
 			if (converter != null)
 			{

+ 5 - 0
src/MoonSharp.Interpreter/Platforms/PlatformAutoDetector.cs

@@ -43,6 +43,10 @@ namespace MoonSharp.Interpreter.Platforms
 			// 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
@@ -59,6 +63,7 @@ namespace MoonSharp.Interpreter.Platforms
 				}
 
 				return m_IsRunningOnAOT.Value;
+#endif
 			}
 		}
 

+ 16 - 1
src/MoonSharp.Interpreter/Script.cs

@@ -28,7 +28,7 @@ namespace MoonSharp.Interpreter
 		/// <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
@@ -557,12 +557,27 @@ namespace MoonSharp.Interpreter
 			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);