18e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*
28e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
38e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copyright (C) 2008 Kelvin W Sherlock (ksherlock@gmail.com)
48e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
58e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Redistribution and use in source and binary forms, with or without
68e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * modification, are permitted provided that the following conditions
78e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * are met:
88e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 1. Redistributions of source code must retain the above copyright
98e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    notice, this list of conditions and the following disclaimer.
108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 2. Redistributions in binary form must reproduce the above copyright
118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    notice, this list of conditions and the following disclaimer in the
128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    documentation and/or other materials provided with the distribution.
138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifndef JSObjectRef_h
288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#define JSObjectRef_h
298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include <JavaScriptCore/JSBase.h>
318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include <JavaScriptCore/JSValueRef.h>
328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include <JavaScriptCore/WebKitAvailability.h>
338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifndef __cplusplus
358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include <stdbool.h>
368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif
378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include <stddef.h> /* for size_t */
388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifdef __cplusplus
408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectextern "C" {
418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif
428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@enum JSPropertyAttribute
458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@constant kJSPropertyAttributeNone         Specifies that a property has no special attributes.
468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@constant kJSPropertyAttributeReadOnly     Specifies that a property is read-only.
478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@constant kJSPropertyAttributeDontEnum     Specifies that a property should not be enumerated by JSPropertyEnumerators and JavaScript for...in loops.
488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@constant kJSPropertyAttributeDontDelete   Specifies that the delete operation should fail on a property.
498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectenum {
518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    kJSPropertyAttributeNone         = 0,
528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    kJSPropertyAttributeReadOnly     = 1 << 1,
538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    kJSPropertyAttributeDontEnum     = 1 << 2,
548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    kJSPropertyAttributeDontDelete   = 1 << 3
558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project};
568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSPropertyAttributes
598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract A set of JSPropertyAttributes. Combine multiple attributes by logically ORing them together.
608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef unsigned JSPropertyAttributes;
628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@enum JSClassAttribute
658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@constant kJSClassAttributeNone Specifies that a class has no special attributes.
668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@constant kJSClassAttributeNoAutomaticPrototype Specifies that a class should not automatically generate a shared prototype for its instance objects. Use kJSClassAttributeNoAutomaticPrototype in combination with JSObjectSetPrototype to manage prototypes manually.
678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectenum {
698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    kJSClassAttributeNone = 0,
708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    kJSClassAttributeNoAutomaticPrototype = 1 << 1
718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project};
728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSClassAttributes
758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract A set of JSClassAttributes. Combine multiple attributes by logically ORing them together.
768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef unsigned JSClassAttributes;
788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectInitializeCallback
818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract The callback invoked when an object is first created.
828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject being created.
848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function Initialize, you would declare it like this:
858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectvoid Initialize(JSContextRef ctx, JSObjectRef object);
878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectUnlike the other object callbacks, the initialize callback is called on the least
898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectderived class (the parent class) first, and the most derived class last.
908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef void
928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectInitializeCallback) (JSContextRef ctx, JSObjectRef object);
938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectFinalizeCallback
968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract The callback invoked when an object is finalized (prepared for garbage collection). An object may be finalized on any thread.
978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject being finalized.
988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function Finalize, you would declare it like this:
998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectvoid Finalize(JSObjectRef object);
1018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectThe finalize callback is called on the most derived class first, and the least
1038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectderived class (the parent class) last.
1048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectYou must not call any function that may cause a garbage collection or an allocation
1068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectof a garbage collected object from within a JSObjectFinalizeCallback. This includes
1078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectall functions that have a JSContextRef parameter.
1088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
1098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef void
1108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectFinalizeCallback) (JSObjectRef object);
1118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
1138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectHasPropertyCallback
1148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract The callback invoked when determining whether an object has a property.
1158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
1168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject to search for the property.
1178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyName A JSString containing the name of the property look up.
1188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result true if object has the property, otherwise false.
1198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function HasProperty, you would declare it like this:
1208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectbool HasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName);
1228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf this function returns false, the hasProperty request forwards to object's statically declared properties, then its parent class chain (which includes the default object class), then its prototype chain.
1248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectThis callback enables optimization in cases where only a property's existence needs to be known, not its value, and computing its value would be expensive.
1268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf this callback is NULL, the getProperty callback will be used to service hasProperty requests.
1288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
1298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef bool
1308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectHasPropertyCallback) (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName);
1318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
1338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectGetPropertyCallback
1348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract The callback invoked when getting a property's value.
1358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
1368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject to search for the property.
1378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyName A JSString containing the name of the property to get.
1388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param exception A pointer to a JSValueRef in which to return an exception, if any.
1398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result The property's value if object has the property, otherwise NULL.
1408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function GetProperty, you would declare it like this:
1418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJSValueRef GetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
1438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf this function returns NULL, the get request forwards to object's statically declared properties, then its parent class chain (which includes the default object class), then its prototype chain.
1458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
1468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef JSValueRef
1478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectGetPropertyCallback) (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
1488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
1508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectSetPropertyCallback
1518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract The callback invoked when setting a property's value.
1528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
1538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject on which to set the property's value.
1548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyName A JSString containing the name of the property to set.
1558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param value A JSValue to use as the property's value.
1568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param exception A pointer to a JSValueRef in which to return an exception, if any.
1578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result true if the property was set, otherwise false.
1588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function SetProperty, you would declare it like this:
1598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectbool SetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception);
1618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf this function returns false, the set request forwards to object's statically declared properties, then its parent class chain (which includes the default object class).
1638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
1648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef bool
1658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectSetPropertyCallback) (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception);
1668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
1688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectDeletePropertyCallback
1698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract The callback invoked when deleting a property.
1708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
1718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject in which to delete the property.
1728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyName A JSString containing the name of the property to delete.
1738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param exception A pointer to a JSValueRef in which to return an exception, if any.
1748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result true if propertyName was successfully deleted, otherwise false.
1758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function DeleteProperty, you would declare it like this:
1768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectbool DeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
1788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf this function returns false, the delete request forwards to object's statically declared properties, then its parent class chain (which includes the default object class).
1808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
1818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef bool
1828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectDeletePropertyCallback) (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
1838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
1858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectGetPropertyNamesCallback
1868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract The callback invoked when collecting the names of an object's properties.
1878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
1888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject whose property names are being collected.
1898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param accumulator A JavaScript property name accumulator in which to accumulate the names of object's properties.
1908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function GetPropertyNames, you would declare it like this:
1918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectvoid GetPropertyNames(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames);
1938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectProperty name accumulators are used by JSObjectCopyPropertyNames and JavaScript for...in loops.
1958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectUse JSPropertyNameAccumulatorAddName to add property names to accumulator. A class's getPropertyNames callback only needs to provide the names of properties that the class vends through a custom getProperty or setProperty callback. Other properties, including statically declared properties, properties vended by other classes, and properties belonging to object's prototype, are added independently.
1978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
1988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef void
1998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectGetPropertyNamesCallback) (JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames);
2008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
2028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectCallAsFunctionCallback
2038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract The callback invoked when an object is called as a function.
2048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
2058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param function A JSObject that is the function being called.
2068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param thisObject A JSObject that is the 'this' variable in the function's scope.
2078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param argumentCount An integer count of the number of arguments in arguments.
2088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param arguments A JSValue array of the  arguments passed to the function.
2098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param exception A pointer to a JSValueRef in which to return an exception, if any.
2108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSValue that is the function's return value.
2118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function CallAsFunction, you would declare it like this:
2128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJSValueRef CallAsFunction(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
2148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf your callback were invoked by the JavaScript expression 'myObject.myFunction()', function would be set to myFunction, and thisObject would be set to myObject.
2168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf this callback is NULL, calling your object as a function will throw an exception.
2188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
2198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef JSValueRef
2208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectCallAsFunctionCallback) (JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
2218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
2238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectCallAsConstructorCallback
2248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract The callback invoked when an object is used as a constructor in a 'new' expression.
2258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
2268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param constructor A JSObject that is the constructor being called.
2278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param argumentCount An integer count of the number of arguments in arguments.
2288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param arguments A JSValue array of the  arguments passed to the function.
2298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param exception A pointer to a JSValueRef in which to return an exception, if any.
2308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSObject that is the constructor's return value.
2318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function CallAsConstructor, you would declare it like this:
2328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJSObjectRef CallAsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
2348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf your callback were invoked by the JavaScript expression 'new myConstructor()', constructor would be set to myConstructor.
2368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf this callback is NULL, using your object as a constructor in a 'new' expression will throw an exception.
2388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
2398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef JSObjectRef
2408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectCallAsConstructorCallback) (JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
2418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
2438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectHasInstanceCallback
2448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract hasInstance The callback invoked when an object is used as the target of an 'instanceof' expression.
2458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
2468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param constructor The JSObject that is the target of the 'instanceof' expression.
2478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param possibleInstance The JSValue being tested to determine if it is an instance of constructor.
2488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param exception A pointer to a JSValueRef in which to return an exception, if any.
2498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result true if possibleInstance is an instance of constructor, otherwise false.
2508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function HasInstance, you would declare it like this:
2518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectbool HasInstance(JSContextRef ctx, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
2538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf your callback were invoked by the JavaScript expression 'someValue instanceof myObject', constructor would be set to myObject and possibleInstance would be set to someValue.
2558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf this callback is NULL, 'instanceof' expressions that target your object will return false.
2578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectStandard JavaScript practice calls for objects that implement the callAsConstructor callback to implement the hasInstance callback as well.
2598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
2608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef bool
2618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectHasInstanceCallback)  (JSContextRef ctx, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
2628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
2648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@typedef JSObjectConvertToTypeCallback
2658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract The callback invoked when converting an object to a particular JavaScript type.
2668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
2678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject to convert.
2688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param type A JSType specifying the JavaScript type to convert to.
2698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param exception A pointer to a JSValueRef in which to return an exception, if any.
2708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result The objects's converted value, or NULL if the object was not converted.
2718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion If you named your function ConvertToType, you would declare it like this:
2728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJSValueRef ConvertToType(JSContextRef ctx, JSObjectRef object, JSType type, JSValueRef* exception);
2748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf this function returns false, the conversion request forwards to object's parent class chain (which includes the default object class).
2768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectThis function is only invoked when converting an object to number or string. An object converted to boolean is 'true.' An object converted to object is itself.
2788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
2798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef JSValueRef
2808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project(*JSObjectConvertToTypeCallback) (JSContextRef ctx, JSObjectRef object, JSType type, JSValueRef* exception);
2818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
2838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@struct JSStaticValue
2848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract This structure describes a statically declared value property.
2858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field name A null-terminated UTF8 string containing the property's name.
2868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field getProperty A JSObjectGetPropertyCallback to invoke when getting the property's value.
2878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field setProperty A JSObjectSetPropertyCallback to invoke when setting the property's value. May be NULL if the ReadOnly attribute is set.
2888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field attributes A logically ORed set of JSPropertyAttributes to give to the property.
2898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
2908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef struct {
2918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    const char* const name;
2928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectGetPropertyCallback getProperty;
2938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectSetPropertyCallback setProperty;
2948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSPropertyAttributes attributes;
2958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project} JSStaticValue;
2968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
2978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
2988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@struct JSStaticFunction
2998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract This structure describes a statically declared function property.
3008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field name A null-terminated UTF8 string containing the property's name.
3018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field callAsFunction A JSObjectCallAsFunctionCallback to invoke when the property is called as a function.
3028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field attributes A logically ORed set of JSPropertyAttributes to give to the property.
3038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
3048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef struct {
3058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    const char* const name;
3068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectCallAsFunctionCallback callAsFunction;
3078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSPropertyAttributes attributes;
3088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project} JSStaticFunction;
3098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
3118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@struct JSClassDefinition
3128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract This structure contains properties and callbacks that define a type of object. All fields other than the version field are optional. Any pointer may be NULL.
3138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field version The version number of this structure. The current version is 0.
3148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field attributes A logically ORed set of JSClassAttributes to give to the class.
3158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field className A null-terminated UTF8 string containing the class's name.
3168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field parentClass A JSClass to set as the class's parent class. Pass NULL use the default object class.
3178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field staticValues A JSStaticValue array containing the class's statically declared value properties. Pass NULL to specify no statically declared value properties. The array must be terminated by a JSStaticValue whose name field is NULL.
3188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field staticFunctions A JSStaticFunction array containing the class's statically declared function properties. Pass NULL to specify no statically declared function properties. The array must be terminated by a JSStaticFunction whose name field is NULL.
3198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field initialize The callback invoked when an object is first created. Use this callback to initialize the object.
3208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field finalize The callback invoked when an object is finalized (prepared for garbage collection). Use this callback to release resources allocated for the object, and perform other cleanup.
3218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field hasProperty The callback invoked when determining whether an object has a property. If this field is NULL, getProperty is called instead. The hasProperty callback enables optimization in cases where only a property's existence needs to be known, not its value, and computing its value is expensive.
3228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field getProperty The callback invoked when getting a property's value.
3238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field setProperty The callback invoked when setting a property's value.
3248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field deleteProperty The callback invoked when deleting a property.
3258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field getPropertyNames The callback invoked when collecting the names of an object's properties.
3268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field callAsFunction The callback invoked when an object is called as a function.
3278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field hasInstance The callback invoked when an object is used as the target of an 'instanceof' expression.
3288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field callAsConstructor The callback invoked when an object is used as a constructor in a 'new' expression.
3298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@field convertToType The callback invoked when converting an object to a particular JavaScript type.
3308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion The staticValues and staticFunctions arrays are the simplest and most efficient means for vending custom properties. Statically declared properties autmatically service requests like getProperty, setProperty, and getPropertyNames. Property access callbacks are required only to implement unusual properties, like array indexes, whose names are not known at compile-time.
3318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectIf you named your getter function "GetX" and your setter function "SetX", you would declare a JSStaticValue array containing "X" like this:
3338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJSStaticValue StaticValueArray[] = {
3358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    { "X", GetX, SetX, kJSPropertyAttributeNone },
3368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    { 0, 0, 0, 0 }
3378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project};
3388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectStandard JavaScript practice calls for storing function objects in prototypes, so they can be shared. The default JSClass created by JSClassCreate follows this idiom, instantiating objects with a shared, automatically generating prototype containing the class's function objects. The kJSClassAttributeNoAutomaticPrototype attribute specifies that a JSClass should not automatically generate such a prototype. The resulting JSClass instantiates objects with the default object prototype, and gives each instance object its own copy of the class's function objects.
3408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectA NULL callback specifies that the default object callback should substitute, except in the case of hasProperty, where it specifies that getProperty should substitute.
3428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
3438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projecttypedef struct {
3448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    int                                 version; /* current (and only) version is 0 */
3458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSClassAttributes                   attributes;
3468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    const char*                         className;
3488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSClassRef                          parentClass;
3498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    const JSStaticValue*                staticValues;
3518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    const JSStaticFunction*             staticFunctions;
3528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectInitializeCallback          initialize;
3548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectFinalizeCallback            finalize;
3558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectHasPropertyCallback         hasProperty;
3568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectGetPropertyCallback         getProperty;
3578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectSetPropertyCallback         setProperty;
3588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectDeletePropertyCallback      deleteProperty;
3598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectGetPropertyNamesCallback    getPropertyNames;
3608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectCallAsFunctionCallback      callAsFunction;
3618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectCallAsConstructorCallback   callAsConstructor;
3628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectHasInstanceCallback         hasInstance;
3638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSObjectConvertToTypeCallback       convertToType;
3648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project} JSClassDefinition;
3658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
3678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@const kJSClassDefinitionEmpty
3688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract A JSClassDefinition structure of the current version, filled with NULL pointers and having no attributes.
3698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion Use this constant as a convenience when creating class definitions. For example, to create a class definition with only a finalize method:
3708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJSClassDefinition definition = kJSClassDefinitionEmpty;
3728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectdefinition.finalize = Finalize;
3738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
3748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT extern const JSClassDefinition kJSClassDefinitionEmpty;
3758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
3778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
3788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Creates a JavaScript class suitable for use with JSObjectMake.
3798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param definition A JSClassDefinition that defines the class.
3808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSClass with the given definition. Ownership follows the Create Rule.
3818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
3828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSClassRef JSClassCreate(const JSClassDefinition* definition);
3838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
3858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
3868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Retains a JavaScript class.
3878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param jsClass The JSClass to retain.
3888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSClass that is the same as jsClass.
3898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
3908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSClassRef JSClassRetain(JSClassRef jsClass);
3918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
3938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
3948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Releases a JavaScript class.
3958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param jsClass The JSClass to release.
3968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
3978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT void JSClassRelease(JSClassRef jsClass);
3988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
3998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
4008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
4018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Creates a JavaScript object.
4028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
4038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param jsClass The JSClass to assign to the object. Pass NULL to use the default object class.
4048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param data A void* to set as the object's private data. Pass NULL to specify no private data.
4058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSObject with the given class and private data.
4068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion The default object class does not allocate storage for private data, so you must provide a non-NULL jsClass to JSObjectMake if you want your object to be able to store private data.
4078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectdata is set on the created object before the intialize methods in its class chain are called. This enables the initialize methods to retrieve and manipulate data through JSObjectGetPrivate.
4098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
4108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, void* data);
4118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
4138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
4148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Convenience method for creating a JavaScript function with a given callback as its implementation.
4158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
4168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param name A JSString containing the function's name. This will be used when converting the function to string. Pass NULL to create an anonymous function.
4178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param callAsFunction The JSObjectCallAsFunctionCallback to invoke when the function is called.
4188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSObject that is a function. The object's prototype will be the default function prototype.
4198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
4208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSObjectRef JSObjectMakeFunctionWithCallback(JSContextRef ctx, JSStringRef name, JSObjectCallAsFunctionCallback callAsFunction);
4218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
4238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
4248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Convenience method for creating a JavaScript constructor.
4258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
4268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param jsClass A JSClass that is the class your constructor will assign to the objects its constructs. jsClass will be used to set the constructor's .prototype property, and to evaluate 'instanceof' expressions. Pass NULL to use the default object class.
4278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param callAsConstructor A JSObjectCallAsConstructorCallback to invoke when your constructor is used in a 'new' expression. Pass NULL to use the default object constructor.
4288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSObject that is a constructor. The object's prototype will be the default object prototype.
4298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion The default object constructor takes no arguments and constructs an object of class jsClass with no private data.
4308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
4318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSObjectRef JSObjectMakeConstructor(JSContextRef ctx, JSClassRef jsClass, JSObjectCallAsConstructorCallback callAsConstructor);
4328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
4348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @function
4358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @abstract Creates a JavaScript Array object.
4368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param ctx The execution context to use.
4378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param argumentCount An integer count of the number of arguments in arguments.
4388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param arguments A JSValue array of data to populate the Array with. Pass NULL if argumentCount is 0.
4398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @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.
4408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @result A JSObject that is an Array.
4418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @discussion The behavior of this function does not exactly match the behavior of the built-in Array constructor. Specifically, if one argument
4428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project is supplied, this function returns an array with one element.
4438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
4448f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng QianJS_EXPORT JSObjectRef JSObjectMakeArray(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) AVAILABLE_IN_WEBKIT_VERSION_4_0;
4458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
4478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @function
4488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @abstract Creates a JavaScript Date object, as if by invoking the built-in Date constructor.
4498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param ctx The execution context to use.
4508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param argumentCount An integer count of the number of arguments in arguments.
4518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param arguments A JSValue array of arguments to pass to the Date Constructor. Pass NULL if argumentCount is 0.
4528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @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.
4538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @result A JSObject that is a Date.
4548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
4558f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng QianJS_EXPORT JSObjectRef JSObjectMakeDate(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) AVAILABLE_IN_WEBKIT_VERSION_4_0;
4568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
4588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @function
4598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @abstract Creates a JavaScript Error object, as if by invoking the built-in Error constructor.
4608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param ctx The execution context to use.
4618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param argumentCount An integer count of the number of arguments in arguments.
4628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param arguments A JSValue array of arguments to pass to the Error Constructor. Pass NULL if argumentCount is 0.
4638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @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.
4648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @result A JSObject that is a Error.
4658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
4668f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng QianJS_EXPORT JSObjectRef JSObjectMakeError(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) AVAILABLE_IN_WEBKIT_VERSION_4_0;
4678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
4698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @function
4708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @abstract Creates a JavaScript RegExp object, as if by invoking the built-in RegExp constructor.
4718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param ctx The execution context to use.
4728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param argumentCount An integer count of the number of arguments in arguments.
4738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @param arguments A JSValue array of arguments to pass to the RegExp Constructor. Pass NULL if argumentCount is 0.
4748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @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.
4758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project @result A JSObject that is a RegExp.
4768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
4778f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng QianJS_EXPORT JSObjectRef JSObjectMakeRegExp(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) AVAILABLE_IN_WEBKIT_VERSION_4_0;
4788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
4808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
4818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Creates a function with a given script as its body.
4828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
4838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param name A JSString containing the function's name. This will be used when converting the function to string. Pass NULL to create an anonymous function.
4848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param parameterCount An integer count of the number of parameter names in parameterNames.
4858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param parameterNames A JSString array containing the names of the function's parameters. Pass NULL if parameterCount is 0.
4868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param body A JSString containing the script to use as the function's body.
4878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param sourceURL A JSString containing a URL for the script's source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions.
4888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions.
4898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param exception A pointer to a JSValueRef in which to store a syntax error exception, if any. Pass NULL if you do not care to store a syntax error exception.
4908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSObject that is a function, or NULL if either body or parameterNames contains a syntax error. The object's prototype will be the default function prototype.
4918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion Use this method when you want to execute a script repeatedly, to avoid the cost of re-parsing the script before each execution.
4928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
4938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSObjectRef JSObjectMakeFunction(JSContextRef ctx, JSStringRef name, unsigned parameterCount, const JSStringRef parameterNames[], JSStringRef body, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception);
4948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
4958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
4968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
4978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Gets an object's prototype.
4988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx  The execution context to use.
4998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object A JSObject whose prototype you want to get.
5008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSValue that is the object's prototype.
5018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
5028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object);
5038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
5058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
5068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Sets an object's prototype.
5078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx  The execution context to use.
5088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject whose prototype you want to set.
5098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param value A JSValue to set as the object's prototype.
5108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
5118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT void JSObjectSetPrototype(JSContextRef ctx, JSObjectRef object, JSValueRef value);
5128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
5148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
5158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Tests whether an object has a given property.
5168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject to test.
5178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyName A JSString containing the property's name.
5188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result true if the object has a property whose name matches propertyName, otherwise false.
5198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
5208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT bool JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName);
5218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
5238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
5248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Gets a property from an object.
5258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
5268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject whose property you want to get.
5278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyName A JSString containing the property's name.
5288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@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.
5298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result The property's value if object has the property, otherwise the undefined value.
5308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
5318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSValueRef JSObjectGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
5328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
5348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
5358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Sets a property on an object.
5368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
5378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject whose property you want to set.
5388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyName A JSString containing the property's name.
5398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param value A JSValue to use as the property's value.
5408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@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.
5418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param attributes A logically ORed set of JSPropertyAttributes to give to the property.
5428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
5438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes, JSValueRef* exception);
5448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
5468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
5478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Deletes a property from an object.
5488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
5498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject whose property you want to delete.
5508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyName A JSString containing the property's name.
5518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@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.
5528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result true if the delete operation succeeds, otherwise false (for example, if the property has the kJSPropertyAttributeDontDelete attribute set).
5538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
5548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
5558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
5578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
5588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Gets a property from an object by numeric index.
5598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
5608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject whose property you want to get.
5618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyIndex An integer value that is the property's name.
5628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@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.
5638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result The property's value if object has the property, otherwise the undefined value.
5648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion Calling JSObjectGetPropertyAtIndex is equivalent to calling JSObjectGetProperty with a string containing propertyIndex, but JSObjectGetPropertyAtIndex provides optimized access to numeric properties.
5658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
5668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSValueRef JSObjectGetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef* exception);
5678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
5698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
5708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Sets a property on an object by numeric index.
5718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
5728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject whose property you want to set.
5738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyIndex The property's name as a number.
5748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param value A JSValue to use as the property's value.
5758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@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.
5768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion Calling JSObjectSetPropertyAtIndex is equivalent to calling JSObjectSetProperty with a string containing propertyIndex, but JSObjectSetPropertyAtIndex provides optimized access to numeric properties.
5778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
5788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT void JSObjectSetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef value, JSValueRef* exception);
5798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
5818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
5828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Gets an object's private data.
5838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object A JSObject whose private data you want to get.
5848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A void* that is the object's private data, if the object has private data, otherwise NULL.
5858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
5868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT void* JSObjectGetPrivate(JSObjectRef object);
5878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
5898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
5908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Sets a pointer to private data on an object.
5918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject whose private data you want to set.
5928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param data A void* to set as the object's private data.
5938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result true if object can store private data, otherwise false.
5948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@discussion The default object class does not allocate storage for private data. Only objects created with a non-NULL JSClass can store private data.
5958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
5968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT bool JSObjectSetPrivate(JSObjectRef object, void* data);
5978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
5988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
5998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
6008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Tests whether an object can be called as a function.
6018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx  The execution context to use.
6028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject to test.
6038e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result true if the object can be called as a function, otherwise false.
6048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
6058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT bool JSObjectIsFunction(JSContextRef ctx, JSObjectRef object);
6068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
6088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
6098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Calls an object as a function.
6108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
6118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject to call as a function.
6128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param thisObject The object to use as "this," or NULL to use the global object as "this."
6138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param argumentCount An integer count of the number of arguments in arguments.
6148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param arguments A JSValue array of arguments to pass to the function. Pass NULL if argumentCount is 0.
6158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@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.
6168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result The JSValue that results from calling object as a function, or NULL if an exception is thrown or object is not a function.
6178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
6188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
6198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
6218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
6228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Tests whether an object can be called as a constructor.
6238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx  The execution context to use.
6248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject to test.
6258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result true if the object can be called as a constructor, otherwise false.
6268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
6278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT bool JSObjectIsConstructor(JSContextRef ctx, JSObjectRef object);
6288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
6308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
6318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Calls an object as a constructor.
6328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
6338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The JSObject to call as a constructor.
6348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param argumentCount An integer count of the number of arguments in arguments.
6358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param arguments A JSValue array of arguments to pass to the constructor. Pass NULL if argumentCount is 0.
6368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@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.
6378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result The JSObject that results from calling object as a constructor, or NULL if an exception is thrown or object is not a constructor.
6388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
6398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
6408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
6428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
6438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Gets the names of an object's enumerable properties.
6448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param ctx The execution context to use.
6458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param object The object whose property names you want to get.
6468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSPropertyNameArray containing the names object's enumerable properties. Ownership follows the Create Rule.
6478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
6488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSPropertyNameArrayRef JSObjectCopyPropertyNames(JSContextRef ctx, JSObjectRef object);
6498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
6518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
6528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Retains a JavaScript property name array.
6538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param array The JSPropertyNameArray to retain.
6548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSPropertyNameArray that is the same as array.
6558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
6568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSPropertyNameArrayRef JSPropertyNameArrayRetain(JSPropertyNameArrayRef array);
6578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
6598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
6608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Releases a JavaScript property name array.
6618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param array The JSPropetyNameArray to release.
6628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
6638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT void JSPropertyNameArrayRelease(JSPropertyNameArrayRef array);
6648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
6668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
6678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Gets a count of the number of items in a JavaScript property name array.
6688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param array The array from which to retrieve the count.
6698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result An integer count of the number of names in array.
6708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
6718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT size_t JSPropertyNameArrayGetCount(JSPropertyNameArrayRef array);
6728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
6748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
6758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Gets a property name at a given index in a JavaScript property name array.
6768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param array The array from which to retrieve the property name.
6778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param index The index of the property name to retrieve.
6788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@result A JSStringRef containing the property name.
6798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
6808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT JSStringRef JSPropertyNameArrayGetNameAtIndex(JSPropertyNameArrayRef array, size_t index);
6818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
6838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@function
6848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@abstract Adds a property name to a JavaScript property name accumulator.
6858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param accumulator The accumulator object to which to add the property name.
6868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@param propertyName The property name to add.
6878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
6888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source ProjectJS_EXPORT void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef accumulator, JSStringRef propertyName);
6898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifdef __cplusplus
6918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project}
6928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif
6938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
6948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif /* JSObjectRef_h */
695