Permalink
Browse files

Simplified construction by removing init method and fn alias.

  • Loading branch information...
1 parent 71364fc commit 0b4e1acd68e91a18f2d74be1d375ab437c6a0962 @scottgonzalez scottgonzalez committed May 5, 2010
Showing with 7 additions and 8 deletions.
  1. +7 −8 lib/JSLINQ.js
View
@@ -21,13 +21,13 @@ else{
(function() {
JSLINQ = window[namespace] = function(dataItems) {
- return new JSLINQ.fn.init(dataItems);
- };
- JSLINQ.fn = JSLINQ.prototype = {
- init: function(dataItems) {
- this.items = dataItems;
- },
+ if (!(this instanceof JSLINQ)) {
+ return new JSLINQ(dataItems);
+ }
+ this.items = dataItems;
+ };
+ JSLINQ.prototype = {
// The current version of JSLINQ being used
jslinq: "2.10",
@@ -198,5 +198,4 @@ else{
return this.Last() || defaultValue;
}
};
- JSLINQ.fn.init.prototype = JSLINQ.fn;
-})();
+})();

0 comments on commit 0b4e1ac

Please sign in to comment.