-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
implement exponentiation operator #89
Comments
This issue could maybe also be labelled as |
Re: 'somewhere in the big match statement'. There's already a The |
Now that I look at it, this looks done. |
The |
Mind if I take a look at this one? |
* Exponentiation (**) now works. Added missing NumOp type, token match, and calculation. * Assignment exponentiation (**=) now works. Added missing AssignOp type, token match, and calculation. This fixes #89.
The javascript built-in exponentiation operator (
**
) is missing in the implementation of the lexer. It is a shorthand forMath.pow()
built-in.It should probably be added to the lexer in this method, somewhere in the big match statement https://github.com/jasonwilliams/boa/blob/master/src/lib/syntax/lexer.rs#L207-L533
The operator's syntax and semantics is defined in this section here https://tc39.es/ecma262/#sec-exp-operator in the spec and does the same thing at runtime than
Math.pow()
, which is already implemented here https://github.com/jasonwilliams/boa/blob/master/src/lib/js/math.rs#L140-L148.The text was updated successfully, but these errors were encountered: