Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#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 3 years ago by dylan

Milestone: tbd1.11
Owner: set to dylan
Status: newassigned

comment:2 Changed 3 years ago by dylan

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 3 years ago by dylans <dylan@…>

Resolution: fixed
Status: assignedclosed

In fb60490e4fdd2fff13eb1ab3aef25ecacb1cd521/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:4 Changed 3 years ago by dylans <dylan@…>

In 02626f7b52fbe2097451392a206ec5515131a1a6/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:5 Changed 3 years ago by dylans <dylan@…>

In 390f2791366e3058d7c3b569d5763d9e967de894/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:6 Changed 3 years ago by dylans <dylan@…>

In 9531c1ad2de532d82be8bdaf068645b73ede85f4/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:7 Changed 3 years ago by dylans <dylan@…>

In 811fe5c0668e835237a3b8c4a887fe843267eb34/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:8 Changed 3 years ago by dylan

Milestone: 1.111.7.9

Thanks for the patch Claude!

Note: See TracTickets for help on using tickets.