Hi there,
I am investigating a browser compatibility issue with Google' mobile
talk gadget (http://talkgadget.google.com/talkgadget/m). Please
compare my posting on: http://www.google.com/support/forum/...6caeb020&hl=en
-
After checking the js sources that are imported, I came across this
function
var ja = function(a) {
if (/^\s*$/ [x](a)) return c;
return /^[\],:{}\s\u2028\u2 029]*$/ [x](a[y](/\\["\\\/bfnrtu]/g,
"@")[y](/"[^"\\\n\r\u2028\ u2029\x00-\x1f\x7f-\x9f]*"|true|false|n ull|-?
\d+(?:\.\d*)?(? :[eE][+\-]?\d+)?/g, "]")[y](/(?:^|:|,)(?:[\s
\u2028\u2029]*\[)+/g, ""))
}
while it looks like x is assigned to "test" (var ... x = "test" in the
beginning of that file) and c is assigned to false.
I haven't seen this particular bit of JS syntax before:
if (/^\s*$/ [x](a)) return c;
Can anybody enlighten me what the expression for the condition
resolves to? The regexp is clear, means "check if line is only
whitespace or empty", but the rest is mysterious. For example, why is
there no logical operator? Or is the regexp applied to the [x](a) ?!?
It'd be great if anybody could point me to a piece of language
specification that clarifies this bit.
After all, it might also be that my vision is blurred and I am
completely missing something simple. In any case, thanks for your
help.
Dominik
I am investigating a browser compatibility issue with Google' mobile
talk gadget (http://talkgadget.google.com/talkgadget/m). Please
compare my posting on: http://www.google.com/support/forum/...6caeb020&hl=en
-
After checking the js sources that are imported, I came across this
function
var ja = function(a) {
if (/^\s*$/ [x](a)) return c;
return /^[\],:{}\s\u2028\u2 029]*$/ [x](a[y](/\\["\\\/bfnrtu]/g,
"@")[y](/"[^"\\\n\r\u2028\ u2029\x00-\x1f\x7f-\x9f]*"|true|false|n ull|-?
\d+(?:\.\d*)?(? :[eE][+\-]?\d+)?/g, "]")[y](/(?:^|:|,)(?:[\s
\u2028\u2029]*\[)+/g, ""))
}
while it looks like x is assigned to "test" (var ... x = "test" in the
beginning of that file) and c is assigned to false.
I haven't seen this particular bit of JS syntax before:
if (/^\s*$/ [x](a)) return c;
Can anybody enlighten me what the expression for the condition
resolves to? The regexp is clear, means "check if line is only
whitespace or empty", but the rest is mysterious. For example, why is
there no logical operator? Or is the regexp applied to the [x](a) ?!?
It'd be great if anybody could point me to a piece of language
specification that clarifies this bit.
After all, it might also be that my vision is blurred and I am
completely missing something simple. In any case, thanks for your
help.
Dominik
Comment