Ask questionsGlobal-based Variable will generate strange characters

In, I find a very strange problem:

For, if I take this variable out of the scope of the function, it cannot pass the newly-added unit test for the version of Nodejs 10.15.3, but if the same Regex is put directly into the body of the function, everything seems normal. I'm NOT sure why it happens like this?



Answer questions addaleax

@MaledongGit Can you post a simplified reproduction? Otherwise it’s going to be hard for somebody else to tell what’s going on.


Related questions

--max-http-header-size= is not allowed in NODE_OPTIONS
Crash with "req.handle.writev is not a function" on Socket.Writable.uncork hot 2
pkg-exports: "." errors without a specified `main` hot 2
shutdown ENOTCONN on TLS.Socket._final hot 2
HTTP/2 requests eventually start throwing NGHTTP2_ENHANCE_YOUR_CALM errors hot 2
Assertion `(parser->current_buffer_len_) == (0)' failed hot 1
Node.js 12.10 throwing EPROTO on HTTPS request hot 1
Remove util.inherits usage internally? hot 1
[Bug] Node 10.1.0 TLS issue with ldap: Client network socket disconnected before secure TLS connection was established hot 1
ReferenceError: internalBinding is not defined hot 1
Incorrect timezone hot 1
HPE_INVALID_HEADER_TOKEN on http requests hot 1
HPE_INVALID_HEADER_TOKEN on http requests hot 1
crypto, bad decrypt hot 1
stream.finished behaviour change hot 1
Github User Rank List