Skip to content

Commit

Permalink
use unnamed functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepb committed May 20, 2012
1 parent 814b77b commit 3ebe2d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions sage.js
Expand Up @@ -11,7 +11,6 @@ Apache License
){

var global = this;
var previousSage = this.sage; this.sage = sage;

/**
* Copy properties from sources to target.
Expand All @@ -22,13 +21,13 @@ Apache License
* @api private
*/

function extend(target /* sources.. */) {
var extend = function(target /* sources.. */) {
var source, key, i = 1;
while (source = arguments[i++]) {
for (key in source) target[key] = source[key];
}
return target;
}
};

/**
* Stringify value.
Expand All @@ -38,9 +37,9 @@ Apache License
* @api private
*/

function asString(that) {
var asString = function(that) {
return Object.prototype.toString.call(that);
}
};

/**
* Check if value is a string.
Expand All @@ -50,9 +49,9 @@ Apache License
* @api private
*/

function isString(that) {
var isString = function(that) {
return asString(that) == '[object String]';
}
};

/**
* Check if value is an object.
Expand All @@ -62,9 +61,9 @@ Apache License
* @api private
*/

function isObject(that) {
var isObject = function(that) {
return asString(that) == '[object Object]';
}
};

/**
* Check if value is an array.
Expand All @@ -74,9 +73,9 @@ Apache License
* @api private
*/

function isArray(that) {
var isArray = function(that) {
return asString(that) == '[object Array]';
}
};

/**
* Check if value is a function.
Expand All @@ -86,9 +85,9 @@ Apache License
* @api private
*/

function isFunction(that) {
var isFunction = function(that) {
return asString(that) == '[object Function]';
}
};

/**
* Sage library entry point.
Expand All @@ -98,16 +97,17 @@ Apache License
* otherwise returns a `Client`.
*/

function sage(uri) {
var sage = function(uri) {
return sage.make(uri);
}
};

/**
* Restore global variable `sage` to original value.
*
* @return {sage} The `sage` library as an object.
*/

var previousSage = this.sage; this.sage = sage;
sage.noConflict = function() {
global.sage = previousSage;
return sage;
Expand Down
2 changes: 1 addition & 1 deletion sage.min.js

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

0 comments on commit 3ebe2d7

Please sign in to comment.