source: frontend/node_modules/underscore/amd/_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: 572 bytes
Line 
1define(['./isObject', './_setup'], function (isObject, _setup) {
2
3 // Create a naked function reference for surrogate-prototype-swapping.
4 function ctor() {
5 return function(){};
6 }
7
8 // An internal function for creating a new object that inherits from another.
9 function baseCreate(prototype) {
10 if (!isObject(prototype)) return {};
11 if (_setup.nativeCreate) return _setup.nativeCreate(prototype);
12 var Ctor = ctor();
13 Ctor.prototype = prototype;
14 var result = new Ctor;
15 Ctor.prototype = null;
16 return result;
17 }
18
19 return baseCreate;
20
21});
Note: See TracBrowser for help on using the repository browser.