[gjs] console: Default interact version to JavaScript 1.8



commit 39cf5d2f51dcad72a7e175f21a3ffe602b5dd4b3
Author: Colin Walters <walters verbum org>
Date:   Fri May 27 14:09:56 2011 -0400

    console: Default interact version to JavaScript 1.8
    
    We were inconsistent in our default version handling; for scripts
    and command line arguments we used the #define from context.c,
    but for simply "gjs" we used "default", i.e. 1.5.
    
    This is broken since many overrides like dbus.js haven't been
    down-ported to 1.5.

 gjs/console.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gjs/console.c b/gjs/console.c
index 1d0b10f..12c6d62 100644
--- a/gjs/console.c
+++ b/gjs/console.c
@@ -76,7 +76,7 @@ main(int argc, char **argv)
         len = strlen(script);
         filename = "<command line>";
     } else if (argc <= 1) {
-        source_js_version = "default";
+        source_js_version = NULL;
         script = g_strdup("const Console = imports.console; Console.interact();");
         len = strlen(script);
         filename = "<stdin>";
@@ -94,8 +94,11 @@ main(int argc, char **argv)
     /* If user explicitly specifies a version, use it */
     if (js_version != NULL)
         source_js_version = js_version;
-    js_context = g_object_new(GJS_TYPE_CONTEXT, "search-path", include_path,
-                              "js-version", source_js_version, NULL);
+    if (source_js_version != NULL)
+        js_context = g_object_new(GJS_TYPE_CONTEXT, "search-path", include_path,
+                                  "js-version", source_js_version, NULL);
+    else
+        js_context = g_object_new(GJS_TYPE_CONTEXT, "search-path", include_path, NULL);
 
     /* prepare command line arguments */
     if (!gjs_context_define_string_array(js_context, "ARGV",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]