On 30/03/2013, at 00:56, Isaac Schlueter wrote:
> ```javascript
> var chunk;
> while (null !== (chunk = rs.read())) {
> doSomething(chunk);
> }
> ```
I use to write code like that too but it might break it seems, look:
<https://bugs.webkit.org/show_bug.cgi?id=114594>
this works:
function works (s) {
var pos;
var n= 0;
var t;
var r= "";
var o= "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var p= "5678901234nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM";
while (n < s.length) {
t= s[n];
pos= o.indexOf(t);
r+= (pos >= 0) ? p[pos] : t;
n++;
}
return r;
}
this doesn't:
function fails (s) {
var pos, n = 0,
t, r = "",
o = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
p = "5678901234nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM";
while (n < s.length) {
r += ((pos = o.indexOf(t = s[n++])) >= 0) ? p[pos] : t;
}
return r;
}
--
( Jorge )();
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.