@basthon/kernel-javascript 0.62.22 → 0.64.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/lib/comlink-worker.js +1 -1
- package/lib/kernel.d.ts +1 -0
- package/lib/kernel.js +3 -0
- package/lib/worker.js +5 -3
- package/package.json +3 -3
package/lib/comlink-worker.js
CHANGED
package/lib/kernel.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { JavaScriptKernelWorker } from "./worker";
|
|
|
3
3
|
export declare class JavaScriptKernel extends KernelMainBase<JavaScriptKernelWorker> {
|
|
4
4
|
constructor(options: any);
|
|
5
5
|
protected newWorker(): Worker;
|
|
6
|
+
protected importLegacyWorker(): Promise<void>;
|
|
6
7
|
language(): string;
|
|
7
8
|
languageName(): string;
|
|
8
9
|
moduleExts(): string[];
|
package/lib/kernel.js
CHANGED
package/lib/worker.js
CHANGED
|
@@ -5,8 +5,10 @@ export class JavaScriptKernelWorker extends KernelWorkerBase {
|
|
|
5
5
|
// do not forget to call the parent constructor
|
|
6
6
|
super(options);
|
|
7
7
|
// the window object is not available in a webworker...
|
|
8
|
-
self.window
|
|
9
|
-
|
|
8
|
+
if (self.window == null)
|
|
9
|
+
self.window = self;
|
|
10
|
+
if (self.Canvas == null)
|
|
11
|
+
self.Canvas = globalThis.OffscreenCanvas;
|
|
10
12
|
}
|
|
11
13
|
/*
|
|
12
14
|
* Initialize the kernel.
|
|
@@ -29,7 +31,7 @@ export class JavaScriptKernelWorker extends KernelWorkerBase {
|
|
|
29
31
|
: { "text/plain": objectInspect(result) };
|
|
30
32
|
}
|
|
31
33
|
putFile(filename, content) {
|
|
32
|
-
console.error(`
|
|
34
|
+
console.error(`File ${filename} not added since putFile has no mean in the JS context.`);
|
|
33
35
|
}
|
|
34
36
|
async putModule(filename, content) {
|
|
35
37
|
content = new Uint8Array(content);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basthon/kernel-javascript",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.0",
|
|
4
4
|
"description": "Basthon - JavaScript Kernel",
|
|
5
5
|
"homepage": "https://basthon.fr",
|
|
6
6
|
"bugs": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"clean": "rm -rf lib/"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@basthon/kernel-base": "0.
|
|
28
|
+
"@basthon/kernel-base": "0.64.0",
|
|
29
29
|
"comlink": "^4.4.1",
|
|
30
30
|
"object-inspect": "^1.13.1"
|
|
31
31
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "1e6bb930f8b51e2a307179afcd9426d2672af4e3"
|
|
40
40
|
}
|