Skip to content
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

Unary operator fixes #27

Merged
merged 5 commits into from
Sep 19, 2017
Merged

Unary operator fixes #27

merged 5 commits into from
Sep 19, 2017

Conversation

alexwarren
Copy link

Fixes #26

guillaumeprevot added a commit to guillaumeprevot/webapps-calculator that referenced this pull request May 9, 2016
- ajout des rubriques "Accélération", "Force", "Pression", "Puissance", "Vitesse" et mise à jour de certaines autres rubriques
- renvoi vers la page Wikipedia des conversions en ne précisant que l'unité (par exemple convertir("radian"))
- ajout de noms secondaires pour les unités (par exemple masse atomique = dalton = Da = u = uma)
- intégration d'une [pull request](EricSmekens/jsep#23) pour personnaliser les "literals" (pi par exemple)
- intégration d'une [pull request](EricSmekens/jsep#27) pour corriger les opérateurs unaires
- intégration d'une [pull request](EricSmekens/jsep#17) pour permettre de saisir des nombres en héxa (0x12 par exemple)
- sur le même principe, permettre de saisir des nombres en binaire (0b1100 = 12 par exemple) ou en octal (0o12 = 10 par exemple)
@LeaVerou
Copy link
Collaborator

@EricSmekens What is wrong with this one and it hasn't been merged? Can I help?

@EricSmekens
Copy link
Owner

@LeaVerou, I was first focussing on low-impact merges to get a release version out soon.
Now I'm back from holiday I will try to release a version soon, and then to focus on PR's like this.

You can always help by checking/testing PR's and confirm them. Makes it more confident for me to merge them, as I cannot completely oversee the impact on jsep yet.

@EricSmekens
Copy link
Owner

I will check the backslashes soon, if it matches esprima's output or what we can do about that.

@LeaVerou
Copy link
Collaborator

LeaVerou commented Sep 18, 2017

@EricSmekens I have pulled this locally, resolved conflicts, and tested it. Both the jsep testsuite pass, and my own testsuite for Mavo's expression parsing (which uses jsep). Should I merge or do you want to do any more checks?

@EricSmekens
Copy link
Owner

I'm fine with merging this! :)

@LeaVerou LeaVerou merged commit 88727c9 into EricSmekens:master Sep 19, 2017
@LeaVerou
Copy link
Collaborator

Yay, merged!
Thank you @alexwarren!

@LeaVerou
Copy link
Collaborator

LeaVerou commented Sep 20, 2017

Uh-oh, I just realized this causes a pretty serious bug.
Run this:

> jsep.addUnaryOp("not");
> jsep("notes")
< {type: "UnaryExpression", operator: "not", argument: {}, prefix: true}

Damn. Looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants