[TIMOB-5859] MobileWeb: Implement require() function
| GitHub Issue | n/a |
| Type | New Feature |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2011-12-02T17:54:48.000+0000 |
| Affected Version/s | Release 1.8.0 |
| Fix Version/s | Sprint 2011-48, Release 1.8.0.1 |
| Components | MobileWeb |
| Labels | stage |
| Reporter | Chris Barber |
| Assignee | Chris Barber |
| Created | 2011-10-25T10:03:46.000+0000 |
| Updated | 2017-03-03T22:28:24.000+0000 |
Description
Need to add support for the require() function. This function will accept a string of the module to load, then synchronously fetches the module, evaluates the module, caches the API, and returns the API.
Attachments
https://github.com/appcelerator/titanium_mobile/pull/702
Found another bug with evaluating string modules.
Fixed. Pull request: https://github.com/appcelerator/titanium_mobile/pull/729
Added testmodule.js that you simply console.debug(require("testmodule")). It should output an object { a: function() }, but instead outputs function().
Pull request: https://github.com/appcelerator/titanium_mobile/pull/759
Added comprehensive test of require() and Ti.include() including relative paths.
Closing as duplicate.