mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: fix copyIn
This commit is contained in:
1 parent
167c70c2b1
commit
e6927bcc49
5 files changed
+17
-25
No files matched your search
@@ -6,7 +6,7 @@ import { compilerText } from './utils';
|
||||
import { Execute } from './interface';
|
||||
|
||||
export = async function compile(
|
||||
lang: LangConfig, code: string, target: string, copyIn: any, next?: Function,
|
||||
lang: LangConfig, code: string, target: string, copyIn: any = {}, next?: Function,
|
||||
): Promise<Execute> {
|
||||
target = lang.target || target;
|
||||
const f = {};
|
||||
@@ -23,11 +23,11 @@ export = async function compile(
|
||||
if (next) next({ compiler_text: compilerText(stdout, stderr) });
|
||||
f[target] = { fileId: fileIds[target] };
|
||||
return {
|
||||
execute: lang.execute, copyIn: f, clean: () => del(fileIds[target]), time: lang.time_limit_rate || 1,
|
||||
execute: lang.execute, copyIn: { ...copyIn, ...f }, clean: () => del(fileIds[target]), time: lang.time_limit_rate || 1,
|
||||
};
|
||||
}
|
||||
f[target] = { content: code };
|
||||
return {
|
||||
execute: lang.execute, copyIn: f, clean: () => Promise.resolve(null), time: lang.time_limit_rate || 1,
|
||||
execute: lang.execute, copyIn: { ...copyIn, ...f }, clean: () => Promise.resolve(null), time: lang.time_limit_rate || 1,
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user