Skip to content

Commit 60d8ade

Browse files
Backport PR #210 on branch 3.x (Enable Kernels to be built on top of kernlSpec arguments) (#216)
* Enable Kernels to be built on top of kernlSpec arguments (#210) * Enable Kernels to be built on top of kernlSpec arguments * apply suggestion * better formatting * Update packages/xeus/src/worker.ts Co-authored-by: martinRenou <[email protected]> --------- Co-authored-by: martinRenou <[email protected]> (cherry picked from commit ddcb13c) * Update snapshots --------- Co-authored-by: martinRenou <[email protected]>
1 parent 9b76541 commit 60d8ade

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

packages/xeus/src/worker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ export class XeusRemoteKernel {
179179
});
180180
}
181181

182-
rawXKernel = new globalThis.Module.xkernel();
182+
// backward compatibility: Checking if the kernel constructor takes argument or not
183+
rawXKernel = globalThis.Module.xkernel.length
184+
? new globalThis.Module.xkernel(kernelSpec.argv)
185+
: new globalThis.Module.xkernel();
183186
rawXServer = rawXKernel.get_server();
184187
if (!rawXServer) {
185188
console.error('Failed to start kernel!');
-2.28 KB
Loading
-2.28 KB
Loading

0 commit comments

Comments
 (0)