Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
6.6.0, 6.5.0
-
Untriaged
-
1
-
Unknown
Description
Run a simple Eventing function as follows:
function OnUpdate(doc, meta) {
|
var pow;
|
|
pow = 2 ** 4; |
log('A yes 16 from: pow = 2 ** 4', pow); |
|
pow = 2 ** (3 + 1); |
log('B not 16 from: pow = 2 ** (3 + 1)', pow); |
}
|
Deploy from now and Kick off a single mutation The results are incorrect
2020-04-18T08:17:40.839-07:00 [INFO] "A yes 16 from: pow = 2 ** 4" 16 |
2020-04-18T08:17:40.839-07:00 [INFO] "B not 16 from: pow = 2 ** (3 + 1)" 9 |
Both pow functions should have given 16, I believe this is a transpiler issue where the grouping syntax is ignored (at least in the case of the '**' operator).
Of course Node.js works as expected e.g.
# cat pow.js
|
const log = console.log
|
|
var pow;
|
|
pow = 2 ** 4;
|
log('A yes 16 from: pow = 2 ** 4', pow);
|
|
pow = 2 ** (3 + 1);
|
log('B not 16 from: pow = 2 ** (3 + 1)', pow);
|
|
# node pow.js
|
A yes 16 from: pow = 2 ** 4 16
|
B not 16 from: pow = 2 ** (3 + 1) 16
|
Attachments
Issue Links
- backports to
-
MB-38843 Eventing operator precedence for group has issues
- Closed