Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed unneeded closure

  • Loading branch information...
commit 83f12f654c726b0043ef5a65e23c42d1dd2a01e4 1 parent c8a37a8
@fk1blow authored
Showing with 52 additions and 50 deletions.
  1. +52 −50 lib/seek.class.js
View
102 lib/seek.class.js
@@ -1,3 +1,8 @@
+function cl(o) {
+ console.log.apply(this, arguments);
+}
+
+
function objectLength(obj) {
var result = 0;
for(var prop in obj) {
@@ -33,62 +38,60 @@ var __extends = function(child, parent) {
-var ClassBuilder = (function() {
- var dummy_context = null;
+var ClassBuilder = {
+ dummy_context: null,
- return {
- // Extended function
- extends: function(child, parent) {
- __extends(child, parent);
- },
-
- // Adds the instance methods to the prototype
- createInstance: function(body) {
- dummy_context = function(init_params) {
- var args = [];
- for(var i in arguments) {
- args[i] = arguments[i];
- }
- // trying to call only the instance's initialize method and not the parent's initialize
- // i don't know if this will work as expected
- if(typeof(this.initialize) != 'undefined')
- this.initialize.apply(this, args);
- };
- var c = dummy_context;
-
- var tmp_methods = {};
-
- if(body && body.methods) {
- for(var i in body.methods) {
- tmp_methods[i] = body.methods[i]
- }
- }
- if(body && body.attributes) {
- for(var i in body.attributes) {
- tmp_methods[i] = body.attributes[i]
- }
+ // Extended function
+ extends: function(child, parent) {
+ __extends(child, parent);
+ },
+
+ // Adds the instance methods to the prototype
+ createInstance: function(body) {
+ this.dummy_context = function(init_params) {
+ var args = [];
+ for(var i in arguments) {
+ args[i] = arguments[i];
}
- c.prototype = tmp_methods;
- this.createDefaults(c);
-
- return dummy_context;
- },
+ // trying to call only the instance's initialize method and not the parent's initialize
+ // i don't know if this will work as expected
+ if(typeof(this.initialize) != 'undefined')
+ this.initialize.apply(this, args);
+ };
+ var c = this.dummy_context;
- // Adds default methods to object instances
- createDefaults: function(class_object) {
- class_object.prototype.getClassName = function() {
- return this.__classname;
- }
- },
+ var tmp_methods = {};
- // Adds the static properties(methods, attributes)
- createStatic: function(context, methods) {
- for(var i in methods) {
- context[i] = methods[i];
+ if(body && body.methods) {
+ for(var i in body.methods) {
+ tmp_methods[i] = body.methods[i]
}
}
+ if(body && body.attributes) {
+ for(var i in body.attributes) {
+ tmp_methods[i] = body.attributes[i]
+ }
+ }
+ c.prototype = tmp_methods;
+ this.createDefaults(c);
+
+ return this.dummy_context;
+ },
+
+ // Adds default methods to object instances
+ createDefaults: function(class_object) {
+ class_object.prototype.getClassName = function() {
+ return this.__classname;
+ }
+ },
+
+ // Adds the static properties(methods, attributes)
+ createStatic: function(context, methods) {
+ for(var i in methods) {
+ context[i] = methods[i];
+ }
}
-}());
+};
function Class(body) {
@@ -124,4 +127,3 @@ function Class(body) {
exports.Class = Class;
-
Please sign in to comment.
Something went wrong with that request. Please try again.