Similar to SpiderMonkey's jsshell, or V8's d8, this is needed to create an eshost agent.
./target/debug/bin is almost that, but needs:
Things needed in the shell runtime itself:
print() function in the global scope (or similar). SpiderMonkey's JavaScript shell defines this as:stdout, separated by spaces (" ") and terminated by a newline ("\n").globalThis or similar mechanismnewGlobal() or d8's Realm.global(realmId) (which requires some way of making a realmId, ie. Realm.create() or Realm.createAllowCrossRealmAccess())evaluate(code) or d8's Realm.eval(realmId, code)Thanks @rwaldron im sure we can get onto this.
@rwaldron what would happen if you pass an object to print(), would it call toString() on that object?
@jasonwilliams sorry I missed your question! It may be easier to point you to SpiderMonkey's print(): https://github.com/mozilla/gecko-dev/blob/master/js/src/shell/js.cpp#L2687-L2724
Some way to create a new realm and global object, eg. jsshell's newGlobal() or d8's Realm.global(realmId) (which requires some way of making a realmId, ie. Realm.create() or Realm.createAllowCrossRealmAccess())
@rwaldron do you have an example of Test262 using this somewhere so we can see for context?
Edit:
Found this https://github.com/patil215/v8/blob/bb941b58df9ee1e4048b69a555a2ce819fb819ed/test/mjsunit/cross-realm-filtering.js
I think that something that might be missing here is the ability to create multiline blocks in the shell, if we want to complete it further. But for the rest, this is mostly done, right?
I think that something that might be missing here is the ability to create multiline blocks in the shell, if we want to complete it further. But for the rest, this is mostly done, right?
We have pretty much implemented all of the feature shell request.
Maybe we should close this issue in favor of the new issue #341
I鈥檓 happy to close this also