source: frontend/node_modules/underscore/modules/_baseCreate.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 535 bytes
Line 
1import isObject from './isObject.js';
2import { nativeCreate } from './_setup.js';
3
4// Create a naked function reference for surrogate-prototype-swapping.
5function ctor() {
6 return function(){};
7}
8
9// An internal function for creating a new object that inherits from another.
10export default function baseCreate(prototype) {
11 if (!isObject(prototype)) return {};
12 if (nativeCreate) return nativeCreate(prototype);
13 var Ctor = ctor();
14 Ctor.prototype = prototype;
15 var result = new Ctor;
16 Ctor.prototype = null;
17 return result;
18}
Note: See TracBrowser for help on using the repository browser.