TiGlobalContextRef TiContextGetGlobalContext(TiContextRef ctx) { TiExcState* exec = toJS(ctx); APIEntryShim entryShim(exec); return toGlobalRef(exec->lexicalGlobalObject()->globalExec()); }
TiObjectRef TiContextGetGlobalObject(TiContextRef ctx) { TiExcState* exec = toJS(ctx); APIEntryShim entryShim(exec); // It is necessary to call toThisObject to get the wrapper object when used with WebCore. return toRef(exec->lexicalGlobalObject()->toThisObject(exec)); }