[gjs] tests: Update for new strict mode semantics



commit 9d4f7653aae54126390469337095bda198c50968
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Dec 12 00:55:14 2012 -0500

    tests: Update for new strict mode semantics
    
    Writing to a read-only / permanent property now throw an error,
    not silently fail.

 test/js/testGIMarshalling.js |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/test/js/testGIMarshalling.js b/test/js/testGIMarshalling.js
index 0155b66..889dd47 100644
--- a/test/js/testGIMarshalling.js
+++ b/test/js/testGIMarshalling.js
@@ -244,11 +244,18 @@ function testGType() {
     assertEquals("gchararray", GObject.TYPE_STRING.name);
 
     // Make sure "name" is readonly
-    GObject.TYPE_STRING.name = "foo";
+    try {
+        GObject.TYPE_STRING.name = "foo";
+    } catch(e) {
+    }
     assertEquals("gchararray", GObject.TYPE_STRING.name);
 
     // Make sure "name" is permanent
-    assertFalse((delete GObject.TYPE_STRING.name));
+    try {
+        delete GObject.TYPE_STRING.name;
+    } catch(e) {
+    }
+    assertEquals("gchararray", GObject.TYPE_STRING.name);
 
     // Make sure "toString" works
     assertEquals("[object GType for 'void']", GObject.TYPE_NONE.toString());



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