Advertisement
robertbira

Italian Translation Report: Node.js [Part 8 - 1121 words]

Jul 19th, 2018
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.70 KB | None | 0 0
  1. The environment that the API is invoked under.
  2. representing the being queried.
  3. The underlying data buffer of the
  4. Length in bytes of the underlying data buffer.
  5. Returns if the API succeeded.
  6. This API is used to retrieve the underlying data buffer of an and
  7. its length.
  8. Use caution while using this API.
  9. The lifetime of the underlying data
  10. buffer is managed by the even after it's returned.
  11. A
  12. possible safe way to use this API is in conjunction with
  13. which can be used to guarantee control over the
  14. lifetime of the
  15. It's also safe to use the returned data buffer
  16. within the same callback as long as there are no calls to other APIs that might
  17. trigger a GC.
  18. Use caution while using this API since the underlying data buffer's
  19. lifetime is not guaranteed if it's managed by the VM.
  20. representing JavaScript whose prototype to return.
  21. This returns the equivalent of (which is not the same as the function's property).
  22. representing prototype of the given object.
  23. representing the whose properties to query.
  24. Scalar datatype of the elements within the
  25. of elements in the
  26. The data buffer underlying the typed array.
  27. The byte offset within the data buffer from which
  28. to start projecting the
  29. This API returns various properties of a typed array.
  30. of bytes in the
  31. C boolean primitive equivalent of the given JavaScript
  32. If a non-boolean is passed in it returns
  33. representing JavaScript external value.
  34. Pointer to the data wrapped by the JavaScript external value.
  35. This API retrieves the external data pointer that was previously passed to
  36. If the number exceeds the range of the 32 bit integer, then the result is
  37. truncated to the equivalent of the bottom 32 bits.
  38. This can result in a large positive number becoming a negative number if the value is > 2^31 -1.
  39. Non-finite number values set the result to zero.
  40. values outside the range of
  41. -(2^53 - 1) - (2^53 - 1) will lose precision.
  42. Buffer to write the ISO-8859-1-encoded string into.
  43. If NULL is passed in, the length of the string (in bytes) is returned.
  44. Size of the destination buffer.
  45. When this value is
  46. insufficient, the returned string will be truncated.
  47. Number of bytes copied into the buffer, excluding the null terminator.
  48. This API returns the ISO-8859-1-encoded string corresponding the value passed in.
  49. in 2-byte code units
  50.  
  51. Functions to get global instances
  52. The value of the boolean to retrieve.
  53. This API is used to return the JavaScript singleton object that is used to represent the given boolean value.
  54.  
  55. Working with JavaScript Values - Abstract Operations
  56. N-API exposes a set of APIs to perform some abstract operations on JavaScript
  57. values.
  58. Some of these operations are documented under Section 7 of the ECMAScript Language Specification
  59. These APIs support doing one of the following:
  60. Coerce JavaScript values to specific JavaScript types (such as or)
  61. Check the type of a JavaScript value.
  62. Check for equality between two JavaScript values.
  63. The JavaScript value to coerce.
  64. This API implements the abstract operation as defined in Section 7.1.2 of the ECMAScript Language Specification.
  65. This API can be re-entrant if getters are defined on the passed-in
  66. The JavaScript value whose type to query.
  67. The type of the JavaScript value.
  68. if the type of is not a known ECMAScript type and is not an External value.
  69. This API represents behavior similar to invoking the Operator on the object as defined in Section 12.5.5 of the ECMAScript Language Specification.
  70. However, it has support for detecting an External value.
  71. If has a type that is invalid, an error is returned.
  72. The JavaScript value to check.
  73. The JavaScript function object of the constructor function to check against.
  74. Boolean that is set to true if is true.
  75. Whether the given object is an array.
  76. This API checks if the passed in is an array buffer.
  77. Whether the two objects are equal.
  78. This API represents the invocation of the Strict Equality algorithm as defined in Section 7.2.14 of the ECMAScript Language Specification.
  79.  
  80. Working with JavaScript Properties
  81. N-API exposes a set of APIs to get and set properties on JavaScript objects.
  82. Some of these types are documented under Section 7 of the ECMAScript Language Specification
  83. Properties in JavaScript are represented as a tuple of a key and a value.
  84. Fundamentally, all property keys in N-API can be represented in one of the following forms:
  85. Named: a simple UTF8-encoded string
  86. Integer-Indexed: an index value represented by
  87. JavaScript value: these are represented in N-API by
  88. This can be a representing a or
  89. N-API values are represented by the type
  90. Any N-API call that requires a JavaScript value takes in a
  91. However, it's the caller's responsibility to make sure that the in question is of the JavaScript type expected by the API.
  92. The APIs documented in this section provide a simple interface to
  93. get and set properties on arbitrary JavaScript objects represented by
  94. For instance, consider the following JavaScript code snippet:
  95. The equivalent can be done using N-API values with the following snippet:
  96. Create a napi_value for 123
  97. Indexed properties can be set in a similar manner.
  98. Create a napi_value for 'hello'
  99. Properties can be retrieved using the APIs described in this section.
  100. The following is the approximate equivalent of the N-API counterpart:
  101. Finally, multiple properties can also be defined on an object for performance
  102. reasons.
  103. Create napi_values for 123 and 456
  104. Set the properties
  105.  
  106. Structures
  107. Used with napi_define_class to distinguish static properties from instance properties.
  108. Ignored by napi_define_properties.
  109. are flags used to control the behavior of properties set on a JavaScript object.
  110. Other than they correspond to the attributes listed in Section 6.1.7.1 of the ECMAScript Language Specification.
  111. They can be one or more of the following bitflags:
  112. Used to indicate that no explicit attributes are set on the
  113. given property.
  114. By default, a property is read only, not enumerable and not
  115. configurable.
  116. Used to indicate that a given property is writable.
  117. Used to indicate that the property will be defined as a static property on a class as opposed to an instance property, which is the default. This is used only by
  118. One of utf8name or name should be NULL.
  119. Optional describing the key for the property, encoded as UTF8.
  120. One of or must be provided for the property.
  121. Optional that points to a JavaScript string or symbol to be used as the key for the property.
  122. The value that's retrieved by a get access of the property if the
  123. property is a data property.
  124. If this is passed in, set and to (since these members won't be used).
  125. A function to call when a get access of the property is performed.
  126. The given function is called implicitly by the runtime when the
  127. property is accessed from JavaScript code (or if a get on the property is
  128. performed using a N-API call).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement