Changeset 7920
- Timestamp:
- 10/15/07 17:19:16 (11 months ago)
- Files:
-
- spinoffs/prototype/trunk/CHANGELOG (modified) (1 diff)
- spinoffs/prototype/trunk/src/array.js (modified) (1 diff)
- spinoffs/prototype/trunk/test/unit/array.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinoffs/prototype/trunk/CHANGELOG
r7877 r7920 1 1 *SVN* 2 3 * Make sure $w always returns an array. [Andrew Dupont, Tobie Langel] 2 4 3 5 * Add more tests to Hash. [Mislav Marohnić] spinoffs/prototype/trunk/src/array.js
r7876 r7920 129 129 130 130 function $w(string) { 131 if (!Object.isString(string)) return []; 131 132 string = string.strip(); 132 133 return string ? string.split(/\s+/) : []; spinoffs/prototype/trunk/test/unit/array.html
r7193 r7920 205 205 assertEnumEqual(['a', 'b', 'c', 'd'], $w('a b c d')); 206 206 assertEnumEqual([], $w(' ')); 207 assertEnumEqual([], $w('')); 208 assertEnumEqual([], $w(null)); 209 assertEnumEqual([], $w(undefined)); 210 assertEnumEqual([], $w()); 211 assertEnumEqual([], $w(10)); 207 212 assertEnumEqual(['a'], $w('a')); 208 213 assertEnumEqual(['a'], $w('a '));