Skip to content

Commit

Permalink
Revert "emit support multi data params"
Browse files Browse the repository at this point in the history
This reverts commit 3949dd4.
  • Loading branch information
army8735 committed Mar 12, 2014
1 parent 3949dd4 commit 1c04267
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions dist/sea-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ seajs.off = function(name, callback) {

// Emit event, firing all bound callbacks. Callbacks receive the same
// arguments as `emit` does, apart from the event name
var emit = seajs.emit = function(name) {
var emit = seajs.emit = function(name, data) {
var list = events[name], fn

if (list) {
// Copy callback lists to prevent modification
list = list.slice()
var args = Array.prototype.slice.call(arguments, 1);

// Execute event callbacks
while ((fn = list.shift())) {
fn.apply(null, args);
fn(data)
}
}

Expand Down Expand Up @@ -524,7 +524,7 @@ Module.prototype.load = function() {

// Emit `load` event for plugins such as combo plugin
var uris = mod.resolve()
emit("load", uris, mod)
emit("load", uris)

var len = mod._remain = uris.length
var m
Expand Down
2 changes: 1 addition & 1 deletion dist/sea.js

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

2 changes: 1 addition & 1 deletion src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Module.prototype.load = function() {

// Emit `load` event for plugins such as combo plugin
var uris = mod.resolve()
emit("load", uris, mod)
emit("load", uris)

var len = mod._remain = uris.length
var m
Expand Down
6 changes: 3 additions & 3 deletions src/util-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ seajs.off = function(name, callback) {

// Emit event, firing all bound callbacks. Callbacks receive the same
// arguments as `emit` does, apart from the event name
var emit = seajs.emit = function(name) {
var emit = seajs.emit = function(name, data) {
var list = events[name], fn

if (list) {
// Copy callback lists to prevent modification
list = list.slice()
var args = Array.prototype.slice.call(arguments, 1);

// Execute event callbacks
while ((fn = list.shift())) {
fn.apply(null, args);
fn(data)
}
}

Expand Down

0 comments on commit 1c04267

Please sign in to comment.