on master help sign in
cosmetic: use a slightly more descriptive names
commitfd7707e6491ac0c29f662ebeb85789d3401d5d0b authorEvan Czaplicki <info@elm-lang.org> dateMon 6 Jan 2014, 05:21 (13 years ago) parent502cfc0
1 file changed+11−9
libraries/Native/Utils.js+11−9
libraries/Native/Utils.js+11−9
@@ -225,11 +225,13 @@ Elm.Native.Utils.make = function(elm) {
225225 }
226226 if (missing.length > 0) {
227227 throw new Error("Initialization Error: module " + moduleName +
228− " was not given inputs for the following ports: " + missing.join(', '));
228+ " was not given inputs for the following ports: " +
229+ missing.join(', '));
229230 }
230231 if (extra.length > 0) {
231− throw new Error("Initialization Error: module " + moduleName +
232− " has been given ports that do not exist: " + extra.join(', '));
232+ throw new Error(
233+ "Initialization Error: module " + moduleName +
234+ " has been given ports that do not exist: " + extra.join(', '));
233235 }
234236 }
235237
@@ -266,17 +268,17 @@ Elm.Native.Utils.make = function(elm) {
266268 return signal;
267269 }
268270 function portOut(name, signal) {
269− var handlers = []
271+ var subscribers = []
270272 function subscribe(handler) {
271− handlers.push(handler);
273+ subscribers.push(handler);
272274 }
273275 function unsubscribe(handler) {
274− handlers.pop(handlers.indexOf(handler));
276+ subscribers.pop(subscribers.indexOf(handler));
275277 }
276− Signal.lift(function(v) {
277− var len = handlers.length;
278+ Signal.lift(function(value) {
279+ var len = subscribers.length;
278280 for (var i = 0; i < len; ++i) {
279− handlers[i](v);
281+ subscribers[i](value);
280282 }
281283 }, signal);
282284 elm.ports_out[name] = { subscribe:subscribe, unsubscribe:unsubscribe };