~ubuntu-branches/ubuntu/raring/gjs/raring

« back to all changes in this revision

Viewing changes to gi/ns.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-03-13 19:15:08 UTC
  • mfrom: (1.6.7)
  • Revision ID: package-import@ubuntu.com-20120313191508-k44let6s97mb45uv
Tags: 1.31.20-0ubuntu1
* New upstream release.
* Add gir package
* debian/control.in: Require minimum glib 2.31
* Drop all patches since they've been applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
 
100
100
    info = g_irepository_find_by_name(repo, priv->namespace, name);
101
101
    if (info == NULL) {
102
 
        /* Special-case fallback hack for GParamSpec */
103
 
        if (strcmp(name, "ParamSpec") == 0 &&
104
 
            strcmp(priv->namespace, "GLib") == 0) {
105
 
            if (!gjs_define_param_class(context,
106
 
                                        obj,
107
 
                                        NULL)) {
108
 
                JS_EndRequest(context);
109
 
                goto out;
110
 
            } else {
111
 
                *objp = obj; /* we defined the property in this object */
112
 
                JS_EndRequest(context);
113
 
                ret = JS_TRUE;
114
 
                goto out;
115
 
            }
116
 
        } else {
117
 
            /* No property defined, but no error either, so return TRUE */
118
 
            JS_EndRequest(context);
119
 
            ret = JS_TRUE;
120
 
            goto out;
121
 
        }
 
102
        /* No property defined, but no error either, so return TRUE */
 
103
        JS_EndRequest(context);
 
104
        ret = JS_TRUE;
 
105
        goto out;
122
106
    }
123
107
 
124
108
    gjs_debug(GJS_DEBUG_GNAMESPACE,
145
129
    return ret;
146
130
}
147
131
 
148
 
/* If we set JSCLASS_CONSTRUCT_PROTOTYPE flag, then this is called on
149
 
 * the prototype in addition to on each instance. When called on the
150
 
 * prototype, "obj" is the prototype, and "retval" is the prototype
151
 
 * also, but can be replaced with another object to use instead as the
152
 
 * prototype. If we don't set JSCLASS_CONSTRUCT_PROTOTYPE we can
153
 
 * identify the prototype as an object of our class with NULL private
154
 
 * data.
155
 
 */
156
132
GJS_NATIVE_CONSTRUCTOR_DECLARE(ns)
157
133
{
158
134
    GJS_NATIVE_CONSTRUCTOR_VARIABLES(ns)
159
135
    Ns *priv;
160
136
 
161
 
    (void) argv;
162
 
 
163
137
    GJS_NATIVE_CONSTRUCTOR_PRELUDE(ns);
164
138
 
165
139
    priv = g_slice_new0(Ns);