Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#29 closed defect (fixed)

dojo makes debugging un-necessarialy difficult

Reported by: alex Owned by: alex
Priority: high Milestone:
Component: General Version:
Keywords: Cc:
Blocked By: Blocking:

Description

Dojo's package system handles module dependencies (and quite nicely, I might add), but the current in-browser system for dependency satisfaction relies on a synchronous XMLHTTP request to get a script file. The result is then eval()'d and it's dependencies are likewise satisfied synchronously.

This works nicely, but one of the unfortunate side-effects of the current system is to make debugging difficult because all scripts appear to be coming from an "eval()" statement somehere in bootstrap1.js. JavaScript? debuggers (like Venkman) deal with this poorly.

A solution for debugging purposes might be to use a modified version of the dependency satisfaction modifications which are used in the build system to get an ordered list of files to include. The resulting list (without the eval() step) could then be used to print out a series of document.write("<script />") calls which can place the scripts "in" the document, which would allow JavaScript? debuggers to point to line numbers and exact locations in code where errors occur.

Change History (3)

comment:1 Changed 14 years ago by dlaliberte@…

Although writing out SCRIPT tags would allow the browser and debuggers to see the source in the proper files, would this satisfy the dependencies in time, before the dependent code uses it? Normally the inserted script tags would be processed some time after the current script tag is finished. Is this true also if one merely sets the src property of a currently existing script tag?

If dependent module code were completely wrapped in a function definition, and dependencies were handled outside of that definition, then the module function could be called after the dependencies are satisfied, even if that happens asynchronously.

comment:2 Changed 14 years ago by alex

Resolution: fixed
Status: newclosed

fixed by [1084]

comment:3 Changed 12 years ago by (none)

Milestone: 0.2release

Milestone 0.2release deleted

Note: See TracTickets for help on using tickets.