Opened 5 years ago

Closed 5 years ago

#17627 closed defect (invalid)

dojo loader leaves source code in closure

Reported by: mehuge Owned by: mehuge
Priority: undecided Milestone: tbd
Component: General Version: 1.9.2
Keywords: Cc:
Blocked By: Blocking:


in dojo.js around line 313, to following code is used to load module source:-

var eval_ =

use the function constructor so our eval is scoped close to (but not in) in the global space with minimal pollution new Function('return eval(arguments[0]);');

When the closures are examined with a method of a module (e.g. in postCreate) the highest level closure (the one just above global) contains a reference to arguments passed to eval with element 0 being a copy of the source code of the module.

The following code removes the source code from the closure after it has been eval'd

new Function('var module = eval(arguments[0]); delete arguments[0]; return module;');

leaving the arguments array referenced, but with and undefined [0] argument, and a reference to the module itself.

Change History (2)

comment:1 Changed 5 years ago by Colin Snover

Owner: set to mehuge
Status: newpending

I don’t understand what the impact of this report is or what is improved by modifying this code. Could you please explain in more detail what you believe is problematic?

comment:2 Changed 5 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.