Skip to content

Commit

Permalink
fix naming issue for minifier
Browse files Browse the repository at this point in the history
  • Loading branch information
mnater committed Jun 26, 2018
1 parent 72bab08 commit cbbbdef
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions Hyphenopoly_Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
}
}());

const t = H.clientFeat;

(function setupEvents() {
// Events known to the system
const definedEvents = empty();
Expand Down Expand Up @@ -239,8 +237,8 @@
return false;
}
/* eslint-enable max-len, no-magic-numbers, no-prototype-builtins */
if (t.wasm === null) {
t.wasm = runWasmTest();
if (H.clientFeat.wasm === null) {
H.clientFeat.wasm = runWasmTest();
}
}());

Expand Down Expand Up @@ -324,7 +322,7 @@
}
}

return (t.wasm)
return (H.clientFeat.wasm)
? fetchBinary
: requestBinary;
}());
Expand Down Expand Up @@ -355,7 +353,7 @@
if (!H.specMems) {
H.specMems = empty();
}
if (t.wasm) {
if (H.clientFeat.wasm) {
H.specMems[lang] = new WebAssembly.Memory({
"initial": wasmPages,
"maximum": 256
Expand Down Expand Up @@ -387,7 +385,7 @@
H.binaries = empty();
}
scriptLoader(H.paths.maindir, "Hyphenopoly.js");
if (t.wasm) {
if (H.clientFeat.wasm) {
binLoader(
H.paths.maindir,
"hyphenEngine.wasm",
Expand All @@ -410,7 +408,7 @@
* @returns {undefined}
*/
function createTest(lang) {
if (t.langs[lang]) {
if (H.clientFeat.langs[lang]) {
return;
}
if (!fakeBody) {
Expand Down Expand Up @@ -458,22 +456,21 @@
* @param {Object} el - the element
* @returns {Boolean} result of the check
*/
function checkCSSHyphensSupport(el) {
const supp = el.style.hyphens === "auto" ||
el.style.webkitHyphens === "auto" ||
el.style.msHyphens === "auto" ||
el.style["-moz-hyphens"] === "auto";
return supp;
function checkCSSHyphensSupport(elm) {
return (elm.style.hyphens === "auto" ||
elm.style.webkitHyphens === "auto" ||
elmm.style.msHyphens === "auto" ||
elm.style["-moz-hyphens"] === "auto");
}

Object.keys(H.require).forEach(function doReqLangs(lang) {
if (H.require[lang] === "FORCEHYPHENOPOLY") {
t.polyfill = true;
t.langs[lang] = "H9Y";
H.clientFeat.polyfill = true;
H.clientFeat.langs[lang] = "H9Y";
loadRessources(lang);
} else if (
t.langs[lang] &&
t.langs[lang] === "H9Y"
H.clientFeat.langs[lang] &&
H.clientFeat.langs[lang] === "H9Y"
) {
loadRessources(lang);
} else {
Expand All @@ -486,11 +483,11 @@
if (H.require[lang] !== "FORCEHYPHENOPOLY") {
const el = d.getElementById(lang);
if (checkCSSHyphensSupport(el) && el.offsetHeight > 12) {
t.polyfill = t.polyfill || false;
t.langs[lang] = "CSS";
H.clientFeat.polyfill = H.clientFeat.polyfill || false;
H.clientFeat.langs[lang] = "CSS";
} else {
t.polyfill = true;
t.langs[lang] = "H9Y";
H.clientFeat.polyfill = true;
H.clientFeat.langs[lang] = "H9Y";
loadRessources(lang);
}
}
Expand All @@ -500,7 +497,7 @@
}());

(function run() {
if (t.polyfill) {
if (H.clientFeat.polyfill) {
d.documentElement.style.visibility = "hidden";

H.setup.timeOutHandler = window.setTimeout(function timedOut() {
Expand Down

0 comments on commit cbbbdef

Please sign in to comment.