diff options
| author | MichaĆ Sabiniarz <31597105+mhvsa@users.noreply.github.com> | 2019-06-07 02:51:04 +0100 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-06-06 21:51:04 -0400 |
| commit | 9bea576f3ea224ec72f371f6f0bc582171ca7890 (patch) | |
| tree | 17a0dbfd8f463ca93e7240e13ec6cbf2bad4b751 /core/libdeno/libdeno_test.js | |
| parent | e3b2205eba2851380a9a149071cb4fb7e8218b13 (diff) | |
Deno.core.evalContext & Deno.core.print fix (#2465)
Diffstat (limited to 'core/libdeno/libdeno_test.js')
| -rw-r--r-- | core/libdeno/libdeno_test.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/libdeno/libdeno_test.js b/core/libdeno/libdeno_test.js index 156af1e47..17a6343cf 100644 --- a/core/libdeno/libdeno_test.js +++ b/core/libdeno/libdeno_test.js @@ -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"); + } +}; |
