locutusjs / locutus

Bringing stdlibs of other programming languages to JavaScript for educational purposes
https://locutus.io
MIT License
3.72k stars 1.12k forks source link

Invalid syntax '/php/_helpers/_bc' in released '_locutus_shared/_locutus_shared_bc.js' #456

Closed chihsuan closed 6 months ago

chihsuan commented 2 years ago

Description

An invalid JS syntax found in the released '_locutus_shared/_locutus_shared_bc.js' line 6:

To reproduce:

  1. npm install locutus
  2. Open node_modules/locutus/php/_locutus_shared/_locutus_shared_bc.js
1 'use strict';
2
3 module.exports = function _bc() {
4   // eslint-disable-line camelcase
5   //  discuss at: http://locutus.io
6 /php/_helpers/_bc

I think somehow an additional newline is added to the line 5.

Version: locutus@2.0.16 OS: MacOS

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 14 days.

kvz commented 6 months ago

When I try this locally, the new location is node_modules/locutus/php/_helpers/_bc.js and it seems to not suffer from this:

'use strict';

module.exports = function _bc() {
  //  discuss at: https://locutus.io/php/_helpers/_bc
  // original by: lmeyrick (https://sourceforge.net/projects/bcmath-js/)
  // improved by: Brett Zamir (https://brett-zamir.me)
  //   example 1: var $bc = _bc()
  //   example 1: var $result = $bc.PLUS
  //   returns 1: '+'

Closing as resolved in the meantime