Thanks, that's useful. I will take a look but I am not sure the string
issue is related to the error handling. If you wrap your strings in a
function it will work, e.g.
p.evaluate("function() { console.log('first message'); }");
Without the function wrapper it generates a parse error for some sort of
internal reason that I haven't investigated yet (and we don't do stack
traces for parse errors)
Jon
On 14/06/12 10:07, Ivan De Marino wrote:
> There you go:
https://gist.github.com/2929203
>
> This should show all the "weird" errors I'm getting.
>
> Particularly, I think the evaluation of code "via string" is broken. Badly.
>
> On 13 June 2012 20:10, Jon Leighton <
j...@jonathanleighton.com
> <mailto:
j...@jonathanleighton.com>> wrote:
>
> Ok, I have been able to reproduce a problem when an error occurs
> within a sub-frame of the page. I'll work up a fix and you guys can
> let me know if it solves your issues.
>
>
> On 13/06/12 20:03, Jon Leighton wrote:
>
> Sorry, I sent this before I saw your and David's replies. Didn't
> mean to
> be impatient :)
>
> On 13/06/12 19:26, Jon Leighton wrote:
>
> Hey,
>
> I can't reproduce with the following example:
>
https://gist.github.com/__2925648
> <
https://gist.github.com/2925648>
>
> Can you help me reproduce the issue please?
>
> Thanks
>
> On 12/06/12 01:00, Ivan De Marino wrote:
>
> This is mostly for Ariya and Jon, but I thought it would
> be better to
> discuss it here. Maybe others can pitch in.
>
> Check out this change I currently made on a branch of mine:
> *
https://github.com/detro/__phantomjs/commit/__47430fed501e428596ade91bfe615d__b1f73af568#diff-2*
> <
https://github.com/detro/phantomjs/commit/47430fed501e428596ade91bfe615db1f73af568#diff-2*>
>
>
>
> I had to do that because, in my experience, *if an error
> occurs in a
> Page* (not the
phantom.page, but a "normal"
> webpage),*the "error" value
> at that point of the callback handling is undefined*.
>
> Can you guys confirm?
>
> PS I think it's the *"__exception" object within the
> Page frame that is
> not defined somehow*.
> PPS This is happening within GhostDriver, that does a
> fairly complex use
> of pages, contexts and so forth. Though, even in the
> worst intricated
> mix of Javascript, I think that "__exception" should
> still be set.
> Right?
>
>
>
>
> --
>
http://jonathanleighton.com/
>
>
>
>
> --
> *Ivan De Marino*
> Coder, Technologist, Cook, Italian
>
>
blog.ivandemarino.me <
http://blog.ivandemarino.me> |
>
www.linkedin.com/in/ivandemarino
> <
http://www.linkedin.com/in/ivandemarino> |
twitter.com/detronizator
> <
http://twitter.com/detronizator>
--
http://jonathanleighton.com/