Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11505] Android: (V8 only) Using require() a second time for the same module returns undefined instead of cached module object.

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2012-10-17T18:39:22.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Release 3.1.0, 2012 Sprint 21 Core, 2012 Sprint 21
ComponentsAndroid
Labelscore, qe-port, regression, triage
ReporterBill Dawson
AssigneeBill Dawson
Created2012-10-16T18:52:20.000+0000
Updated2012-12-05T18:01:48.000+0000

Description

Titanium Mobile 3.0.0, V8, any android version, any desktop os, any Studio version.

Create a project and target 3.0.0.

Put the attached module zip file in the project folder.

Add the module to the project (i.e., edit tiapp.xml section appropriately).

Make this the project's app.js:

require("ti.bertram").example();
require("ti.bertram").example();

Run the project and you'll get the runtime error that you can't call "example" of undefined.

This is a *regression* and is not present in 2.1.3. The problem does not occur when Rhino is the runtime.

Attachments

FileDateSize
ti.bertram-android-0.1.zip2012-10-16T19:00:28.000+000044008

Comments

  1. Bill Dawson 2012-10-16

    Master PR ready: https://github.com/appcelerator/titanium_mobile/pull/3253/
  2. Bill Dawson 2012-10-16

    3_0_X PR ready: https://github.com/appcelerator/titanium_mobile/pull/3254/
  3. Natalie Huynh 2012-12-05

    Tested with 3.0.0.20121204144658 on Droid 1 2.2.3

JSON Source