Ignore:
Timestamp:
Jun 10, 2019, 9:35:00 AM (6 years ago)
Author:
[email protected]
Message:

Make new Symbol/Promise API public
https://bugs.webkit.org/show_bug.cgi?id=198709

Reviewed by Saam Barati.

We also need to #ifdef some tests when building for older
platforms because the signatures for some methods are outdated on
those platforms.

  • API/JSObjectRef.h:
  • API/JSObjectRefPrivate.h:
  • API/JSValue.h:
  • API/JSValuePrivate.h:
  • API/JSValueRef.h:
  • API/tests/testapi.mm:

(testObjectiveCAPIMain):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSObjectRef.h

    r243376 r246265  
    11/*
    2  * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006-2019 Apple Inc. All rights reserved.
    33 * Copyright (C) 2008 Kelvin W Sherlock ([email protected])
    44 *
     
    478478
    479479/*!
     480 @function
     481 @abstract Creates a JavaScript promise object by invoking the provided executor.
     482 @param ctx The execution context to use.
     483 @param resolve A pointer to a JSObjectRef in which to store the resolve function for the new promise. Pass NULL if you do not care to store the resolve callback.
     484 @param reject A pointer to a JSObjectRef in which to store the reject function for the new promise. Pass NULL if you do not care to store the reject callback.
     485 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
     486 @result A JSObject that is a promise or NULL if an exception occurred.
     487 */
     488JS_EXPORT JSObjectRef JSObjectMakeDeferredPromise(JSContextRef ctx, JSObjectRef* resolve, JSObjectRef* reject, JSValueRef* exception) JSC_API_AVAILABLE(macos(10.15), ios(13.0));
     489
     490/*!
    480491@function
    481492@abstract Creates a function with a given script as its body.
     
    555566
    556567/*!
     568 @function
     569 @abstract Tests whether an object has a given property using a JSValueRef as the property key.
     570 @param object The JSObject to test.
     571 @param propertyKey A JSValueRef containing the property key to use when looking up the property.
     572 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
     573 @result true if the object has a property whose name matches propertyKey, otherwise false.
     574 @discussion This function is the same as performing "propertyKey in object" from JavaScript.
     575 */
     576JS_EXPORT bool JSObjectHasPropertyForKey(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, JSValueRef* exception) JSC_API_AVAILABLE(macos(10.15), ios(13.0));
     577
     578/*!
     579 @function
     580 @abstract Gets a property from an object using a JSValueRef as the property key.
     581 @param ctx The execution context to use.
     582 @param object The JSObject whose property you want to get.
     583 @param propertyKey A JSValueRef containing the property key to use when looking up the property.
     584 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
     585 @result The property's value if object has the property key, otherwise the undefined value.
     586 @discussion This function is the same as performing "object[propertyKey]" from JavaScript.
     587 */
     588JS_EXPORT JSValueRef JSObjectGetPropertyForKey(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, JSValueRef* exception) JSC_API_AVAILABLE(macos(10.15), ios(13.0));
     589
     590/*!
     591 @function
     592 @abstract Sets a property on an object using a JSValueRef as the property key.
     593 @param ctx The execution context to use.
     594 @param object The JSObject whose property you want to set.
     595 @param propertyKey A JSValueRef containing the property key to use when looking up the property.
     596 @param value A JSValueRef to use as the property's value.
     597 @param attributes A logically ORed set of JSPropertyAttributes to give to the property.
     598 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
     599 @discussion This function is the same as performing "object[propertyKey] = value" from JavaScript.
     600 */
     601JS_EXPORT void JSObjectSetPropertyForKey(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, JSValueRef value, JSPropertyAttributes attributes, JSValueRef* exception) JSC_API_AVAILABLE(macos(10.15), ios(13.0));
     602
     603/*!
     604 @function
     605 @abstract Deletes a property from an object using a JSValueRef as the property key.
     606 @param ctx The execution context to use.
     607 @param object The JSObject whose property you want to delete.
     608 @param propertyKey A JSValueRef containing the property key to use when looking up the property.
     609 @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
     610 @result true if the delete operation succeeds, otherwise false (for example, if the property has the kJSPropertyAttributeDontDelete attribute set).
     611 @discussion This function is the same as performing "delete object[propertyKey]" from JavaScript.
     612 */
     613JS_EXPORT bool JSObjectDeletePropertyForKey(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, JSValueRef* exception) JSC_API_AVAILABLE(macos(10.15), ios(13.0));
     614
     615/*!
    557616@function
    558617@abstract Gets a property from an object by numeric index.
Note: See TracChangeset for help on using the changeset viewer.