-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More work on the qjs plugin, despite its already in master
- Loading branch information
Showing
8 changed files
with
135 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
// import * as std from "std"; | ||
// r2.log("hello world"); | ||
// puts("Hello") | ||
// we have r2cmd and r2 as globals, but its better to use locals | ||
|
||
async function main() { | ||
const r2 = await import("r2"); | ||
r2.log(r2.cmd("?E Clippy")) | ||
} | ||
|
||
main() | ||
console.log("Hello"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,4 @@ | ||
|
||
|
||
// boilerplate to glue r2 and quickjs | ||
import('r2').then(entry).catch((e)=>{throw(e);}); | ||
|
||
function entry(r2) { | ||
try { | ||
require (['index'], function (foo) { foo.main(r2); }); | ||
} catch (e) { | ||
r2.log("Error: " + e.message); | ||
} | ||
} | ||
require (['hello'], function (foo) { | ||
// console.log("foo", foo.main); | ||
foo.main(r2); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters