Changeset 140197 in webkit


Ignore:
Timestamp:
Jan 18, 2013 12:54:34 PM (11 years ago)
Author:
mhahnenberg@apple.com
Message:

Objective-C API: Update documentation for JSValue and JSContext
https://bugs.webkit.org/show_bug.cgi?id=107313

Reviewed by Geoffrey Garen.

After changing the semantics of object lifetime we need to update the API documentation to reflect the new semantics.

  • API/APIJSValue.h:
  • API/JSContext.h:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

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

    r140086 r140197  
    2929
    3030// A JSValue is a reference to a value within the JavaScript object space of a
    31 // JSVirtualMachine. All instances of JSValue originate from a JSContext, and
    32 // hold a strong reference to this JSContext. Where an instance method is invoked
    33 // upon a JSValue, and this returns another JSValue, the returned JSValue will
    34 // originate from the same JSContext as the JSValue on which the method was
    35 // invoked.
    36 //
    37 // The JSContext is used to manage the life-cycle of the referenced JavaScript
    38 // value within the virtual machine. So long as the JSContext is being retained
    39 // the JSValue will continue to keep the referenced value within the JavaScript
    40 // virtual machine alive. When the JSContext associated with a JSValue is
    41 // deallocated the weak context property of the JSValue will become nil. After
    42 // this occurs the value within the JavaScript virtual machine is no longer
    43 // being maintained by this JSValue, and the JSValue instance may no longer by
    44 // used as a reference to this value. For any method invoked on instance of
    45 // JSValue with a nil context, the method will return a nil/zero/false result.
     31// JSVirtualMachine. All instances of JSValue originate from a JSContext and
     32// hold a strong reference to this JSContext. As long as any value associated with
     33// a particular JSContext is retained, that JSContext will remain alive.
     34// Where an instance method is invoked upon a JSValue, and this returns another
     35// JSValue, the returned JSValue will originate from the same JSContext as the
     36// JSValue on which the method was invoked.
    4637//
    4738// For all methods taking arguments of type id, arguments will be converted
  • trunk/Source/JavaScriptCore/API/JSContext.h

    r138689 r140197  
    3434// JSContext is also used to manage the life-cycle of objects within the
    3535// JavaScript virtual machine. Every instance of JSValue is associated with a
    36 // JSContext via a weak reference. The JSValue will keep the JavaScript value it
    37 // references alive so long as the JSContext is also retained. When an instance
    38 // of JSContext is deallocated and the weak references to it are cleared the
    39 // JSValues that had been associated with this context will be invalidated, and
    40 // will cease to keep the values within the JavaScript engine alive.
     36// JSContext via a strong reference. The JSValue will keep the JSContext it
     37// references alive so long as the JSValue remains alive. When all of the JSValues
     38// that reference a particular JSContext have been deallocated the JSContext
     39// will be deallocated unless it has been previously retained.
    4140
    4241NS_CLASS_AVAILABLE(10_9, NA)
  • trunk/Source/JavaScriptCore/ChangeLog

    r140195 r140197  
     12013-01-18  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Objective-C API: Update documentation for JSValue and JSContext
     4        https://bugs.webkit.org/show_bug.cgi?id=107313
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        After changing the semantics of object lifetime we need to update the API documentation to reflect the new semantics.
     9
     10        * API/APIJSValue.h:
     11        * API/JSContext.h:
     12
    1132013-01-18  Balazs Kilvady  <kilvadyb@homejinni.com>
    214
Note: See TracChangeset for help on using the changeset viewer.