#17564 closed defect (fixed)
[patch] dojox/html/_base.js , function download(src) can hide received code
Reported by: | Claude Guyomard | Owned by: | dylan |
---|---|---|---|
Priority: | undecided | Milestone: | 1.7.9 |
Component: | Dojox | Version: | 1.9.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
dojox/html/_base.js , function download(src)
This function concatenates the received code to byRef.code. In case that previous code (previous.js) terminates with an inline comment (e.g. / / @ sourceMappingURL=previous.js), the 1st line of the next aggregated code (next.js) will be hidden. As a result, the browser console will indicate a syntax error rather difficult to recognize because individual parts are syntaxically correct.
I suggest the following code :
xhrUtil.get({
url: src, sync: true, load: function(code){
if(byRef.code != "") {
code = "\n" + code;
} byRef.code += code+";";
}, error: byRef.errBack
});
return cont.replace(/<script\s*(?![>]*type=['"]?(?:dojo\/|text\/html\b))[>]*?(?:src=(['"]?)([>]*?)\1[>]*)?>([\s\S]*?)<\/script>/gi,
function(ignore, delim, src, code){
if(src){
download(src);
}else{
if(byRef.code != "") {
code = "\n" + code;
} byRef.code += code; Why not to concatenate a ';' here ?
} return "";
});
Regards,
Claude
Change History (8)
comment:1 Changed 6 years ago by
Milestone: | tbd → 1.11 |
---|---|
Owner: | set to dylan |
Status: | new → assigned |
comment:2 Changed 6 years ago by
Summary: | dojox/html/_base.js , function download(src) can hide received code → [patch] dojox/html/_base.js , function download(src) can hide received code |
---|
comment:3 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In fb60490e4fdd2fff13eb1ab3aef25ecacb1cd521/dojox: