Title: [234383] trunk/Source/_javascript_Core
Revision
234383
Author
[email protected]
Date
2018-07-30 14:27:43 -0700 (Mon, 30 Jul 2018)

Log Message

Clarify conversion rules for JSValue property access API
https://bugs.webkit.org/show_bug.cgi?id=188179

Reviewed by Geoffrey Garen.

* API/JSValue.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSValue.h (234382 => 234383)


--- trunk/Source/_javascript_Core/API/JSValue.h	2018-07-30 20:38:20 UTC (rev 234382)
+++ trunk/Source/_javascript_Core/API/JSValue.h	2018-07-30 21:27:43 UTC (rev 234383)
@@ -326,7 +326,7 @@
 @abstract Access a property of a JSValue.
 @result The JSValue for the requested property or the JSValue <code>undefined</code> 
  if the property does not exist.
-@discussion Corresponds to the _javascript_ operation <code>object[property]</code>. Pass an NSString * to access a named property. Other valid properties include symbols, numbers, and stringifiable objects. In macOS 10.13 and iOS 11 and below, 'property' was an NSString *.
+@discussion Corresponds to the _javascript_ operation <code>object[property]</code>. After macOS TBA and iOS TBA, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS TBA and iOS TBA, 'property' was expected to be an NSString *.
 */
 - (JSValue *)valueForProperty:(JSValueProperty)property;
 
@@ -333,7 +333,7 @@
 /*!
 @method
 @abstract Set a property on a JSValue.
-@discussion Corresponds to the _javascript_ operation <code>object[property] = value</code>. Pass an NSString * to access a named property. Other valid properties include symbols, numbers, and stringifiable objects. In macOS 10.13 and iOS 11 and below, 'property' was an NSString *.
+@discussion Corresponds to the _javascript_ operation <code>object[property] = value</code>. After macOS TBA and iOS TBA, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS TBA and iOS TBA, 'property' was expected to be an NSString *.
 */
 - (void)setValue:(id)value forProperty:(JSValueProperty)property;
 
@@ -341,7 +341,7 @@
 @method
 @abstract Delete a property from a JSValue.
 @result YES if deletion is successful, NO otherwise.
-@discussion Corresponds to the _javascript_ operation <code>delete object[property]</code>. Pass an NSString * to access a named property. Other valid properties include symbols, numbers, and stringifiable objects. In macOS 10.13 and iOS 11 and below, 'property' was an NSString *.
+@discussion Corresponds to the _javascript_ operation <code>delete object[property]</code>. After macOS TBA and iOS TBA, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS TBA and iOS TBA, 'property' was expected to be an NSString *.
 */
 - (BOOL)deleteProperty:(JSValueProperty)property;
 
@@ -350,7 +350,7 @@
 @abstract Check if a JSValue has a property.
 @discussion This method has the same function as the _javascript_ operator <code>in</code>.
 @result Returns YES if property is present on the value.
-@discussion Corresponds to the _javascript_ operation <code>property in object</code>. Pass an NSString * to access a named property. Other valid properties include symbols, numbers, and stringifiable objects. In macOS 10.13 and iOS 11 and below, 'property' was an NSString *.
+@discussion Corresponds to the _javascript_ operation <code>property in object</code>. After macOS TBA and iOS TBA, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS TBA and iOS TBA, 'property' was expected to be an NSString *.
 */
 - (BOOL)hasProperty:(JSValueProperty)property;
 
@@ -358,8 +358,7 @@
 @method
 @abstract Define properties with custom descriptors on JSValues.
 @discussion This method may be used to create a data or accessor property on an object.
- This method operates in accordance with the Object.defineProperty method in the 
- _javascript_ language. Pass an NSString * to access a named property. Other valid properties include symbols, numbers, and stringifiable objects. In macOS 10.13 and iOS 11 and below, 'property' was an NSString *.
+ This method operates in accordance with the Object.defineProperty method in the _javascript_ language. After macOS TBA and iOS TBA, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS TBA and iOS TBA, 'property' was expected to be an NSString *.
 */
 - (void)defineProperty:(JSValueProperty)property descriptor:(id)descriptor;
 
@@ -595,8 +594,8 @@
 @/textblock
 
  An object key passed as a subscript will be converted to a _javascript_ value,
- and then the value converted to a string used as a property name. In macOS
- 10.13 and iOS 11 and below, the <code>key</code> argument of
+ and then the value using the same rules as <code>valueWithObject:inContext:</code>. In macOS
+ TBA and iOS TBA and below, the <code>key</code> argument of
  <code>setObject:object forKeyedSubscript:key</code> was restricted to an
  <code>NSString <NSCopying> *</code> but that restriction was never used.
 */

Modified: trunk/Source/_javascript_Core/ChangeLog (234382 => 234383)


--- trunk/Source/_javascript_Core/ChangeLog	2018-07-30 20:38:20 UTC (rev 234382)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-07-30 21:27:43 UTC (rev 234383)
@@ -1,5 +1,14 @@
 2018-07-30  Keith Miller  <[email protected]>
 
+        Clarify conversion rules for JSValue property access API
+        https://bugs.webkit.org/show_bug.cgi?id=188179
+
+        Reviewed by Geoffrey Garen.
+
+        * API/JSValue.h:
+
+2018-07-30  Keith Miller  <[email protected]>
+
         Rename some JSC API functions/types.
         https://bugs.webkit.org/show_bug.cgi?id=188173
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to