Ejemplo n.º 1
0
		internal static string DefaultObjectToString(Scriptable obj)
		{
			return "[object " + obj.GetClassName() + ']';
		}
Ejemplo n.º 2
0
		/// <summary>Define this function as a JavaScript constructor.</summary>
		/// <remarks>
		/// Define this function as a JavaScript constructor.
		/// <p>
		/// Sets up the "prototype" and "constructor" properties. Also
		/// calls setParent and setPrototype with appropriate values.
		/// Then adds the function object as a property of the given scope, using
		/// <code>prototype.getClassName()</code>
		/// as the name of the property.
		/// </remarks>
		/// <param name="scope">
		/// the scope in which to define the constructor (typically
		/// the global object)
		/// </param>
		/// <param name="prototype">the prototype object</param>
		/// <seealso cref="Scriptable.SetParentScope(Scriptable)">Scriptable.SetParentScope(Scriptable)</seealso>
		/// <seealso cref="Scriptable.SetPrototype(Scriptable)">Scriptable.SetPrototype(Scriptable)</seealso>
		/// <seealso cref="Scriptable.GetClassName()">Scriptable.GetClassName()</seealso>
		public virtual void AddAsConstructor(Scriptable scope, Scriptable prototype)
		{
			InitAsConstructor(scope, prototype);
			DefineProperty(scope, prototype.GetClassName(), this, ScriptableObject.DONTENUM);
		}