Changeset 49802 in webkit for trunk/JavaScriptCore/API/APICast.h


Ignore:
Timestamp:
Oct 19, 2009, 12:59:32 PM (16 years ago)
Author:
[email protected]
Message:

Added a private API for getting a global context from a context, for
clients who want to preserve a context for a later callback.

Patch by Geoffrey Garen <[email protected]> on 2009-10-19
Reviewed by Sam Weinig.

  • API/APICast.h:

(toGlobalRef): Added an ASSERT, since this function is used more often
than before.

  • API/JSContextRef.cpp:
  • API/JSContextRefPrivate.h: Added. The new API.
  • API/tests/testapi.c:

(print_callAsFunction):
(main): Test the new API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/APICast.h

    r46598 r49802  
    2828
    2929#include "JSAPIValueWrapper.h"
     30#include "JSGlobalObject.h"
    3031#include "JSValue.h"
    3132#include <wtf/Platform.h>
     
    119120inline JSGlobalContextRef toGlobalRef(JSC::ExecState* e)
    120121{
     122    ASSERT(e == e->lexicalGlobalObject()->globalExec());
    121123    return reinterpret_cast<JSGlobalContextRef>(e);
    122124}
Note: See TracChangeset for help on using the changeset viewer.