summaryrefslogtreecommitdiff
path: root/modules/cairo-surface.cpp
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-03-30 20:01:45 -0300
committerPhilip Chimento <philip.chimento@gmail.com>2017-04-07 08:47:52 -0700
commitbc8f143e4a3a5407c65ebbf500d0c54598bb6104 (patch)
treea57801f66f11e7cba17671df90039ab45c5ba9c2 /modules/cairo-surface.cpp
parent3141fc0637b70414c78de997d7d78e866e02e4f6 (diff)
downloadgjs-bc8f143e4a3a5407c65ebbf500d0c54598bb6104.tar.gz
Send in prototype to JS_NewObject
Send in a reference to the prototype to JS_NewObject, this makes sure that the created object contains all properties from the prototypes. This makes it possible to call Cairo.Context methods on wrappers created from API created through introspection. https://bugzilla.gnome.org/show_bug.cgi?id=614413
Diffstat (limited to 'modules/cairo-surface.cpp')
-rw-r--r--modules/cairo-surface.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/cairo-surface.cpp b/modules/cairo-surface.cpp
index abfb3132..9d2d0f7f 100644
--- a/modules/cairo-surface.cpp
+++ b/modules/cairo-surface.cpp
@@ -206,7 +206,8 @@ gjs_cairo_surface_from_surface(JSContext *context,
return gjs_cairo_svg_surface_from_surface(context, surface);
JS::RootedObject object(context,
- JS_NewObject(context, &gjs_cairo_surface_class));
+ JS_NewObjectWithGivenProto(context, &gjs_cairo_surface_class,
+ gjs_cairo_surface_prototype));
if (!object) {
gjs_throw(context, "failed to create surface");
return NULL;