Skip to content

JsObjectDefineProperty

rhuanjl edited this page Sep 1, 2018 · 1 revision

Defines a new object's own property from a property descriptor.

Syntax

CHAKRA_API
    JsObjectDefineProperty(
        _In_ JsValueRef object,
        _In_ JsValueRef key,
        _In_ JsValueRef propertyDescriptor,
        _Out_ bool *result);

Parameters

  • object: The object that has the property.
  • key: The key (JavascriptString or JavascriptSymbol) to the property.
  • propertyDescriptor: The property descriptor.
  • result: Whether the property was defined.

Return Value

The code JsNoError if the operation succeeded, a failure code otherwise.

Remarks

This API is experimental and may have breaking changes later.

Requires an active script context.

Clone this wiki locally