Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item12952: jslinting resig
remaining errors:

jslint:resig.uncompressed.js:10:62:'xyz' is not defined.
jslint:resig.uncompressed.js:10:62:Expected an assignment or function call and instead saw an expression.
jslint:resig.uncompressed.js:45:10:Be careful when making functions within a loop. Consider putting the function in a closure.
jslint:resig.uncompressed.js:26:9:The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
  • Loading branch information
MichaelDaum committed Sep 1, 2014
1 parent a41af4d commit 3352732
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions pub/System/ConfigurePlugin/resig.uncompressed.js
Expand Up @@ -2,39 +2,42 @@
* By John Resig http://ejohn.org/
* MIT Licensed.
*/
/*global Class */
// Inspired by base2 and Prototype
(function(){
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;

"use strict";

var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; /* SMELL: xyz is not defined */

// The base Class implementation (does nothing)
this.Class = function(){};

// Create a new Class that inherits from this class
Class.extend = function(prop) {
var _super = this.prototype;
var _super = this.prototype, prototype, name;

// Instantiate a base class (but only create the instance,
// don't run the init constructor)
initializing = true;
var prototype = new this();
prototype = new this();
initializing = false;

// Copy the properties over onto the new prototype
for (var name in prop) {
for (name in prop) {
// Check if we're overwriting an existing function
prototype[name] = typeof prop[name] == "function" &&
typeof _super[name] == "function" && fnTest.test(prop[name]) ?
(function(name, fn){
return function() {
var tmp = this._super;
var tmp = this._super, ret;

// Add a new ._super() method that is the same method
// but on the super-class
this._super = _super[name];

// The method only need to be bound temporarily, so we
// remove it when we're done executing
var ret = fn.apply(this, arguments);
ret = fn.apply(this, arguments);
this._super = tmp;

return ret;
Expand All @@ -46,8 +49,9 @@
// The dummy class constructor
function Class() {
// All construction is actually done in the init method
if ( !initializing && this.init )
if ( !initializing && this.init ) {
this.init.apply(this, arguments);
}
}

// Populate our constructed prototype object
Expand Down

0 comments on commit 3352732

Please sign in to comment.