mirror of
https://github.com/flynx/object.js.git
synced 2025-10-30 02:50:10 +00:00
some cleanup and minor stuff...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8a18714798
commit
d426e03f42
68
object.js
68
object.js
@ -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 })
|
||||||
|
|||||||
@ -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": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user