Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
384 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict'
|
---|
| 2 | /* eslint no-proto: 0 */
|
---|
| 3 | module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties)
|
---|
| 4 |
|
---|
| 5 | function setProtoOf (obj, proto) {
|
---|
| 6 | obj.__proto__ = proto
|
---|
| 7 | return obj
|
---|
| 8 | }
|
---|
| 9 |
|
---|
| 10 | function mixinProperties (obj, proto) {
|
---|
| 11 | for (var prop in proto) {
|
---|
| 12 | if (!obj.hasOwnProperty(prop)) {
|
---|
| 13 | obj[prop] = proto[prop]
|
---|
| 14 | }
|
---|
| 15 | }
|
---|
| 16 | return obj
|
---|
| 17 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.