Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for node.js, Firefox, Chromium #39

Merged
merged 1 commit into from
Apr 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ env:
- TARGET=arm OS=linux M32=-m32
- TARGET=m68k OS=linux M32=-m32
- TARGET=pdp11 OS=unix M32=-m32 CHECK=check-16-bit
- TARGET=asmjs M32=
- TARGET=asmjs M32=-m32
- TARGET=asmjs M32= JS=js24
- TARGET=asmjs M32=-m32 JS=js24
- TARGET=asmjs M32=-m32 JS=nodejs
matrix:
exclude:
- os: osx
Expand All @@ -26,9 +27,11 @@ matrix:
- os: osx
env: TARGET=pdp11 OS=unix M32=-m32 CHECK=check-16-bit
- os: osx
env: TARGET=asmjs M32=
env: TARGET=asmjs M32= JS=js24
- os: osx
env: TARGET=asmjs M32=-m32
env: TARGET=asmjs M32=-m32 JS=js24
- os: osx
env: TARGET=asmjs M32=-m32 JS=nodejs
install: sh -e install-deps.sh install_${TRAVIS_OS_NAME:-linux}
script: make ${CHECK:-check} M32=$M32 TARGET=$TARGET OS=$OS
notifications:
Expand Down
7 changes: 6 additions & 1 deletion install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ install_linux() {
m68k-tos) download_tosemu;;
pdp11-unix) download_apout;;
avr-*) sudo apt-get install simulavr;;
asmjs-*) sudo apt-get install libmozjs-24-bin;;
esac
case "$TARGET-$JS" in
asmjs-js24) sudo apt-get install libmozjs-24-bin;;
asmjs-nodejs)
wget -qO- https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install nodejs;;
esac
}

Expand Down
42 changes: 42 additions & 0 deletions targets/asmjs/forth.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>lbForth</title>
<script>
window.onload = function () {
var node = document.getElementById("input");
document.getElementsByTagName("form")[0].addEventListener("submit", function (e) {
forth_output(node.value + "\n");
forth_input(node.value + "\n");
node.value = "";
e.preventDefault();
});

forth_output("");
};

var output = "";

function forth_output(str)
{
output += str;

var n = document.getElementById("output");

if (n) n.innerHTML = output;
}
</script>
<script type="application/javascript"
src="forth.js">
</script>
</head>
<body>
<pre style="white-space: pre-wrap !important">
<div id="output"></div>
</pre>
<form>
<input id="input"/>
</form>
</body>
</html>
Loading