Pasting code into node repl makes it exit on Windows

Node v8.11.2
Win10 Pro

I run node from cmd.exe, and simply paste this code using r-click:

var crypto = require('crypto');
function hmacN(N)
{
    console.log(N);
}

The moment I paste it, node exists and I get this output:

Microsoft Windows [Version 10.0.17134.81]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\username>node
> var crypto = require('crypto');
undefined
> function hmacN(N)
... {
...     console.log(N);
... }
undefined
>
C:\Users\username>

This used to work properly (e.g. it shouldn't exit), that's how I always test snippets by pasting them into node-repl console.

Interesting observation: if I paste incomplete code (without last }) then it won't exit and I need to manually complete it with the last brace and can continue. Or, if pasted block doesn't end with a new line character, then it will also won't exist and will wait for manual [ENTER] key press. Also, to confirm, the problem happens on 8.11.3 as well