Permalink
Browse files

moved version number to 1.0.7

  • Loading branch information...
1 parent 78137ec commit bf95d6115b64b0fe889cd4e443e44a9bc5ac957e @CatChen committed Nov 14, 2011
Showing with 25 additions and 22 deletions.
  1. +5 −0 CHANGELOG.md
  2. +1 −1 README.md
  3. +1 −1 build/jshelpers-min.js
  4. +8 −9 build/jshelpers.js
  5. +1 −1 build/overload-min.js
  6. +8 −9 build/overload.js
  7. +1 −1 package.json
View
@@ -1,5 +1,10 @@
# Changelog
+## 1.0.7
+
+* Fix `...` (aka `Overload.More`) bug when it matches 0 arguments and thus should be recognized as empty `Array`.
+* Fix bug when comparing `...` (aka `Overload.More`) with numbers of `*` (aka `Overload.Any`).
+
## 1.0.6
* Added support for exporting as YUI module.
View
@@ -4,7 +4,7 @@ jsHelpers is a set of tools help you write your AJAX application in a simpler wa
What does jsHelpers do then? I apologize for not providing more details here. You can find it in [documentations](http://catchen.github.com/jsHelpers/). All documentations are in both Chinese and English.
-The latest release is [1.0.6](https://github.com/CatChen/jsHelpers/tree/1.0.6). In this release, all source code and unit tests are ready. It also works with [Node.js](http://nodejs.org/) and [Node Package Manager](http://npmjs.org/).
+The latest release is [1.0.7](https://github.com/CatChen/jsHelpers/tree/1.0.7). In this release, all source code and unit tests are ready. It also works with [Node.js](http://nodejs.org/) and [Node Package Manager](http://npmjs.org/).
# How to use
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1517,15 +1517,13 @@
} else if(signature1.more && signature2.more) {
/* Function.more exisits in both signature */
if (signature1.length > signature2.length) {
- signature2 = copySignature(signature2);
- while (signature2.length < signature1.length) {
- signature2[signature2.length] = Overload.Any;
- }
- } else if (signature1.length < signature2.length) {
+ signature1Better = true;
signature1 = copySignature(signature1);
- while (signature1.length < signature2.length) {
- signature1[signature1.length] = Overload.Any;
- }
+ signature1.length = signature2.length;
+ } else if (signature1.length < signature2.length) {
+ signature2Better = true;
+ signature2 = copySignature(signature2);
+ signature2.length = signature1.length;
}
}
for (var i = 0; i < signature1.length; i++) {
@@ -1541,6 +1539,7 @@
} else if (!signature1Better && signature2Better) {
return -1;
} else {
+ /* if both signatures are better in some way it means a conflict */
return 0;
}
};
@@ -1597,7 +1596,7 @@
var overload = select(arguments);
if (overload) {
var transformedArguments = Array.prototype.slice.call(arguments, 0);
- if (transformedArguments.length > overload.signature.length) {
+ if (overload.signature.more) {
var moreArguments = transformedArguments.splice(overload.signature.length);
transformedArguments.push(moreArguments);
}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -81,15 +81,13 @@
} else if(signature1.more && signature2.more) {
/* Function.more exisits in both signature */
if (signature1.length > signature2.length) {
- signature2 = copySignature(signature2);
- while (signature2.length < signature1.length) {
- signature2[signature2.length] = Overload.Any;
- }
- } else if (signature1.length < signature2.length) {
+ signature1Better = true;
signature1 = copySignature(signature1);
- while (signature1.length < signature2.length) {
- signature1[signature1.length] = Overload.Any;
- }
+ signature1.length = signature2.length;
+ } else if (signature1.length < signature2.length) {
+ signature2Better = true;
+ signature2 = copySignature(signature2);
+ signature2.length = signature1.length;
}
}
for (var i = 0; i < signature1.length; i++) {
@@ -105,6 +103,7 @@
} else if (!signature1Better && signature2Better) {
return -1;
} else {
+ /* if both signatures are better in some way it means a conflict */
return 0;
}
};
@@ -161,7 +160,7 @@
var overload = select(arguments);
if (overload) {
var transformedArguments = Array.prototype.slice.call(arguments, 0);
- if (transformedArguments.length > overload.signature.length) {
+ if (overload.signature.more) {
var moreArguments = transformedArguments.splice(overload.signature.length);
transformedArguments.push(moreArguments);
}
View
@@ -2,7 +2,7 @@
"name": "jshelpers",
"description": "Helpers for JavaScript",
"homepage": "http://catchen.github.com/jsHelpers/",
- "version": "1.0.6",
+ "version": "1.0.7",
"author": {
"name": "Cat Chen",
"email": "catchen@catchen.me",

0 comments on commit bf95d61

Please sign in to comment.