File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ define(
200
200
// 如果prototype上的属性是引用类型,则复制一份,
201
201
// 防止因共享修改导致的问题
202
202
if ( ! this . hasOwnProperty ( 'datasource' ) && this . datasource ) {
203
- this . datasource = Object . create ? Object . create ( this . datasource ) : u . clone ( this . datasource ) ;
203
+ this . datasource = u . clone ( this . datasource ) ;
204
204
}
205
205
206
206
if ( context ) {
Original file line number Diff line number Diff line change @@ -11,10 +11,6 @@ define(
11
11
var util = require ( './util' ) ;
12
12
var u = require ( 'underscore' ) ;
13
13
14
- function create ( oringin ) {
15
- return Object . create ? Object . create ( oringin ) : u . clone ( oringin ) ;
16
- }
17
-
18
14
/**
19
15
* @class View
20
16
*
@@ -35,11 +31,11 @@ define(
35
31
// 如果prototype上的属性是引用类型,则复制一份,
36
32
// 防止因共享修改导致的问题
37
33
if ( ! this . hasOwnProperty ( 'uiProperties' ) && this . uiProperties ) {
38
- this . uiProperties = create ( this . uiProperties ) ;
34
+ this . uiProperties = u . clone ( this . uiProperties ) ;
39
35
}
40
36
41
37
if ( ! this . hasOwnProperty ( 'uiEvents' ) && this . uiEvents ) {
42
- this . uiEvents = create ( this . uiEvents ) ;
38
+ this . uiEvents = u . clone ( this . uiEvents ) ;
43
39
}
44
40
45
41
this . initialize ( ) ;
Original file line number Diff line number Diff line change @@ -59,12 +59,13 @@ define(
59
59
// 因为自己实现的`bind`很会影响调试时的单步调试,
60
60
// 跳进一个函数的时候还要经过这个`bind`几步很烦,原生的就不会
61
61
var nativeBind = Function . prototype . bind ;
62
+
62
63
/**
63
64
* 固定函数的`this`变量和若干参数
64
65
*
65
66
* @param {Function } fn 操作的目标函数
66
67
* @param {Mixed } context 函数的`this`变量
67
- * @param {Mixed ... } args 固定的参数
68
+ * @param {...Mixed } args 固定的参数
68
69
* @return {Function } 固定了`this`变量和若干参数后的新函数对象
69
70
*/
70
71
util . bind = nativeBind
You can’t perform that action at this time.
0 commit comments