Skip to content

Commit

Permalink
Merge pull request #1663 from davidpcaldwell/davidpcaldwell/issue/#1657
Browse files Browse the repository at this point in the history
#1657: Move jrunscript embedding documentation JSAPI -> Fifty
  • Loading branch information
davidpcaldwell authored Sep 10, 2024
2 parents a3265e3 + 881bdcf commit 5b612bb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 53 deletions.
29 changes: 0 additions & 29 deletions loader/jrunscript/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,6 @@
</head>
<body>
<h1>Overview</h1>
<div>
<h2>Embedding</h2>
<!--
Move to internal documentation
<p>
Note that these are implemented by creating implementations of <code>$javahost</code> and <code>$bridge</code>
and invoking <code>expression.js</code>.
</p>
<li>
Then the generic container interface script <code>loader/jrunscript/expression.js</code> is evaluated,
using the <code>$javahost</code> and <code>$bridge</code> objects in scope.
<ul>
<li>
It first invokes <code>loader/expression.js</code>, providing appropriate implementations of
<code>$slime</code> and <code>$engine</code>,
to create the <a href="../../loader/api.html">SLIME runtime</a>.
</li>
<li>
It then post-processes the SLIME runtime to provide additional
<a href="../../loader/jrunscript/api.html">Java-specific</a> interfaces.
</li>
</ul>
</li>
<li>
The SLIME runtime is possibly post-processed by
the engine embedding script before being returned to the shell embedding script.
</li>
-->
</div>
<div>
<h1>Properties</h1>
<p>
Expand Down
15 changes: 15 additions & 0 deletions loader/jrunscript/expression.fifty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ namespace slime.jrunscript.runtime {
}

export namespace mime {
// TODO the customized types should probably be moved to the `jrunscript` property added to the `$api` object,
// and the implementation should simply match the type of the underlying `$api` implementation

/**
* Replaces `$api.mime.Type.fromName` in the SLIME Java environment.
*
Expand Down Expand Up @@ -264,6 +267,16 @@ namespace slime.jrunscript.runtime {
/**
* The `jrunscript` (Java) runtime is loaded by loading an engine-specific script: either the `loader/jrunscript/rhino.js`
* script (for Rhino) or the `loader/jrunscript/nashorn.js` script (for Nashorn or GraalJS).
*
* Note that these are implemented by creating implementations of `$javahost` and `$bridge` and invoking `expression.js`.
*
* Then the generic container interface script `loader/jrunscript/expression.js` is evaluated, using the `$javahost` and
* `$bridge` objects in scope.
*
* * It first invokes `loader/expression.js`, using `$javahost` to provide appropriate implementations of `$slime` and
* `$engine`, to create the {@link slime.runtime.Exports | SLIME runtime}.
* * It then post-processes the SLIME runtime to provide additional
* {@link slime.jrunscript.runtime.Exports | Java-specific properties}.
*/
export namespace internal {
}
Expand Down Expand Up @@ -328,6 +341,8 @@ namespace slime.jrunscript.runtime {
export type SrcClasspathEntry = { src: { loader: slime.old.Loader } }
export type ClasspathEntry = JavaFileClasspathEntry | SlimeClasspathEntry | JarFileClasspathEntry | JarResourceClasspathEntry | SrcClasspathEntry

// TODO probably all jrunscript-specific properties should be properties of the `jrunscript` property; all properties added
// for this environment could be consolidated under that property
/**
* The SLIME Java runtime supports a Java-based SLIME embedding, and extends the {@link slime.runtime.Exports | SLIME runtime}
* to support Java-specific capabilities: a `classpath`, the `jrunscript`, `java` and `io` interfaces,
Expand Down
24 changes: 0 additions & 24 deletions loader/jrunscript/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,30 +207,6 @@
}
)();

// var $exports_mime = (function(was) {
// was.Type.fromName = (
// /**
// *
// * @param { slime.$api.mime.Export["Type"]["fromName"] } was
// * @returns { slime.$api.mime.Export["Type"]["fromName"] }
// */
// function(was) {
// var rv = function(p) {
// var rv = was.apply(this,arguments);
// if (typeof(rv) != "undefined") return rv;
// rv = guess_URLConnection({ name: p });
// return rv;
// };
// rv.slime = was;
// rv.java = {};
// rv.java.URLConnection = guess_URLConnection;
// return rv;
// }
// )(was.Type.fromName);

// return was;
// })(slime.$api.mime);

var $exports_java = slime.file(
new slime.Resource({
name: "slime://loader/jrunscript/java.js",
Expand Down

0 comments on commit 5b612bb

Please sign in to comment.