Skip to content

Commit b41563b

Browse files
committed
Improved polyfill for IE9 Uint8Array (needed for unzip); readonly text view
1 parent 6e04a5b commit b41563b

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

Polyfills.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,11 @@ if (!window.requestAnimationFrame) { // IE9, SliTaz tazweb browser
613613

614614
if (!window.Uint8Array) { // IE9
615615
Utils.console.debug("Polyfill: Uint8Array (fallback only)");
616-
window.Uint8Array = function (oArrayBuffer) {
617-
return oArrayBuffer; // we just return the ArrayBuffer as fallback; enough for our needs
616+
window.Uint8Array = function (numberOrBuffer) {
617+
if (typeof numberOrBuffer === "number") {
618+
return new window.ArrayBuffer(numberOrBuffer);
619+
}
620+
return numberOrBuffer; // we just return the ArrayBuffer as fallback; enough for our needs
618621
};
619622
// A more complex solution would be: https://github.com/inexorabletash/polyfill/blob/master/typedarray.js
620623
}

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<link rel="stylesheet" href="cpcbasic.css" />
7-
<title id="title">CPC Basic v0.10.15</title>
7+
<title id="title">CPC Basic v0.10.16</title>
88
</head>
99

1010
<body id="pageBody">
@@ -52,7 +52,7 @@
5252
<button id="textButton" class="legendButton" title="Show/Hide Text View">Text View</button>
5353
</legend>
5454
<div id="textArea" class="area displayNone">
55-
<textarea id="textText" placeholder="" rows="26" cols="80" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off"></textarea>
55+
<textarea readonly id="textText" placeholder="" rows="26" cols="80" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off"></textarea>
5656
</div>
5757
</fieldset>
5858
<fieldset class="flexBox clearLeft" id="kbdAreaBox">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cpcbasic",
3-
"version": "0.10.15",
3+
"version": "0.10.16",
44
"description": "# CPCBasic - Run CPC BASIC in a Browser",
55
"main": "cpcbasic.js",
66
"directories": {

0 commit comments

Comments
 (0)