[TIMOB-9950] BlackBerry: Fix/implement relative include/require
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-02-21T03:50:03.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.1.0, 2013 Sprint 04 BB, 2013 Sprint 04 |
Components | BlackBerry |
Labels | small |
Reporter | David Lifshitz |
Assignee | Russell McMahon |
Created | 2012-07-12T11:54:04.000+0000 |
Updated | 2017-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).
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
Closing ticket as fixed.