💻
How are you using Babel?
Programmatic API (babel.transform, babel.parse)
Input code
(/* @__PURE__ */ f()).g()
REPL Link
Configuration file name
No response
Configuration
None
Current and expected behavior
Currently babel strips the parentheses of (/* @__PURE__ */ f()), causing the whole expression f().g() be marked as pure.
/* @__PURE__ */
f().g();
// expect: same as input
Environment
System:
OS: macOS 12.5
Binaries:
Node: 18.6.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.15.0 - /usr/local/bin/npm
npmPackages:
@babel/core: ^7.7.4 => 7.18.9
@babel/plugin-proposal-class-properties: ^7.7.4 => 7.18.6
@babel/plugin-proposal-object-rest-spread: ^7.7.4 => 7.18.9
@babel/plugin-transform-modules-commonjs: ^7.15.0 => 7.18.6
@babel/preset-env: ^7.7.4 => 7.18.9
@babel/preset-react: ^7.7.4 => 7.18.6
@babel/preset-typescript: ^7.7.4 => 7.18.6
babel-loader: ^8.0.6 => 8.2.5
webpack: ^5.74.0 => 5.74.0
Possible solution
No response
Additional context
No response
💻
How are you using Babel?
Programmatic API (
babel.transform,babel.parse)Input code
REPL Link
Configuration file name
No response
Configuration
None
Current and expected behavior
Currently babel strips the parentheses of
(/* @__PURE__ */ f()), causing the whole expressionf().g()be marked as pure.Environment
Possible solution
No response
Additional context
No response