From 64077ed3ff0a334c714a022d443373482b7004b9 Mon Sep 17 00:00:00 2001 From: Justin Windle Date: Tue, 28 May 2013 16:37:03 -0400 Subject: [PATCH] Internal syntax changes for `chain` method. #18 --- js/sketch.js | 16 +++++++--------- js/sketch.min.js | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/js/sketch.js b/js/sketch.js index 9c867fb..c8aabd3 100755 --- a/js/sketch.js +++ b/js/sketch.js @@ -127,7 +127,13 @@ var Sketch = (function() { function chain( target ) { - extend( target, { + for ( var key in target ) + + if ( isFunction( target[ key ] ) ) + + target[ key ] = proxy( target[ key ], target ); + + return extend( target, { set: function( key, val ) { @@ -135,14 +141,6 @@ var Sketch = (function() { else extend( target, key, true ); } }); - - for ( var key in target ) - - if ( isFunction( target[ key ] ) ) - - target[ key ] = proxy( target[ key ], target ); - - return target; } /* diff --git a/js/sketch.min.js b/js/sketch.min.js index f9a9d00..32e5d88 100644 --- a/js/sketch.min.js +++ b/js/sketch.min.js @@ -1,2 +1,2 @@ /* Copyright (C) 2013 Justin Windle, http://soulwire.co.uk */ -var Sketch=function(){"use strict";function e(e){return"[object Array]"==Object.prototype.toString.call(e)}function t(e){return"function"==typeof e}function n(e){return"number"==typeof e}function r(e){return"string"==typeof e}function o(e){return C[e]||String.fromCharCode(e)}function i(e,t,n){for(var r in t)(n||!e.hasOwnProperty(r))&&(e[r]=t[r]);return e}function u(e,t){return function(){var n=e.apply(t,arguments);return void 0===n?t:n}}function a(e){var n={};for(var r in e)n[r]=t(e[r])?u(e[r],e):e[r];return n}function c(e){i(e,{set:function(t,n){r(t)?e[t]=n:i(e,t,!0)}});for(var n in e)t(e[n])&&(e[n]=u(e[n],e));return e}function l(e){function n(n){t(n)&&n.apply(e,[].splice.call(arguments,1))}function u(e){for(_=0;_