Fossil SCM
Imported a 2-line polyfill for MSIE's missing NodeList.forEach, courtesy of the Mozilla docs.
Commit
4dd270761d996e34cdd85acf2c60d75787b917791fa1ace510e31709eae29c62
Parent
15a7b1fd377dd67…
1 file changed
+8
-2
+8
-2
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -1441,12 +1441,18 @@ | ||
| 1441 | 1441 | /* Set up the generic/app-agnostic parts of window.fossil |
| 1442 | 1442 | ** which require C-level state... */ |
| 1443 | 1443 | if(addScriptTag!=0){ |
| 1444 | 1444 | style_emit_script_tag(0,0); |
| 1445 | 1445 | } |
| 1446 | - CX("(function(){\n" | |
| 1447 | - "if(!window.fossil) window.fossil={};\n" | |
| 1446 | + CX("(function(){\n"); | |
| 1447 | + CX(/*MSIE NodeList.forEach polyfill, courtesy of Mozilla: | |
| 1448 | + https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill | |
| 1449 | + */ | |
| 1450 | + "if(window.NodeList && !NodeList.prototype.forEach){" | |
| 1451 | + "NodeList.prototype.forEach = Array.prototype.forEach;" | |
| 1452 | + "}\n"); | |
| 1453 | + CX("if(!window.fossil) window.fossil={};\n" | |
| 1448 | 1454 | "window.fossil.version = %!j;\n" |
| 1449 | 1455 | /* fossil.rootPath is the top-most CGI/server path, |
| 1450 | 1456 | ** including a trailing slash. */ |
| 1451 | 1457 | "window.fossil.rootPath = %!j+'/';\n", |
| 1452 | 1458 | get_version(), g.zTop); |
| 1453 | 1459 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1441,12 +1441,18 @@ | |
| 1441 | /* Set up the generic/app-agnostic parts of window.fossil |
| 1442 | ** which require C-level state... */ |
| 1443 | if(addScriptTag!=0){ |
| 1444 | style_emit_script_tag(0,0); |
| 1445 | } |
| 1446 | CX("(function(){\n" |
| 1447 | "if(!window.fossil) window.fossil={};\n" |
| 1448 | "window.fossil.version = %!j;\n" |
| 1449 | /* fossil.rootPath is the top-most CGI/server path, |
| 1450 | ** including a trailing slash. */ |
| 1451 | "window.fossil.rootPath = %!j+'/';\n", |
| 1452 | get_version(), g.zTop); |
| 1453 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1441,12 +1441,18 @@ | |
| 1441 | /* Set up the generic/app-agnostic parts of window.fossil |
| 1442 | ** which require C-level state... */ |
| 1443 | if(addScriptTag!=0){ |
| 1444 | style_emit_script_tag(0,0); |
| 1445 | } |
| 1446 | CX("(function(){\n"); |
| 1447 | CX(/*MSIE NodeList.forEach polyfill, courtesy of Mozilla: |
| 1448 | https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill |
| 1449 | */ |
| 1450 | "if(window.NodeList && !NodeList.prototype.forEach){" |
| 1451 | "NodeList.prototype.forEach = Array.prototype.forEach;" |
| 1452 | "}\n"); |
| 1453 | CX("if(!window.fossil) window.fossil={};\n" |
| 1454 | "window.fossil.version = %!j;\n" |
| 1455 | /* fossil.rootPath is the top-most CGI/server path, |
| 1456 | ** including a trailing slash. */ |
| 1457 | "window.fossil.rootPath = %!j+'/';\n", |
| 1458 | get_version(), g.zTop); |
| 1459 |