-
Notifications
You must be signed in to change notification settings - Fork 41
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
... #42
base: master
Are you sure you want to change the base?
... #42
Conversation
Multiple initializers should be comma-separated.
This prevents matching 'hasOwnProperty' and other properties of object.
Property names are encoded with a leading dot, since method names are the most common case. This allows us to handle `Array.prototype.slice.call(...)` and similar constructs in a subsequent patch.
This is common in JS, which passes arrays by reference, but is generally not useful in PHP, which passes arrays by value.
|
|
|
Very cool! |
It's not quite clear to me, but I think @zaoqi is proposing to merge a bunch of changes from the https://github.com/cscott/js2php fork back into master? They are all appropriate, I guess, except mabe for b4bd92a and da730e8 -- and even those probably don't hurt anything. I should note though that the focus of my patches shifted from trying to exactly match JS execution (ie, execute JavaScript in PHP) from trying to provide a reasonable-quality "natural reading" source-level transformation to guide a port. We are porting https://www.mediawiki.org/wiki/Parsoid from JS into PHP ( https://www.mediawiki.org/wiki/Parsing/Notes/Moving_Parsoid_Into_Core/Porting ) and we've found js2php invaluable for doing a first pass conversion of our ~70k lines of code (see wikimedia/mediawiki-services-parsoid@83ed537). When we actually "port" the code after that, we can easily concentrate on the differences between the js2php-generated skeleton and the working file -- the diff now shows "real" changes, not just syntax conversion. All of which is to say I wasn't super concerned with executability of the result, as long as it "looked right" to a reader, and in a few places I added big |
No description provided.