[Pkg-javascript-commits] [dojo] 13/149: Refs #18168. dojo/on: adjust feature detection such that it also works in iOS 8 (beta) with a built dojo/on stripping the strict mode
David Prévot
taffit at moszumanska.debian.org
Sat Feb 27 03:13:42 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository dojo.
commit 5eba843709e8c80fdcd8f4eeff3f98fba04f39d3
Author: Adrian Vasiliu <vasiliu at fr.ibm.com>
Date: Fri Aug 29 14:10:08 2014 +0200
Refs #18168. dojo/on: adjust feature detection such that it also works in iOS 8 (beta) with a built dojo/on stripping the strict mode
---
on.js | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/on.js b/on.js
index 419ff24..ef42cb6 100644
--- a/on.js
+++ b/on.js
@@ -19,10 +19,15 @@ define(["./has!dom-addeventlistener?:./aspect", "./_base/kernel", "./sniff"], fu
var EventDelegate = function(){};
EventDelegate.prototype =
document.createEvent("MouseEvents"); // original event
+ // Attempt to modify a property of an event delegate and check if
+ // it succeeds. Depending on browsers and on whether dojo/on's
+ // strict mode is stripped in a Dojo build, there are 3 known behaviors:
+ // it may either succeed, or raise an error, or fail to set the property
+ // without raising an error.
try{
- // Attempt to modify a property of an event delegate:
- (new EventDelegate).target = null;
- return true; // can use event delegation
+ var eventDelegate = new EventDelegate;
+ eventDelegate.target = null;
+ return eventDelegate.target === null;
}catch(e){
return false; // cannot use event delegation
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git
More information about the Pkg-javascript-commits
mailing list