comparison lib/js/urweb.js @ 828:14a6c0971d89

String.length
author Adam Chlipala <adamc@hcoop.net>
date Sat, 30 May 2009 09:59:10 -0400
parents be0988e46336
children 20fe00fd81da
comparison
equal deleted inserted replaced
827:497c7dbcc695 828:14a6c0971d89
235 x.sources = null; 235 x.sources = null;
236 x.closures = null; 236 x.closures = null;
237 x.innerHTML = html; 237 x.innerHTML = html;
238 addNode(x); 238 addNode(x);
239 runScripts(x); 239 runScripts(x);
240 alert("HTML:\n" + html);
241 } 240 }
242 241
243 var thisScript = null; 242 var thisScript = null;
244 243
245 function runScripts(node) { 244 function runScripts(node) {
349 } 348 }
350 349
351 function ts(x) { return x.toString() } 350 function ts(x) { return x.toString() }
352 function bs(b) { return (b ? "True" : "False") } 351 function bs(b) { return (b ? "True" : "False") }
353 352
354 function sub(x, i) { return x[i]; } 353 function sub(s, i) { return s[i]; }
355 function suf(x, i) { return x.substring(i); } 354 function suf(s, i) { return s.substring(i); }
355 function slen(s) { return s.length; }
356 356
357 function pi(s) { 357 function pi(s) {
358 var r = parseInt(s); 358 var r = parseInt(s);
359 if (r.toString() == s) 359 if (r.toString() == s)
360 return r; 360 return r;