|
4 | 4 | import { StringExt } from './BaseTypes'; |
5 | 5 | import { Geometry } from './Geometry'; |
6 | 6 | import URI from 'urijs'; |
| 7 | +import { CircularUtil } from './CircularUtil'; |
7 | 8 |
|
8 | 9 | /** |
9 | 10 | * @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:<br> |
@@ -168,36 +169,7 @@ const Util = { |
168 | 169 | * @returns {Object} 目标对象。 |
169 | 170 | */ |
170 | 171 |
|
171 | | - extend: function (destination, source) { |
172 | | - destination = destination || {}; |
173 | | - if (source) { |
174 | | - for (var property in source) { |
175 | | - var value = source[property]; |
176 | | - if (value !== undefined) { |
177 | | - destination[property] = value; |
178 | | - } |
179 | | - } |
180 | | - |
181 | | - /** |
182 | | - * IE doesn't include the toString property when iterating over an object's |
183 | | - * properties with the for(property in object) syntax. Explicitly check if |
184 | | - * the source has its own toString property. |
185 | | - */ |
186 | | - |
187 | | - /* |
188 | | - * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative |
189 | | - * prototype object" when calling hawOwnProperty if the source object |
190 | | - * is an instance of window.Event. |
191 | | - */ |
192 | | - |
193 | | - var sourceIsEvt = typeof window.Event === 'function' && source instanceof window.Event; |
194 | | - |
195 | | - if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty('toString')) { |
196 | | - destination.toString = source.toString; |
197 | | - } |
198 | | - } |
199 | | - return destination; |
200 | | - }, |
| 172 | + extend: CircularUtil.extend, |
201 | 173 | /** |
202 | 174 | * @memberOf CommonUtil |
203 | 175 | * @description 对象拷贝。 |
@@ -583,21 +555,15 @@ const Util = { |
583 | 555 | * @type {number} |
584 | 556 | * @default 0 |
585 | 557 | */ |
586 | | - lastSeqID: 0, |
| 558 | + lastSeqID: CircularUtil.lastSeqID, |
587 | 559 |
|
588 | 560 | /** |
589 | 561 | * @memberOf CommonUtil |
590 | 562 | * @description 创建唯一 ID 值。 |
591 | 563 | * @param {string} [prefix] - 前缀。 |
592 | 564 | * @returns {string} 唯一的 ID 值。 |
593 | 565 | */ |
594 | | - createUniqueID: function (prefix) { |
595 | | - if (prefix == null) { |
596 | | - prefix = 'id_'; |
597 | | - } |
598 | | - Util.lastSeqID += 1; |
599 | | - return prefix + Util.lastSeqID; |
600 | | - }, |
| 566 | + createUniqueID: CircularUtil.createUniqueID, |
601 | 567 |
|
602 | 568 | /** |
603 | 569 | * @memberOf CommonUtil |
|
0 commit comments