Skip to content

Commit

Permalink
检查handler参数类型
Browse files Browse the repository at this point in the history
  • Loading branch information
heeroluo committed Aug 5, 2015
1 parent e73136e commit a49c98d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion dom/1.1.x/dom-event-debug.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* JRaiser 2 Javascript Library
* dom-event - v1.1.1 (2015-04-29T10:20:17+0800)
* dom-event - v1.1.1 (2015-08-05T09:57:13+0800)
* http://jraiser.org/ | Released under MIT license
*/
define(function(require, exports, module) { 'use strict';
Expand Down Expand Up @@ -342,6 +342,10 @@ var listenerManager = (function() {
function on(node, types, handler, options) {
if ( !supportEvent(node) ) { return; }

if (typeof handler !== 'function') {
throw new Error('handler must be a function');
}

types.forEach(function(type) {
type = type.split('.');

Expand Down
4 changes: 2 additions & 2 deletions dom/1.1.x/dom-event.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a49c98d

Please sign in to comment.