Skip to main content
Anton Petrov
Known Participant
May 9, 2018
Answered

Bitwise operators | and & precedence

  • May 9, 2018
  • 2 replies
  • 1111 views

I still can't believe this is possible. After few days (and nights) of debugging, I found that JSX doesn't confirms with JS specifications about '&' and  '|' operators precedence. 

In ESTK "1 | 1 & 0" results in 0. It should be the same as "1 | (1 & 0)", which is 1.

The issue I had was with an external minified library crypto-js and the debugging was real pain.

As I could't find this fact documented, I'm still wondering is that by design or it's Adobe's implementation bug?

This topic has been closed for replies.
Correct answer BarlaeDC

Hi,

As per this thread it is stated that the scripting engine doesn't conform in all ways, so it could be either a bug or a implementation issue, Does Adobe have any plans to update JavaScript .

At the moment, I guess it is just best to be explicit with your JavaScript.

Regards

Malcolm

2 replies

BarlaeDC
Community Expert
Community Expert
May 10, 2018

Hi,

I posted the thread so you could see 2 points, 1 - that ExtendScript does not conform to the specifications, and hence you get some anomalies in how code functions. and 2 - that there is a debate about what to do with Scripting going forward, do Adobe update extendscript or move to a different framework (nodejs ........ ).

This was just to give you some understanding of where the ExtendScript library is, and the problems that can arise because of this.

I agree that it should be fixed/updated to match the specification but until such time as there is a approach chosen by Adobe as to how to move forward with ExtendScript, we pretty much have to work around the issues.

As always you can log the issue officially with Adobe here - Feature Request/Bug Report Form

Regards

Malcolm

BarlaeDC
Community Expert
BarlaeDCCommunity ExpertCorrect answer
Community Expert
May 9, 2018

Hi,

As per this thread it is stated that the scripting engine doesn't conform in all ways, so it could be either a bug or a implementation issue, Does Adobe have any plans to update JavaScript .

At the moment, I guess it is just best to be explicit with your JavaScript.

Regards

Malcolm

Trevor:
Legend
May 9, 2018

It sounds very much like the should be some major changes. I would expect some announcement within the next month or 2 but it might well be covered by an NDA.