some cleanup and minor stuff...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-11-19 23:39:10 +03:00
parent 8a18714798
commit d426e03f42
2 changed files with 55 additions and 15 deletions

View File

@ -41,6 +41,21 @@ module.LINK_FUNCTION_METHODS = [
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Helpers... // Helpers...
// 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
// consistency...
//
var BOOTSTRAP =
function(func){
var b = BOOTSTRAP.__delayed = BOOTSTRAP.__delayed || []
func ?
b.push(func)
: b.map(function(f){ f() }) }
module.TAB_SIZE = 4 module.TAB_SIZE = 4
module.LEADING_TABS = 1 module.LEADING_TABS = 1
@ -248,9 +263,19 @@ function(base, obj, non_strict){
// object to trigger iteration stop... // object to trigger iteration stop...
// //
// NOTE: this is a placeholder for documnetation/context purposes, see // NOTE: we need Constructor(..) to make this so will deffer this to the
// the actual implementation at the end of the module... // end...
module.STOP = undefined BOOTSTRAP(function(){
module.STOP =
Constructor('STOP', {
doc: 'stop iteration.',
__init__: function(value){
this.value = value },
})
})
// Get a list of source objects for a prop/attr name... // Get a list of source objects for a prop/attr name...
@ -968,14 +993,25 @@ function Constructor(name, a, b, c){
return _constructor } return _constructor }
// complete the constructor...
//
// NOTE: currently this is a complement to the top level functions.
Object.assign(Constructor, {
sources,
values,
//--------------------------------------------------------------------- parent,
// For more info see .sources(..) above... parentProperty,
module.STOP = parentCall,
Constructor('STOP', {
doc: 'stop iteration.', parentOf,
__init__: function(value){ childOf,
this.value = value }, related,
match,
matchPartial,
deepKeys,
}) })
@ -1196,10 +1232,8 @@ var Mixin =
module.Mixin = module.Mixin =
Constructor('Mixin', { Constructor('Mixin', {
// static methods... // static methods...
// XXX should we add the above mixin funcs as static methods here??? //
// ...not sure yet... // NOTE: currently this is a complement to the top level functions.
// XXX if this proves usefull should we chose one or keep both locations???
// XXX EXPERIMENTAL...
mixin, mixin,
mixinFlat, mixinFlat,
mixout, mixout,
@ -1256,6 +1290,12 @@ Constructor('Mixin', {
//---------------------------------------------------------------------
BOOTSTRAP()
/********************************************************************** /**********************************************************************
* vim:set ts=4 sw=4 : */ return module }) * vim:set ts=4 sw=4 : */ return module })

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-object", "name": "ig-object",
"version": "5.4.7", "version": "5.4.9",
"description": "", "description": "",
"main": "object.js", "main": "object.js",
"scripts": { "scripts": {