<commit_before>using Uno;
using Uno.UX;
using Uno.Collections;
using Uno.Threading;
using Uno.Compiler.ExportTargetInterop;

namespace Fuse.Scripting.Duktape
{
	extern(USE_DUKTAPE) class RawCallback
	{
		Context _context;
		Callback _callback;

		public RawCallback(Context context, Callback callback)
		{
			_context = context;
			_callback = callback;
		}

		public void Call(IntPtr argsPtr)
		{
			try
			{
				var jsArgs = new Array(_context, argsPtr);
				int len = jsArgs.Length;
				object[] args = new object[len];
				for (int i = 0; i < len; ++i)
				{
					args[i] = jsArgs[i];
				}
				_context.Push(_callback(args));
			}
			catch (Scripting.Error e)
			{
				_context.DukContext.error(e.Message);
			}
		}
	}

	public extern(USE_DUKTAPE) class Context : Fuse.Scripting.JavaScript.JSContext
	{
		readonly Object _globalObject;
		internal readonly ConcurrentQueue<int> _unstash = new ConcurrentQueue<int>();
		internal readonly Function _externalType;
		readonly Function _arrayBufferType;
		readonly Function _callbackFactory;
		internal readonly duk_context DukContext;

		public override Fuse.Scripting.Object GlobalObject { get { return _globalObject; } }

		public Context(): base()
		{
			DukContext = duktape.create_heap_default();

			{<commit_msg>Fuse.Scripting.JavaScript: fix Duktape build<commit_after>using Uno;
using Uno.UX;
using Uno.Collections;
using Uno.Threading;
using Uno.Compiler.ExportTargetInterop;

namespace Fuse.Scripting.Duktape
{
	extern(USE_DUKTAPE) class RawCallback
	{
		Context _context;
		Callback _callback;

		public RawCallback(Context context, Callback callback)
		{
			_context = context;
			_callback = callback;
		}

		public void Call(IntPtr argsPtr)
		{
			try
			{
				var jsArgs = new Array(_context, argsPtr);
				int len = jsArgs.Length;
				object[] args = new object[len];
				for (int i = 0; i < len; ++i)
				{
					args[i] = jsArgs[i];
				}
				_context.Push(_callback(_context, args));
			}
			catch (Scripting.Error e)
			{
				_context.DukContext.error(e.Message);
			}
		}
	}

	public extern(USE_DUKTAPE) class Context : Fuse.Scripting.JavaScript.JSContext
	{
		readonly Object _globalObject;
		internal readonly ConcurrentQueue<int> _unstash = new ConcurrentQueue<int>();
		internal readonly Function _externalType;
		readonly Function _arrayBufferType;
		readonly Function _callbackFactory;
		internal readonly duk_context DukContext;

		public override Fuse.Scripting.Object GlobalObject { get { return _globalObject; } }

		public Context(): base()
		{
			DukContext = duktape.create_heap_default();

			{
{'fraction_non_alphanumeric': 0.09693679720822024, 'fraction_numerical': 0.0007754943776657619, 'mean_word_length': 3.877126654064272, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1456221', 'n_tokens_mistral': 986, 'n_tokens_neox': 839, 'n_words': 202}