mirror of
https://github.com/flynx/object.js.git
synced 2025-11-01 03:50:09 +00:00
minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8d3e701d4c
commit
fe0903b28e
@ -398,6 +398,9 @@ function(context, constructor, ...args){
|
||||
// it via. Object.create(..) or copy it...
|
||||
//
|
||||
// XXX EXPERIMENTAL: calling .__rawinstance__(..) to create an instance...
|
||||
// NOTE: to disable .__rawinstance__(..) handling set it to false in the
|
||||
// class prototype...
|
||||
//
|
||||
// XXX Q: should the context in .__new__(..) be _constructor or .prototype???
|
||||
// ...currently it's .prototype...
|
||||
var Constructor =
|
||||
@ -432,7 +435,6 @@ function Constructor(name, a, b){
|
||||
// set .toString(..)...
|
||||
// NOTE: do this only if .toString(..) is not defined by user...
|
||||
;((cls_proto || {}).toString() == ({}).toString())
|
||||
// XXX is this the right way to go or should we set this openly???
|
||||
&& Object.defineProperty(_constructor, 'toString', {
|
||||
value: function(){
|
||||
var args = proto.__init__ ?
|
||||
@ -452,7 +454,7 @@ function Constructor(name, a, b){
|
||||
_constructor.prototype = proto
|
||||
// XXX EXPERIMENTAL...
|
||||
// generic raw instance constructor...
|
||||
_constructor.__rawinstance__
|
||||
_constructor.__rawinstance__ instanceof Function
|
||||
|| (_constructor.__rawinstance__ =
|
||||
function(context, ...args){
|
||||
return makeRawInstance(context, this, ...args) })
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-object",
|
||||
"version": "2.4.5",
|
||||
"version": "2.4.6",
|
||||
"description": "",
|
||||
"main": "object.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user