~ubuntu-branches/ubuntu/saucy/gjs/saucy

« back to all changes in this revision

Viewing changes to gjs/context.c

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2013-08-23 11:54:16 UTC
  • mfrom: (1.10.10)
  • Revision ID: package-import@ubuntu.com-20130823115416-nx92f38l0oftvitt
Tags: 1.37.6-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
    JS_BeginRequest(context);
201
201
 
202
202
    str = g_string_new("");
203
 
    (void)JS_EnterLocalRootScope(context);
204
203
    for (n = 0; n < argc; ++n) {
205
204
        JSExceptionState *exc_state;
206
205
        JSString *jstr;
217
216
 
218
217
        if (jstr != NULL) {
219
218
            if (!gjs_string_to_utf8(context, STRING_TO_JSVAL(jstr), &s)) {
220
 
                JS_LeaveLocalRootScope(context);
221
219
                JS_EndRequest(context);
222
220
                g_string_free(str, TRUE);
223
221
                return JS_FALSE;
228
226
            if (n < (argc-1))
229
227
                g_string_append_c(str, ' ');
230
228
        } else {
231
 
            JS_LeaveLocalRootScope(context);
232
229
            JS_EndRequest(context);
233
230
            *buffer = g_string_free(str, TRUE);
234
231
            if (!*buffer)
237
234
        }
238
235
 
239
236
    }
240
 
    JS_LeaveLocalRootScope(context);
241
237
    *buffer = g_string_free(str, FALSE);
242
238
 
243
239
    JS_EndRequest(context);
595
591
 
596
592
    if (!g_getenv("GJS_DISABLE_JIT")) {
597
593
        gjs_debug(GJS_DEBUG_CONTEXT, "Enabling JIT");
598
 
        options_flags |= JSOPTION_METHODJIT;
 
594
        options_flags |= JSOPTION_METHODJIT | JSOPTION_TYPE_INFERENCE;
599
595
    }
600
596
 
601
597
    JS_SetOptions(js_context->context,
634
630
                           JSPROP_READONLY | JSPROP_PERMANENT))
635
631
        g_error("No memory to export global object as 'window'");
636
632
 
 
633
    if (!JS_InitReflect(js_context->context, js_context->global))
 
634
        g_error("Failed to register Reflect Parser Api");
 
635
 
637
636
    /* Define a global function called log() */
638
637
    if (!JS_DefineFunction(js_context->context, js_context->global,
639
638
                           "log",