[gjs/wip/strict: 1/2] Remove support for E4X



commit 565d810f7db4c0087d8029a078a3a45ef6ef01a2
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jul 17 12:37:33 2013 -0400

    Remove support for E4X

 gjs/context.c                   |    2 +-
 installed-tests/js/testGDBus.js |  156 ++++++++++++++++++++-------------------
 modules/overrides/Gio.js        |   18 +----
 3 files changed, 81 insertions(+), 95 deletions(-)
---
diff --git a/gjs/context.c b/gjs/context.c
index c9353d7..b9d4a07 100644
--- a/gjs/context.c
+++ b/gjs/context.c
@@ -587,7 +587,7 @@ gjs_context_constructor (GType                  type,
      *
      * JSOPTION_STRICT: Report warnings to error reporter function.
      */
-    options_flags = JSOPTION_DONT_REPORT_UNCAUGHT | JSOPTION_STRICT | JSOPTION_ALLOW_XML;
+    options_flags = JSOPTION_DONT_REPORT_UNCAUGHT | JSOPTION_STRICT;
 
     if (!g_getenv("GJS_DISABLE_JIT")) {
         gjs_debug(GJS_DEBUG_CONTEXT, "Enabling JIT");
diff --git a/installed-tests/js/testGDBus.js b/installed-tests/js/testGDBus.js
index 53dc766..8cae611 100644
--- a/installed-tests/js/testGDBus.js
+++ b/installed-tests/js/testGDBus.js
@@ -4,83 +4,85 @@ const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
 const Mainloop = imports.mainloop;
 
-/* The methods list with their signatures.
- *
- * *** NOTE: If you add stuff here, you need to update testIntrospectReal
- */
-var TestIface = <interface name="org.gnome.gjs.Test">
-<method name="nonJsonFrobateStuff">
-    <arg type="i" direction="in"/>
-    <arg type="s" direction="out"/>
-</method>
-<method name="frobateStuff">
-    <arg type="a{sv}" direction="in"/>
-    <arg type="a{sv}" direction="out"/>
-</method>
-<method name="alwaysThrowException">
-    <arg type="a{sv}" direction="in"/>
-    <arg type="a{sv}" direction="out"/>
-</method>
-<method name="thisDoesNotExist"/>
-<method name="noInParameter">
-    <arg type="s" direction="out"/>
-</method>
-<method name="multipleInArgs">
-    <arg type="i" direction="in"/>
-    <arg type="i" direction="in"/>
-    <arg type="i" direction="in"/>
-    <arg type="i" direction="in"/>
-    <arg type="i" direction="in"/>
-    <arg type="s" direction="out"/>
-</method>
-<method name="noReturnValue"/>
-<method name="emitSignal"/>
-<method name="multipleOutValues">
-    <arg type="s" direction="out"/>
-    <arg type="s" direction="out"/>
-    <arg type="s" direction="out"/>
-</method>
-<method name="oneArrayOut">
-    <arg type="as" direction="out"/>
-</method>
-<method name="arrayOfArrayOut">
-    <arg type="aas" direction="out"/>
-</method>
-<method name="multipleArrayOut">
-    <arg type="as" direction="out"/>
-    <arg type="as" direction="out"/>
-</method>
-<method name="arrayOutBadSig">
-    <arg type="i" direction="out"/>
-</method>
-<method name="byteArrayEcho">
-    <arg type="ay" direction="in"/>
-    <arg type="ay" direction="out"/>
-</method>
-<method name="byteEcho">
-    <arg type="y" direction="in"/>
-    <arg type="y" direction="out"/>
-</method>
-<method name="dictEcho">
-    <arg type="a{sv}" direction="in"/>
-    <arg type="a{sv}" direction="out"/>
-</method>
-<method name="echo">
-    <arg type="s" direction="in"/>
-    <arg type="i" direction="in"/>
-    <arg type="s" direction="out"/>
-    <arg type="i" direction="out"/>
-</method>
-<method name="structArray">
-    <arg type="a(ii)" direction="out"/>
-</method>
-<signal name="signalFoo">
-    <arg type="s" direction="out"/>
-</signal>
-<property name="PropReadOnly" type="b" access="read" />
-<property name="PropWriteOnly" type="s" access="write" />
-<property name="PropReadWrite" type="v" access="readwrite" />
-</interface>
+function M() {
+    return [].slice.call(arguments).join('\n');
+}
+
+var TestIface = M('<node>',
+'<interface name="org.gnome.gjs.Test">',
+'<method name="nonJsonFrobateStuff">',
+'    <arg type="i" direction="in"/>',
+'    <arg type="s" direction="out"/>',
+'</method>',
+'<method name="frobateStuff">',
+'    <arg type="a{sv}" direction="in"/>',
+'    <arg type="a{sv}" direction="out"/>',
+'</method>',
+'<method name="alwaysThrowException">',
+'    <arg type="a{sv}" direction="in"/>',
+'    <arg type="a{sv}" direction="out"/>',
+'</method>',
+'<method name="thisDoesNotExist"/>',
+'<method name="noInParameter">',
+'    <arg type="s" direction="out"/>',
+'</method>',
+'<method name="multipleInArgs">',
+'    <arg type="i" direction="in"/>',
+'    <arg type="i" direction="in"/>',
+'    <arg type="i" direction="in"/>',
+'    <arg type="i" direction="in"/>',
+'    <arg type="i" direction="in"/>',
+'    <arg type="s" direction="out"/>',
+'</method>',
+'<method name="noReturnValue"/>',
+'<method name="emitSignal"/>',
+'<method name="multipleOutValues">',
+'    <arg type="s" direction="out"/>',
+'    <arg type="s" direction="out"/>',
+'    <arg type="s" direction="out"/>',
+'</method>',
+'<method name="oneArrayOut">',
+'    <arg type="as" direction="out"/>',
+'</method>',
+'<method name="arrayOfArrayOut">',
+'    <arg type="aas" direction="out"/>',
+'</method>',
+'<method name="multipleArrayOut">',
+'    <arg type="as" direction="out"/>',
+'    <arg type="as" direction="out"/>',
+'</method>',
+'<method name="arrayOutBadSig">',
+'    <arg type="i" direction="out"/>',
+'</method>',
+'<method name="byteArrayEcho">',
+'    <arg type="ay" direction="in"/>',
+'    <arg type="ay" direction="out"/>',
+'</method>',
+'<method name="byteEcho">',
+'    <arg type="y" direction="in"/>',
+'    <arg type="y" direction="out"/>',
+'</method>',
+'<method name="dictEcho">',
+'    <arg type="a{sv}" direction="in"/>',
+'    <arg type="a{sv}" direction="out"/>',
+'</method>',
+'<method name="echo">',
+'    <arg type="s" direction="in"/>',
+'    <arg type="i" direction="in"/>',
+'    <arg type="s" direction="out"/>',
+'    <arg type="i" direction="out"/>',
+'</method>',
+'<method name="structArray">',
+'    <arg type="a(ii)" direction="out"/>',
+'</method>',
+'<signal name="signalFoo">',
+'    <arg type="s" direction="out"/>',
+'</signal>',
+'<property name="PropReadOnly" type="b" access="read" />',
+'<property name="PropWriteOnly" type="s" access="write" />',
+'<property name="PropReadWrite" type="v" access="readwrite" />',
+'</interface>',
+'</node>');
 
 /* Test is the actual object exporting the dbus methods */
 function Test() {
diff --git a/modules/overrides/Gio.js b/modules/overrides/Gio.js
index 8f543ef..fb3d372 100644
--- a/modules/overrides/Gio.js
+++ b/modules/overrides/Gio.js
@@ -222,23 +222,7 @@ function _newNodeInfo(constructor, value) {
 }
 
 function _newInterfaceInfo(value) {
-    var xml;
-    if (typeof value == 'string')
-        xml = new XML(value);
-    else if (value instanceof XML)
-        xml = value;
-    else
-        throw TypeError('Invalid type ' + Object.prototype.toString.call(value));
-
-    var node;
-    if (xml.name() == 'interface') {
-        // wrap inside a node
-        node = <node/>;
-        node.node += xml;
-    } else
-        node = xml;
-
-    var nodeInfo = Gio.DBusNodeInfo.new_for_xml(node);
+    var nodeInfo = Gio.DBusNodeInfo.new_for_xml(value);
     return nodeInfo.interfaces[0];
 }
 


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