Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-20141

Global scope variables can be shared with CommonJS modules

    Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: Release 5.1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      Mac OSX Version 10.10.2 (14C109)
      Titanium Studio, build: 3.4.1.201410281727
      Alloy 1.5.1
      SDK 3.4.1.GA
      iOS iPhone

      Description

      module.js
      ```
      console.log(controllerVariable);
      moduleVariable = "moduleVariable";
      module.exports = {};
      ```

      controller.js
      ```
      controllerVariable = "controllerVariable";
      var module = require("module");
      console.log(moduleVariable);
      ```

      Output when running the application is:
      moduleVariable
      controllerVariable

      Expected that the global scope of the controller would not be shared with the global scope of the module.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              erisco Eric
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-20784
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code