mirror of
https://github.com/flynx/object.js.git
synced 2025-10-30 02:50:10 +00:00
cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
26423c58f3
commit
a5620ab965
16
object.js
16
object.js
@ -426,22 +426,16 @@ function(base, ...objects){
|
|||||||
// - link the object into the prototype chain
|
// - link the object into the prototype chain
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// This will not call .__init__(..)
|
// This will not call .__init__(..), hence the "uninitialized".
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// NOTE: context is only used when passeding to .__new__(..) if defined,
|
// NOTE: "context" is only used when passeding to .__new__(..) if defined,
|
||||||
// and is ignored otherwise...
|
// and is ignored otherwise...
|
||||||
// NOTE: as this is simply an extension to the base JavaScript protocol this
|
// NOTE: as this is simply an extension to the base JavaScript protocol this
|
||||||
// can be used to construct any object...
|
// can be used to construct any object...
|
||||||
// Example:
|
// Example:
|
||||||
// var O = function(){}
|
|
||||||
// // new is optional...
|
// // new is optional...
|
||||||
// var o = new makeRawInstance(null, O)
|
// var l = new makeRawInstance(null, Array, 'a', 'b', 'c')
|
||||||
// NOTE: .__new__(..) is intentionaly an instance method (contary to
|
|
||||||
// Python) this is done because there are no classes in JS and
|
|
||||||
// adding and instance constructor as a class method would create
|
|
||||||
// unneccessary restrictions both on the "class" object and on the
|
|
||||||
// instance...
|
|
||||||
// NOTE: the following are not the same:
|
// NOTE: the following are not the same:
|
||||||
// var C = Constructor('C', function(){ .. })
|
// var C = Constructor('C', function(){ .. })
|
||||||
// and
|
// and
|
||||||
@ -449,7 +443,6 @@ function(base, ...objects){
|
|||||||
// the difference is in C.prototype vs. C2.prototype, the first
|
// the difference is in C.prototype vs. C2.prototype, the first
|
||||||
// being a function while the second is an object with a call
|
// being a function while the second is an object with a call
|
||||||
// method...
|
// method...
|
||||||
// XXX Q: should the two cases produce the same result???
|
|
||||||
var makeRawInstance =
|
var makeRawInstance =
|
||||||
module.makeRawInstance =
|
module.makeRawInstance =
|
||||||
function(context, constructor, ...args){
|
function(context, constructor, ...args){
|
||||||
@ -648,8 +641,6 @@ function(context, constructor, ...args){
|
|||||||
// It is however possible to mix related types as we are doing for
|
// It is however possible to mix related types as we are doing for
|
||||||
// callable instances (Function + Object -- a function is an object).
|
// callable instances (Function + Object -- a function is an object).
|
||||||
// See README.md for more info.
|
// See README.md for more info.
|
||||||
//
|
|
||||||
// XXX revise .toString(..) definition test...
|
|
||||||
var Constructor =
|
var Constructor =
|
||||||
module.Constructor =
|
module.Constructor =
|
||||||
// shorthand...
|
// shorthand...
|
||||||
@ -757,5 +748,6 @@ function Constructor(name, a, b, c){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* vim:set ts=4 sw=4 : */ return module })
|
* vim:set ts=4 sw=4 : */ return module })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user