bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-05-16 17:49:20 +03:00
parent acb4254f6a
commit 7e6d4f3188
2 changed files with 5 additions and 2 deletions

View File

@ -536,10 +536,13 @@ function(context, constructor, ...args){
: constructor.prototype.__call__ : constructor.prototype.__call__
.call(obj, this, ...arguments)) }, .call(obj, this, ...arguments)) },
constructor) constructor)
// recursively call .__rawinstance__(..)
: constructor.__proto__.__rawinstance__ ?
constructor.__proto__.__rawinstance__(context, ...args)
// use parent's constructor... // use parent's constructor...
: (typeof(constructor.__proto__) == 'function' : (typeof(constructor.__proto__) == 'function'
&& constructor.__proto__ !== (function(){}).__proto__) ? && constructor.__proto__ !== (function(){}).__proto__) ?
Reflect.construct(constructor.__proto__, [], constructor) Reflect.construct(constructor.__proto__, args, constructor)
// default object base... // default object base...
: Reflect.construct(Object, [], constructor) : Reflect.construct(Object, [], constructor)

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-object", "name": "ig-object",
"version": "4.0.1", "version": "4.0.2",
"description": "", "description": "",
"main": "object.js", "main": "object.js",
"scripts": { "scripts": {