Deno.core.evalContext & Deno.core.print fix (#2465)

This commit is contained in:
Michał Sabiniarz 2019-06-07 02:51:04 +01:00 committed by Ryan Dahl
parent e3b2205eba
commit 9bea576f3e
5 changed files with 54 additions and 3 deletions

View file

@ -195,3 +195,27 @@ global.LibDenoEvalContextError = () => {
assert(!errInfo5.isCompileError); // is NOT a compilation error! (just eval)
assert(errInfo5.thrown.message === "Unexpected end of input");
};
global.LibDenoEvalContextInvalidArgument = () => {
try {
Deno.core.evalContext();
} catch (e) {
assert(e instanceof TypeError);
assert(e.message === "Invalid Argument");
}
};
global.LibDenoPrintInvalidArgument = () => {
try {
Deno.core.print();
} catch (e) {
assert(e instanceof TypeError);
assert(e.message === "Invalid Argument");
}
try {
Deno.core.print(2, 3, 4);
} catch (e) {
assert(e instanceof TypeError);
assert(e.message === "Invalid Argument");
}
};