Socket
Socket
Sign inDemoInstall

jsface

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.0 to 2.3.0

1

5

CHANGELOG.txt

@@ -0,1 +1,6 @@

v2.3.0 Dec 02, 2014
----------------------------------------------------------------
* Fix instanceof (#20)
* Retire $class (#17)
v2.2.0 Oct 11, 2013

@@ -2,0 +7,0 @@ ----------------------------------------------------------------

14

dist/jsface.all.js

@@ -121,10 +121,15 @@ /*

// make sure parent is always an array
parent = !parent || arrayOrNil(parent) ? parent : [ parent ];
len = parent && parent.length;
if ( !singleton && len) {
clazz.prototype = classOrNil(parent[0]) ? new parent[0] : parent[0];
clazz.prototype.constructor = clazz;
}
// determine bindTo: where api should be bound
bindTo = singleton ? clazz : clazz.prototype;
// make sure parent is always an array
parent = !parent || arrayOrNil(parent) ? parent : [ parent ];
// do inherit
len = parent && parent.length;
while (i < len) {

@@ -156,3 +161,2 @@ p = parent[i++];

clazz.$superp = p && p.prototype ? p.prototype : p;
bindTo.$class = clazz;
}

@@ -159,0 +163,0 @@

@@ -5,2 +5,2 @@ /*

*/
!function(a,b,c,d,e,f,g,h){function i(a){return a&&typeof a===b&&!(typeof a.length===c&&!a.propertyIsEnumerable(d))&&a||null}function j(a){return a&&typeof a===b&&typeof a.length===c&&!a.propertyIsEnumerable(d)&&a||null}function k(a){return a&&"function"==typeof a&&a||null}function l(a){return"[object String]"===e.apply(a)&&a||null}function m(a){return k(a)&&a.prototype&&a===a.prototype.constructor&&a||null}function n(a,b,c,d,e,f){c&&c.hasOwnProperty(a)||(d[a]=b,e&&(f[a]=b))}function o(a,b,c){if(j(b))for(var d=b.length;--d>=0;)o(a,b[d],c);else{c=c||{constructor:1,$super:1,prototype:1,$superp:1};var e,f,g=m(a),h=m(b),k=a.prototype;if(i(b))for(e in b)n(e,b[e],c,a,g,k);if(h){f=b.prototype;for(e in f)n(e,f[e],c,a,g,k)}g&&h&&o(k,b.prototype,c)}}function p(a,b){b||(b=a,a=0);var c,d,e,f,g,h,i,l,m=0,n={constructor:1,$singleton:1,$statics:1,prototype:1,$super:1,$superp:1,main:1,toString:0},o=p.plugins;b=("function"==typeof b?b():b)||{},d=b.hasOwnProperty("constructor")?b.constructor:0,e=b.$singleton,f=b.$statics;for(g in o)n[g]=1;for(c=e?{}:d?d:function(){},h=e?c:c.prototype,a=!a||j(a)?a:[a],i=a&&a.length;i>m;){l=a[m++];for(g in l)n[g]||(h[g]=l[g],e||(c[g]=l[g]));for(g in l.prototype)n[g]||(h[g]=l.prototype[g])}for(g in b)n[g]||(h[g]=b[g]);for(g in f)c[g]=h[g]=f[g];e||(l=a&&a[0]||a,c.$super=l,c.$superp=l&&l.prototype?l.prototype:l,h.$class=c);for(g in o)o[g](c,a,b);return k(b.main)&&b.main.call(c,c),c}p.plugins={},h={Class:p,extend:o,mapOrNil:i,arrayOrNil:j,functionOrNil:k,stringOrNil:l,classOrNil:m},"undefined"!=typeof module&&module.exports?module.exports=h:(g=a.Class,a.Class=p,a.jsface=h,h.noConflict=function(){a.Class=g})}(this,"object","number","length",Object.prototype.toString),function(a){var b=a.jsface||require("./jsface"),c=b.Class,d=b.functionOrNil,e=[],f=0;c.plugins.$ready=function g(a,b,c,h){for(var i,j,k,l=c.$ready,m=b?b.length:0,n=m,o=m&&b[0].$super;m--;)for(j=0;f>j&&(k=e[j],i=b[m],i===k[0]&&(k[1].call(i,a,b,c),n--),n);j++);o&&g(a,[o],c,!0),!h&&d(l)&&(l.call(a,a,b,c),e.push([a,l]),f++)}}(this),function(a){function b(a,b,c,d){function e(){for(var a,b,c=e[k],d=c.length,f=e[l],g=f.length,h=e[m];d--;)if(b=c[d].apply(this,arguments),i(b)&&b.$skip===!0)return b.$data;for(a=h.apply(this,arguments);g--;)if(b=f[g].apply(this,arguments),i(b)&&b.$skip===!0)return a;return a}return a[j]===a?(a[k].push(b),a[l].push(c),a[n].push(d),a):(h(e,a,0,!0),f(a)&&(e.prototype=a.prototype),e[k]=[b],e[l]=[c],e[m]=a,e[n]=[d],e[j]=e,e.$super=a.$super,e.$superp=a.$superp,e)}function c(a,b){var d,e,f;if(a&&a===a[j])if(b){for(e=f=a[n].length;e--&&a[n][e]!==b;);if(e>=0){if(1===f)return c(a);a[n].splice(e,1),a[k].splice(e,1),a[l].splice(e,1)}}else d=a[m],delete a[m],delete a[n],delete a[k],delete a[l],delete a[j];return d}function d(a,b,d,e,f,g){function h(b,d){var f,h,j,k,l;for(f in b)h=f/1==f?b[f]:f,j="constructor"===h,k=e&&g[h]===a[h],l=c(j&&e&&a||g[h],d),i=i||j&&l,l&&!j&&(g[h]=l,k&&(a[h]=l))}var i,k,l,n;if("remove"===b)if(d)h(d,d);else{i=e&&a===a[j]&&a[m];for(var p in g){var n=g[p],q=e&&g[p]===a[p];g[p]=c(n)||g[p],q&&(a[p]=g[p])}}else{if(null===(k=/^remove /.exec(b)))throw o+"params";l=b.replace(k,"").split(" "),h(l)}return i||a}var e=a.jsface||require("./jsface"),f=(e.Class,e.classOrNil),g=e.functionOrNil,h=e.extend,i=e.mapOrNil,j="___wrapper___",k="___before_fns___",l="___after_fns___",m="___origin_fn___",n="___advisors___",o="Invalid ",p="Non-function property named ",q=function(){};e.pointcut=function(a,c){var e,f,h,j=g(a),k=i(a),l=null!==/^remove ?/.exec(c),m=l&&arguments[2];if(!j&&!k||!i(c)&&!l)throw o+"params";if(e=j?a.prototype:a,l)return d(a,c,m,j,k,e);for(f in c){h=c[f],h=g(h)?{before:h}:h;var n,r=i(h)&&!h.before?q:h.before,s=i(h)&&!h.after?q:h.after;if(!g(r))throw o+f+":before";if(!g(s))throw o+f+":after";if(k){if(!g(e[f]))throw p+f;e[f]=b(e[f],r,s,c)}else if("constructor"===f)a=b(a,r,s,c);else{if(!g(e[f]))throw p+f;n=j&&e[f]===a[f],e[f]=b(e[f],r,s,c),n&&(a[f]=e[f])}}return a},"undefined"!=typeof module&&module.exports&&(module.exports=e.pointcut)}(this);
!function(a,b,c,d,e,f,g,h){function i(a){return a&&typeof a===b&&!(typeof a.length===c&&!a.propertyIsEnumerable(d))&&a||null}function j(a){return a&&typeof a===b&&typeof a.length===c&&!a.propertyIsEnumerable(d)&&a||null}function k(a){return a&&"function"==typeof a&&a||null}function l(a){return"[object String]"===e.apply(a)&&a||null}function m(a){return k(a)&&a.prototype&&a===a.prototype.constructor&&a||null}function n(a,b,c,d,e,f){c&&c.hasOwnProperty(a)||(d[a]=b,e&&(f[a]=b))}function o(a,b,c){if(j(b))for(var d=b.length;--d>=0;)o(a,b[d],c);else{c=c||{constructor:1,$super:1,prototype:1,$superp:1};var e,f,g=m(a),h=m(b),k=a.prototype;if(i(b))for(e in b)n(e,b[e],c,a,g,k);if(h){f=b.prototype;for(e in f)n(e,f[e],c,a,g,k)}g&&h&&o(k,b.prototype,c)}}function p(a,b){b||(b=a,a=0);var c,d,e,f,g,h,i,l,n=0,o={constructor:1,$singleton:1,$statics:1,prototype:1,$super:1,$superp:1,main:1,toString:0},q=p.plugins;b=("function"==typeof b?b():b)||{},d=b.hasOwnProperty("constructor")?b.constructor:0,e=b.$singleton,f=b.$statics;for(g in q)o[g]=1;for(c=e?{}:d?d:function(){},a=!a||j(a)?a:[a],i=a&&a.length,!e&&i&&(c.prototype=m(a[0])?new a[0]:a[0],c.prototype.constructor=c),h=e?c:c.prototype;i>n;){l=a[n++];for(g in l)o[g]||(h[g]=l[g],e||(c[g]=l[g]));for(g in l.prototype)o[g]||(h[g]=l.prototype[g])}for(g in b)o[g]||(h[g]=b[g]);for(g in f)c[g]=h[g]=f[g];e||(l=a&&a[0]||a,c.$super=l,c.$superp=l&&l.prototype?l.prototype:l);for(g in q)q[g](c,a,b);return k(b.main)&&b.main.call(c,c),c}p.plugins={},h={Class:p,extend:o,mapOrNil:i,arrayOrNil:j,functionOrNil:k,stringOrNil:l,classOrNil:m},"undefined"!=typeof module&&module.exports?module.exports=h:(g=a.Class,a.Class=p,a.jsface=h,h.noConflict=function(){a.Class=g})}(this,"object","number","length",Object.prototype.toString),function(a){var b=a.jsface||require("./jsface"),c=b.Class,d=b.functionOrNil,e=[],f=0;c.plugins.$ready=function g(a,b,c,h){for(var i,j,k,l=c.$ready,m=b?b.length:0,n=m,o=m&&b[0].$super;m--;)for(j=0;f>j&&(k=e[j],i=b[m],i===k[0]&&(k[1].call(i,a,b,c),n--),n);j++);o&&g(a,[o],c,!0),!h&&d(l)&&(l.call(a,a,b,c),e.push([a,l]),f++)}}(this),function(a){function b(a,b,c,d){function e(){for(var a,b,c=e[k],d=c.length,f=e[l],g=f.length,h=e[m];d--;)if(b=c[d].apply(this,arguments),i(b)&&b.$skip===!0)return b.$data;for(a=h.apply(this,arguments);g--;)if(b=f[g].apply(this,arguments),i(b)&&b.$skip===!0)return a;return a}return a[j]===a?(a[k].push(b),a[l].push(c),a[n].push(d),a):(h(e,a,0,!0),f(a)&&(e.prototype=a.prototype),e[k]=[b],e[l]=[c],e[m]=a,e[n]=[d],e[j]=e,e.$super=a.$super,e.$superp=a.$superp,e)}function c(a,b){var d,e,f;if(a&&a===a[j])if(b){for(e=f=a[n].length;e--&&a[n][e]!==b;);if(e>=0){if(1===f)return c(a);a[n].splice(e,1),a[k].splice(e,1),a[l].splice(e,1)}}else d=a[m],delete a[m],delete a[n],delete a[k],delete a[l],delete a[j];return d}function d(a,b,d,e,f,g){function h(b,d){var f,h,j,k,l;for(f in b)h=f/1==f?b[f]:f,j="constructor"===h,k=e&&g[h]===a[h],l=c(j&&e&&a||g[h],d),i=i||j&&l,l&&!j&&(g[h]=l,k&&(a[h]=l))}var i,k,l,n;if("remove"===b)if(d)h(d,d);else{i=e&&a===a[j]&&a[m];for(var p in g){var n=g[p],q=e&&g[p]===a[p];g[p]=c(n)||g[p],q&&(a[p]=g[p])}}else{if(null===(k=/^remove /.exec(b)))throw o+"params";l=b.replace(k,"").split(" "),h(l)}return i||a}var e=a.jsface||require("./jsface"),f=(e.Class,e.classOrNil),g=e.functionOrNil,h=e.extend,i=e.mapOrNil,j="___wrapper___",k="___before_fns___",l="___after_fns___",m="___origin_fn___",n="___advisors___",o="Invalid ",p="Non-function property named ",q=function(){};e.pointcut=function(a,c){var e,f,h,j=g(a),k=i(a),l=null!==/^remove ?/.exec(c),m=l&&arguments[2];if(!j&&!k||!i(c)&&!l)throw o+"params";if(e=j?a.prototype:a,l)return d(a,c,m,j,k,e);for(f in c){h=c[f],h=g(h)?{before:h}:h;var n,r=i(h)&&!h.before?q:h.before,s=i(h)&&!h.after?q:h.after;if(!g(r))throw o+f+":before";if(!g(s))throw o+f+":after";if(k){if(!g(e[f]))throw p+f;e[f]=b(e[f],r,s,c)}else if("constructor"===f)a=b(a,r,s,c);else{if(!g(e[f]))throw p+f;n=j&&e[f]===a[f],e[f]=b(e[f],r,s,c),n&&(a[f]=e[f])}}return a},"undefined"!=typeof module&&module.exports&&(module.exports=e.pointcut)}(this);

@@ -121,10 +121,15 @@ /*

// make sure parent is always an array
parent = !parent || arrayOrNil(parent) ? parent : [ parent ];
len = parent && parent.length;
if ( !singleton && len) {
clazz.prototype = classOrNil(parent[0]) ? new parent[0] : parent[0];
clazz.prototype.constructor = clazz;
}
// determine bindTo: where api should be bound
bindTo = singleton ? clazz : clazz.prototype;
// make sure parent is always an array
parent = !parent || arrayOrNil(parent) ? parent : [ parent ];
// do inherit
len = parent && parent.length;
while (i < len) {

@@ -156,3 +161,2 @@ p = parent[i++];

clazz.$superp = p && p.prototype ? p.prototype : p;
bindTo.$class = clazz;
}

@@ -159,0 +163,0 @@

@@ -5,2 +5,2 @@ /*

*/
!function(a,b,c,d,e,f,g,h){function i(a){return a&&typeof a===b&&!(typeof a.length===c&&!a.propertyIsEnumerable(d))&&a||null}function j(a){return a&&typeof a===b&&typeof a.length===c&&!a.propertyIsEnumerable(d)&&a||null}function k(a){return a&&"function"==typeof a&&a||null}function l(a){return"[object String]"===e.apply(a)&&a||null}function m(a){return k(a)&&a.prototype&&a===a.prototype.constructor&&a||null}function n(a,b,c,d,e,f){c&&c.hasOwnProperty(a)||(d[a]=b,e&&(f[a]=b))}function o(a,b,c){if(j(b))for(var d=b.length;--d>=0;)o(a,b[d],c);else{c=c||{constructor:1,$super:1,prototype:1,$superp:1};var e,f,g=m(a),h=m(b),k=a.prototype;if(i(b))for(e in b)n(e,b[e],c,a,g,k);if(h){f=b.prototype;for(e in f)n(e,f[e],c,a,g,k)}g&&h&&o(k,b.prototype,c)}}function p(a,b){b||(b=a,a=0);var c,d,e,f,g,h,i,l,m=0,n={constructor:1,$singleton:1,$statics:1,prototype:1,$super:1,$superp:1,main:1,toString:0},o=p.plugins;b=("function"==typeof b?b():b)||{},d=b.hasOwnProperty("constructor")?b.constructor:0,e=b.$singleton,f=b.$statics;for(g in o)n[g]=1;for(c=e?{}:d?d:function(){},h=e?c:c.prototype,a=!a||j(a)?a:[a],i=a&&a.length;i>m;){l=a[m++];for(g in l)n[g]||(h[g]=l[g],e||(c[g]=l[g]));for(g in l.prototype)n[g]||(h[g]=l.prototype[g])}for(g in b)n[g]||(h[g]=b[g]);for(g in f)c[g]=h[g]=f[g];e||(l=a&&a[0]||a,c.$super=l,c.$superp=l&&l.prototype?l.prototype:l,h.$class=c);for(g in o)o[g](c,a,b);return k(b.main)&&b.main.call(c,c),c}p.plugins={},h={Class:p,extend:o,mapOrNil:i,arrayOrNil:j,functionOrNil:k,stringOrNil:l,classOrNil:m},"undefined"!=typeof module&&module.exports?module.exports=h:(g=a.Class,a.Class=p,a.jsface=h,h.noConflict=function(){a.Class=g})}(this,"object","number","length",Object.prototype.toString);
!function(a,b,c,d,e,f,g,h){function i(a){return a&&typeof a===b&&!(typeof a.length===c&&!a.propertyIsEnumerable(d))&&a||null}function j(a){return a&&typeof a===b&&typeof a.length===c&&!a.propertyIsEnumerable(d)&&a||null}function k(a){return a&&"function"==typeof a&&a||null}function l(a){return"[object String]"===e.apply(a)&&a||null}function m(a){return k(a)&&a.prototype&&a===a.prototype.constructor&&a||null}function n(a,b,c,d,e,f){c&&c.hasOwnProperty(a)||(d[a]=b,e&&(f[a]=b))}function o(a,b,c){if(j(b))for(var d=b.length;--d>=0;)o(a,b[d],c);else{c=c||{constructor:1,$super:1,prototype:1,$superp:1};var e,f,g=m(a),h=m(b),k=a.prototype;if(i(b))for(e in b)n(e,b[e],c,a,g,k);if(h){f=b.prototype;for(e in f)n(e,f[e],c,a,g,k)}g&&h&&o(k,b.prototype,c)}}function p(a,b){b||(b=a,a=0);var c,d,e,f,g,h,i,l,n=0,o={constructor:1,$singleton:1,$statics:1,prototype:1,$super:1,$superp:1,main:1,toString:0},q=p.plugins;b=("function"==typeof b?b():b)||{},d=b.hasOwnProperty("constructor")?b.constructor:0,e=b.$singleton,f=b.$statics;for(g in q)o[g]=1;for(c=e?{}:d?d:function(){},a=!a||j(a)?a:[a],i=a&&a.length,!e&&i&&(c.prototype=m(a[0])?new a[0]:a[0],c.prototype.constructor=c),h=e?c:c.prototype;i>n;){l=a[n++];for(g in l)o[g]||(h[g]=l[g],e||(c[g]=l[g]));for(g in l.prototype)o[g]||(h[g]=l.prototype[g])}for(g in b)o[g]||(h[g]=b[g]);for(g in f)c[g]=h[g]=f[g];e||(l=a&&a[0]||a,c.$super=l,c.$superp=l&&l.prototype?l.prototype:l);for(g in q)q[g](c,a,b);return k(b.main)&&b.main.call(c,c),c}p.plugins={},h={Class:p,extend:o,mapOrNil:i,arrayOrNil:j,functionOrNil:k,stringOrNil:l,classOrNil:m},"undefined"!=typeof module&&module.exports?module.exports=h:(g=a.Class,a.Class=p,a.jsface=h,h.noConflict=function(){a.Class=g})}(this,"object","number","length",Object.prototype.toString);

@@ -121,10 +121,15 @@ /*

// make sure parent is always an array
parent = !parent || arrayOrNil(parent) ? parent : [ parent ];
len = parent && parent.length;
if ( !singleton && len) {
clazz.prototype = classOrNil(parent[0]) ? new parent[0] : parent[0];
clazz.prototype.constructor = clazz;
}
// determine bindTo: where api should be bound
bindTo = singleton ? clazz : clazz.prototype;
// make sure parent is always an array
parent = !parent || arrayOrNil(parent) ? parent : [ parent ];
// do inherit
len = parent && parent.length;
while (i < len) {

@@ -156,3 +161,2 @@ p = parent[i++];

clazz.$superp = p && p.prototype ? p.prototype : p;
bindTo.$class = clazz;
}

@@ -159,0 +163,0 @@

@@ -1,2 +0,2 @@

Copyright (c) 2009-2013 Tan Nhu
Copyright (c) Tan Nhu

@@ -3,0 +3,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

@@ -6,3 +6,3 @@ {

"author": "Tan Nhu <tnhu AT me . com>",
"version": "2.2.0",
"version": "2.3.0",
"keywords": [

@@ -41,2 +41,2 @@ "jsface",

}
}
}

@@ -65,7 +65,7 @@ ![Benchmark result](https://lh5.googleusercontent.com/-2dQo8ttjn48/T2KVyppgd2I/AAAAAAAADQw/GvEpE5MIYUo/s956/Screen%2520Shot%25202012-03-15%2520at%25206.21.04%2520PM.png "Benchmark")

this.id = id;
this.$class.$super.call(this, name, age); // Invoke parent's constructor
Student.$super.call(this, name, age); // Invoke parent's constructor
},
toString: function() {
return this.id + "/" + this.$class.$superp.toString.call(this); // Invoke parent's toString method
return this.id + "/" + Student.$superp.toString.call(this); // Invoke parent's toString method
}

@@ -72,0 +72,0 @@ });

@@ -152,9 +152,9 @@ var context = this,

var Test = Class();
equal(classOrNil(Test), Test, "Class defination must be a class");
equal(classOrNil(Test), Test, "Class definition must be a class");
var Foo = Class({});
equal(classOrNil(Foo), Foo, "Class defination must be a class");
equal(classOrNil(Foo), Foo, "Class definition must be a class");
var Bar = Class("Hello World", {});
equal(classOrNil(Bar), Bar, "Class defination must be a class");
var Bar = Class(Object, {});
equal(classOrNil(Bar), Bar, "Class definition must be a class");
});

@@ -175,4 +175,4 @@

equal(functionOrNil(Foo), Foo, "Class defination must be a function");
equal(classOrNil(Foo), Foo, "Class defination must be a class");
equal(functionOrNil(Foo), Foo, "Class definition must be a function");
equal(classOrNil(Foo), Foo, "Class definition must be a class");
equal(mapOrNil(foo), foo, "Class instance must be a map");

@@ -368,3 +368,3 @@ equal(foo.sayHi(), "Hello World John Rambo", "Error invoking method on class instance");

equal(classOrNil(Bar), Bar, "Class defination must be a class");
equal(classOrNil(Bar), Bar, "Class definition must be a class");
equal(bar.sayHi, Bar.sayHi, "Static method must be the same on both class and class instance");

@@ -371,0 +371,0 @@ equal(bar.sayHi, Foo.sayHi, "Static method must be the same on both class and class instance");

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc