void VJSRequireClass::_Initialize (const VJSParms_initialize &inParms, void *) { XBOX::VJSObject thisObject(inParms.GetObject()); XBOX::VJSArray arrayObject(inParms.GetContext()); XBOX::VFolder *folder = XBOX::VFolder::RetainSystemFolder(eFK_Executable, false); xbox_assert(folder != NULL); #if VERSIONMAC XBOX::VFolder *parentFolder = folder->RetainParentFolder(); XBOX::VFilePath path(parentFolder->GetPath(), "Modules/", FPS_POSIX); XBOX::ReleaseRefCountable<XBOX::VFolder>(&parentFolder); #else XBOX::VFilePath path(folder->GetPath(), "Modules/", FPS_POSIX); #endif XBOX::ReleaseRefCountable<XBOX::VFolder>(&folder); XBOX::VString defaultPath; path.GetPosixPath(defaultPath); thisObject.SetProperty("paths", arrayObject, JS4D::PropertyAttributeDontDelete); arrayObject.PushString(defaultPath); }
void VJSModuleState::_GetRequireFunctionURL (XBOX::VString *outURLString) { XBOX::VFolder *folder = XBOX::VFolder::RetainSystemFolder(eFK_Executable, false); xbox_assert(folder != NULL); #if VERSIONMAC XBOX::VFolder *parentFolder = folder->RetainParentFolder(); XBOX::VFilePath path(parentFolder->GetPath(), "Resources/Web Components/walib/WAF/Core/Native/requireFunction.js", FPS_POSIX); XBOX::VFile file(path); if (!file.Exists()) { path.FromRelativePath(parentFolder->GetPath(), "walib/WAF/Core/Native/requireFunction.js", FPS_POSIX); } XBOX::ReleaseRefCountable<XBOX::VFolder>(&parentFolder); #else XBOX::VFilePath path(folder->GetPath(), "Resources/Web Components/walib/WAF/Core/Native/requireFunction.js", FPS_POSIX); XBOX::VFile file(path); if (!file.Exists()) path.FromRelativePath(folder->GetPath(), "walib/WAF/Core/Native/requireFunction.js", FPS_POSIX); #endif path.GetPosixPath(*outURLString); XBOX::ReleaseRefCountable<XBOX::VFolder>(&folder); }