Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#10156 closed defect (fixed)

miscalced dojo root when working from source

Reported by: Mike Wilson Owned by: Rawld Gill
Priority: low Milestone: 1.8
Component: Loader Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:

Description

There is a small bug in the getRootNode() function in SVN/dojo/dojo.js, wrt the regexp on line 57:

var rePkg = /dojo\.js(\W|$)/i;

The problem is it will match on other script URLs that end with "dojo.js", f ex:

<script src="my-stuff-for-dojo.js"></script>
<script src="dojo.js"></script>

results in:

root = "my-stuff-for-"

which will break loading of further Dojo files. This bug can easily be corrected by making the regexp more restrictive.

Change History (11)

comment:1 Changed 10 years ago by Mike Wilson

Btw, I should mention that this bug applies to current HEAD as well (1.4 beta).

comment:2 Changed 10 years ago by Adam Peller

Owner: changed from anonymous to James Burke

comment:3 Changed 10 years ago by James Burke

Milestone: tbd1.5

This regexp has been there for a while, pushing to 1.5.

comment:4 Changed 9 years ago by James Burke

Milestone: 1.51.6

comment:5 Changed 9 years ago by bill

Milestone: 1.6future

(sadly) punting seemingly abandoned ticket and meta tickets to future

comment:6 Changed 8 years ago by bill

Component: GeneralLoader
Milestone: futuretbd
Owner: changed from James Burke to Rawld Gill
Status: newassigned

There's no getRootNode() method anymore but there is a regex in dojo.js:

/(.*)\/?dojo\.js(\W|$)/

Looks like it will incorrectly match my-stuff-for-dojo.js due to the ? after the slash. Maybe you want something like:

/(\/|^)dojo.js(\W|$)/

comment:7 Changed 8 years ago by ben hockey

Priority: highlow

comment:8 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

In [28420]:

improved dojo sniff; fixes #10156; !strict

comment:9 Changed 8 years ago by Rawld Gill

Note that dojoConfig can override any sniffed value.

comment:10 Changed 8 years ago by Rawld Gill

In [28421]:

propagate dojoDir change in [28420] to cdn path; refs #10156; !strict

comment:11 Changed 8 years ago by bill

Milestone: tbd1.8
Note: See TracTickets for help on using tickets.