<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 16, 2015 at 2:03 PM, Gijs Kruitbosch <span dir="ltr"><<a href="mailto:gijskruitbosch@gmail.com" target="_blank">gijskruitbosch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Ditching the preprocessor would also mean ungodly-long in-tree JS
      files because extra script references add overhead. It's no
      coincidence web devs unify their JS into only a few files, too.
      Obviously we could replace it with other magical "put the things
      together" solutions, but that's unlikely to solve the same tooling
      problem, ie, multiple files that apply to a single global. If
      anything, I wish we split up browser.js even more ways.<br></div></div></blockquote><div><br></div><div>I didn't mean to suggest that we should just expand out all the preprocessor invocations. I count 795 uses of #ifdef in our JS code (some from b2g). All of these could easily be replaced by something like |if (Constant.XP_MACOSX)|. The new code would only be a tiny bit slower.<br><br></div><div>#include usage is harder to fix but also much less common--only 88 uses. Some of these were originally JSMs but got converted to #includes when compartments had much higher overhead than they do now. The stuff in browser.js would probably require more refactoring, but I think it's worth doing.<br></div><div> <br></div><div>-Bill<br></div></div></div></div>