[seed] Adding GIRepository hidden inside Seed.js context



commit 98e7c9d330a3c83c09c79181eb4f83437c13b41a
Author: Danilo Cesar Lemes de Paula <danilo cesar collabora co uk>
Date:   Thu Oct 6 14:26:10 2016 -0300

    Adding GIRepository hidden inside Seed.js context
    
    Seed.js content is visible from the main Javascript context.
    That means that an object trying to use "GIRepository" as global var
    will get an error.
    
    Seed.js should hide GIRepository in an anonymous context to use it.

 jsextensions/Seed.js.in      |    2 ++
 tests/javascript/Makefile.am |    1 -
 2 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/jsextensions/Seed.js.in b/jsextensions/Seed.js.in
index 3c66fa2..27341bc 100644
--- a/jsextensions/Seed.js.in
+++ b/jsextensions/Seed.js.in
@@ -63,8 +63,10 @@ if(!imports.searchPath || (imports.searchPath.length == 0))
 // TODO: This will work, but won't work if not installed
 // that's a bit OK at the moment, as Seed doesn't work properly uninstalled anyway.
 // But it should be fixed soon!
+(function(){
 const GIRepository = imports.gi.GIRepository;
 GIRepository.Repository.prepend_search_path("%pkglibdir%/girepository-1.0/");
+})()
 
 Seed.sprintf = function ()
 {
diff --git a/tests/javascript/Makefile.am b/tests/javascript/Makefile.am
index d85904c..b25bf8c 100644
--- a/tests/javascript/Makefile.am
+++ b/tests/javascript/Makefile.am
@@ -79,7 +79,6 @@ TESTS = \
 XFAIL_TESTS = \
        gerror.js \
        gdk-event.js \
-       object-info.js \
        property-glib-exception.js \
        $(NULL)
 


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