Skip to content

Commit

Permalink
not all msgs will be CL related, maybeother components are trying to …
Browse files Browse the repository at this point in the history
…re-use the postMessage channel.
  • Loading branch information
caridy committed Mar 26, 2012
1 parent ce55956 commit 6a61a95
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions perf/cl.js
Expand Up @@ -63,10 +63,17 @@ YUI.add('cl', function (Y, NAME) {
self._addListener(self._WIN, 'message', function (e) {
var source = e.source,
origin = e.origin,
parsed = Y.JSON.parse(e.data),
name = parsed.name,
parsed,
name,
data;

try {
parsed = Y.JSON.parse(e.data);
name = parsed && parsed.name;
} catch (err) {
Y.log('Invalid data structure as part of the message, discarded message.', INFO, NAME);
}

Y.log('Received window message: '+e.data+' from '+origin, DEBUG, NAME);

if (! name) {
Expand Down

0 comments on commit 6a61a95

Please sign in to comment.