Skip to content

camp.handle problem when path[0] is not defined #15

Closed
jankeromnes opened this Issue Feb 27, 2012 · 5 comments

2 participants

@jankeromnes
Collaborator

Works:

camp.handle('/types.html', function (query, path) {
  path[0] = '/types.html';
  camp.server.emit('gottypes', data);
}, function gottypes (data) {
  return data;
});

Doesn't work (the page is never delivered):

camp.handle('/types.html', function (query, path) {
  // nothing
  camp.server.emit('gottypes', data);
}, function gottypes (data) {
  return data;
});

I think this is a problem.

@espadrine
Owner

Cannot reproduce. I tried that exact snippet of code (with a sensible value for data), and it works fine.

Tell me more about it. console.log it.

@jankeromnes
Collaborator

I'll try to reproduce soon. The snippet wasn't exactly like that: the camp.emit really was deferred. I'll let you know.

@espadrine
Owner

I'll be waiting then.

@espadrine
Owner

Can you see if the problem still occurs with 9e3d2e2 ?

@espadrine
Owner

@jankeromnes I'll close this issue tomorrow unless you find that it still happens to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.