From 93cd9a5365261a235be9829c07ec3326f68d4127 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 20 Nov 2020 03:53:09 +0300 Subject: [PATCH] cleanup and notes... Signed-off-by: Alex A. Naanou --- object.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/object.js b/object.js index dc39897..b2ab737 100755 --- a/object.js +++ b/object.js @@ -41,10 +41,10 @@ module.LINK_FUNCTION_METHODS = [ //--------------------------------------------------------------------- // Helpers... -// bootstrapping utility... +// Bootstrapping utility... // // Since we can face chicken-egg issues here, this should keep things -// both consistent in terms of flow and in terms of actual logical +// both consistent in terms of doc flow and in terms of actual logical // consistency... // var BOOTSTRAP = @@ -56,6 +56,8 @@ function(func){ +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + module.TAB_SIZE = 4 module.LEADING_TABS = 1 @@ -179,8 +181,6 @@ function(strings, ...values){ // // NOTE: this is like Object.keys(..) but will get keys for all levels // till stop if given... -// -// XXX should we add this to Object??? var deepKeys = module.deepKeys = function(obj, stop){ @@ -261,10 +261,16 @@ function(base, obj, non_strict){ //--------------------------------------------------------------------- // Prototype chain content access... -// object to trigger iteration stop... +// trigger iteration stop... // // NOTE: we need Constructor(..) to make this so will deffer this to the // end... +// +// XXX should we unify this and how types.js/Array does things with +// StopTteration??? +// ...I'm not sure I like the StopIteration approach as adding a +// try/catch block and rethrowing excptions masks their origin and +// context and makes things harder when tracking down errors... BOOTSTRAP(function(){ module.STOP = @@ -690,7 +696,7 @@ function(context, constructor, ...args){ // use parent's constructor... : (typeof(constructor.__proto__) == 'function' // XXX for some reason if using (function(){}).__proto__ - // instead of Function.prototype below coverage is + // instead of Function.prototype below, coverage is // not counted for the condition.... && constructor.__proto__ !== Function.prototype) ? Reflect.construct(constructor.__proto__, args, constructor) @@ -993,7 +999,7 @@ function Constructor(name, a, b, c){ return _constructor } -// complete the constructor... +// Complete the constructor... // // NOTE: currently this is a complement to the top level functions. Object.assign(Constructor, { @@ -1237,6 +1243,7 @@ Constructor('Mixin', { mixin, mixinFlat, mixout, + mixins, hasMixin,