1 | 'use strict';
|
2 | var isCallable = require('../internals/is-callable');
|
3 | var isObject = require('../internals/is-object');
|
4 | var setPrototypeOf = require('../internals/object-set-prototype-of');
|
5 |
|
6 |
|
7 | module.exports = function ($this, dummy, Wrapper) {
|
8 | var NewTarget, NewTargetPrototype;
|
9 | if (
|
10 |
|
11 | setPrototypeOf &&
|
12 |
|
13 | isCallable(NewTarget = dummy.constructor) &&
|
14 | NewTarget !== Wrapper &&
|
15 | isObject(NewTargetPrototype = NewTarget.prototype) &&
|
16 | NewTargetPrototype !== Wrapper.prototype
|
17 | ) setPrototypeOf($this, NewTargetPrototype);
|
18 | return $this;
|
19 | };
|