jsapi.h and jsfriendapi.h are mega-huge, monolithic headers. A one-stop shop is maybe (maybe) convenient for users. But it's terrible for Gecko and SpiderMonkey: touching jsapi.h rebuilds the world. (The one-stop shop approach is also pretty terrible for users because js*api.h are unreadable, disorganized messes.)
SpiderMonkey hackers are gradually splitting jsapi.h and jsfriendapi.h into many separate headers containing sensible, readable subsets of documented API. We want to let you skim js/public/* to find the likely header, then read it to see what's in it. (This doesn't substitute for real docs, but it's a big help.) I just took a notable step in the direction of splitting up jsapi.h. Specifically: Every function in jsapi.h that compiles/evaluates JavaScript on the main thread now requires #include "js/CompilationAndEvaluation.h". You must #include *that specific header* to compile/execute scripts. (Off-thread compilation isn't fully moved to its own header, so jsapi.h still provides all that stuff still.) And if you need to create a JS::SourceBufferHolder to call a compilation API, you must #include "js/SourceBufferHolder.h". Headers only need a forward-declared JS::SourceBufferHolder; if you want to *create* a JS::SourceBufferHolder you must get the definition yourself. I fixed existing code: you just need to know bootlegging script-evaluation APIs will fail now. More changes to split up jsapi.h and jsfriendapi.h are coming, in no particular time frame. Jeff _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform