summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2012-07-04 22:31:08 +0200
committerGiovanni Campagna <gcampagna@src.gnome.org>2012-08-07 21:36:31 +0200
commite8a9d36c90d4a6bbf17b9275b838296b3b28e80a (patch)
tree6edcd30a706e2a05b28f51a16a024cd7b78da743
parentb0557046f3551c90449cd60a2bcbe66d40851281 (diff)
downloadgjs-e8a9d36c90d4a6bbf17b9275b838296b3b28e80a.tar.gz
GIRepositoryFunction: don't install a resolve hook
GI functions don't have lazy properties, so they don't need a resolve hook. This is mainly a code cleanup. https://bugzilla.gnome.org/show_bug.cgi?id=679688
-rw-r--r--gi/function.c45
1 files changed, 2 insertions, 43 deletions
diff --git a/gi/function.c b/gi/function.c
index a4209d21..111a803d 100644
--- a/gi/function.c
+++ b/gi/function.c
@@ -67,45 +67,6 @@ static GSList *completed_trampolines = NULL; /* GjsCallbackTrampoline */
GJS_DEFINE_PRIV_FROM_JS(Function, gjs_function_class)
-/*
- * Like JSResolveOp, but flags provide contextual information as follows:
- *
- * JSRESOLVE_QUALIFIED a qualified property id: obj.id or obj[id], not id
- * JSRESOLVE_ASSIGNING obj[id] is on the left-hand side of an assignment
- * JSRESOLVE_DETECTING 'if (o.p)...' or similar detection opcode sequence
- * JSRESOLVE_DECLARING var, const, or function prolog declaration opcode
- * JSRESOLVE_CLASSNAME class name used when constructing
- *
- * The *objp out parameter, on success, should be null to indicate that id
- * was not resolved; and non-null, referring to obj or one of its prototypes,
- * if id was resolved.
- */
-static JSBool
-function_new_resolve(JSContext *context,
- JSObject *obj,
- jsid id,
- uintN flags,
- JSObject **objp)
-{
- Function *priv;
- char *name;
-
- *objp = NULL;
-
- if (!gjs_get_string_id(context, id, &name))
- return JS_TRUE; /* not resolved, but no error */
-
- priv = priv_from_js(context, obj);
-
- gjs_debug_jsprop(GJS_DEBUG_GFUNCTION, "Resolve prop '%s' hook obj %p priv %p", name, obj, priv);
- g_free(name);
-
- if (priv == NULL)
- return JS_TRUE; /* we are the prototype, or have the wrong class */
-
- return JS_TRUE;
-}
-
void
gjs_callback_trampoline_ref(GjsCallbackTrampoline *trampoline)
{
@@ -1429,15 +1390,13 @@ function_to_string (JSContext *context,
*/
static struct JSClass gjs_function_class = {
"GIRepositoryFunction", /* means "new GIRepositoryFunction()" works */
- JSCLASS_HAS_PRIVATE |
- JSCLASS_NEW_RESOLVE |
- JSCLASS_NEW_RESOLVE_GETS_START,
+ JSCLASS_HAS_PRIVATE,
JS_PropertyStub,
JS_PropertyStub,
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
- (JSResolveOp) function_new_resolve, /* needs cast since it's the new resolve signature */
+ JS_ResolveStub,
JS_ConvertStub,
function_finalize,
NULL,