JS 1.8 syntax checking in Komodo

I’ve been using JavaScript 1.8 expression closures lately, but ActiveState Komodo‘s JS syntax checker, which is just SpiderMonkey 1.7, doesn’t recognize them, so it treats them as a syntax error and stops checking the file:

Fortunately, the fix turns out to be pretty simple. Komodo ships with SpiderMonkey 1.7 as an executable, so I first built SpiderMonkey 1.8 (on Linux) using the SpiderMonkey build instructions:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -l mozilla/js/src mozilla/js/src/config mozilla/js/src/editline mozilla/js/src/fdlibm<br />cd mozilla/js/src<br />BUILD_OPT=1 make -f Makefile.ref<br />

Then I backed up Komodo’s version and replaced it with the one I built:

cp Linux_All_OPT.OBJ/js ~/Applications/Komodo-IDE-4/lib/mozilla/js18<br />cd ~/Applications/Komodo-IDE-4/lib/mozilla<br />mv js js17<br />ln -s js18 js<br />

Voila! Syntax checking works for expression closures:

In theory I might have just horked some part of Komodo that depends on JS 1.7, although the New in JavaScript 1.8 doc doesn’t mention breaking changes between the two versions, and so far Komodo seems to be working fine.

If it does create problems, however, then a more contained fix, as ActiveState’s Todd Whiteman points out on the Komodo Discuss mailing list, would be to update koXPCShellLinter.py’s jsInterp variable to point to the 1.8 executable.

 

Myk Melez

Myk is a Principal Software Architect and in-house entrepreneur at Mozilla. A Mozillian since 1999, he's contributed to the Web App Developer Initiative, PluotSorbet, Open Web Apps, Firefox OS Simulator, Jetpack, Raindrop, Snowl, Personas, Firefox, Thunderbird, and Bugzilla. He's just a cook. He's all out of bubblegum.

 

2 thoughts on “JS 1.8 syntax checking in Komodo

  1. I love to find other people had my same problems and they solved them.

    I can concentrate to do something different.

    thanks a lot

    dafi

  2. Myk, we try to maintain source-level (not binary) compatibility in SpiderMonkey, so if your ln trick here causes bugs in Komodo, it might be worth filing them. I did something similar with JS1.8 -> JS1.6 and Firefox still ran and appeared to work (though at the time, I disabled E4X support to get it to build).

Comments are closed.