@suchipi/quickjs 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -43
- package/build/aarch64-apple-darwin/bin/file-to-bytecode.js +7 -2
- package/build/aarch64-apple-darwin/bin/qjs +0 -0
- package/build/aarch64-apple-darwin/bin/qjsbootstrap +0 -0
- package/build/aarch64-apple-darwin/bin/qjsbootstrap-bytecode +0 -0
- package/build/aarch64-apple-darwin/bin/qjsc +0 -0
- package/build/aarch64-apple-darwin/bin/quickjs-run +0 -0
- package/build/aarch64-apple-darwin/extras/fib.so +0 -0
- package/build/aarch64-apple-darwin/extras/is-stdin-a-tty +0 -0
- package/build/aarch64-apple-darwin/extras/log-argv +0 -0
- package/build/aarch64-apple-darwin/extras/point.so +0 -0
- package/build/aarch64-apple-darwin/extras/run-test262 +0 -0
- package/build/aarch64-apple-darwin/extras/sample-program/sum +0 -0
- package/build/aarch64-apple-darwin/extras/stack-limit-test +0 -0
- package/build/aarch64-apple-darwin/lib/quickjs-core.a +0 -0
- package/build/aarch64-apple-darwin/lib/quickjs-full.a +0 -0
- package/build/aarch64-unknown-linux-gnu/bin/file-to-bytecode.js +7 -2
- package/build/aarch64-unknown-linux-gnu/bin/qjs +0 -0
- package/build/aarch64-unknown-linux-gnu/bin/qjsbootstrap +0 -0
- package/build/aarch64-unknown-linux-gnu/bin/qjsbootstrap-bytecode +0 -0
- package/build/aarch64-unknown-linux-gnu/bin/qjsc +0 -0
- package/build/aarch64-unknown-linux-gnu/bin/quickjs-run +0 -0
- package/build/aarch64-unknown-linux-gnu/extras/fib.so +0 -0
- package/build/aarch64-unknown-linux-gnu/extras/is-stdin-a-tty +0 -0
- package/build/aarch64-unknown-linux-gnu/extras/log-argv +0 -0
- package/build/aarch64-unknown-linux-gnu/extras/point.so +0 -0
- package/build/aarch64-unknown-linux-gnu/extras/run-test262 +0 -0
- package/build/aarch64-unknown-linux-gnu/extras/sample-program/sum +0 -0
- package/build/aarch64-unknown-linux-gnu/extras/stack-limit-test +0 -0
- package/build/aarch64-unknown-linux-gnu/lib/quickjs-core.a +0 -0
- package/build/aarch64-unknown-linux-gnu/lib/quickjs-full.a +0 -0
- package/build/aarch64-unknown-linux-musl/bin/file-to-bytecode.js +7 -2
- package/build/aarch64-unknown-linux-musl/bin/qjs +0 -0
- package/build/aarch64-unknown-linux-musl/bin/qjsbootstrap +0 -0
- package/build/aarch64-unknown-linux-musl/bin/qjsbootstrap-bytecode +0 -0
- package/build/aarch64-unknown-linux-musl/bin/qjsc +0 -0
- package/build/aarch64-unknown-linux-musl/bin/quickjs-run +0 -0
- package/build/aarch64-unknown-linux-musl/extras/fib.so +0 -0
- package/build/aarch64-unknown-linux-musl/extras/is-stdin-a-tty +0 -0
- package/build/aarch64-unknown-linux-musl/extras/point.so +0 -0
- package/build/aarch64-unknown-linux-musl/extras/run-test262 +0 -0
- package/build/aarch64-unknown-linux-musl/extras/sample-program/sum +0 -0
- package/build/aarch64-unknown-linux-musl/extras/stack-limit-test +0 -0
- package/build/aarch64-unknown-linux-musl/lib/quickjs-core.a +0 -0
- package/build/aarch64-unknown-linux-musl/lib/quickjs-full.a +0 -0
- package/build/aarch64-unknown-linux-static/bin/file-to-bytecode.js +7 -2
- package/build/aarch64-unknown-linux-static/bin/qjs +0 -0
- package/build/aarch64-unknown-linux-static/bin/qjsbootstrap +0 -0
- package/build/aarch64-unknown-linux-static/bin/qjsbootstrap-bytecode +0 -0
- package/build/aarch64-unknown-linux-static/bin/qjsc +0 -0
- package/build/aarch64-unknown-linux-static/bin/quickjs-run +0 -0
- package/build/aarch64-unknown-linux-static/extras/fib.so +0 -0
- package/build/aarch64-unknown-linux-static/extras/is-stdin-a-tty +0 -0
- package/build/aarch64-unknown-linux-static/extras/point.so +0 -0
- package/build/aarch64-unknown-linux-static/extras/run-test262 +0 -0
- package/build/aarch64-unknown-linux-static/extras/sample-program/sum +0 -0
- package/build/aarch64-unknown-linux-static/extras/stack-limit-test +0 -0
- package/build/aarch64-unknown-linux-static/lib/quickjs-core.a +0 -0
- package/build/aarch64-unknown-linux-static/lib/quickjs-full.a +0 -0
- package/build/dts/quickjs-libbytecode.d.ts +5 -1
- package/build/dts/quickjs-libc.d.ts +15 -4
- package/build/dts/quickjs-libcontext.d.ts +3 -3
- package/build/dts/{quickjs-libmodule.d.ts → quickjs-libengine.d.ts} +29 -1
- package/build/dts/quickjs-modulesys.d.ts +27 -43
- package/build/x86_64-apple-darwin/bin/file-to-bytecode.js +7 -2
- package/build/x86_64-apple-darwin/bin/qjs +0 -0
- package/build/x86_64-apple-darwin/bin/qjsbootstrap +0 -0
- package/build/x86_64-apple-darwin/bin/qjsbootstrap-bytecode +0 -0
- package/build/x86_64-apple-darwin/bin/qjsc +0 -0
- package/build/x86_64-apple-darwin/bin/quickjs-run +0 -0
- package/build/x86_64-apple-darwin/extras/fib.so +0 -0
- package/build/x86_64-apple-darwin/extras/is-stdin-a-tty +0 -0
- package/build/x86_64-apple-darwin/extras/log-argv +0 -0
- package/build/x86_64-apple-darwin/extras/point.so +0 -0
- package/build/x86_64-apple-darwin/extras/run-test262 +0 -0
- package/build/x86_64-apple-darwin/extras/sample-program/sum +0 -0
- package/build/x86_64-apple-darwin/extras/stack-limit-test +0 -0
- package/build/x86_64-apple-darwin/lib/quickjs-core.a +0 -0
- package/build/x86_64-apple-darwin/lib/quickjs-full.a +0 -0
- package/build/x86_64-pc-windows-static/bin/file-to-bytecode.js +7 -2
- package/build/x86_64-pc-windows-static/bin/qjs.exe +0 -0
- package/build/x86_64-pc-windows-static/bin/qjsbootstrap-bytecode.exe +0 -0
- package/build/x86_64-pc-windows-static/bin/qjsbootstrap.exe +0 -0
- package/build/x86_64-pc-windows-static/bin/qjsc.exe +0 -0
- package/build/x86_64-pc-windows-static/bin/quickjs-run.exe +0 -0
- package/build/x86_64-pc-windows-static/extras/is-stdin-a-tty.exe +0 -0
- package/build/x86_64-pc-windows-static/extras/log-argv.exe +0 -0
- package/build/x86_64-pc-windows-static/extras/run-test262.exe +0 -0
- package/build/x86_64-pc-windows-static/extras/sample-program/sum.exe +0 -0
- package/build/x86_64-pc-windows-static/extras/stack-limit-test.exe +0 -0
- package/build/x86_64-pc-windows-static/lib/quickjs-core.a +0 -0
- package/build/x86_64-pc-windows-static/lib/quickjs-full.a +0 -0
- package/build/x86_64-unknown-linux-gnu/bin/file-to-bytecode.js +7 -2
- package/build/x86_64-unknown-linux-gnu/bin/qjs +0 -0
- package/build/x86_64-unknown-linux-gnu/bin/qjsbootstrap +0 -0
- package/build/x86_64-unknown-linux-gnu/bin/qjsbootstrap-bytecode +0 -0
- package/build/x86_64-unknown-linux-gnu/bin/qjsc +0 -0
- package/build/x86_64-unknown-linux-gnu/bin/quickjs-run +0 -0
- package/build/x86_64-unknown-linux-gnu/extras/fib.so +0 -0
- package/build/x86_64-unknown-linux-gnu/extras/is-stdin-a-tty +0 -0
- package/build/x86_64-unknown-linux-gnu/extras/log-argv +0 -0
- package/build/x86_64-unknown-linux-gnu/extras/point.so +0 -0
- package/build/x86_64-unknown-linux-gnu/extras/run-test262 +0 -0
- package/build/x86_64-unknown-linux-gnu/extras/sample-program/sum +0 -0
- package/build/x86_64-unknown-linux-gnu/extras/stack-limit-test +0 -0
- package/build/x86_64-unknown-linux-gnu/lib/quickjs-core.a +0 -0
- package/build/x86_64-unknown-linux-gnu/lib/quickjs-full.a +0 -0
- package/build/x86_64-unknown-linux-musl/bin/file-to-bytecode.js +7 -2
- package/build/x86_64-unknown-linux-musl/bin/qjs +0 -0
- package/build/x86_64-unknown-linux-musl/bin/qjsbootstrap +0 -0
- package/build/x86_64-unknown-linux-musl/bin/qjsbootstrap-bytecode +0 -0
- package/build/x86_64-unknown-linux-musl/bin/qjsc +0 -0
- package/build/x86_64-unknown-linux-musl/bin/quickjs-run +0 -0
- package/build/x86_64-unknown-linux-musl/extras/fib.so +0 -0
- package/build/x86_64-unknown-linux-musl/extras/is-stdin-a-tty +0 -0
- package/build/x86_64-unknown-linux-musl/extras/point.so +0 -0
- package/build/x86_64-unknown-linux-musl/extras/run-test262 +0 -0
- package/build/x86_64-unknown-linux-musl/extras/sample-program/sum +0 -0
- package/build/x86_64-unknown-linux-musl/extras/stack-limit-test +0 -0
- package/build/x86_64-unknown-linux-musl/lib/quickjs-core.a +0 -0
- package/build/x86_64-unknown-linux-musl/lib/quickjs-full.a +0 -0
- package/build/x86_64-unknown-linux-static/bin/file-to-bytecode.js +7 -2
- package/build/x86_64-unknown-linux-static/bin/qjs +0 -0
- package/build/x86_64-unknown-linux-static/bin/qjsbootstrap +0 -0
- package/build/x86_64-unknown-linux-static/bin/qjsbootstrap-bytecode +0 -0
- package/build/x86_64-unknown-linux-static/bin/qjsc +0 -0
- package/build/x86_64-unknown-linux-static/bin/quickjs-run +0 -0
- package/build/x86_64-unknown-linux-static/extras/fib.so +0 -0
- package/build/x86_64-unknown-linux-static/extras/is-stdin-a-tty +0 -0
- package/build/x86_64-unknown-linux-static/extras/point.so +0 -0
- package/build/x86_64-unknown-linux-static/extras/run-test262 +0 -0
- package/build/x86_64-unknown-linux-static/extras/sample-program/sum +0 -0
- package/build/x86_64-unknown-linux-static/extras/stack-limit-test +0 -0
- package/build/x86_64-unknown-linux-static/lib/quickjs-core.a +0 -0
- package/build/x86_64-unknown-linux-static/lib/quickjs-full.a +0 -0
- package/package.json +2 -2
- package/.gitmodules +0 -6
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* You can
|
|
4
|
-
*
|
|
5
|
-
* This global can also be used to identify whether an object is a module
|
|
6
|
-
* namespace record.
|
|
2
|
+
* An object which lets you configure the module loader (import/export/require).
|
|
3
|
+
* You can change these properties to add support for importing new filetypes.
|
|
7
4
|
*/
|
|
8
|
-
interface
|
|
9
|
-
/**
|
|
10
|
-
* Returns true if `target` is a module namespace object.
|
|
11
|
-
*/
|
|
12
|
-
[Symbol.hasInstance](target: any): target is {
|
|
13
|
-
[key: string | number | symbol]: any;
|
|
14
|
-
};
|
|
15
|
-
|
|
5
|
+
interface ModuleDelegate {
|
|
16
6
|
/**
|
|
17
7
|
* A list of filetype extensions that may be omitted from an import specifier
|
|
18
8
|
* string.
|
|
@@ -24,7 +14,7 @@ interface ModuleGlobal {
|
|
|
24
14
|
* See the doc comment on {@link require} for more information.
|
|
25
15
|
*
|
|
26
16
|
* NOTE: If you add a new extension to this array, you will likely also want
|
|
27
|
-
* to add to {@link
|
|
17
|
+
* to add to {@link compilers}.
|
|
28
18
|
*/
|
|
29
19
|
searchExtensions: Array<string>;
|
|
30
20
|
|
|
@@ -51,7 +41,7 @@ interface ModuleGlobal {
|
|
|
51
41
|
* ```js
|
|
52
42
|
* import * as std from "std";
|
|
53
43
|
*
|
|
54
|
-
*
|
|
44
|
+
* ModuleDelegate.compilers[".txt"] = (filename, content) => {
|
|
55
45
|
* return `export default ${JSON.stringify(content)}`;
|
|
56
46
|
* }
|
|
57
47
|
* ```
|
|
@@ -65,24 +55,20 @@ interface ModuleGlobal {
|
|
|
65
55
|
* And `names` will be a string containing the contents of names.txt.
|
|
66
56
|
*
|
|
67
57
|
* NOTE: When adding to this object, you may also wish to add to
|
|
68
|
-
* {@link
|
|
58
|
+
* {@link searchExtensions}.
|
|
69
59
|
*/
|
|
70
60
|
compilers: {
|
|
71
61
|
[extensionWithDot: string]: (filename: string, content: string) => string;
|
|
72
62
|
};
|
|
73
63
|
|
|
74
64
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
|
-
define(name: string, obj: { [key: string]: any }): void;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Resolves a require/import request from `fromFile` into a canonicalized path.
|
|
65
|
+
* Resolves a require/import request from `fromFile` into a canonicalized
|
|
66
|
+
* path.
|
|
82
67
|
*
|
|
83
68
|
* To change native module resolution behavior, replace this function with
|
|
84
69
|
* your own implementation. Note that you must handle
|
|
85
|
-
* `
|
|
70
|
+
* `ModuleDelegate.searchExtensions` yourself in your replacement
|
|
71
|
+
* implementation.
|
|
86
72
|
*/
|
|
87
73
|
resolve(name: string, fromFile: string): string;
|
|
88
74
|
|
|
@@ -90,15 +76,12 @@ interface ModuleGlobal {
|
|
|
90
76
|
* Reads the contents of the given resolved module name into a string.
|
|
91
77
|
*
|
|
92
78
|
* To change native module loading behavior, replace this function with your
|
|
93
|
-
* own implementation. Note that you must handle `
|
|
94
|
-
* in your replacement implementation.
|
|
79
|
+
* own implementation. Note that you must handle `ModuleDelegate.compilers`
|
|
80
|
+
* yourself in your replacement implementation.
|
|
95
81
|
*/
|
|
96
82
|
read(modulePath: string): string;
|
|
97
83
|
}
|
|
98
84
|
|
|
99
|
-
// global added by QJMS_AddModuleGlobal
|
|
100
|
-
declare var Module: ModuleGlobal;
|
|
101
|
-
|
|
102
85
|
interface RequireFunction {
|
|
103
86
|
/**
|
|
104
87
|
* Synchronously import a module.
|
|
@@ -107,8 +90,8 @@ interface RequireFunction {
|
|
|
107
90
|
*
|
|
108
91
|
* If `source` does not have a file extension, and a file without an extension
|
|
109
92
|
* cannot be found, the engine will check for files with the extensions in
|
|
110
|
-
* {@link
|
|
111
|
-
* behavior also happens when using normal `import` statements.
|
|
93
|
+
* {@link ModuleDelegate.searchExtensions}, and use one of those if present.
|
|
94
|
+
* This behavior also happens when using normal `import` statements.
|
|
112
95
|
*
|
|
113
96
|
* For example, if you write:
|
|
114
97
|
*
|
|
@@ -117,20 +100,20 @@ interface RequireFunction {
|
|
|
117
100
|
* ```
|
|
118
101
|
*
|
|
119
102
|
* but there's no file named `somewhere` in the same directory as the file
|
|
120
|
-
* where that import appears, and `
|
|
121
|
-
* value:
|
|
103
|
+
* where that import appears, and `ModuleDelegate.searchExtensions` is the
|
|
104
|
+
* default value:
|
|
122
105
|
*
|
|
123
106
|
* ```js
|
|
124
107
|
* [".js"]
|
|
125
108
|
* ```
|
|
126
109
|
*
|
|
127
110
|
* then the engine will look for `somewhere.js`. If that doesn't exist, the
|
|
128
|
-
* engine will look for `somewhere/index.js`. If *that* doesn't exist, an
|
|
129
|
-
* will be thrown.
|
|
111
|
+
* engine will look for `somewhere/index.js`. If *that* doesn't exist, an
|
|
112
|
+
* error will be thrown.
|
|
130
113
|
*
|
|
131
|
-
* If you add more extensions to `
|
|
132
|
-
* will use those, too. It will search in the same order as the strings
|
|
133
|
-
* in the `
|
|
114
|
+
* If you add more extensions to `ModuleDelegate.searchExtensions`, then the
|
|
115
|
+
* engine will use those, too. It will search in the same order as the strings
|
|
116
|
+
* appear in the `ModuleDelegate.searchExtensions` array.
|
|
134
117
|
*/
|
|
135
118
|
(source: string): any;
|
|
136
119
|
|
|
@@ -140,7 +123,7 @@ interface RequireFunction {
|
|
|
140
123
|
resolve: (source: string) => string;
|
|
141
124
|
}
|
|
142
125
|
|
|
143
|
-
// global added by
|
|
126
|
+
// global added by QJMS_InitContext
|
|
144
127
|
declare var require: RequireFunction;
|
|
145
128
|
|
|
146
129
|
// gets set per-module by QJMS_SetModuleImportMeta
|
|
@@ -170,11 +153,12 @@ interface ImportMeta {
|
|
|
170
153
|
*
|
|
171
154
|
* Equivalent to `globalThis.require.resolve`.
|
|
172
155
|
*
|
|
173
|
-
* Behaves similarly to [the browser
|
|
156
|
+
* Behaves similarly to [the browser
|
|
157
|
+
* import.meta.resolve](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve),
|
|
174
158
|
* but it does not ensure that the returned string is a valid URL, because it
|
|
175
|
-
* delegates directly to {@link
|
|
176
|
-
* want this to return URL strings, change `
|
|
177
|
-
* to work with URL strings.
|
|
159
|
+
* delegates directly to {@link ModuleDelegate.resolve} to resolve the name.
|
|
160
|
+
* If you want this to return URL strings, change `ModuleDelegate.resolve` and
|
|
161
|
+
* `ModuleDelegate.read` to work with URL strings.
|
|
178
162
|
*/
|
|
179
163
|
resolve: RequireFunction["resolve"];
|
|
180
164
|
}
|
|
@@ -11,7 +11,8 @@ import * as std from "quickjs:std";
|
|
|
11
11
|
import * as Bytecode from "quickjs:bytecode";
|
|
12
12
|
|
|
13
13
|
function main() {
|
|
14
|
-
|
|
14
|
+
let [_quickjsRun, _thisScript, inputFile, outputFile, encodedFileName] =
|
|
15
|
+
scriptArgs;
|
|
15
16
|
|
|
16
17
|
if (!(inputFile && outputFile)) {
|
|
17
18
|
throw new Error(
|
|
@@ -19,7 +20,11 @@ function main() {
|
|
|
19
20
|
);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
if (!encodedFileName) {
|
|
24
|
+
encodedFileName = inputFile;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const bytecode = Bytecode.fromFile(inputFile, { encodedFileName });
|
|
23
28
|
const out = std.open(outputFile, "wb");
|
|
24
29
|
out.write(bytecode, 0, bytecode.byteLength);
|
|
25
30
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -11,7 +11,8 @@ import * as std from "quickjs:std";
|
|
|
11
11
|
import * as Bytecode from "quickjs:bytecode";
|
|
12
12
|
|
|
13
13
|
function main() {
|
|
14
|
-
|
|
14
|
+
let [_quickjsRun, _thisScript, inputFile, outputFile, encodedFileName] =
|
|
15
|
+
scriptArgs;
|
|
15
16
|
|
|
16
17
|
if (!(inputFile && outputFile)) {
|
|
17
18
|
throw new Error(
|
|
@@ -19,7 +20,11 @@ function main() {
|
|
|
19
20
|
);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
if (!encodedFileName) {
|
|
24
|
+
encodedFileName = inputFile;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const bytecode = Bytecode.fromFile(inputFile, { encodedFileName });
|
|
23
28
|
const out = std.open(outputFile, "wb");
|
|
24
29
|
out.write(bytecode, 0, bytecode.byteLength);
|
|
25
30
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -11,7 +11,8 @@ import * as std from "quickjs:std";
|
|
|
11
11
|
import * as Bytecode from "quickjs:bytecode";
|
|
12
12
|
|
|
13
13
|
function main() {
|
|
14
|
-
|
|
14
|
+
let [_quickjsRun, _thisScript, inputFile, outputFile, encodedFileName] =
|
|
15
|
+
scriptArgs;
|
|
15
16
|
|
|
16
17
|
if (!(inputFile && outputFile)) {
|
|
17
18
|
throw new Error(
|
|
@@ -19,7 +20,11 @@ function main() {
|
|
|
19
20
|
);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
if (!encodedFileName) {
|
|
24
|
+
encodedFileName = inputFile;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const bytecode = Bytecode.fromFile(inputFile, { encodedFileName });
|
|
23
28
|
const out = std.open(outputFile, "wb");
|
|
24
29
|
out.write(bytecode, 0, bytecode.byteLength);
|
|
25
30
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -11,7 +11,8 @@ import * as std from "quickjs:std";
|
|
|
11
11
|
import * as Bytecode from "quickjs:bytecode";
|
|
12
12
|
|
|
13
13
|
function main() {
|
|
14
|
-
|
|
14
|
+
let [_quickjsRun, _thisScript, inputFile, outputFile, encodedFileName] =
|
|
15
|
+
scriptArgs;
|
|
15
16
|
|
|
16
17
|
if (!(inputFile && outputFile)) {
|
|
17
18
|
throw new Error(
|
|
@@ -19,7 +20,11 @@ function main() {
|
|
|
19
20
|
);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
if (!encodedFileName) {
|
|
24
|
+
encodedFileName = inputFile;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const bytecode = Bytecode.fromFile(inputFile, { encodedFileName });
|
|
23
28
|
const out = std.open(outputFile, "wb");
|
|
24
29
|
out.write(bytecode, 0, bytecode.byteLength);
|
|
25
30
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -11,7 +11,8 @@ import * as std from "quickjs:std";
|
|
|
11
11
|
import * as Bytecode from "quickjs:bytecode";
|
|
12
12
|
|
|
13
13
|
function main() {
|
|
14
|
-
|
|
14
|
+
let [_quickjsRun, _thisScript, inputFile, outputFile, encodedFileName] =
|
|
15
|
+
scriptArgs;
|
|
15
16
|
|
|
16
17
|
if (!(inputFile && outputFile)) {
|
|
17
18
|
throw new Error(
|
|
@@ -19,7 +20,11 @@ function main() {
|
|
|
19
20
|
);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
if (!encodedFileName) {
|
|
24
|
+
encodedFileName = inputFile;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const bytecode = Bytecode.fromFile(inputFile, { encodedFileName });
|
|
23
28
|
const out = std.open(outputFile, "wb");
|
|
24
29
|
out.write(bytecode, 0, bytecode.byteLength);
|
|
25
30
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suchipi/quickjs",
|
|
3
3
|
"description": "Suchipi's QuickJS Fork",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"main": "./npm/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"qjs": "npm/cli/qjs.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@babel/preset-env": "^7.20.2",
|
|
14
14
|
"@babel/preset-typescript": "^7.18.6",
|
|
15
15
|
"@suchipi/print": "^2.5.0",
|
|
16
|
-
"@suchipi/shinobi": "^0.
|
|
16
|
+
"@suchipi/shinobi": "^1.0.0",
|
|
17
17
|
"@types/jest": "^29.2.4",
|
|
18
18
|
"@types/node": "^18.11.9",
|
|
19
19
|
"@types/shelljs": "^0.8.11",
|