Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9950] BlackBerry: Fix/implement relative include/require

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-02-21T03:50:03.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.1.0, 2013 Sprint 04 BB, 2013 Sprint 04
ComponentsBlackBerry
Labelssmall
ReporterDavid Lifshitz
AssigneeRussell McMahon
Created2012-07-12T11:54:04.000+0000
Updated2017-03-09T00:46:32.000+0000

Description

Currently, include()'s method of doing relative files only works if all done in successive order. It does not work for windows with a url (not implemented) or if include is used in a function of a file in a subdir. Also, require() does not have any method right now. My proposal is to store the filepath in each TiObject so it can be retrieved later when needed. Also, we need to make sure that require() properly handles a "native Titanium module" by its ID (eg com.example.module).

Comments

  1. David Lifshitz 2012-08-16

    I may have come across some potential solutions to this, but it would need to be verified if it works: http://stackoverflow.com/questions/10040604/how-to-get-scripts-origin-filename-in-v8 {noformat} args.Callee()->GetScriptOrigin().ResourceName() or StackTrace::CurrentStackTrace(1, StackTrace::kScriptName)->GetFrame(0)->GetScriptName() {noformat} Also need to fix this for image urls
  2. Lee Morris 2017-03-09

    Closing ticket as fixed.

JSON Source