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

Resolve #1657: Migrate loader/jrunscript JSAPI -> Fifty #1669

Merged
merged 2 commits into from
Sep 12, 2024
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
1 change: 1 addition & 0 deletions contributor/jrunscript.fifty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
fifty.load("../loader/jrunscript/expression.fifty.ts");
fifty.load("../loader/api/old/unit.fifty.ts");
fifty.load("../rhino/system/test/Packages.inonit.system.fifty.ts");
fifty.load("../rhino/system/java/inonit/script/runtime/io/Streams.fifty.ts");
fifty.load("../rhino/jrunscript/api.fifty.ts");
if (hasJsoup) fifty.load("../loader/document/module.fifty.ts");
fifty.load("../js/web/module.fifty.ts");
Expand Down
7 changes: 0 additions & 7 deletions contributor/jrunscript.jsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,9 @@
pathname: SRC.getRelativePath("loader/api.html")
}));

suite.add("internal/jrunscript/main", new jsh.unit.html.Part({
// Test cases of loader implementation
// TODO redundant; now tested per-engine in contributor/suite.jsh.js
pathname: SRC.getRelativePath("loader/jrunscript/api.html")
}));

suite.add("internal/other", new jsh.unit.html.Part({
// Test cases involving the HTML test runner itself
pathname: SRC.getRelativePath("loader/api/test/data/1/api.html")
// TODO loader/jrunscript/java has some tests
// TODO loader/jrunscript/test/data/2/ has some tests but they require some classes in classpath
}));

Expand Down
2 changes: 1 addition & 1 deletion jrunscript/io/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h1>Context</h1>
<div>
<h1>Exports</h1>
<ul>
<li class="constructor" jsapi:reference="getApi('../../loader/jrunscript/api.html').getElement('Loader')">
<li class="constructor">
</li>
<li class="object">
<div class="name">java</div>
Expand Down
1 change: 0 additions & 1 deletion jrunscript/jsh/etc/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
components.add("js/debug/", { jsh: { module: true }});

components.add("loader/jrunscript/", { jsh: { api: true }});
// TODO loader/jrunscript/java has some tests
// TODO loader/jrunscript/test/data/2/ has some tests but they require some classes in classpath
// TODO jrunscript/io/mime.api.html has some tests

Expand Down
163 changes: 0 additions & 163 deletions loader/jrunscript/api.html

This file was deleted.

25 changes: 20 additions & 5 deletions loader/jrunscript/expression.fifty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,29 @@ namespace slime.jrunscript.runtime {
}

export interface JavaCodeLoaderSource {
/**
* An object representing resources that can be loaded by this Loader.
*/
_source: slime.jrunscript.native.inonit.script.engine.Code.Loader
}

/** @deprecated */
/**
* @deprecated
*
* An object that can return resources given paths.
*/
export interface DeprecatedResourcesSource {
child?: any
resources: any
Loader?: any

resources: {
/**
* Returns an implementation for a resource at the given path.
* @param path A path.
* @returns An argument for the `Resource` constructor that implements the resource at the given path, or `null` if
* no resource is located at the given path.
*/
get: (path: string) => slime.jrunscript.runtime.old.resource.Descriptor & { string?: string }
}
}

export type CustomSource = ZipFileSource | ZipResourceSource | JavaFileSource | JavaCodeLoaderSource | DeprecatedResourcesSource
Expand Down Expand Up @@ -559,8 +574,8 @@ namespace slime.jrunscript.runtime {
}
});

var api = loader.get("api.html");
test(api.type.toString() == "text/html");
var script = loader.get("expression.js");
verify(script).type.evaluate(String).is("application/javascript");

jsh.shell.console("Loading module ...");
var loaderModule = loader.module("../../jrunscript/io/test/Loader.js");
Expand Down
68 changes: 0 additions & 68 deletions loader/jrunscript/java/api.html

This file was deleted.

3 changes: 0 additions & 3 deletions loader/jrunscript/test/suite.jsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
suite.add("slime", new jsh.unit.html.Part({
pathname: SRC.getRelativePath("loader/api.html")
}));
suite.add("jrunscript/main", new jsh.unit.html.Part({
pathname: SRC.getRelativePath("loader/jrunscript/api.html")
}));

/**
*
Expand Down
Loading
Loading