예제 #1
0
파일: Constants.cs 프로젝트: arjenst/NetJS
        public Constant Get(int offset, Scope scope)
        {
            Constant current = Parts[0];

            if (current is Variable currentVariable)
            {
                current = scope.GetVariable(currentVariable.Name);
            }

            for (var i = 1; i < Parts.Count - offset; i++)
            {
                current = current.GetProperty(Parts[i], scope);
            }

            return(current);
        }
예제 #2
0
파일: Constants.cs 프로젝트: arjenst/NetJS
 public override Constant GetValue(Scope scope)
 {
     return(scope.GetVariable(Name));
 }