Level 15 (exceptionalCrossing.js)?

Solution 1:

You can put anything in there that doesn't exist. eg

player.killedBy(nothing);

When you go in the water it will then throw an error message because nothing doesn't exist.

Solution 2:

Actually you can pass the level without throwing any exception, just hacking the code:

[line 32] player.killedBy('
');},'onCollision':function(player){map.getWidth(
);

Just replacing the "onCollision" action again with a function that doesn't do anything.
enter image description here

Then you can walk on water!!

Solution 3:

You can use concatenation and short circuit the collision detection routine i.e.

map.defineObject('water', {
    'symbol': '░',
    'color': '#44f',
    'onCollision': function (player) {
        player.killedBy(''+map.placePlayer(1,1));
    }
});