Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13133] Ti API: Implement support for file, line, etc "macros"

GitHub Issuen/a
TypeStory
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsTiAPI
Labelscb-tooling
ReporterBryan Hughes
AssigneeUnknown
Created2013-03-20T17:10:15.000+0000
Updated2020-02-05T07:22:45.000+0000

Description

Node.js has two useful "macros" of sorts: __dirname and __filename (see http://nodejs.org/api/globals.html). We should consider adding similar macros of our own: * __file * __line * __function It's worth noting that Node.js only supports __dirname and __filename because they can be inserted as module-scoped variables, but __line and __column require compile-time support. It's a lot easier for us to do compile-time support (a true macro) than it is for Node.js, but it's still worth discussing this point. Note: for production builds, we should not insert this information. Strings should be undefined/empty string and numbers should be NaN This should be implemented as a CLI hook that uses uglify to walk the AST tree and modify it

Comments

No comments

JSON Source