endel / js2php

JavaScript (ES6) to PHP source-to-source transpiler.
https://endel.github.io/js2php/
MIT License
333 stars 41 forks source link

Fixed regex for non literals. #29

Closed 2pha closed 6 years ago

2pha commented 6 years ago

fixes #28

2pha commented 6 years ago

sorry, I forgot to create a branch before making the fixes

2pha commented 6 years ago

Also, another comment on the fix for strings as function arguments. Sometimes the type of argument is unknown (in my case, converting a class function) and then if you use ".length", it will assume an array and convert to "count()". To get around this, I check for the name of the function argument name, if the variable is named "string", it assumes a string.

2pha commented 6 years ago

I made the mistake of not creating a branch before committing and creating this pull request, so am closing.

endel commented 6 years ago

Hi @2pha, sorry, for some reason I'm not receiving email updates about this repository. Do you mind creating a new pull-request for this? Cheers!

2pha commented 6 years ago

ok, no worries. https://github.com/endel/js2php/pull/31