Bug 873730. Make JS_SourceHook take a Handle for the JSScript. r=till

This commit is contained in:
Boris Zbarsky 2013-05-18 23:09:11 -04:00
parent 3bbf4c8611
commit 9b8ebb7008
2 changed files with 4 additions and 2 deletions

View File

@ -177,7 +177,8 @@ struct JSFunctionSpecWithHelp {
extern JS_FRIEND_API(bool)
JS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWithHelp *fs);
typedef bool (* JS_SourceHook)(JSContext *cx, JSScript *script, jschar **src, uint32_t *length);
typedef bool (* JS_SourceHook)(JSContext *cx, JS::Handle<JSScript*> script,
jschar **src, uint32_t *length);
extern JS_FRIEND_API(void)
JS_SetSourceHook(JSRuntime *rt, JS_SourceHook hook);

View File

@ -2601,7 +2601,8 @@ ReadSourceFromFilename(JSContext *cx, const char *filename, jschar **src, uint32
function. See the comment in the XPCJSRuntime constructor.
*/
static bool
SourceHook(JSContext *cx, JSScript *script, jschar **src, uint32_t *length)
SourceHook(JSContext *cx, JS::Handle<JSScript*> script, jschar **src,
uint32_t *length)
{
*src = NULL;
*length = 0;