narwhal on WSH

13 views
Skip to first unread message

Ben Collver

unread,
Dec 19, 2010, 12:26:20 PM12/19/10
to Narwhal and Jack
Here is a first pass at running narwhal on the Windows Scripting
Host. I started with a clean copy of 280north-narwhal-v0.3.2-0-
g081a97a.zip from http://narwhaljs.org/. I modified a few core files
to work on WSH. The changes did not cause any additional failures
when running all tests in Rhino.

On WSH, JScript does not have getters and setters. I worked around
this in engines/default/lib/binary.js.

JScript adds a null array member if a trailing comma exists in the
construction. I removed one from packages/narwhal-lib/lib/narwhal/
term.js.

I changed packages/narwhal-lib/lib/narwhal/packages.js to ignore the
options object if it is undefined.

JScript regexp bugs break the module system, so I pull in xregexp
early in the bootstrap process.

Instructions:
- Fetch the following two files.
http://terrorpin.net/narwhal-wsh-diff.txt
http://terrorpin.net/wsh.zip
- Extract wsh.zip to the engines directory.
- Apply the changes shown in narwhal-wsh-diff.txt
- Open a command prompt in the narwhal directory.
- Run the following commands.
set NARWHAL_ENGINE=wsh
bin\narwhal.cmd examples\hello
Reply all
Reply to author
Forward
0 new messages