Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
fdecbddc
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fdecbddc
编写于
6月 24, 2014
作者:
E
erik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
little optimize
上级
f92127bc
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
112 addition
and
113 deletion
+112
-113
src/util/accMath.js
src/util/accMath.js
+22
-28
src/util/ecAnimation.js
src/util/ecAnimation.js
+73
-47
src/util/ecData.js
src/util/ecData.js
+6
-30
src/util/ecQuery.js
src/util/ecQuery.js
+7
-6
src/util/kwargs.js
src/util/kwargs.js
+4
-2
未找到文件。
src/util/accMath.js
浏览文件 @
fdecbddc
...
@@ -2,18 +2,18 @@
...
@@ -2,18 +2,18 @@
* 高精度数学运算
* 高精度数学运算
*/
*/
define
(
function
()
{
define
(
function
()
{
//除法函数,用来得到精确的除法结果
//
除法函数,用来得到精确的除法结果
//说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。
//
说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。
//调用:accDiv(arg1,arg2)
//
调用:accDiv(arg1,arg2)
//返回值:arg1除以arg2的精确结果
//
返回值:arg1除以arg2的精确结果
function
accDiv
(
arg1
,
arg2
)
{
function
accDiv
(
arg1
,
arg2
)
{
return
accMul
(
arg1
,
1
/
arg2
);
return
accMul
(
arg1
,
1
/
arg2
);
}
}
//乘法函数,用来得到精确的乘法结果
//
乘法函数,用来得到精确的乘法结果
//说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
//
说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
//调用:accMul(arg1,arg2)
//
调用:accMul(arg1,arg2)
//返回值:arg1乘以arg2的精确结果
//
返回值:arg1乘以arg2的精确结果
function
accMul
(
arg1
,
arg2
)
{
function
accMul
(
arg1
,
arg2
)
{
var
m
=
0
;
var
m
=
0
;
var
s1
=
arg1
.
toString
();
var
s1
=
arg1
.
toString
();
...
@@ -28,34 +28,28 @@ define(function() {
...
@@ -28,34 +28,28 @@ define(function() {
}
}
catch
(
e
){}
catch
(
e
){}
return
Number
(
s1
.
replace
(
'
.
'
,
''
))
return
(
s1
.
replace
(
'
.
'
,
''
)
-
0
)
*
(
s2
.
replace
(
'
.
'
,
''
)
-
0
)
/
Math
.
pow
(
10
,
m
);
*
Number
(
s2
.
replace
(
'
.
'
,
''
))
/
Math
.
pow
(
10
,
m
);
}
}
//加法函数,用来得到精确的加法结果
//
加法函数,用来得到精确的加法结果
//说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。
//
说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。
//调用:accAdd(arg1,arg2)
//
调用:accAdd(arg1,arg2)
//返回值:arg1加上arg2的精确结果
//
返回值:arg1加上arg2的精确结果
function
accAdd
(
arg1
,
arg2
)
{
function
accAdd
(
arg1
,
arg2
)
{
var
r1
;
var
r1
=
0
;
var
r2
;
var
r2
=
0
;
var
m
;
try
{
try
{
r1
=
arg1
.
toString
().
split
(
'
.
'
)[
1
].
length
;
r1
=
arg1
.
toString
().
split
(
'
.
'
)[
1
].
length
;
}
}
catch
(
e
)
{
catch
(
e
)
{}
r1
=
0
;
}
try
{
try
{
r2
=
arg2
.
toString
().
split
(
'
.
'
)[
1
].
length
;
r2
=
arg2
.
toString
().
split
(
'
.
'
)[
1
].
length
;
}
catch
(
e
)
{
r2
=
0
;
}
}
catch
(
e
)
{}
m
=
Math
.
pow
(
10
,
Math
.
max
(
r1
,
r2
));
var
m
=
Math
.
pow
(
10
,
Math
.
max
(
r1
,
r2
));
return
(
Math
.
round
(
arg1
*
m
)
+
Math
.
round
(
arg2
*
m
))
/
m
;
return
(
Math
.
round
(
arg1
*
m
)
+
Math
.
round
(
arg2
*
m
))
/
m
;
}
}
...
...
src/util/ecAnimation.js
浏览文件 @
fdecbddc
...
@@ -18,45 +18,46 @@ define(function (require) {
...
@@ -18,45 +18,46 @@ define(function (require) {
* @param {tring} easing
* @param {tring} easing
*/
*/
function
pointList
(
zr
,
oldShape
,
newShape
,
duration
,
easing
)
{
function
pointList
(
zr
,
oldShape
,
newShape
,
duration
,
easing
)
{
var
newPointList
;
var
newPointList
=
newShape
.
style
.
pointList
;
var
newPointListLen
=
newPointList
.
length
;
var
oldPointList
;
if
(
!
oldShape
)
{
// add
if
(
!
oldShape
)
{
// add
newPointList
=
[];
oldPointList
=
[];
var
len
=
newShape
.
style
.
pointList
.
length
;
if
(
newShape
.
_orient
!=
'
vertical
'
)
{
if
(
newShape
.
_orient
!=
'
vertical
'
)
{
var
y
=
new
Shape
.
style
.
p
ointList
[
0
][
1
];
var
y
=
new
P
ointList
[
0
][
1
];
for
(
var
i
=
0
;
i
<
l
en
;
i
++
)
{
for
(
var
i
=
0
;
i
<
newPointListL
en
;
i
++
)
{
newPointList
[
i
]
=
[
newShape
.
style
.
p
ointList
[
i
][
0
],
y
];
oldPointList
[
i
]
=
[
newP
ointList
[
i
][
0
],
y
];
}
}
}
}
else
{
else
{
var
x
=
new
Shape
.
style
.
p
ointList
[
0
][
0
];
var
x
=
new
P
ointList
[
0
][
0
];
for
(
var
i
=
0
;
i
<
l
en
;
i
++
)
{
for
(
var
i
=
0
;
i
<
newPointListL
en
;
i
++
)
{
newPointList
[
i
]
=
[
x
,
newShape
.
style
.
p
ointList
[
i
][
1
]];
oldPointList
[
i
]
=
[
x
,
newP
ointList
[
i
][
1
]];
}
}
}
}
if
(
newShape
.
type
==
'
half-smooth-polygon
'
)
{
if
(
newShape
.
type
==
'
half-smooth-polygon
'
)
{
newPointList
[
len
-
1
]
=
zrUtil
.
clone
(
newShape
.
style
.
pointList
[
l
en
-
1
]);
oldPointList
[
newPointListLen
-
1
]
=
zrUtil
.
clone
(
newPointList
[
newPointListL
en
-
1
]);
newPointList
[
len
-
2
]
=
zrUtil
.
clone
(
newShape
.
style
.
pointList
[
l
en
-
2
]);
oldPointList
[
newPointListLen
-
2
]
=
zrUtil
.
clone
(
newPointList
[
newPointListL
en
-
2
]);
}
}
oldShape
=
{
style
:
{
pointList
:
new
PointList
}};
oldShape
=
{
style
:
{
pointList
:
old
PointList
}};
}
}
newPointList
=
newShape
.
style
.
pointList
;
oldPointList
=
oldShape
.
style
.
pointList
;
if
(
oldShape
.
style
.
pointList
.
length
==
newPointList
.
length
)
{
var
oldPointListLen
=
oldPointList
.
length
;
newShape
.
style
.
pointList
=
oldShape
.
style
.
pointList
;
if
(
oldPointListLen
==
newPointListLen
)
{
newShape
.
style
.
pointList
=
oldPointList
;
}
}
else
if
(
old
Shape
.
style
.
pointList
.
length
<
newPointList
.
length
)
{
else
if
(
old
PointListLen
<
newPointListLen
)
{
// 原来短,新的长,补全
// 原来短,新的长,补全
newShape
.
style
.
pointList
=
oldShape
.
style
.
pointList
.
concat
(
newShape
.
style
.
pointList
=
oldPointList
.
concat
(
newPointList
.
slice
(
oldPointListLen
));
newPointList
.
slice
(
oldShape
.
style
.
pointList
.
length
)
);
}
}
else
{
else
{
// 原来长,新的短,截断
// 原来长,新的短,截断
newShape
.
style
.
pointList
=
oldShape
.
style
.
pointList
.
slice
(
newShape
.
style
.
pointList
=
oldPointList
.
slice
(
0
,
newPointListLen
);
0
,
newPointList
.
length
);
}
}
zr
.
addShape
(
newShape
);
zr
.
addShape
(
newShape
);
zr
.
animate
(
newShape
.
id
,
'
style
'
)
zr
.
animate
(
newShape
.
id
,
'
style
'
)
.
when
(
.
when
(
...
@@ -66,6 +67,22 @@ define(function (require) {
...
@@ -66,6 +67,22 @@ define(function (require) {
.
start
(
easing
);
.
start
(
easing
);
}
}
/**
* 复制样式
*
* @inner
* @param {Object} target 目标对象
* @param {Object} source 源对象
* @param {...string} props 复制的属性列表
*/
function
cloneStyle
(
target
,
source
)
{
var
len
=
arguments
.
length
;
for
(
var
i
=
2
;
i
<
len
;
i
++
)
{
var
prop
=
arguments
[
i
];
target
.
style
[
prop
]
=
source
.
style
[
prop
];
}
}
/**
/**
* 方型动画
* 方型动画
*
*
...
@@ -76,29 +93,31 @@ define(function (require) {
...
@@ -76,29 +93,31 @@ define(function (require) {
* @param {tring} easing
* @param {tring} easing
*/
*/
function
rectangle
(
zr
,
oldShape
,
newShape
,
duration
,
easing
)
{
function
rectangle
(
zr
,
oldShape
,
newShape
,
duration
,
easing
)
{
var
newShapeStyle
=
newShape
.
style
;
if
(
!
oldShape
)
{
// add
if
(
!
oldShape
)
{
// add
oldShape
=
{
oldShape
=
{
style
:
{
style
:
{
x
:
newShape
.
s
tyle
.
x
,
x
:
newShape
S
tyle
.
x
,
y
:
newShape
.
_orient
==
'
vertical
'
y
:
newShape
.
_orient
==
'
vertical
'
?
newShape
.
style
.
y
+
newShape
.
s
tyle
.
height
?
newShape
Style
.
y
+
newShapeS
tyle
.
height
:
newShape
.
s
tyle
.
y
,
:
newShape
S
tyle
.
y
,
width
:
newShape
.
_orient
==
'
vertical
'
width
:
newShape
.
_orient
==
'
vertical
'
?
newShape
.
s
tyle
.
width
:
0
,
?
newShape
S
tyle
.
width
:
0
,
height
:
newShape
.
_orient
!=
'
vertical
'
height
:
newShape
.
_orient
!=
'
vertical
'
?
newShape
.
s
tyle
.
height
:
0
?
newShape
S
tyle
.
height
:
0
}
}
};
};
}
}
var
newX
=
newShape
.
style
.
x
;
var
newX
=
newShapeStyle
.
x
;
var
newY
=
newShape
.
style
.
y
;
var
newY
=
newShapeStyle
.
y
;
var
newWidth
=
newShape
.
style
.
width
;
var
newWidth
=
newShapeStyle
.
width
;
var
newHeight
=
newShape
.
style
.
height
;
var
newHeight
=
newShapeStyle
.
height
;
newShape
.
style
.
x
=
oldShape
.
style
.
x
;
cloneStyle
(
newShape
.
style
.
y
=
oldShape
.
style
.
y
;
newShape
,
oldShape
,
newShape
.
style
.
width
=
oldShape
.
style
.
width
;
'
x
'
,
'
y
'
,
'
width
'
,
'
height
'
newShape
.
style
.
height
=
oldShape
.
style
.
height
;
);
zr
.
addShape
(
newShape
);
zr
.
addShape
(
newShape
);
zr
.
animate
(
newShape
.
id
,
'
style
'
)
zr
.
animate
(
newShape
.
id
,
'
style
'
)
.
when
(
.
when
(
...
@@ -218,8 +237,10 @@ define(function (require) {
...
@@ -218,8 +237,10 @@ define(function (require) {
var
startAngle
=
newShape
.
style
.
startAngle
;
var
startAngle
=
newShape
.
style
.
startAngle
;
var
endAngle
=
newShape
.
style
.
endAngle
;
var
endAngle
=
newShape
.
style
.
endAngle
;
newShape
.
style
.
startAngle
=
oldShape
.
style
.
startAngle
;
cloneStyle
(
newShape
.
style
.
endAngle
=
oldShape
.
style
.
endAngle
;
newShape
,
oldShape
,
'
startAngle
'
,
'
endAngle
'
);
zr
.
addShape
(
newShape
);
zr
.
addShape
(
newShape
);
zr
.
animate
(
newShape
.
id
,
'
style
'
)
zr
.
animate
(
newShape
.
id
,
'
style
'
)
...
@@ -257,8 +278,10 @@ define(function (require) {
...
@@ -257,8 +278,10 @@ define(function (require) {
var
x
=
newShape
.
style
.
x
;
var
x
=
newShape
.
style
.
x
;
var
y
=
newShape
.
style
.
y
;
var
y
=
newShape
.
style
.
y
;
newShape
.
style
.
x
=
oldShape
.
style
.
x
;
cloneStyle
(
newShape
.
style
.
y
=
oldShape
.
style
.
y
;
newShape
,
oldShape
,
'
x
'
,
'
y
'
);
zr
.
addShape
(
newShape
);
zr
.
addShape
(
newShape
);
zr
.
animate
(
newShape
.
id
,
'
style
'
)
zr
.
animate
(
newShape
.
id
,
'
style
'
)
...
@@ -325,10 +348,10 @@ define(function (require) {
...
@@ -325,10 +348,10 @@ define(function (require) {
var
target1
=
newShape
.
style
.
target1
;
var
target1
=
newShape
.
style
.
target1
;
if
(
oldShape
.
style
)
{
if
(
oldShape
.
style
)
{
newShape
.
style
.
source0
=
oldShape
.
style
.
source0
;
cloneStyle
(
newShape
.
style
.
source1
=
oldShape
.
style
.
source1
;
newShape
,
oldShape
,
newShape
.
style
.
target0
=
oldShape
.
style
.
target0
;
'
source0
'
,
'
source1
'
,
'
target0
'
,
'
target1
'
newShape
.
style
.
target1
=
oldShape
.
style
.
target1
;
)
;
}
}
zr
.
addShape
(
newShape
);
zr
.
addShape
(
newShape
);
...
@@ -391,6 +414,7 @@ define(function (require) {
...
@@ -391,6 +414,7 @@ define(function (require) {
newShape
.
style
.
_y
=
newShape
.
style
.
y
;
newShape
.
style
.
_y
=
newShape
.
style
.
y
;
newShape
.
style
.
_width
=
newShape
.
style
.
width
;
newShape
.
style
.
_width
=
newShape
.
style
.
width
;
newShape
.
style
.
_height
=
newShape
.
style
.
height
;
newShape
.
style
.
_height
=
newShape
.
style
.
height
;
if
(
!
oldShape
)
{
// add
if
(
!
oldShape
)
{
// add
var
x
=
newShape
.
_x
||
0
;
var
x
=
newShape
.
_x
||
0
;
var
y
=
newShape
.
_y
||
0
;
var
y
=
newShape
.
_y
||
0
;
...
@@ -431,10 +455,12 @@ define(function (require) {
...
@@ -431,10 +455,12 @@ define(function (require) {
var
xEnd
=
newShape
.
style
.
xEnd
;
var
xEnd
=
newShape
.
style
.
xEnd
;
var
yStart
=
newShape
.
style
.
yStart
;
var
yStart
=
newShape
.
style
.
yStart
;
var
yEnd
=
newShape
.
style
.
yEnd
;
var
yEnd
=
newShape
.
style
.
yEnd
;
newShape
.
style
.
xStart
=
oldShape
.
style
.
xStart
;
newShape
.
style
.
xEnd
=
oldShape
.
style
.
xEnd
;
cloneStyle
(
newShape
.
style
.
yStart
=
oldShape
.
style
.
yStart
;
newShape
,
oldShape
,
newShape
.
style
.
yEnd
=
oldShape
.
style
.
yEnd
;
'
xStart
'
,
'
xEnd
'
,
'
yStart
'
,
'
yEnd
'
);
zr
.
addShape
(
newShape
);
zr
.
addShape
(
newShape
);
zr
.
animate
(
newShape
.
id
,
'
style
'
)
zr
.
animate
(
newShape
.
id
,
'
style
'
)
.
when
(
.
when
(
...
...
src/util/ecData.js
浏览文件 @
fdecbddc
...
@@ -22,12 +22,9 @@ define(function() {
...
@@ -22,12 +22,9 @@ define(function() {
)
{
)
{
var
value
;
var
value
;
if
(
typeof
data
!=
'
undefined
'
)
{
if
(
typeof
data
!=
'
undefined
'
)
{
if
(
typeof
data
.
value
!=
'
undefined
'
)
{
value
=
data
.
value
==
null
value
=
data
.
value
;
?
data
}
:
data
.
value
;
else
{
value
=
data
;
}
}
}
shape
.
_echartsData
=
{
shape
.
_echartsData
=
{
...
@@ -56,21 +53,14 @@ define(function() {
...
@@ -56,21 +53,14 @@ define(function() {
switch
(
key
)
{
switch
(
key
)
{
case
'
series
'
:
case
'
series
'
:
return
data
&&
data
.
_series
;
case
'
seriesIndex
'
:
case
'
seriesIndex
'
:
return
data
&&
data
.
_seriesIndex
;
case
'
data
'
:
case
'
data
'
:
return
data
&&
data
.
_data
;
case
'
dataIndex
'
:
case
'
dataIndex
'
:
return
data
&&
data
.
_dataIndex
;
case
'
name
'
:
case
'
name
'
:
return
data
&&
data
.
_name
;
case
'
value
'
:
case
'
value
'
:
return
data
&&
data
.
_value
;
case
'
special
'
:
case
'
special
'
:
return
data
&&
data
.
_special
;
case
'
special2
'
:
case
'
special2
'
:
return
data
&&
data
.
_special2
;
return
data
&&
data
[
'
_
'
+
key
]
;
}
}
return
null
;
return
null
;
...
@@ -86,28 +76,14 @@ define(function() {
...
@@ -86,28 +76,14 @@ define(function() {
shape
.
_echartsData
=
shape
.
_echartsData
||
{};
shape
.
_echartsData
=
shape
.
_echartsData
||
{};
switch
(
key
)
{
switch
(
key
)
{
case
'
series
'
:
// 当前系列值
case
'
series
'
:
// 当前系列值
shape
.
_echartsData
.
_series
=
value
;
break
;
case
'
seriesIndex
'
:
// 系列数组位置索引
case
'
seriesIndex
'
:
// 系列数组位置索引
shape
.
_echartsData
.
_seriesIndex
=
value
;
break
;
case
'
data
'
:
// 当前数据值
case
'
data
'
:
// 当前数据值
shape
.
_echartsData
.
_data
=
value
;
break
;
case
'
dataIndex
'
:
// 数据数组位置索引
case
'
dataIndex
'
:
// 数据数组位置索引
shape
.
_echartsData
.
_dataIndex
=
value
;
break
;
case
'
name
'
:
case
'
name
'
:
shape
.
_echartsData
.
_name
=
value
;
break
;
case
'
value
'
:
case
'
value
'
:
shape
.
_echartsData
.
_value
=
value
;
break
;
case
'
special
'
:
case
'
special
'
:
shape
.
_echartsData
.
_special
=
value
;
break
;
case
'
special2
'
:
case
'
special2
'
:
shape
.
_echartsData
.
_special2
=
value
;
shape
.
_echartsData
[
'
_
'
+
key
]
=
value
;
break
;
break
;
}
}
}
}
...
...
src/util/ecQuery.js
浏览文件 @
fdecbddc
...
@@ -14,22 +14,24 @@ define(function() {
...
@@ -14,22 +14,24 @@ define(function() {
*/
*/
function
query
(
optionTarget
,
optionLocation
)
{
function
query
(
optionTarget
,
optionLocation
)
{
if
(
typeof
optionTarget
==
'
undefined
'
)
{
if
(
typeof
optionTarget
==
'
undefined
'
)
{
return
undefined
;
return
;
}
}
if
(
!
optionLocation
)
{
if
(
!
optionLocation
)
{
return
optionTarget
;
return
optionTarget
;
}
}
optionLocation
=
optionLocation
.
split
(
'
.
'
);
optionLocation
=
optionLocation
.
split
(
'
.
'
);
var
length
=
optionLocation
.
length
;
var
length
=
optionLocation
.
length
;
var
curIdx
=
0
;
var
curIdx
=
0
;
while
(
curIdx
<
length
)
{
while
(
curIdx
<
length
)
{
optionTarget
=
optionTarget
[
optionLocation
[
curIdx
]];
optionTarget
=
optionTarget
[
optionLocation
[
curIdx
]];
if
(
typeof
optionTarget
==
'
undefined
'
)
{
if
(
typeof
optionTarget
==
'
undefined
'
)
{
return
undefined
;
return
;
}
}
curIdx
++
;
curIdx
++
;
}
}
return
optionTarget
;
return
optionTarget
;
}
}
...
@@ -45,7 +47,6 @@ define(function() {
...
@@ -45,7 +47,6 @@ define(function() {
return
finalOption
;
return
finalOption
;
}
}
}
}
return
undefined
;
}
}
/**
/**
...
@@ -54,10 +55,9 @@ define(function() {
...
@@ -54,10 +55,9 @@ define(function() {
*/
*/
function
deepMerge
(
ctrList
,
optionLocation
)
{
function
deepMerge
(
ctrList
,
optionLocation
)
{
var
finalOption
;
var
finalOption
;
var
tempOption
;
var
len
=
ctrList
.
length
;
var
len
=
ctrList
.
length
;
while
(
len
--
)
{
while
(
len
--
)
{
tempOption
=
query
(
ctrList
[
len
],
optionLocation
);
var
tempOption
=
query
(
ctrList
[
len
],
optionLocation
);
if
(
typeof
tempOption
!=
'
undefined
'
)
{
if
(
typeof
tempOption
!=
'
undefined
'
)
{
if
(
typeof
finalOption
==
'
undefined
'
)
{
if
(
typeof
finalOption
==
'
undefined
'
)
{
finalOption
=
zrUtil
.
clone
(
tempOption
);
finalOption
=
zrUtil
.
clone
(
tempOption
);
...
@@ -69,6 +69,7 @@ define(function() {
...
@@ -69,6 +69,7 @@ define(function() {
}
}
}
}
}
}
return
finalOption
;
return
finalOption
;
}
}
...
...
src/util/kwargs.js
浏览文件 @
fdecbddc
...
@@ -23,7 +23,8 @@ define(function (){
...
@@ -23,7 +23,8 @@ define(function (){
// Check the existance of the kwargs
// Check the existance of the kwargs
if
(
kwargs
&&
kwargs
.
constructor
===
Object
)
{
if
(
kwargs
&&
kwargs
.
constructor
===
Object
)
{
args
.
pop
();
args
.
pop
();
}
else
{
}
else
{
kwargs
=
{};
kwargs
=
{};
}
}
...
@@ -32,7 +33,8 @@ define(function (){
...
@@ -32,7 +33,8 @@ define(function (){
var
name
=
names
[
i
];
var
name
=
names
[
i
];
if
(
name
in
kwargs
)
{
if
(
name
in
kwargs
)
{
args
[
i
]
=
kwargs
[
name
];
args
[
i
]
=
kwargs
[
name
];
}
else
if
(
name
in
defaults
&&
args
[
i
]
===
undefined
){
}
else
if
(
name
in
defaults
&&
args
[
i
]
==
null
){
args
[
i
]
=
defaults
[
name
];
args
[
i
]
=
defaults
[
name
];
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录