diff options
author | Johan Dahlin <johan@gnome.org> | 2010-03-30 20:01:45 -0300 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2017-04-07 08:47:52 -0700 |
commit | bc8f143e4a3a5407c65ebbf500d0c54598bb6104 (patch) | |
tree | a57801f66f11e7cba17671df90039ab45c5ba9c2 /modules/cairo-surface.cpp | |
parent | 3141fc0637b70414c78de997d7d78e866e02e4f6 (diff) | |
download | gjs-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.cpp | 3 |
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; |