|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
750 bytes
|
| Line | |
|---|
| 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 | // makes subclassing work correct for wrapped built-ins
|
|---|
| 7 | module.exports = function ($this, dummy, Wrapper) {
|
|---|
| 8 | var NewTarget, NewTargetPrototype;
|
|---|
| 9 | if (
|
|---|
| 10 | // it can work only with native `setPrototypeOf`
|
|---|
| 11 | setPrototypeOf &&
|
|---|
| 12 | // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
|
|---|
| 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 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.