Opened 9 years ago
Closed 9 years ago
#15441 closed defect (fixed)
Parser swallows errors
Reported by: | Mike Wilcox | Owned by: | Kitson Kelly |
---|---|---|---|
Priority: | blocker | Milestone: | 1.8 |
Component: | Parser | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
A recent commit that allows the parser to asynchronously load AMD packages using promises, which I've tracked down as the culprit to swallowing errors.
For a test, simply add something like: foo=bar; (undefined global var) in a postCreate in a widget that is parsed in markup.
I was under the impression that this async parse feature would be an opt-in?
Refs: #15118 Commit: [28464/dojo]
Attachments (1)
Change History (7)
comment:1 Changed 9 years ago by
Cc: | Kitson Kelly added |
---|---|
Milestone: | tbd → 1.7.3 |
Priority: | undecided → high |
comment:2 Changed 9 years ago by
Milestone: | 1.7.3 → 1.8 |
---|
comment:3 Changed 9 years ago by
Cc: | Kitson Kelly removed |
---|---|
Owner: | changed from bill to Kitson Kelly |
Status: | new → assigned |
Yah, that milestone didn't make sense to me either.
The parser features are not opt-in, and as you said, the asynchronous support makes error reporting more difficult, specifically that it needs to be done through the Deferred, calling reject(). However, in the common case when the parser runs synchronously it would be good to throw the errors synchronously, like in the old days. Probably at the end of parse() etc. we should throw if the promise is fulfilled and has an error condition.
I think Kitson said he was going to work on this.
comment:4 Changed 9 years ago by
Kitson, I attached a patch that I think is all that should be needed. I'm not seeing an indication that Deferred will handle uncaught errors, so imho you should do it in the parser.
This will throw two errors if you attach your own handler like parser.parse().then(handlers...). But I believe that side effect is harmless.
comment:5 Changed 9 years ago by
Priority: | high → blocker |
---|
Do not understand why milestone was set to 1.7.3 since this is a feature that only exists in 1.8.