mirror of
https://github.com/flynx/object.js.git
synced 2025-11-02 04:20:08 +00:00
docs and cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8c2a30de42
commit
ed1dd3a2b6
13
object.js
13
object.js
@ -175,13 +175,19 @@ function(root, ...objects){
|
|||||||
//
|
//
|
||||||
// This will not call .__init__(..)
|
// This will not call .__init__(..)
|
||||||
//
|
//
|
||||||
// XXX Q: should this be a class method or a utility???
|
// NOTE: as this simply an extension to the base JavaScript protocol this
|
||||||
|
// can be used to construct using any object...
|
||||||
|
// Example:
|
||||||
|
// var O = function(){}
|
||||||
|
// // new is optional...
|
||||||
|
// var o = new makeRawInstance(null, O)
|
||||||
|
//
|
||||||
// XXX Q: should .__new__(..) be a class method???
|
// XXX Q: should .__new__(..) be a class method???
|
||||||
|
// ...in a prototype model I'm not sure...
|
||||||
var makeRawInstance =
|
var makeRawInstance =
|
||||||
module.makeRawInstance =
|
module.makeRawInstance =
|
||||||
function(context, constructor, ...args){
|
function(context, constructor, ...args){
|
||||||
var _mirror_doc =
|
var _mirror_doc = function(func, target){
|
||||||
function(func, target){
|
|
||||||
Object.defineProperty(func, 'toString', {
|
Object.defineProperty(func, 'toString', {
|
||||||
value: function(...args){
|
value: function(...args){
|
||||||
return target.toString(...args) },
|
return target.toString(...args) },
|
||||||
@ -324,7 +330,6 @@ function(context, constructor, ...args){
|
|||||||
//
|
//
|
||||||
// XXX Q: should the context in .__new__(..) be _constructor or .prototype???
|
// XXX Q: should the context in .__new__(..) be _constructor or .prototype???
|
||||||
// ...currently it's .prototype...
|
// ...currently it's .prototype...
|
||||||
// XXX Q: should we add a wrapper to .makeRawInstance(..) as a class method here???
|
|
||||||
var Constructor =
|
var Constructor =
|
||||||
module.Constructor =
|
module.Constructor =
|
||||||
// shorthand...
|
// shorthand...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user