mirror of
https://github.com/flynx/object.js.git
synced 2025-11-01 12:00:10 +00:00
doc cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
788dc567d7
commit
61ab565afb
24
object.js
24
object.js
@ -1,5 +1,9 @@
|
|||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
*
|
*
|
||||||
|
* object.js
|
||||||
|
*
|
||||||
|
* Repo and docs:
|
||||||
|
* https://github.com/flynx/object.js
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* XXX should this extend Object???
|
* XXX should this extend Object???
|
||||||
@ -315,6 +319,15 @@ function(root, ...objects){
|
|||||||
// adding and instance constructor as a class method would create
|
// adding and instance constructor as a class method would create
|
||||||
// unneccessary restrictions both on the "class" object and on the
|
// unneccessary restrictions both on the "class" object and on the
|
||||||
// instance...
|
// instance...
|
||||||
|
//
|
||||||
|
// XXX Q: should the context (this) in .__new__(..) be _constructor or
|
||||||
|
// .prototype???
|
||||||
|
// ... .prototype seems to be needed more often but through it we
|
||||||
|
// can't reach the actual constructor... but on the other hand we
|
||||||
|
// can (should?) always explicitly use it -- .__new__(..) is usually
|
||||||
|
// in the same scope + this makes it more reusable for chaining
|
||||||
|
// .__new__(..) calls...
|
||||||
|
// ...currently it's .prototype...
|
||||||
var makeRawInstance =
|
var makeRawInstance =
|
||||||
module.makeRawInstance =
|
module.makeRawInstance =
|
||||||
function(context, constructor, ...args){
|
function(context, constructor, ...args){
|
||||||
@ -356,8 +369,6 @@ function(context, constructor, ...args){
|
|||||||
enumerable: false,
|
enumerable: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
// there is explicitly no initialization here...
|
|
||||||
|
|
||||||
return obj }
|
return obj }
|
||||||
|
|
||||||
|
|
||||||
@ -437,7 +448,7 @@ function(context, constructor, ...args){
|
|||||||
// NOTE: raw instance creation is defined by makeRawInstance(..) so see
|
// NOTE: raw instance creation is defined by makeRawInstance(..) so see
|
||||||
// it for more info.
|
// it for more info.
|
||||||
// NOTE: raw instance creation can be completely overloaded by defining
|
// NOTE: raw instance creation can be completely overloaded by defining
|
||||||
// .__rawinstance__(..) on the constructor. (XXX EXPERIMENTAL)
|
// .__rawinstance__(..) on the constructor.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@ -486,11 +497,7 @@ function(context, constructor, ...args){
|
|||||||
// not reusable, to use the same prototype for multiple objects
|
// not reusable, to use the same prototype for multiple objects
|
||||||
// clone it via. Object.create(..) or copy it...
|
// clone it via. Object.create(..) or copy it...
|
||||||
// NOTE: to disable .__rawinstance__(..) handling set it to false in the
|
// NOTE: to disable .__rawinstance__(..) handling set it to false in the
|
||||||
// class prototype... (XXX EXPERIMENTAL)
|
// class prototype...
|
||||||
//
|
|
||||||
// XXX EXPERIMENTAL: calling .__rawinstance__(..) to create an instance...
|
|
||||||
// XXX Q: should the context in .__new__(..) be _constructor or .prototype???
|
|
||||||
// ...currently it's .prototype...
|
|
||||||
var Constructor =
|
var Constructor =
|
||||||
module.Constructor =
|
module.Constructor =
|
||||||
// shorthand...
|
// shorthand...
|
||||||
@ -541,7 +548,6 @@ function Constructor(name, a, b){
|
|||||||
})
|
})
|
||||||
_constructor.__proto__ = cls_proto
|
_constructor.__proto__ = cls_proto
|
||||||
_constructor.prototype = proto
|
_constructor.prototype = proto
|
||||||
// XXX EXPERIMENTAL...
|
|
||||||
// generic raw instance constructor...
|
// generic raw instance constructor...
|
||||||
_constructor.__rawinstance__ instanceof Function
|
_constructor.__rawinstance__ instanceof Function
|
||||||
|| (_constructor.__rawinstance__ =
|
|| (_constructor.__rawinstance__ =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user