Ejemplo n.º 1
0
        internal Script(string code, string path, ScriptOptions options, Type globalsType, ScriptBuilder builder, Script previous)
        {
            _code = code ?? "";
            _path = path ?? "";
            _options = options ?? ScriptOptions.Default;
            _globalsType = globalsType;
            _previous = previous;

            if (_previous != null && builder != null && _previous._lazyBuilder != builder)
            {
                throw new ArgumentException("Incompatible script builder.");
            }

            _lazyBuilder = builder;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new instance of a script of this type.
 /// </summary>
 internal abstract Script Make(string code, string path, ScriptOptions options, Type globalsType, Type returnType, ScriptBuilder builder, Script previous);
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new version of this script with the <see cref="ScriptBuilder"/> specified.
 /// </summary>
 internal Script WithBuilder(ScriptBuilder builder)
 {
     return this.With(builder: builder);
 }
Ejemplo n.º 4
0
        internal Script(string code, string path, ScriptOptions options, Type globalsType, Type returnType, ScriptBuilder builder, Script previous)
        {
            _code        = code ?? "";
            _path        = path ?? "";
            _options     = options ?? ScriptOptions.Default;
            _globalsType = globalsType;
            _returnType  = returnType ?? typeof(object);
            _previous    = previous;

            if (_previous != null && builder != null && _previous._lazyBuilder != builder)
            {
                throw new ArgumentException("Incompatible script builder.");
            }

            _lazyBuilder = builder;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Creates a new instance of a script of this type.
 /// </summary>
 internal abstract Script Make(string code, string path, ScriptOptions options, Type globalsType, Type returnType, ScriptBuilder builder, Script previous);
Ejemplo n.º 6
0
 /// <summary>
 /// Creates a new verion of this script with the <see cref="ScriptBuilder"/> specified.
 /// </summary>
 internal Script WithBuilder(ScriptBuilder builder)
 {
     return(this.With(builder: builder));
 }
Ejemplo n.º 7
0
        internal Script(ScriptCompiler compiler, string code, ScriptOptions options, Type globalsType, ScriptBuilder builder, Script previous)
        {
            Compiler    = compiler;
            Code        = code ?? "";
            Options     = options ?? ScriptOptions.Default;
            GlobalsType = globalsType;
            Previous    = previous;

            if (Previous != null && builder != null && Previous._lazyBuilder != builder)
            {
                throw new ArgumentException("Incompatible script builder.");
            }

            _lazyBuilder = builder;
        }