Closed vkurko closed 3 years ago
Describe the current, buggy behavior
The wp i18n make-pot fails to parse a JS file with the following content (simplified):
wp i18n make-pot
8e-5.toFixed(3)
The result is:
Debug (make-pot): Could not parse file test.js: Invalid exponential notation (line 1, column 5) (0.097s)
Describe how other contributors can replicate this bug
Create a test.js file with the mentioned content inside a WordPress plugin and run wp i18n make-pot.
test.js
Describe what you would expect as the correct outcome
The file is parsed and processed by the wp i18n command.
wp i18n
Let us know what environment you are running this on
$ wp --info OS: Linux 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 Shell: /bin/bash PHP binary: /usr/bin/php7.4 PHP version: 7.4.3 php.ini used: /etc/php/7.4/cli/php.ini MySQL binary: /usr/bin/mysql MySQL version: mysql Ver 8.0.25-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) SQL modes: WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli WP-CLI vendor dir: phar://wp-cli.phar/vendor WP_CLI phar path: /home/xxx/xxx WP-CLI packages dir: /home/xxx/.wp-cli/packages/ WP-CLI global config: WP-CLI project config: WP-CLI version: 2.5.1-alpha-632cc05 $ wp package list +---------------------+-----------------+------------+-----------+----------------+ | name | authors | version | update | update_version | +---------------------+-----------------+------------+-----------+----------------+ | wp-cli/i18n-command | Pascal Birchler | dev-master | available | 2.x-dev | +---------------------+-----------------+------------+-----------+----------------+
Confirmed and reported upstream: https://github.com/mck89/peast/issues/40
This was now fixed upstream.
It will be resolved in WP-CLI with the next dependency updates.
Bug Report
Describe the current, buggy behavior
The
wp i18n make-pot
fails to parse a JS file with the following content (simplified):The result is:
Describe how other contributors can replicate this bug
Create a
test.js
file with the mentioned content inside a WordPress plugin and runwp i18n make-pot
.Describe what you would expect as the correct outcome
The file is parsed and processed by the
wp i18n
command.Let us know what environment you are running this on