changeset 59:b2d7ea4e37b9

Use void 0 instead of null
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Sun, 17 Feb 2013 18:00:59 +0100
parents 0e3844b99811
children 6a784ff11d14
files dw.js index.html
diffstat 2 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/dw.js	Sun Feb 17 17:26:03 2013 +0100
+++ b/dw.js	Sun Feb 17 18:00:59 2013 +0100
@@ -28,7 +28,7 @@
             var tile = self.get(x, y);
             var key = module.key[tile];
             if (!key) {
-                return null;
+                return void 0;
             }
             if (key[prop]) {
                 return key[prop];
@@ -36,11 +36,11 @@
             if (key.tile) {
                 key = module.key[key.tile];
                 if (!key) {
-                    return null;
+                    return void 0;
                 }
                 return key[prop];
             }
-            return null;
+            return void 0;
         }
 
         self.find = function (tile) {
@@ -51,7 +51,7 @@
                     return [x, y];
                 }
             }
-            return null;
+            return void 0;
         };
 
         function Square(x, y) {
@@ -242,7 +242,7 @@
                     var sprite = module.find_sprite(nx, ny);
                     if (sprite) {
                         var s = module.field.get_prop(nx, ny, 'unlock_sprite');
-                        if (s !== null) {
+                        if (s !== void 0) {
                             sprite.set_image(s);
                         };
                     };
@@ -257,7 +257,7 @@
                         module.Message("You have " + give + " now.");
                         self.add_item(give);
                         var s = module.field.get_prop(nx, ny, 'give_sprite');
-                        if (s !== null) {
+                        if (s !== void 0) {
                             var sprite = module.find_sprite(nx, ny);
                             if (sprite) {
                                 sprite.set_image(s);
--- a/index.html	Sun Feb 17 17:26:03 2013 +0100
+++ b/index.html	Sun Feb 17 18:00:59 2013 +0100
@@ -97,7 +97,6 @@
                 'tile': '.',
                 'sprite': "key.png",
                 'give': "key",
-                'give_sprite': "",
             },
             'h': {
                 'tile': '.',