Пример #1
0
        public EcmaValue(object value)
        {
            EcmaValue resolved = EcmaValueUtility.ConvertFromObject(value);

            this.handle  = resolved.handle;
            this.binder_ = resolved.binder;
        }
Пример #2
0
        public EcmaValue(RuntimeObject value)
        {
            IEcmaValueBinder binder = (IEcmaValueBinder)value ?? UndefinedBinder.Default;

            this.handle  = binder.ToHandle(value);
            this.binder_ = binder;
        }
Пример #3
0
        public EcmaValue(SerializationInfo info, StreamingContext context)
        {
            Type      type     = (Type)info.GetValue("ut", typeof(Type));
            object    value    = info.GetValue("uo", type);
            EcmaValue resolved = EcmaValueUtility.ConvertFromObject(value);

            this.handle  = resolved.handle;
            this.binder_ = resolved.binder;
        }
Пример #4
0
        public EcmaValue(Symbol value)
        {
            if (value.SymbolType != 0)
            {
                this.handle  = new EcmaValueHandle((long)value.SymbolType);
                this.binder_ = WellKnownSymbolBinder.Default;
            }
            else
            {
                IEcmaValueBinder binder = PrimitiveBinderWrapper <Symbol> .GetBinder(value, SymbolBinder.Default);

                this.handle  = binder.ToHandle(value);
                this.binder_ = binder;
            }
        }
Пример #5
0
        public EcmaValue(string value)
        {
            if (value == null)
            {
                this.handle  = default;
                this.binder_ = default;
            }
            else
            {
                IEcmaValueBinder binder = WellKnownPropertyNameBinder.IsWellKnownPropertyName(value) ? WellKnownPropertyNameBinder.Default : PrimitiveBinderWrapper <string> .GetBinder(value, StringBinder.Default);

                this.handle  = binder.ToHandle(value);
                this.binder_ = binder;
            }
        }
Пример #6
0
 public EcmaValue(sbyte value)
 {
     this.handle  = Int32Binder.Default.ToHandle(value);
     this.binder_ = Int32Binder.Default;
 }
Пример #7
0
 public EcmaValue(bool value)
 {
     this.handle  = BooleanBinder.Default.ToHandle(value);
     this.binder_ = BooleanBinder.Default;
 }
Пример #8
0
 internal EcmaValue(EcmaValueHandle value, IEcmaValueBinder binder)
 {
     this.handle  = value;
     this.binder_ = binder;
 }
Пример #9
0
 public EcmaValue(ulong value)
 {
     this.handle  = DoubleBinder.Default.ToHandle(value);
     this.binder_ = DoubleBinder.Default;
 }
Пример #10
0
 public EcmaValue(long value)
 {
     this.handle  = Int64Binder.Default.ToHandle(value);
     this.binder_ = Int64Binder.Default;
 }