[gom] examples: Fix JavaScript example



commit 7a71f41cc7bf6ee9171a2bc0ea051ff514e5759d
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Mar 14 10:36:12 2017 +0100

    examples: Fix JavaScript example
    
    It worked, but would cause crashes when extended.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=779843

 examples/gom.js |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/examples/gom.js b/examples/gom.js
index f53e09d..bcb8920 100644
--- a/examples/gom.js
+++ b/examples/gom.js
@@ -23,17 +23,14 @@ const ItemClass = new Lang.Class({
                                        ''),
     },
 
-    _init: function(params) {
-        this.parent(params);
-
-        Gom.Resource.set_table.call(this, 'items');
-        Gom.Resource.set_primary_key.call(this, 'id');
-    },
-
     _instance_init: function() {
     },
 });
 
+Gom.Resource.set_table.call(ItemClass, 'items');
+Gom.Resource.set_primary_key.call(ItemClass, 'id');
+
+
 // Open
 let adapter = new Gom.Adapter;
 adapter.open_sync('/tmp/gom-js-test.db');


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