Skip to content

Commit

Permalink
refs #18533, convert dojox/lang/functional zip.js and curry.js to AMD
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit a475eec
Author: Arūnas Rukšnaitis <[email protected]>
Date:   Tue Apr 28 20:27:36 2015 +0100

    #18533 dojox/lang/functional zip.js and curry.js in AMD style (broken in 1.10.4)
  • Loading branch information
arunasr authored and dylans committed Apr 28, 2015
1 parent a9287d4 commit 7adb026
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dojox.profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var profile = (function(){
"help",
"image/(Gallery|SlideShow|ThumbnailPicker)",
"jq",
"lang/(aspect|async|docs|observable|oo|typed|functional/(binrec|curry|linrec|listcomp|multirec|numrec|tailrec|util|zip))",
"lang/(aspect|async|docs|observable|oo|typed|functional/(binrec|linrec|listcomp|multirec|numrec|tailrec|util))",
"layout/(BorderContainer|dnd|ext-dijit)",
"mobile/app/",
"rails",
Expand Down
14 changes: 5 additions & 9 deletions lang/functional/curry.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
dojo.provide("dojox.lang.functional.curry");

dojo.require("dojox.lang.functional.lambda");
define(["dojo/_base/lang", "./lambda"],
function(lang, df){

// This module adds high-level functions and related constructs:
// - currying and partial functions
Expand All @@ -13,10 +12,7 @@ dojo.require("dojox.lang.functional.lambda");

// Defined methods:
// - take any valid lambda argument as the functional argument

(function(){
var df = dojox.lang.functional, ap = Array.prototype;

var ap = Array.prototype;
var currying = function(/*Object*/ info){
return function(){ // Function
var args = info.args.concat(ap.slice.call(arguments, 0));
Expand All @@ -27,7 +23,7 @@ dojo.require("dojox.lang.functional.lambda");
};
};

dojo.mixin(df, {
lang.mixin(df, {
// currying and partial functions
curry: function(/*Function|String|Array*/ f, /*Number?*/ arity){
// summary:
Expand Down Expand Up @@ -95,4 +91,4 @@ dojo.require("dojox.lang.functional.lambda");
};
}
});
})();
});
10 changes: 4 additions & 6 deletions lang/functional/zip.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
dojo.provide("dojox.lang.functional.zip");
define(["dojo/_base/lang", "./lambda"],
function(lang, df){

// This module adds high-level functions and related constructs:
// - zip combiners

// Defined methods:
// - operate on dense arrays

(function(){
var df = dojox.lang.functional;

dojo.mixin(df, {
lang.mixin(df, {
// combiners
zip: function(){
// summary:
Expand Down Expand Up @@ -41,4 +39,4 @@ dojo.provide("dojox.lang.functional.zip");
return df.zip.apply(null, a); // Array
}
});
})();
});

0 comments on commit 7adb026

Please sign in to comment.