-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repl: no RegExp side effects #18931
Comments
@bnoordhuis When we run from the file, the output should be empty, right? Source: console.log(RegExp.$_) output (< v8.0.0)
output (>= v8.0.0){ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'asan': 0,
'coverage': 'false',
'debug_devtools': 'node',
'force_dynamic_crt': 0,
'host_arch': 'x64',
'icu_data_file': 'icudt59l.dat',
'icu_data_in': '../../deps/icu-small/source/data/in/icudt59l.dat',
'icu_endianness': 'l',
'icu_gyp_path': 'tools/icu/icu-generic.gyp',
'icu_locales': 'en,root',
'icu_path': 'deps/icu-small',
'icu_small': 'true',
'icu_ver_major': '59',
'llvm_version': 0,
'node_byteorder': 'little',
'node_enable_d8': 'false',
'node_enable_v8_vtunejit': 'false',
'node_install_npm': 'true',
'node_module_version': 57,
'node_no_browser_globals': 'false',
'node_prefix': '/',
'node_release_urlbase': 'https://nodejs.org/download/release/',
'node_shared': 'false',
'node_shared_cares': 'false',
'node_shared_http_parser': 'false',
'node_shared_libuv': 'false',
'node_shared_openssl': 'false',
'node_shared_zlib': 'false',
'node_tag': '',
'node_use_bundled_v8': 'true',
'node_use_dtrace': 'true',
'node_use_etw': 'false',
'node_use_lttng': 'false',
'node_use_openssl': 'true',
'node_use_perfctr': 'false',
'node_use_v8_platform': 'true',
'node_without_node_options': 'false',
'openssl_fips': '',
'openssl_no_asm': 0,
'shlib_suffix': '57.dylib',
'target_arch': 'x64',
'uv_parent_path': '/deps/uv/',
'uv_use_dtrace': 'true',
'v8_enable_gdbjit': 0,
'v8_enable_i18n_support': 1,
'v8_enable_inspector': 1,
'v8_no_strict_aliasing': 1,
'v8_optimized_debug': 0,
'v8_promise_internal_field_count': 1,
'v8_random_seed': 0,
'v8_use_snapshot': 'true',
'want_separate_host_toolset': 0,
'want_separate_host_toolset_mkpeephole': 0,
'xcode_version': '7.0'}} |
@princejwesley That's right, |
Preserve all RegExp static properties - RegExp.$1 to RegExp.9 - input, lastMatch, lastParen - leftContext and rightContext Fixes: nodejs#18931
Disallow global RegExp object usage inside repl.js, readline.js and tty.js. Use RegExp from internal context to prevent updating global.RegExp static properties tools/eslint-rules/no-regex-literal-for-repl.js linter is added to prevent regex literal usage in repl code path Fixes: nodejs#18931
I had a look at this and it seems the only way to really solve this is the solution suggested by @princejwesley in #20549. We should either accept this as a side effect that we do not want to fix or we should revive that PR. I personally suggest we go for the latter. |
Caused by the repl trying to fix up the side effects to
RegExp.$1
toRegExp.$9
. :-)The text was updated successfully, but these errors were encountered: