Giter Club home page Giter Club logo

eshost-cli's Introduction

eshost-cli

Travis Build Status Appveyor Build Status

eshost-cli makes it easy to run and compare ECMAScript code uniformly across a number of runtimes. Support for runtimes is provided by the library eshost. Every host is initialized with the eshost runtime API available which provides a uniform way to print, create realms, and eval code.

See eshost's supported hosts for a list of hosts, download/build locations, and other information.

Usage

See --help output for the full details. Basic usage:

  • Add hosts using eshost --add <host name> <host type> <host path> --args <optional arguments>.
  • Automatically configure esvu-installed hosts using eshost --configure-esvu.
  • Automatically configure jsvu-installed hosts using eshost --configure-jsvu.
  • Evaluate a single expression using -e: eshost -e "[1,2,3].length".
  • Execute a multi-statement program using -x: eshost -x "foo = 42; print(foo);"
  • Execute a script using eshost path/to/script.js.
  • Execute an expression or multi-statement program as module code using -m:
    • eshost -me "foo = 42" (this example should result in errors!)
    • eshost -mx "foo = 42; print(foo);" (this example should result in errors!)
  • Execute a source file as module code by saving the file with an .mjs extension: eshost file.mjs; or by using the -m option: eshost -m file.js

Install and Configure Hosts

Linux and macOS

Manually, using esvu:

npm install esvu -g;
export PATH="${HOME}/.esvu/bin:${PATH}";

esvu --engines=all;

export ESHOST_PATH_CHAKRA=`which chakra`;
export ESHOST_PATH_ENGINE262=`which engine262`;
export ESHOST_PATH_HERMES=`which hermes`;
export ESHOST_PATH_JAVASCRIPTCORE=`which javascriptcore`;
export ESHOST_PATH_QUICKJS=`which qjs-for-eshost`;
export ESHOST_PATH_SPIDERMONKEY=`which spidermonkey`;
export ESHOST_PATH_V8=`which v8`;
export ESHOST_PATH_XS=`which xs`;

npm install -g eshost-cli;

eshost --add "chakra" ch $ESHOST_PATH_CHAKRA;
eshost --add "engine262" engine262 $ESHOST_PATH_ENGINE262;
eshost --add "hermes" hermes $ESHOST_PATH_HERMES;
eshost --add "javascriptcore" jsc $ESHOST_PATH_JAVASCRIPTCORE;
eshost --add "quickjs" qjs $ESHOST_PATH_QUICKJS;
eshost --add "spidermonkey" jsshell $ESHOST_PATH_SPIDERMONKEY;
eshost --add "v8" d8 $ESHOST_PATH_V8;
eshost --add "xs" xs $ESHOST_PATH_XS;

Manually, using jsvu:

# Engine262
git clone https://github.com/devsnek/engine262.git;
cd engine262 && npm install && npm run build && npm link;
cd ~/

# Everything else...
npm install -g jsvu;
export PATH="${HOME}/.jsvu:${PATH}";

jsvu --engines=chakra,hermes,javascriptcore,spidermonkey,v8,xs

export ESHOST_PATH_CHAKRA=`which chakra`;
export ESHOST_PATH_ENGINE262=`which engine262`;
export ESHOST_PATH_HERMES=`which hermes`;
export ESHOST_PATH_JAVASCRIPTCORE=`which javascriptcore`;
export ESHOST_PATH_QUICKJS=`which qjs-for-eshost`;
export ESHOST_PATH_SPIDERMONKEY=`which spidermonkey`;
export ESHOST_PATH_V8=`which v8`;
export ESHOST_PATH_XS=`which xs`;

npm install -g eshost-cli;

eshost --add "chakra" ch $ESHOST_PATH_CHAKRA;
eshost --add "engine262" engine262 $ESHOST_PATH_ENGINE262;
eshost --add "hermes" hermes $ESHOST_PATH_HERMES;
eshost --add "javascriptcore" jsc $ESHOST_PATH_JAVASCRIPTCORE;
eshost --add "quickjs" qjs $ESHOST_PATH_QUICKJS;
eshost --add "spidermonkey" jsshell $ESHOST_PATH_SPIDERMONKEY;
eshost --add "v8" d8 $ESHOST_PATH_V8;
eshost --add "xs" xs $ESHOST_PATH_XS;
This will install QuickJS on macOS
if [ "$(uname)" = Darwin ]; then wget https://bellard.org/quickjs/quickjs-2021-03-27.tar.xz; tar -xf quickjs-2021-03-27.tar.xz;
cd quickjs-2021-03-27 && make; if [ -f "$PWD/run-test262" ]; then ln -s $PWD/run-test262 /usr/local/bin/qjs-for-eshost; fi; fi;

Windows

Manually, using jsvu:

git clone https://github.com/devsnek/engine262.git
cd .\engine262
npm install
npm run build
npm link
set NPM_GLOBAL_MODULE_PATH=%APPDATA%\npm\
set PATH=%PATH;%NPM_GLOBAL_MODULE_PATH%
where engine262

npm install jsvu

jsvu --os=win64 --engines="chakra,spidermonkey,v8,xs"

set PATH=%PATH;%USERPROFILE%\.jsvu\
set ESHOST_CHAKRA=%USERPROFILE%\.jsvu\chakra.cmd
set ESHOST_ENGINE262=%NPM_GLOBAL_MODULE_PATH%\engine262.cmd
set ESHOST_SPIDERMONKEY=%USERPROFILE%\.jsvu\spidermonkey.cmd
set ESHOST_V8=%USERPROFILE%\.jsvu\v8.cmd
set ESHOST_XS=%USERPROFILE%\.jsvu\xs.cmd

npm install -g eshost-cli;

eshost --add "chakra" ch %ESHOST_CHAKRA%
eshost --add "engine262" engine262 %ESHOST_ENGINE262%
eshost --add "spidermonkey" jsshell %ESHOST_SPIDERMONKEY%
eshost --add "v8" d8 %ESHOST_V8%
eshost --add "xs" xs %ESHOST_XS%

Examples

$ npm install -g eshost-cli
$ eshost --help
$ eshost --add <name> <type> <path to host executable> --args <optional arguments>
$ eshost -e "Map.length"
#### chakra
0

#### engine262
0

#### javascriptcore
0

#### spidermonkey
0

#### v8
0

#### xs
0
$ eshost --configure-esvu --esvu-prefix esvu
$ eshost --tags esvu-web -itsx "let a = 40+2; print(a)"

## Source
let a = 40+2; print(a)

┌──────────┬────┐
│ esvu-ch  │ 42 │
│ esvu-jsc │    │
│ esvu-sm  │    │
│ esvu-v8  │    │
└──────────┴────┘
$ eshost --configure-jsvu --jsvu-prefix jsvu
$ eshost --tags jsvu-web -itsx "let a = 40+2; print(a)"

## Source
let a = 40+2; print(a)

┌──────────┬────┐
│ jsvu-ch  │ 42 │
│ jsvu-jsc │    │
│ jsvu-sm  │    │
│ jsvu-v8  │    │
└──────────┴────┘

Rules For Module Code

Files containing the imported modules must be located in the same directory that the "entry point" file is located. Please read and accept the following examples.

  1. Executing a program with module dependencies, where the entry point is a ".mjs" file:

    mkdir entry-point-mjs;
    cd entry-point-mjs;
    echo "export var a = 1;" >> export.mjs
    echo "import {a} from './export.mjs'; print(a);" >> import.mjs
    
    eshost --host="engine262,javascriptcore,spidermonkey,v8,xs" import.mjs
    #### engine262
    1
    
    #### javascriptcore
    1
    
    #### spidermonkey
    1
    
    #### v8
    1
    
    #### xs
    1
  2. Executing a program with module dependencies, where the entry point is a ".js" file (Notice the use of the -m flag, this is required for ".js" files):

    mkdir entry-point-js;
    cd entry-point-js;
    echo "export var a = 1;" >> export.mjs
    echo "import {a} from './export.mjs'; print(a);" >> import.js
    
    eshost --host="engine262,javascriptcore,spidermonkey,v8,xs" -m import.js
    #### engine262
    1
    
    #### javascriptcore
    1
    
    #### spidermonkey
    1
    
    #### v8
    1
    
    #### xs
    1

Executing a multi-line program with module dependencies is not yet supported. Support is in progress.

Managing Hosts

You can --list, --add, --edit, and --delete hosts. Adding a host requires a name, type, and path to the runtime executable. You can optionally pass arguments using --args. The same host can be added multiple times with different --args which makes it easy to compare the output of runtimes given different options (e.g. by turning language features on and off).

Console hosts are either provided by the browser vendors or, more likely, built from source. The jsvu CLI makes it easy to install and update the most common JavaScript engine binaries.

Host types are those provided by eshost, namely:

Shells

Host Type All Acceptable type Values
ChakraCore chakra, ch
Engine262 engine262
JavaScriptCore javascriptcore, jsc
Nashorn nashorn
Node node
QuickJS qjs 1
SpiderMonkey jsshell, spidermonkey, sm
V8 d8, v8
XS xs

Browsers

Host Type All Acceptable type Values
chrome chrome
edge edge
firefox firefox
safari safari

eshost-cli's People

Contributors

alhadis avatar bakkot avatar bnjmnt4n avatar bterlson avatar chicoxyzzy avatar devsnek avatar dilijev avatar mathiasbynens avatar michaelficarra avatar rwaldron avatar stefanpenner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eshost-cli's Issues

Preparing 3.5.0

Since we've merged a number of features and created tests and increased test coverage, I'd like to update eshost-cli. Here's a draft of the release message:

v3.5.0

  • Add tests and enable Travis (@rwaldron #32)
  • --list learned to sort by name (@dilijev #34)
  • Learned --edit: allows modifying --args or --tags of a host (@dilijev #36)
  • Learned --unanimous, -u: exit(0) and print nothing if all hosts agree, otherwise exit(1). (@dilijev #35, @rwaldron #37)

Did I miss anything we should call out? Anything blocking?

/cc @bterlson @rwaldron

Consistent order for host results

It's a little weird to run the same command twice and get output in a different order.

This means delaying results from fast engines to wait for slower ones, but does not increase total runtime.

`--showSource --table` prints source input twice

Since this commit:

[ 5632a72 ] 2017-08-23 10:52 waldron... Restore default behavior; ensure correct conditions for --unanimous

Output e.g.:

>es --tags council -its -e "42"
## Source
print(42)

## Source
print(42)

┌──────────┬────┐
│ ch-1.7.1 │ 42 │
│ d8       │    │
│ node     │    │
│ node-ch  │    │
│ sm       │    │
└──────────┴────┘

Using default formatter, source is only shown once:

>es --tags council -is -e "42"
## Source
print(42)

#### ch-1.7.1, d8, node, node-ch, sm
42

Looks like part of the change was to restore the old behavior whereby start() prints the source and end() does not, but the change did not remove that block from end() in table.js, resulting in the double print.

Before resolving this I want to visit the design here.

As I envisioned, the design of --unanimous would be to print absolutely nothing (including source) and exit(0) if all engines agree on the input. Useful for scripting over a large number of test cases while easily being able to see the cases that disagreed and without having to route any output to /dev/null.

If --unanimous is specified, we should display source from end() and do so IFF there is NOT unanimous agreement (i.e. there is any output at all).

To preserve original behavior otherwise, print from start() IFF --unanimous is not specified.

/cc @rwaldron @bterlson

Handling negative zero in `print`

➜  eshost -itsx 'function identity(x) {return x}; print(identity(-0))'
## Source
function identity(x) {return x}; print(identity(-0))

## Source
function identity(x) {return x}; print(identity(-0))

┌─────┬───┐
│ ch  │ 0 │
│ jsc │   │
│ sm  │   │
│ v8  │   │
│ xs  │   │
└─────┴───┘

In fact result should be -0 for all engines

> function ident(n) {return n}
< undefined
> ident(-0)
< -0

It seems that -0 coerces to String

Unable to install GraalJS

(I'm not sure if this is an issue with eshost-cli or with GraalJS. If this is a Graal issue, I'm happy to move the discussion over there.)

I just tried to install GraalJS using eshost on a fresh Ubuntu 22.04 LTS box. I was able to install a few engines, but not GraalJS 21.3.3.1, the version available at the time. Here are the results:

$ npm install esvu -g
# snip successful install output
$ which esvu
/usr/local/bin/esvu
$ esvu --engines=all
esvu ❯ version 1.2.9
# snip
GraalJS ❯ Checking version...
GraalJS ❯ Installing version 21.3.3.1
GraalJS ❯ Downloading https://github.com/oracle/graaljs/releases/download/vm-21.3.3.1/graaljs-21.3.3.1-linux-amd64.tar.gz
GraalJS ❯ Extracting /tmp/esvu-ddf2ac3d55c5d5465e2a64c5ee2ee159
GraalJS ❯ Installing /tmp/esvu-ddf2ac3d55c5d5465e2a64c5ee2ee159-extracted
esvu ✖ Fatal error installing GraalJS [Error: ENOENT: no such file or directory, copyfile '/tmp/esvu-ddf2ac3d55c5d5465e2a64c5ee2ee159-extracted/graaljs-21.3.3.1-linux-amd64/lib/libjsvm.so' -> '/root/.esvu/engines/graaljs/graaljs-21.3.3.1-linux-amd64/lib/libjsvm.so'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'copyfile',
  path: '/tmp/esvu-ddf2ac3d55c5d5465e2a64c5ee2ee159-extracted/graaljs-21.3.3.1-linux-amd64/lib/libjsvm.so',
  dest: '/root/.esvu/engines/graaljs/graaljs-21.3.3.1-linux-amd64/lib/libjsvm.so'
}

Somehow we're trying to install a shared library that doesn't exist. I can confirm, though, that Graal's js binary is available, sitting uninstalled in that temprary directory:

$ ls /tmp/esvu-ddf2ac3d55c5d5465e2a64c5ee2ee159-extracted/graaljs-21.3.3.1-linux-amd64/
bin  LICENSE.txt  native-image.properties  README.md  release  THIRD_PARTY_LICENSE.txt
$ /tmp/esvu-ddf2ac3d55c5d5465e2a64c5ee2ee159-extracted/graaljs-21.3.3.1-linux-amd64/bin/js
> "2" + "2" - "2"
20

Any idea what might be going on?

With -s, default formatter groups node host output separately from other host types, even if output is the same

Default:

>eshost --tags council -is -x "print('a'); print(123);"
## Source
print('a'); print(123);

#### ch-1.7.1, d8, sm
a
123

#### node, node-ch
a
123

Table:

>eshost --tags council -its -x "print('a'); print(123);"
## Source
print('a'); print(123);

┌──────────┬─────┐
│ ch-1.7.1 │ a   │
│ d8       │ 123 │
│ node     │     │
│ node-ch  │     │
│ sm       │     │
└──────────┴─────┘

Non-table output displays stdout and stderr on same line

>eshost -is -h d8,sm,ch-dev E:\work\_curiosity_misc\out-err.js
## Source
print(42);
throw TypeError("blah");

#### d8, sm, ch-dev
42TypeError: blah

(Colors are correct, though.)

Note that table output shows them on separate lines:

eshost -its -h d8,sm,ch-dev E:\work\_curiosity_misc\out-err.js
## Source
print(42);
throw TypeError("blah");

┌────────┬─────────────────┐
│ d8     │ 42              │
│ sm     │ TypeError: blah │
│ ch-dev │                 │
└────────┴─────────────────┘

GraalJS and QuickJS will not install

Should these engines be included when running esvu --engines=all? Presently they do not install:

$ cat status.json
{
  "selectedEngines": [
    "ch",
    "engine262",
    "jsc",
    "jsshell",
    "v8",
    "xs"
  ],
  "installed": {
    "ch": {
      "version": "1_11_16",
      "binEntries": [
        "chakra"
      ]
    },
    "engine262": {
      "version": "0.0.1-587a1fa64b42201eccc48280a07b36bbb4f40b7e",
      "binEntries": [
        "engine262"
      ]
    },
    "jsc": {
      "version": "257719",
      "binEntries": [
        "javascriptcore",
        "jsc"
      ]
    },
    "jsshell": {
      "version": "74.0b9",
      "binEntries": [
        "sm",
        "spidermonkey"
      ]
    },
    "v8": {
      "version": "8.2.230",
      "binEntries": [
        "v8"
      ]
    },
    "xs": {
      "version": "10.0.0",
      "binEntries": [
        "xs"
      ]
    }
  }
}
rwaldron in ~/.esvu/engines
$ ls
.
├── [drwxr-xr-x rwaldron staff      96 Mar  2 14:25]  ch/
├── [drwxr-xr-x rwaldron staff      96 Mar  2 14:25]  engine262/
├── [drwxr-xr-x rwaldron staff      96 Mar  2 14:25]  jsc/
├── [drwxr-xr-x rwaldron staff     160 Mar  2 14:26]  jsshell/
├── [drwxr-xr-x rwaldron staff     160 Mar  2 14:26]  v8/
└── [drwxr-xr-x rwaldron staff      96 Mar  2 14:26]  xs/

Cannot installed via pnpm

pnpm i -g eshost-cli
Packages: +414
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 509, reused 509, downloaded 0, added 0, done
node_modules/.pnpm/[email protected]/node_modules/publish-please: Running preinstall script, failed in 80ms
.../node_modules/publish-please preinstall$ node lib/pre-install.js
│ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
│ !! Starting from v2.0.0 publish-please can't be installed globally.          !!
│ !! Use local installation instead : 'npm install --save-dev publish-please', !!
│ !! Or use npx if you do not want to install publish-please as a dependency.  !!
│ !! (learn more: https://github.com/inikulin/publish-please#readme).          !!
│ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
└─ Failed in 80ms
 ERROR  Command failed with exit code 1.

Add -u|--unanimous flag: easily identify whether all engines agree on output

To help with automatic comparative testing between engines, add a -q|--quorum flag. Behavior will be as follows:

  • If all engines under test produce identical output (logic already exists to test this in the collate option), print no output and set exit code to 0.
  • If any engine disagrees, show output, and set exit code to 1
    • Alternatively: set the exit code to (1 + the index of the engine in the config file) to more easily identify which engine disagreed. Perhaps -1 if more than one engine disagrees or there is a greater than 2-way split on the outputs.

/cc @bterlson

jsvu-d8 reporting "Unexpected end of input" for basic test scripts

Verified that the latest eshost is installed (3.8.0 at time of writing) and the jsvu binary is up-to-date (latest):

> eshost -ie "42"
## Source
print(42)

#### jsvu-d8
SyntaxError: Unexpected end of input

The same script runs just fine directly under the jsvu d8 binary.

>where d8
C:\Users\doilij\.jsvu\d8.cmd
>d8 -e "print(42)"
42

Is there some d8 support change that is needed in eshost-cli or eshost or both?

Test hooks for setting config file

Sitting here with an empty eshost config, I feel like modifying the users config file is prone to failure. Can we add the appropriate test hooks to set the config path in Config.js instead?

Show the complete error output

Hi everyone,
any chance to add a feature that shows the complete stack output?
In some cases, I must to check if an issue violate an internal function or a test condition.

Example with eshost: $> eshost test.js

#### V8
RangeError: Offset is outside the bounds of the DataView

Example with V8 binary: $> ./v8 test.js

RangeError: Offset is outside the bounds of the DataView
    at DataView.getInt8 (<anonymous>)
    at test (.../test.js:6:13)
    at test.js:10:6

In second example we know that it was violated a pre-condition of DataView.getInt8 .
Maybe the arg "--stack" can show to the user the stack output of each engine.

auto-detect implementations on missing config file

We should be able to detect the locations of implementations through something similar to which js, which d8, etc. We should also probably run the --version to make sure it is compatible before adding it. This is slightly dangerous because we could be running things that are not ECMAScript implementations.

unable to delete host using `eshost host --delete`

$ eshost host --list
┌──────────────┬─────────┬───────────────────────────────────────────────┬──────┐
│ name         │ type    │ path                                          │ args │
├──────────────┼─────────┼───────────────────────────────────────────────┼──────┤
│ nashorn      │ nashorn │ /usr/java/jdk1.8.0_66/bin/jjs                 │      │
├──────────────┼─────────┼───────────────────────────────────────────────┼──────┤
│ jsc          │ jsc     │ /usr/bin/jsc                                  │      │
├──────────────┼─────────┼───────────────────────────────────────────────┼──────┤
│ node         │ node    │ /home/----/.nvm/versions/node/v5.4.1/bin/node │      │
├──────────────┼─────────┼───────────────────────────────────────────────┼──────┤
│ SpiderMonkey │ jsshell │ /usr/bin/js                                   │      │
└──────────────┴─────────┴───────────────────────────────────────────────┴──────┘
$ eshost host --delete SpiderMonkey
$ eshost host --list
┌──────────────┬─────────┬───────────────────────────────────────────────┬──────┐
│ name         │ type    │ path                                          │ args │
├──────────────┼─────────┼───────────────────────────────────────────────┼──────┤
│ nashorn      │ nashorn │ /usr/java/jdk1.8.0_66/bin/jjs                 │      │
├──────────────┼─────────┼───────────────────────────────────────────────┼──────┤
│ jsc          │ jsc     │ /usr/bin/jsc                                  │      │
├──────────────┼─────────┼───────────────────────────────────────────────┼──────┤
│ node         │ node    │ /home/----/.nvm/versions/node/v5.4.1/bin/node │      │
├──────────────┼─────────┼───────────────────────────────────────────────┼──────┤
│ SpiderMonkey │ jsshell │ /usr/bin/js                                   │      │
└──────────────┴─────────┴───────────────────────────────────────────────┴──────┘
$ 

Unmatched hosts should generate human-readable error messages

The current behavior is a bit opaque.

$ eshost -h fake -se true
(node:9811) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'name' of undefined
    at /usr/lib/node_modules/eshost-cli/bin/eshost.js:385:17
    at Array.map (<anonymous>)
    at runInEachHost (/usr/lib/node_modules/eshost-cli/bin/eshost.js:383:11)
    at Object.<anonymous> (/usr/lib/node_modules/eshost-cli/bin/eshost.js:318:5)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
(node:9811) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9811) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Errors on Mac due to carriage returns

When I npm install -g eshost and then eshost host I get env: node\r: No such file or directory - it seems the file is full of Windows newline characters.

My guess is that this is breaking it on non-Windows systems - when I remove the ^M chars, it seems to execute fine.

cli-table: cell content truncation

Take a look:

Of course the data is intact:

...But I think this is not intuitive for eshost-cli's needs.

I'm going to investigate alternatives.

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

eshost --configure-jsvu

Using config "C:\Users\Jack\.eshost-config.json"
Configuring jsvu host with name "ChakraCore" (type "ch") at "C:\Users\Jack\.jsvu\chakra.cmd"
Host "ChakraCore" already exists
C:\Users\Jack\AppData\Roaming\npm\node_modules\eshost-cli\lib\host-manager.js:172
    ] = VU_HOST_DETAILS[vu][engine];
        ^

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at Object.exports.configureFromVersionUpdater (C:\Users\Jack\AppData\Roaming\npm\node_modules\eshost-cli\lib\host-manager.js:172:9)
    at Object.<anonymous> (C:\Users\Jack\AppData\Roaming\npm\node_modules\eshost-cli\bin\eshost.js:294:15)

Hosts should be ordered consistently (alpha- or config-order)

It appears they are ordered in the order the results come back which makes the order inconsistent between runs, but it would be easier to compare between runs at a glance if the order was consistent.

Config-order is a nice, easy way to order the hosts. Perhaps easier is alphabetical order. Obviously respect output grouping first (--coalesce).

Table formatting incorrect when display length of chars is different from byte length.

For chars with more than one byte, it looks like the table formatting is based on number of bytes rather than number of visible characters.

>eshost -its toLocaleDateString.js
## Source
let culture = ['zh-CN'];
print(Intl.DateTimeFormat.supportedLocalesOf(culture));
let str = new Date().toLocaleDateString(culture, { year: "numeric", month: "short", day: "numeric" });
print(str);
print(str.length);

┌──────────────┬──────────────────┐
│ d8           │ zh-CN            │
│ sm           │ 2017年5月17日       │
│              │ 10               │
├──────────────┼──────────────────┤
│ ch-1.4.3     │ zh-Hans-CN       │
│ ch-1.3.2     │ ?2017???5??17??  │
│ ch-1.2.3     │ 15               │
│ ch-master    │                  │
│ ch-2.0-pre   │                  │
│ ch-intl-gcl  │                  │
│ ch-dev       │                  │
├──────────────┼──────────────────┤
│ node         │ []               │
│ node-nightly │ May 17, 2017     │
│              │ 12               │
├──────────────┼──────────────────┤
│ node-ch      │ [ 'zh-Hans-CN' ] │
│              │ ‎2017‎年‎5月‎17‎日  │
│              │ 15               │
└──────────────┴──────────────────┘

For d8 and sm the line is too short because the Chinese characters have 2 bytes each.

For node-ch the line is too short because it displays bidi markers as 0-width (you can see from the question marks under ch).

Other test cases:

eshost -its -e "'2017\u{10401}'" # surrogate pair
eshost -its -e "'2017\u{5e74}'" # 年 CJK glyph for "year"
> eshost -its -e "'2017\u{10401}'"           
## Source                                
print('2017\u{10401}')                   
                                         
┌──────────────┬────────┐                
│ sm           │ 2017𐐁 │                
│ d8           │        │                
│ node-ch      │        │                
│ node         │        │                
│ node-nightly │        │                
├──────────────┼────────┤                
│ ch-1.4.3     │ 2017?? │                
│ ch-1.3.2     │        │                
│ ch-1.2.3     │        │                
│ ch-2.0-pre   │        │                
│ ch-intl-gcl  │        │                
│ ch-dev       │        │                
│ ch-master    │        │                
└──────────────┴────────┘                

> eshost -its -e "'2017\u{5e74}'"
## Source
print('2017\u{5e74}')

┌──────────────┬───────┐
│ d8           │ 2017年 │
│ sm           │       │
│ node-ch      │       │
│ node         │       │
│ node-nightly │       │
├──────────────┼───────┤
│ ch-1.4.3     │ 2017? │
│ ch-1.2.3     │       │
│ ch-1.3.2     │       │
│ ch-2.0-pre   │       │
│ ch-intl-gcl  │       │
│ ch-master    │       │
│ ch-dev       │       │
└──────────────┴───────┘

Fatal error and core dumps is not displayed on output

Hi everyone,

A few days ago, I discovered this tool to help us on differential testing across engines.
I executed eshost with a code that throws a Fatal error and the output is nothing.
To explain I removed the icudtl.dat from V8 directory and use a test that call Date methods.

  • eshost -s date.js
#### Chakra, SpiderMonkey, V8

  • ~/.jsvu/v8 date.js
#
# Fatal error in , line 0
# Failed to create ICU date format, are ICU data files missing?
#
#
#
#FailureMessage Object: 0x7ffd9ff07310
==== C stack trace ===============================

    /home/.jsvu/engines/v8/v8(+0x2f5383) [0x56124b1dc383]
    /home/.jsvu/engines/v8/v8(+0x2f47fb) [0x56124b1db7fb]
    /home/.jsvu/engines/v8/v8(+0x2f0928) [0x56124b1d7928]
    /home/.jsvu/engines/v8/v8(+0x74b4df) [0x56124b6324df]
    /home/.jsvu/engines/v8/v8(+0x88c045) [0x56124b773045]
    /home/.jsvu/engines/v8/v8(+0xbb9049) [0x56124baa0049]
Received signal 4 ILL_ILLOPN 56124b1d86f2
/home/.jsvu/v8: linha 2: 12233 Instrução ilegal      (imagem do núcleo gravada) "/home/.jsvu/engines/v8/v8" --natives_blob="/home/.jsvu/engines/v8/natives_blob.bin" --snapshot_blob="/home/.jsvu/engines/v8/snapshot_blob.bin" "$@"

The same occurs with core dumps examples.

A question in the README document.

In the Install and Configure Hosts section of the README document. The "eshost --add" command cannot be used When installing eshost instead of eshost-cli with npm. So the correct installation command is "npm install -g eshost-cli"?

Appveyor CI

My rough plan:

  • reproduce (from travis) necessary build out
    • ... (add work steps here)
  • test on a "staging" (Bocoup) appveyor account
  • get it green

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.