Use the SpiderMonkey C++ Coding Style page on wikimo which is more up to date and the canonical source.
The SpiderMonkey project owners enforce coding conventions pretty strictly during code reviews.
- Public function names begin with
JS_followed by capitalized "intercaps", e.g.
- Extern but library-private function names use a
js_prefix and mixed case, e.g.
- Most static function names have unprefixed, mixed-case names:
- But static native methods of JS objects have lowercase, underscore-separated or intercaps names, e.g.,
- And library-private and static data use underscores, not intercaps (but library-private data do use a
- Scalar type names are lowercase and
- Aggregate type names are
JS-prefixed and mixed-case:
- Macros are generally
ALL_CAPSand underscored, to call out potential side effects, multiple uses of a formal argument, etc.
- DLL entry points have their return type expanded within a
JS_PUBLIC_API()macro call, to get the right Windows secret type qualifiers in the right places for all build variants.
- DLL entry points that are not public APIs use