Mercurial > pub > ImplabJs
comparison src/implab/safe.js @ 8:f0035923ff3e
добавлена библиотека для работы с openlayers 3+
| author | cin |
|---|---|
| date | Mon, 21 Aug 2017 17:47:00 +0300 |
| parents | 9c0943c68a90 |
| children | 3d4abbce4afc |
comparison
equal
deleted
inserted
replaced
| 7:9c0943c68a90 | 8:f0035923ff3e |
|---|---|
| 141 /** Wraps the specified function to emulate an asynchronous execution. | 141 /** Wraps the specified function to emulate an asynchronous execution. |
| 142 * @param{Object} thisArg [Optional] Object which will be passed as 'this' to the function. | 142 * @param{Object} thisArg [Optional] Object which will be passed as 'this' to the function. |
| 143 * @param{Function|String} fn [Required] Function wich will be wrapped. | 143 * @param{Function|String} fn [Required] Function wich will be wrapped. |
| 144 */ | 144 */ |
| 145 async: function (fn, thisArg) { | 145 async: function (fn, thisArg) { |
| 146 if (arguments.length == 2) | 146 if (arguments.length == 2 && !(fn instanceof Function)) |
| 147 fn = thisArg[fn]; | 147 fn = thisArg[fn]; |
| 148 | 148 |
| 149 if (fn == null) | 149 if (fn == null) |
| 150 throw new Error("The function must be specified"); | 150 throw new Error("The function must be specified"); |
| 151 | 151 |
