Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Dirty objects should not throw handleEvent errors.
Browse files Browse the repository at this point in the history
And Kris didn't file a bug for it.
  • Loading branch information
mattbasta committed Sep 28, 2012
1 parent a091905 commit 87d69b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions tests/test_js_instanceproperties.py
Expand Up @@ -136,3 +136,18 @@ def test_on_event_handleEvent_fail(self):
""")
self.assert_failed(with_errors=True)

def test_on_event_handleEvent_ignore(self):
"""
Test that dirty objects don't trigger handleEvent errors.
"""

self.setup_err(for_appversions=FX18_DEFINITION)

self.run_script("""
var dirty = this_creates_a_dirty_object();
foo.onclick = dirty;
""")
self.assert_silent()



3 changes: 2 additions & 1 deletion validator/testcases/javascript/instanceproperties.py
Expand Up @@ -104,7 +104,8 @@ def set_on_event(new_value, traverser):
line=traverser.line,
column=traverser.position,
context=traverser.context)
elif not is_literal and new_value.has_property("handleEvent"):
elif (not is_literal and isinstance(new_value.value, jstypes.JSObject) and
"handleEvent" in new_value.value.data):
mess_type = (traverser.err.error if
traverser.err.supports_version(FX18_DEFINITION) else
traverser.err.warning)
Expand Down

0 comments on commit 87d69b9

Please sign in to comment.