main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
407 bytes
|
Line | |
---|
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 (!Object.prototype.hasOwnProperty.call(obj, prop)) {
|
---|
13 | obj[prop] = proto[prop]
|
---|
14 | }
|
---|
15 | }
|
---|
16 | return obj
|
---|
17 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.