Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8071] MobileWeb: require() doesn't cleanup properly after failing to load a module

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-18T16:52:42.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsMobileWeb
Labelsn/a
ReporterChris Barber
AssigneeChris Barber
Created2012-03-17T20:18:53.000+0000
Updated2017-03-03T23:55:57.000+0000

Description

When you do a require("something") and it fails, it returns undefined, which is correct. The problem is that require() didn't cleanup after that failure, so doing require("something") again will return the string "something" instead of throwing an error again.

Comments

  1. Chris Barber 2012-03-17

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/1727 Test by running the following in the console:
       require("something");
       require("something");
       require("something");
       
    All 3 calls should produce errors.
  2. Lee Morris 2017-03-03

    Closing ticket as MobileWeb is no longer supported.

JSON Source