Skip to content

Commit

Permalink
#1657: Try to fix test regression by simplifying and organizing old L…
Browse files Browse the repository at this point in the history
…oader APIs
  • Loading branch information
davidpcaldwell committed Sep 12, 2024
1 parent fbd1eb3 commit 805f1a2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion loader/expression.fifty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ namespace slime {
/**
* Creates a *Loader*. A Loader loads resources from a specified source.
*/
Loader: loader.old.Constructor
Loader: loader.old.Constructor & slime.runtime.internal.old_loaders.Exports["api"]
}
}

Expand Down
3 changes: 1 addition & 2 deletions loader/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@
},
Resource: ResourceExport,
old: {
// TODO the static type definition for this lacks the properties added by `loaders` -- are they necessary?
Loader: Object.assign(loaders.constructor, loaders, { constructor: null }),
Loader: Object.assign(loaders.constructor, loaders.api, { constructor: null }),
loader: loaders.api
},
compiler: {
Expand Down
55 changes: 28 additions & 27 deletions loader/jrunscript/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,37 +899,38 @@
* @param { slime.runtime.Exports["old"]["Loader"] } was
* @returns
*/
function(was/*,api*/) {
function(was) {
/**
* @this { slime.old.Loader }
* @type { slime.runtime.exports.Old["Loader"] }
*/
var rv = function(p) {
if (!p) throw new TypeError("source argument required for Loader.");

// Satisfy TypeScript
this.source = void(0);
this.run = void(0);
this.value = void(0);
this.file = void(0);
this.module = void(0);
this.script = void(0);
this.factory = void(0);
this.Child = void(0);
this.get = void(0);
this.toSynchronous = void(0);

var source = adaptLoaderArgument(p);

was.call(this,source);
};
// // Satisfy TypeScript by adding properties that will be added by Object.assign below
// rv.source = void(0);
// rv.series = void(0);
// rv.tools = void(0);
// Object.assign(rv, api);
var rv = Object.assign(
/**
* @this { slime.old.Loader }
*/
function(p) {
if (!p) throw new TypeError("source argument required for Loader.");

// Satisfy TypeScript
this.source = void(0);
this.run = void(0);
this.value = void(0);
this.file = void(0);
this.module = void(0);
this.script = void(0);
this.factory = void(0);
this.Child = void(0);
this.get = void(0);
this.toSynchronous = void(0);

var source = adaptLoaderArgument(p);

was.call(this,source);
},
was
);
return rv;
}
)(slime.old.Loader/*, slime.old.Loader["api"]*/);
)(slime.old.Loader);

var $exports_classpath = (
/**
Expand Down

0 comments on commit 805f1a2

Please sign in to comment.