Skip to content

Instantly share code, notes, and snippets.

@rbuels
Created September 30, 2013 17:15
Show Gist options
  • Save rbuels/6767015 to your computer and use it in GitHub Desktop.
Save rbuels/6767015 to your computer and use it in GitHub Desktop.
test showing Deferred not properly rejecting listeners
<html>
<head>
<script type="text/javascript" src="dojo.js" data-dojo-config="async: 1"></script>
</head>
<body>
<script type="text/javascript">
require({ baseUrl: '..', packages: ['dojo']}, ['dojo/Deferred'], function( Deferred ) {
var d = new Deferred();
d.then( function() {}, function() {} )
.then( function() {
alert('fail. this should not run');
},
function() {
alert('pass. properly rejected.');
}
);
d.reject();
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment