File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ The judge can also grade in the languages listed below:
6767* Groovy
6868* Haskell
6969* INTERCAL
70+ * JavaScript (Node.js and V8)
7071* Kotlin
7172* Lean 4
7273* LLVM IR
Original file line number Diff line number Diff line change 1+ from dmoj .cptbox .filesystem_policies import ExactFile
2+ from dmoj .executors .script_executor import ScriptExecutor
3+
4+
5+ class Executor (ScriptExecutor ):
6+ ext = 'js'
7+ command = 'node'
8+ nproc = - 1
9+ command_paths = ['node' , 'nodejs' ]
10+ syscalls = ['capget' , 'eventfd2' , 'shutdown' ]
11+ address_grace = 1048576
12+ test_program = """
13+ process.stdin.on('readable', () => {
14+ const chunk = process.stdin.read();
15+ if (chunk != null) {
16+ process.stdout.write(chunk);
17+ }
18+ });
19+ """
20+
21+ def get_env (self ):
22+ env = super ().get_env ()
23+ # Disable io_uring due to potential security implications
24+ env ['UV_USE_IO_URING' ] = '0'
25+ return env
26+
27+ def get_fs (self ):
28+ return super ().get_fs () + [ExactFile ('/usr/lib/ssl/openssl.cnf' )]
29+
30+ @classmethod
31+ def get_version_flags (cls , command ):
32+ return ['--version' ]
You can’t perform that action at this time.
0 commit comments