~ubuntu-branches/ubuntu/wily/mediatomb/wily

« back to all changes in this revision

Viewing changes to src/scripting/playlist_parser_script.cc

  • Committer: Package Import Robot
  • Author(s): Logan Rosen
  • Date: 2013-12-28 23:22:35 UTC
  • mfrom: (4.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20131228232235-uhxpo82dnqa3cw95
Tags: 0.12.1-5ubuntu1
Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
extern "C" {
47
47
 
48
48
static JSBool
49
 
js_readln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 
49
js_readln(JSContext *cx, uintN argc, jsval *argv)
50
50
{
51
 
    PlaylistParserScript *self = (PlaylistParserScript *)JS_GetPrivate(cx, obj);
 
51
    PlaylistParserScript *self = (PlaylistParserScript *)JS_GetPrivate(cx, JS_THIS_OBJECT(cx, argv));
52
52
 
53
53
    String line;
54
54
    
69
69
 
70
70
    JSString *jsline = JS_NewStringCopyZ(cx, line.c_str());
71
71
 
72
 
    *rval = STRING_TO_JSVAL(jsline);
 
72
    JS_SET_RVAL(cx, argv, STRING_TO_JSVAL(jsline));
73
73
  
74
74
    return JS_TRUE;
75
75
}
93
93
 
94
94
        String scriptPath = ConfigManager::getInstance()->getOption(CFG_IMPORT_SCRIPTING_PLAYLIST_SCRIPT); 
95
95
        load(scriptPath);
96
 
        root = JS_NewScriptObject(cx, script);
97
 
        JS_AddNamedRoot(cx, &root, "PlaylistScript");
 
96
        root = JS_NewObject(cx, NULL, script, NULL);
 
97
        JS_AddNamedObjectRoot(cx, &root, "PlaylistScript");
98
98
    }
99
99
    catch (Exception ex)
100
100
    {
245
245
#endif
246
246
 
247
247
    if (root)
248
 
        JS_RemoveRoot(cx, &root);
 
248
        JS_RemoveObjectRoot(cx, &root);
249
249
 
250
250
#ifdef JS_THREADSAFE
251
251
    JS_EndRequest(cx);