|
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:
613 bytes
|
| Line | |
|---|
| 1 | define(['./_baseCreate', './isObject'], function (_baseCreate, isObject) {
|
|---|
| 2 |
|
|---|
| 3 | // Internal function to execute `sourceFunc` bound to `context` with optional
|
|---|
| 4 | // `args`. Determines whether to execute a function as a constructor or as a
|
|---|
| 5 | // normal function.
|
|---|
| 6 | function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
|
|---|
| 7 | if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
|
|---|
| 8 | var self = _baseCreate(sourceFunc.prototype);
|
|---|
| 9 | var result = sourceFunc.apply(self, args);
|
|---|
| 10 | if (isObject(result)) return result;
|
|---|
| 11 | return self;
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | return executeBound;
|
|---|
| 15 |
|
|---|
| 16 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.