Beispiel #1
0
        public override void Validate(Context context, JsxProperty property)
        {
            IType actual = type is MethodType?property.checkProto(context, (MethodType)type) : property.check(context);

            if (!type.isAssignableFrom(context, actual))
            {
                throw new SyntaxError("IllegalAssignment: " + type.ToString() + " " + actual.ToString());
            }
        }
Beispiel #2
0
        public override void Validate(Context context, JsxProperty property)
        {
            IType actual = property.check(context);

            foreach (IType type in types)
            {
                if (type.isAssignableFrom(context, actual))
                {
                    return;
                }
            }
            throw new SyntaxError("Illegal assignment " + actual.ToString());
        }
Beispiel #3
0
        public override void Validate(Context context, JsxProperty property)
        {
            IJsxValue value = property.GetValue();

            if (value.IsLiteral())
            {
                String text = value.ToString();
                if (text.StartsWith("\"") && text.EndsWith("\""))
                {
                    text = text.Substring(1, text.Length - 1);
                }
                if (!values.Contains(text))
                {
                    throw new SyntaxError("Illegal value " + value.ToString());
                }
            }
        }
Beispiel #4
0
 public override void Validate(Context context, JsxProperty property)
 {
     validator.Validate(context, property);
 }
Beispiel #5
0
 public void Validate(Context context, JsxProperty prop)
 {
     validator.Validate(context, prop);
 }
Beispiel #6
0
 public override void Validate(Context context, JsxProperty prop)
 {
     // nothing to do
 }
Beispiel #7
0
 public abstract void Validate(Context context, JsxProperty prop);