JavaScript:SpiderMonkey:Coding Style: Difference between revisions

Jump to navigation Jump to search
Line 265: Line 265:
* js*inlines.h
* js*inlines.h
* */*-inl.h.
* */*-inl.h.
Keep (case-insensitive) lexicographic order with each section.
The presence of conditionally-compiled #include statements complicates thing.  If you have a single #include statement within a #if/#ifdef/#ifndef block, placing the block in the appropriate section is straightforward.  If you have multiple #include statements within a block, use your judgment as to where the best place for it is.


Example for X.cpp:
Example for X.cpp:
Line 270: Line 274:
  #include "X.h"    // put "X-inl.h" instead, if it exists
  #include "X.h"    // put "X-inl.h" instead, if it exists
   
   
  #include "mozilla/StdInt.h"
  #include "mozilla/HashFunctions.h"
   
   
  #include <string.h>
  #include <string.h>
   
   
  #include "jsbar.h"
  #include "jsbar.h"
  #include "jsbaz.h"
#ifdef BAZ
  # include "jsbaz.h"
#endif
#include "jscaz.h"
   
   
  #include "ds/Baz.h"
  #include "ds/Baz.h"
Line 286: Line 293:
  #include "frontend/Thingamabob-inl.h"
  #include "frontend/Thingamabob-inl.h"
  #include "vm/VirtualReality-inl.h"
  #include "vm/VirtualReality-inl.h"
If possible, keep lexicographic order with each section.


= C++ =
= C++ =
Confirmed users
1,345

edits

Navigation menu