Пример #1
0
 public void CopyMembers(Javascript.Object source)
 {
     foreach (string key in source.PublicOwnKeys)
     {
         this.members[key] = this.members[source.members[key]];
     }
 }
Пример #2
0
 public void SetValue(Javascript.Object obj, int index, string[] names)
 {
     if (index + 1 == names.Length)
     {
         if (this[names[index]] is Javascript.PropertyBase)
         {
             //--Property の場合
             ((Javascript.PropertyBase) this[names[index]]).SetValue(obj);
         }
         else
         {
             this[names[index]] = obj;
         }
     }
     else
     {
         if (this is Javascript.PropertyBase)
         {
             Javascript.Object this2 = ((Javascript.PropertyBase) this).GetValue();
             this2[names[index]].SetValue(obj, index + 1, names);
         }
         else
         {
             this[names[index]].SetValue(obj, index + 1, names);
         }
     }
 }
Пример #3
0
        public override void SetValue(Javascript.Object parent, Javascript.Object value)
        {
            if (!(parent is Javascript.ManagedObject))
            {
                throw new System.ArgumentException(NOTSUPPORTED, "parent");
            }
            object o = ((Javascript.ManagedObject)parent).Value;

            if (!this.IsCastableFrom(o.GetType()))
            {
                throw new System.ArgumentException(NOTSUPPORTED, "parent");
            }
            //TODO:書きかけ
            return;
        }
Пример #4
0
        private static RegexOptions GetOptions(Javascript.Object _this)
        {
            var options = new RegexOptions();

            options |= RegexOptions.ECMAScript;

            if ((_this.Get <Javascript.Boolean>("ignoreCase")).Value)
            {
                options |= RegexOptions.IgnoreCase;
            }
            if ((_this.Get <Javascript.Boolean>("multiline")).Value)
            {
                options |= RegexOptions.Multiline;
            }

            // TODO: only enable this for xdoc
            options |= RegexOptions.IgnoreCase;

            return(options);
        }
Пример #5
0
 public Javascript.Object GetValue(int index, string[] names)
 {
     if (index + 1 == names.Length)
     {
         //--末端に来た時
         Javascript.Object o = this[names[index]];
         //CHECK>OK: o が null の時にどうなるか
         if (o is Javascript.PropertyBase)
         {
             //--Property の場合
             return(((Javascript.PropertyBase)o).GetValue());
         }
         else if (this is Javascript.ManagedObject && o is Javascript.ManagedMethod)
         {
             //--ManagedMethod の場合
             return(new Javascript.ManagedDelegate(
                        ((Javascript.ManagedObject) this).Value,
                        (Javascript.ManagedMethod)o
                        ));
         }
         else
         {
             return(o);
         }
     }
     else
     {
         if (this is Javascript.PropertyBase)
         {
             Javascript.Object this2 = ((Javascript.PropertyBase) this).GetValue();
             return(this2[names[index]].GetValue(index + 1, names));
         }
         else
         {
             return(this[names[index]].GetValue(index + 1, names));
         }
     }
 }
Пример #6
0
 public ObjectEnumerator(Javascript.Object o)
 {
     this.hash = o.members;
     this.ie   = this.hash.Keys.GetEnumerator();
 }
Пример #7
0
 public ObjectEnumerable(Javascript.Object o)
 {
     this.obj = o;
 }