From a8f92fad0a3e6334822ed4bc8285db7a6d30206a Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Tue, 8 Mar 2016 20:31:24 -0800 Subject: [PATCH] Remove command line support. Depend on CDN for polyfills --- .gitmodules | 3 -- README.md | 7 --- basic.js | 3 -- cbasic.js | 143 ------------------------------------------------- index.html | 4 +- polyfill | 1 - reference.html | 2 +- script.js | 4 +- 8 files changed, 5 insertions(+), 162 deletions(-) delete mode 100644 .gitmodules delete mode 100644 cbasic.js delete mode 160000 polyfill diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 9254b6b..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "polyfill"] - path = polyfill - url = https://github.com/inexorabletash/polyfill.git diff --git a/README.md b/README.md index 65e9032..4656c5f 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ jsbasic - Applesoft BASIC in JavaScript This is hosted for playing with at http://inexorabletash.github.io/jsbasic/ -Use `git clone --recursive` to get [polyfill](http://github.com/inexorabletash/polyfill) for older browsers. - Notes & Known Issues -------------------- * The BASIC program is compiled to JavaScript before execution. Syntax errors are therefore detected at compile-time rather than at run-time as on a traditional interpreter. For example, the following program would run without errors on an Apple since the erroneous second statement is never reached. `10 END : CHR$(PRINT)` @@ -23,8 +21,3 @@ Notes & Known Issues * `CHR$()` values > 255 do interesting things * `HSCRN(x, y)` allows probing the hi-res screen * hexadecimal literals e.g. `$C010` can be used as numbers - -You can run your basic programs from the command line (with only basic text input and output, and no graphics or DOS commands): -* Clone the repository locally -* On Windows, run from a command prompt via: `cscript.exe cbasic.js your_program.txt` -* On Mac/Linux, install Mozilla Rhino, run from the command prompt via: `java -jar PATH_TO/js.jar cbasic.js your_program.txt` diff --git a/basic.js b/basic.js index 7c6719f..0caf0c3 100644 --- a/basic.js +++ b/basic.js @@ -28,9 +28,6 @@ // // driver will also be called after input is unblocked // // driver may want to yield via setTimeout() after N steps -// ES6 polyfill: -if (!String.prototype.repeat) { String.prototype.repeat = function(n){return Array(n+1).join(this); }; } - this.basic = (function() { var basic = { diff --git a/cbasic.js b/cbasic.js deleted file mode 100644 index c8fd462..0000000 --- a/cbasic.js +++ /dev/null @@ -1,143 +0,0 @@ -// Console: -// For Mozilla Rhino: rhino cbasic.js your_basic_program.txt -// For Windows CScript: cscript.exe cbasic.js your_basic_program.txt - -if(!Object.keys){Object.keys=function(o){if(o!==Object(o))throw new TypeError();var ret=[],p;for(p in o)if(Object.prototype.hasOwnProperty.call(o,p))ret.push(p);return ret;};} -if(!Array.prototype.forEach){Array.prototype.forEach=function(fun){if(this===void 0||this===null){throw new TypeError();}var t=Object(this);var len=t.length>>>0;if(typeof fun!=="function"){throw new TypeError();}var thisp=arguments[1],i;for(i=0;i>>0;if(typeof fun!=="function"){throw new TypeError();}var res=[];res.length=len;var thisp=arguments[1],i;for(i=0;i>>0;if(typeof fun!=="function"){throw new TypeError();}if(len===0&&arguments.length===1){throw new TypeError();}var k=0;var accumulator;if(arguments.length>=2){accumulator=arguments[1];}else{do{if(k in t){accumulator=t[k++];break;}if(++k>=len){throw new TypeError();}}while(true);}while(k - - + + diff --git a/polyfill b/polyfill deleted file mode 160000 index 51e0b23..0000000 --- a/polyfill +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 51e0b2372803abd1c72f740d9fa15ee398b9a5a2 diff --git a/reference.html b/reference.html index dd9633d..4b9a66a 100644 --- a/reference.html +++ b/reference.html @@ -603,7 +603,7 @@ function which implements the logic for walking over the array.

- + '); } - load('polyfill/polyfill.js'); - load('polyfill/keyboard.js'); + load('https://cdn.rawgit.com/inexorabletash/polyfill/v0.1.16/polyfill.min.js'); + load('https://cdn.rawgit.com/inexorabletash/polyfill/v0.1.16/keyboard.js'); load('tty.js'); load('lores.js'); load('hires.js');