<commit_before>using System;
using DotVVM.Framework.Controls;

namespace DotVVM.Framework.Binding
{
    [BindingCompilationRequirements(Delegate = BindingCompilationRequirementType.StronglyRequire,
        Javascript = BindingCompilationRequirementType.StronglyRequire,
        ActionFilters = BindingCompilationRequirementType.IfPossible)]
    [CommandPostbackJsCompile]
    public class CommandBindingExpression : BindingExpression
    {
        public CommandBindingExpression()
        {
        }

        public CommandBindingExpression(Action<object[]> command, string id)
            : this((h, o) => { command(h); return null; }, id)
        { }

        public CommandBindingExpression(CompiledBindingExpression.BindingDelegate command, string id)
            : base(new CompiledBindingExpression() { Delegate = command, Id = id })
        {
        }

        public CommandBindingExpression(CompiledBindingExpression expression)
            : base(expression)
        {
        }


        /// <summary>
        /// Evaluates the binding.
        /// </summary>
        public override object Evaluate(DotvvmBindableControl control, DotvvmProperty property)
        {
            return ExecDelegate(control, property != DotvvmBindableControl.DataContextProperty);
        }

        /// <summary>
        /// Translates the binding to client script.
        /// </summary>
        /// <param name="control"></param>
        /// <param name="property"></param>
        public override string TranslateToClientScript(DotvvmBindableControl control, DotvvmProperty property)
        {
            throw new NotSupportedException("can't translate command to javascript");
        }
    }
}<commit_msg>runtime generated command bindings fixed<commit_after>using System;
using DotVVM.Framework.Controls;

namespace DotVVM.Framework.Binding
{
    [BindingCompilationRequirements(Delegate = BindingCompilationRequirementType.StronglyRequire,
        Javascript = BindingCompilationRequirementType.StronglyRequire,
        ActionFilters = BindingCompilationRequirementType.IfPossible)]
    [CommandPostbackJsCompile]
    public class CommandBindingExpression : BindingExpression
    {
        public CommandBindingExpression()
        {
        }

        public CommandBindingExpression(Action<object[]> command, string id)
            : this((h, o) => { command(h); return null; }, id)
        { }

        public CommandBindingExpression(CompiledBindingExpression.BindingDelegate command, string id)
            : base(new CompiledBindingExpression() { Delegate = command, Id = id, Javascript = $"dotvvm.postbackScript('{ id }')" })
        {
        }

        public CommandBindingExpression(CompiledBindingExpression expression)
            : base(expression)
        {
        }


        /// <summary>
        /// Evaluates the binding.
        /// </summary>
        public override object Evaluate(DotvvmBindableControl control, DotvvmProperty property)
        {
            return ExecDelegate(control, property != DotvvmBindableControl.DataContextProperty);
        }

        /// <summary>
        /// Translates the binding to client script.
        /// </summary>
        /// <param name="control"></param>
        /// <param name="property"></param>
        public override string TranslateToClientScript(DotvvmBindableControl control, DotvvmProperty property)
        {
            throw new NotSupportedException("can't translate command to javascript");
        }
    }
}
{'fraction_non_alphanumeric': 0.09158557527189468, 'fraction_numerical': 0.0, 'mean_word_length': 2.6984126984126986, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, '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': '1886273', 'n_tokens_mistral': 882, 'n_tokens_neox': 825, 'n_words': 181}