Skip to content

Commit ddcb13c

Browse files
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]>
1 parent 57f8f33 commit ddcb13c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/xeus/src/worker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,10 @@ export abstract class XeusRemoteKernel {
207207
}
208208

209209
this._initializeStdin(baseUrl, browsingContextId);
210-
211-
rawXKernel = new globalThis.Module.xkernel();
210+
// backward compatibility: Checking if the kernel constructor takes argument or not
211+
rawXKernel = globalThis.Module.xkernel.length
212+
? new globalThis.Module.xkernel(kernelSpec.argv)
213+
: new globalThis.Module.xkernel();
212214
rawXServer = rawXKernel.get_server();
213215
if (!rawXServer) {
214216
this._logger.error('Failed to start kernel!');

0 commit comments

Comments
 (0)