Skip to content

Commit 050ecf7

Browse files
authored
Merge pull request #1966 from dpvc/issue1936
Prevent infinite loop if an autoloaded component fails to load. #1936
2 parents 8e4b92e + 7f6afd2 commit 050ecf7

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

unpacked/jax/output/CommonHTML/jax.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,10 +1759,19 @@
17591759
// Autoload files based on node type or file name
17601760
//
17611761
CHTMLautoload: function () {
1762+
this.toCommonHTML = MML.mbase.CHTMLautoloadFail;
17621763
var file = CHTML.autoloadDir+"/"+this.type+".js";
17631764
HUB.RestartAfter(AJAX.Require(file));
17641765
},
1766+
CHTMLautoloadFail: function () {
1767+
throw Error("CommonHTML can't autoload '"+ this.type + "'");
1768+
},
1769+
CHTMLautoloadList: {},
17651770
CHTMLautoloadFile: function (name) {
1771+
if (MML.mbase.CHTMLautoloadList.hasOwnProperty(name)) {
1772+
throw Error("CommonHTML can't autoload file '"+name+"'");
1773+
}
1774+
MML.mbase.CHTMLautoloadList[name] = true;
17661775
var file = CHTML.autoloadDir+"/"+name+".js";
17671776
HUB.RestartAfter(AJAX.Require(file));
17681777
},

unpacked/jax/output/HTML-CSS/jax.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,10 +2193,19 @@
21932193

21942194
},{
21952195
HTMLautoload: function () {
2196+
this.toHTML = MML.mbase.HTMLautoloadFail;
21962197
var file = HTMLCSS.autoloadDir+"/"+this.type+".js";
21972198
HUB.RestartAfter(AJAX.Require(file));
21982199
},
2200+
HTMLautoloadFail: function () {
2201+
throw Error("HTML-CSS can't autoload '"+ this.type + "'");
2202+
},
2203+
HTMLautoloadList: {},
21992204
HTMLautoloadFile: function (name) {
2205+
if (MML.mbase.HTMLautoloadList.hasOwnProperty(name)) {
2206+
throw Error("HTML-CSS can't autoload file '"+name+"'");
2207+
}
2208+
MML.mbase.HTMLautoloadList[name] = true;
22002209
var file = HTMLCSS.autoloadDir+"/"+name+".js";
22012210
HUB.RestartAfter(AJAX.Require(file));
22022211
},

unpacked/jax/output/SVG/jax.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,10 +1453,19 @@
14531453
return svg;
14541454
},
14551455
SVGautoload: function () {
1456+
this.toSVG = MML.mbase.SVGautoloadFail;
14561457
var file = SVG.autoloadDir+"/"+this.type+".js";
14571458
HUB.RestartAfter(AJAX.Require(file));
14581459
},
1460+
SVGautoloadFail: function () {
1461+
throw Error("SVG can't autoload '"+ this.type + "'");
1462+
},
1463+
SVGautoloadList: {},
14591464
SVGautoloadFile: function (name) {
1465+
if (MML.mbase.SVGautoloadList.hasOwnProperty(name)) {
1466+
throw Error("SVG can't autoload file '"+name+"'");
1467+
}
1468+
MML.mbase.SVGautoloadList[name] = true;
14601469
var file = SVG.autoloadDir+"/"+name+".js";
14611470
HUB.RestartAfter(AJAX.Require(file));
14621471
}

0 commit comments

Comments
 (0)