Bug 1045900: Move the declaration of INTERNED_STRING_TO_JSID from js/src/jsapi.h to js/public/Id.h. r=jwalden

This commit is contained in:
Jim Blandy 2014-07-30 08:37:03 -07:00
parent b1d8dd8edd
commit 74a8398e27
2 changed files with 10 additions and 10 deletions

View File

@ -60,6 +60,16 @@ JSID_TO_STRING(jsid id)
return (JSString *)JSID_BITS(id);
}
/*
* Only JSStrings that have been interned via the JSAPI can be turned into
* jsids by API clients.
*
* N.B. if a jsid is backed by a string which has not been interned, that
* string must be appropriately rooted to avoid being collected by the GC.
*/
JS_PUBLIC_API(jsid)
INTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);
static MOZ_ALWAYS_INLINE bool
JSID_IS_ZERO(jsid id)
{

View File

@ -803,16 +803,6 @@ JS_NumberValue(double d)
JS_PUBLIC_API(bool)
JS_StringHasBeenInterned(JSContext *cx, JSString *str);
/*
* Only JSStrings that have been interned via the JSAPI can be turned into
* jsids by API clients.
*
* N.B. if a jsid is backed by a string which has not been interned, that
* string must be appropriately rooted to avoid being collected by the GC.
*/
JS_PUBLIC_API(jsid)
INTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);
namespace JS {
// Container class for passing in script source buffers to the JS engine. This