Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | * If selection was an array, returns an object of key/values (value is null if not found), |
42 | 42 | * If selection was not passed or invalid, will return the 'values' object member (be careful as |
43 | 43 | * objects are always passed by reference in JavaScript!). |
44 | | - * @return Map |
| 44 | + * @return Values as a string or object, null if invalid/inexistant. |
45 | 45 | */ |
46 | 46 | Map.prototype.get = function( selection, fallback ) { |
47 | 47 | if ( $.isArray( selection ) ) { |
— | — | @@ -59,7 +59,11 @@ |
60 | 60 | } |
61 | 61 | return this.values[selection]; |
62 | 62 | } |
63 | | - return this.values; |
| 63 | + if ( selection === undefined ) { |
| 64 | + return this.values; |
| 65 | + } else { |
| 66 | + return null; // invalid selection key |
| 67 | + } |
64 | 68 | }; |
65 | 69 | |
66 | 70 | /** |