Ejemplo n.º 1
0
        /// <summary>
        /// Gets an object's property
        /// </summary>
        /// <remarks>
        /// Requires an active script context.
        /// </remarks>
        /// <param name="id">The ID of the property</param>
        /// <returns>The value of the property</returns>
        public JsValue GetProperty(JsPropertyId id)
        {
            JsValue propertyReference;

            JsErrorHelpers.ThrowIfError(NativeMethods.JsGetProperty(this, id, out propertyReference));

            return(propertyReference);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets a property descriptor for an object's own property
        /// </summary>
        /// <remarks>
        /// Requires an active script context.
        /// </remarks>
        /// <param name="propertyId">The ID of the property</param>
        /// <returns>The property descriptor</returns>
        public JsValue GetOwnPropertyDescriptor(JsPropertyId propertyId)
        {
            JsValue descriptorReference;

            JsErrorHelpers.ThrowIfError(NativeMethods.JsGetOwnPropertyDescriptor(this, propertyId, out descriptorReference));

            return(descriptorReference);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Determines whether an object has a non-inherited property
        /// </summary>
        /// <remarks>
        /// Requires an active script context.
        /// </remarks>
        /// <param name="propertyId">The ID of the property</param>
        /// <returns>Whether the object has the non-inherited property</returns>
        public bool HasOwnProperty(JsPropertyId propertyId)
        {
            bool hasOwnProperty;

            JsErrorHelpers.ThrowIfError(NativeMethods.JsHasOwnProperty(this, propertyId, out hasOwnProperty));

            return(hasOwnProperty);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Deletes an object's property
        /// </summary>
        /// <remarks>
        /// Requires an active script context.
        /// </remarks>
        /// <param name="propertyId">The ID of the property</param>
        /// <param name="useStrictRules">The property set should follow strict mode rules</param>
        /// <returns>Whether the property was deleted</returns>
        public JsValue DeleteProperty(JsPropertyId propertyId, bool useStrictRules)
        {
            JsValue returnReference;

            JsErrorHelpers.ThrowIfError(NativeMethods.JsDeleteProperty(this, propertyId, useStrictRules, out returnReference));

            return(returnReference);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Defines a new object's own property from a property descriptor
        /// </summary>
        /// <remarks>
        /// Requires an active script context.
        /// </remarks>
        /// <param name="propertyId">The ID of the property</param>
        /// <param name="propertyDescriptor">The property descriptor</param>
        /// <returns>Whether the property was defined</returns>
        public bool DefineProperty(JsPropertyId propertyId, JsValue propertyDescriptor)
        {
            bool result;

            JsErrorHelpers.ThrowIfError(NativeMethods.JsDefineProperty(this, propertyId, propertyDescriptor, out result));

            return(result);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Sets an object's property
 /// </summary>
 /// <remarks>
 /// Requires an active script context.
 /// </remarks>
 /// <param name="id">The ID of the property</param>
 /// <param name="value">The new value of the property</param>
 /// <param name="useStrictRules">The property set should follow strict mode rules</param>
 public void SetProperty(JsPropertyId id, JsValue value, bool useStrictRules)
 {
     JsErrorHelpers.ThrowIfError(NativeMethods.JsSetProperty(this, id, value, useStrictRules));
 }
Ejemplo n.º 7
0
 internal static extern JsErrorCode JsGetPropertyIdFromSymbol(JsValue symbol, out JsPropertyId propertyId);
Ejemplo n.º 8
0
 internal static extern JsErrorCode JsGetPropertyIdType(JsPropertyId propertyId,
                                                        out JsPropertyIdType propertyIdType);
Ejemplo n.º 9
0
 internal static extern JsErrorCode JsGetOwnPropertyDescriptor(JsValue obj, JsPropertyId propertyId,
                                                               out JsValue propertyDescriptor);
Ejemplo n.º 10
0
 internal static extern JsErrorCode JsCopyPropertyId(JsPropertyId propertyId, byte[] buffer,
                                                     UIntPtr bufferSize, out UIntPtr length);
Ejemplo n.º 11
0
 internal static extern JsErrorCode JsCreatePropertyId(string name, UIntPtr length,
                                                       out JsPropertyId propertyId);
Ejemplo n.º 12
0
 internal static extern JsErrorCode JsDefineProperty(JsValue obj, JsPropertyId propertyId,
                                                     JsValue propertyDescriptor, out bool result);
Ejemplo n.º 13
0
 internal static extern JsErrorCode JsDeleteProperty(JsValue obj, JsPropertyId propertyId, bool useStrictRules,
                                                     out JsValue result);
Ejemplo n.º 14
0
 internal static extern JsErrorCode JsHasOwnProperty(JsValue obj, JsPropertyId propertyId, out bool hasOwnProperty);
Ejemplo n.º 15
0
 internal static extern JsErrorCode JsSetProperty(JsValue obj, JsPropertyId propertyId, JsValue value,
                                                  bool useStrictRules);
Ejemplo n.º 16
0
 internal static extern JsErrorCode JsGetSymbolFromPropertyId(JsPropertyId propertyId, out JsValue symbol);
Ejemplo n.º 17
0
 internal static extern JsErrorCode JsGetProperty(JsValue obj, JsPropertyId propertyId, out JsValue value);