示例#1
0
        public void ReplaceWith(ScriptVar newVar)
        {
            ScriptVar oldVar = Var;

            Var = newVar.Ref();
            oldVar.UnRef();
        }
示例#2
0
 public ScriptVarLink(ScriptVar var, String name)
 {
     Name  = name;
     Var   = var.Ref();
     Next  = null;
     Prev  = null;
     Owned = false;
 }
示例#3
0
 public ScriptVarLink(ScriptVar var, string name, bool readOnly = false)
 {
     Name    = name;
     Var     = var.Ref();
     Next    = null;
     Prev    = null;
     Owned   = false;
     IsConst = readOnly;
 }
示例#4
0
        public void ReplaceWith(ScriptVar newVar)
        {
            if (IsConst && Var?.IsUndefined == false)
            {
                throw new JITException(string.Format("{0} is const, cannot assign a new value", Name));
            }

            var oldVar = Var;

            Var = newVar.Ref();
            oldVar.UnRef();
        }