Skip to content

Commit 90749a7

Browse files
committed
Fix WARNINGs generated by the MathJax packer. #534
1 parent b73eafd commit 90749a7

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
6161
for (var i = 0, m = nl.length; i < m; i++) notation[nl[i]] = true;
6262
if (notation[MML.NOTATION.UPDIAGONALARROW]) notation[MML.NOTATION.UPDIAGONALSTRIKE] = false;
6363

64+
var line;
6465
for (var n in notation) {
6566
if (!notation.hasOwnProperty(n) || !notation[n]) continue;
6667
switch (n) {
@@ -117,8 +118,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
117118
break;
118119

119120
case MML.NOTATION.VERTICALSTRIKE:
120-
var vline = HTMLCSS.createRule(stack,H+D-t/2,0,t);
121-
HTMLCSS.addBox(stack,vline); HTMLCSS.placeBox(vline,p+t+base.bbox.w/2,-D,true);
121+
line = HTMLCSS.createRule(stack,H+D-t/2,0,t);
122+
HTMLCSS.addBox(stack,line); HTMLCSS.placeBox(line,p+t+base.bbox.w/2,-D,true);
122123
break;
123124

124125
case MML.NOTATION.TOP:
@@ -130,14 +131,14 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
130131
break;
131132

132133
case MML.NOTATION.HORIZONTALSTRIKE:
133-
var hline = HTMLCSS.createRule(stack,t,0,W-t/2);
134-
HTMLCSS.addBox(stack,hline); HTMLCSS.placeBox(hline,0,(H+D)/2-D,true);
134+
line = HTMLCSS.createRule(stack,t,0,W-t/2);
135+
HTMLCSS.addBox(stack,line); HTMLCSS.placeBox(line,0,(H+D)/2-D,true);
135136
break;
136137

137138
case MML.NOTATION.UPDIAGONALSTRIKE:
138139
if (HTMLCSS.useVML) {
139140
if (!vml) {vml = this.HTMLvml(stack,H,D,W,t,values.mathcolor)}
140-
var line = this.HTMLvmlElement(vml,"line",{from: "0,"+this.HTMLpx(H+D-t), to: this.HTMLpx(W)+",0"});
141+
line = this.HTMLvmlElement(vml,"line",{from: "0,"+this.HTMLpx(H+D-t), to: this.HTMLpx(W)+",0"});
141142
} else {
142143
if (!svg) {svg = this.HTMLsvg(stack,H,D,W,t,values.mathcolor)}
143144
this.HTMLsvgElement(svg.firstChild,"line",{
@@ -149,7 +150,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
149150
case MML.NOTATION.UPDIAGONALARROW:
150151
if (HTMLCSS.useVML) {
151152
if (!vml) {vml = this.HTMLvml(stack,H,D,W,t,values.mathcolor)}
152-
var line = this.HTMLvmlElement(vml,"line",{from: "0,"+this.HTMLpx(H+D-t), to: this.HTMLpx(W)+","+this.HTMLpx(t)});
153+
line = this.HTMLvmlElement(vml,"line",{from: "0,"+this.HTMLpx(H+D-t), to: this.HTMLpx(W)+","+this.HTMLpx(t)});
153154
this.HTMLvmlElement(line,"stroke",{endarrow:"classic"});
154155
} else {
155156
if (!svg) {svg = this.HTMLsvg(stack,H,D,W,t,values.mathcolor)}

unpacked/jax/output/NativeMML/jax.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@
902902
MML.math.Augment({
903903
toNativeMML: function (parent) {
904904
var tag = this.NativeMMLelement(this.type), math = tag, jax;
905+
var i, m;
905906
nMML.adjustWidths = [];
906907
//
907908
// Some browsers don't seem to add the xmlns attribute, so do it by hand.
@@ -916,7 +917,7 @@
916917
//
917918
// Add the children
918919
//
919-
for (var i = 0, m = this.data.length; i < m; i++) {
920+
for (i = 0, m = this.data.length; i < m; i++) {
920921
if (this.data[i]) {this.data[i].toNativeMML(tag)}
921922
else {tag.appendChild(this.NativeMMLelement("mrow"))}
922923
}
@@ -969,8 +970,8 @@
969970
// fix them up. Use ex's so that they print properly (see above).
970971
//
971972
var mtd = [];
972-
for (var i = 0, m = nMML.adjustWidths.length; i < m; i++) {
973-
var tag = nMML.adjustWidths[i];
973+
for (i = 0, m = nMML.adjustWidths.length; i < m; i++) {
974+
tag = nMML.adjustWidths[i];
974975
var style = tag.getAttribute("style") || "";
975976
if (!style.match(/(^|;)\s*min-width:/)) {
976977
mtd.push(tag.scrollWidth);
@@ -1215,11 +1216,11 @@
12151216
//
12161217
// Process the postscript pairs
12171218
//
1218-
var m = this.data.length, i;
1219+
var m = this.data.length, i, msubsup;
12191220
for (i = 1; i < m; i+=2) {
12201221
if (this.data[i].type === "mprescripts") break;
12211222

1222-
var msubsup = this.NativeMMLelement("msubsup");
1223+
msubsup = this.NativeMMLelement("msubsup");
12231224
msubsup.appendChild(base);
12241225

12251226
//
@@ -1243,7 +1244,7 @@
12431244
// Process the prescript pairs
12441245
//
12451246
for (i++; i < m; i+=2) {
1246-
var msubsup = this.NativeMMLelement("msubsup");
1247+
msubsup = this.NativeMMLelement("msubsup");
12471248
msubsup.appendChild(this.NativeMMLelement("mrow"));
12481249

12491250
//

unpacked/jax/output/SVG/autoload/menclose.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
116116

117117
// perform some reduction e.g. eliminate duplicate notations.
118118
var nl = MathJax.Hub.SplitList(values.notation), notation = {};
119-
for (var i = 0, m = nl.length; i < m; i++) notation[nl[i]] = true;
119+
for (i = 0, m = nl.length; i < m; i++) notation[nl[i]] = true;
120120
if (notation[MML.NOTATION.UPDIAGONALARROW]) notation[MML.NOTATION.UPDIAGONALSTRIKE] = false;
121121

122122
for (var n in notation) {

0 commit comments

Comments
 (0)