Comment #6 on issue 2524 by [email protected]: Throwing an exception in FailedAccessCheckCallback causes weird behavior.
http://code.google.com/p/v8/issues/detail?id=2524

Copy/pasting for posterity:

11:44 <mkwst> haraken: https://gist.github.com/mikewest/4753771 This is what I'm seeing. 11:45 <haraken> mkwst: the test results are different between chromium/linux and chromium/mac?
11:46 <haraken> mkwst: or between chromium/linux and safari/mac?
11:46 <mkwst> cr-mac, safari-mac.
11:47 <haraken> mkwst: then there should be a bug in V8 binding
11:47 <haraken> mkwst: what is throwing the TypeError?
11:47 <haraken> mkwst: target.location or target.location.href?
11:47 <mkwst> haraken: trying to figure that out. i'm seeing weird behavior. :) give me a moment. 11:48 <haraken> mkwst: .location and .href are handled by V8 binding (e.g. V8LocationCustom.cpp). I think the binding is throwing the TypeError incorrectly. 11:51 <mkwst> haraken: I think it's stranger than that. It looks like `console.log` is throwing the TypeError because `console` isn't defined.
11:51 <haraken> mkwst: Is target.location.href returning an expected result?
11:52 <haraken> mkwst: I would guess that V8 is not correctly handling an exception thrown inside the failed callback. 11:53 <haraken> mkwst: V8 should catch the exception and rethrow it, but it doesn't. So things continue to be running with an inconsistent state, and thus we're seeing wierd errors.
11:53 <haraken> mkwst: that's just my guess.
11:54 <haraken> mkwst: what you want to check would be
11:54 <mkwst> haraken: it looks like the SecurityErr gets thrown after the next dom manipulation. 11:54 <haraken> mkwst: (1) the failed callback is called inside target.location.href. 11:55 <haraken> mkwst: (2) the exception is caught before the execution goes through target.location.href.
11:55 <haraken> mkwst: If that's not true, it would be a bug of V8.
11:55 <mkwst> haraken: if i add 'document.write('aaaa');' after the `target.location.href;` line, then i catch a SecurityErr exception, _and_ 'aaaa' is written out. 11:56 <mkwst> haraken: i'll hand it back to the v8 folks who told me to talk to you. ;) 11:56 <haraken> mkwst: ideally, when an exception is thrown from the failed callback, the exception should be thrown before target.location.href is evaluated, right?
11:56 <haraken> mkwst: yeah, that sounds reasonable to me:)

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" 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.


Reply via email to