} } // StringConstructorObj // Implementation for calling the String constructor as a function. // "When String is called as a function rather than as a constructor, // it performs a type conversion." private static object StringConstructorFunction(object this_, params object[] args) { if (args.Length == 0) return ""; else return JConvert.ToString(args[0]); } // StringConstructorFunction
} // StringConstructorFunction // Implementation for calling the String constructor as a constructor. // "When String is called as part of a new expression, it is a constructor: // it initialises the newly created object." public static object StringConstructor(object this_, params object[] args) { string strValue; if (args.Length == 0) strValue = ""; else strValue = JConvert.ToString(args[0]); return new JStringObject(strValue); } // StringConstructor
} // Get (string propName) public virtual object Get(object propName) { return Get(JConvert.ToString(propName)); } // Get (object propName)