Closed Bug 477637 Opened 15 years ago Closed 15 years ago

Automatically detect JSAPI header-library mismatches

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 474873

People

(Reporter: jorendorff, Unassigned)

Details

A source of headaches for embedders is accidentally #including the wrong jsapi.h or linking against the wrong SpiderMonkey shared library.  The resulting behavior can be bizarre and extremely hard to track down (particularly if we've changed something like the bit-encoding of jsvals, as we did between 1.7 and 1.8).

We should detect this mistake at run time.  JS_NewRuntime can be a function-like macro that adds a parameter to the actual library call.  The added parameter is a constant, an int cookie identifying the SM version and any ABI-relevant configure options (such as --enable-threadsafe).  JS_NewRuntime should print a warning and return NULL if the version number passed in (i.e. the ABI id in the jsapi.h seen by the caller) is not exactly the library's version number (i.e. the ABI id seen by jsapi.cpp when SpiderMonkey was built).
Isn't this a dup of bug 474873 ?

/be
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.