diff options
| author | hallgren <hallgren@chalmers.se> | 2010-04-30 14:55:56 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2010-04-30 14:55:56 +0000 |
| commit | 329c39b4d4e90a517b1e19aaed7d4d1494e7d475 (patch) | |
| tree | 1bfb0f3b7535fefb4aff0e4176fde816afb435be /src/runtime/javascript/minibar/support.js | |
| parent | 593f104bc1852be9690d870153dc2ba251490040 (diff) | |
Merge phrasebook.js into minibar.js
Diffstat (limited to 'src/runtime/javascript/minibar/support.js')
| -rw-r--r-- | src/runtime/javascript/minibar/support.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/runtime/javascript/minibar/support.js b/src/runtime/javascript/minibar/support.js index 2161ff650..e2240624c 100644 --- a/src/runtime/javascript/minibar/support.js +++ b/src/runtime/javascript/minibar/support.js @@ -117,7 +117,10 @@ function swap(a,i,j) { // Note: this doesn't work on strings. return a; } -function sort(a) { // Note: this doesn't work on strings. +function sort(a) { +// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/sort + return a.sort; + /* // Note: this doesn't work on strings. for(var i=0;i<a.length-1;i++) { var min=i; for(var j=i+1;j<a.length;j++) @@ -125,6 +128,7 @@ function sort(a) { // Note: this doesn't work on strings. if(min!=i) swap(a,i,min); } return a; + */ } function filter(p,xs) { @@ -143,6 +147,9 @@ function implode(cs) { // array of strings to string */ return cs.join(""); } + +function hasPrefix(s,pre) { return s.substr(0,pre.length)==pre; } + /* function all(p,xs) { for(var i=0;i<xs.length;i++) |
