mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 21:24:48 +00:00
Deno.core.evalContext & Deno.core.print fix (#2465)
This commit is contained in:
parent
e3b2205eba
commit
9bea576f3e
5 changed files with 54 additions and 3 deletions
|
@ -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");
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue