提交 47910327 编写于 作者: L lang

List#getName add parameter to avoid returns not needed index

上级 bbff1547
......@@ -460,12 +460,14 @@ define(function (require) {
/**
* @param {number} idx
* @param {boolean} [notDefaultIdx=false]
* @return {string}
*/
listProto.getName = function (idx) {
listProto.getName = function (idx, notDefaultIdx) {
var nameList = this._nameList;
var rawIndex = this.indices[idx];
return nameList[rawIndex] || (rawIndex + '');
return nameList[rawIndex]
|| (notDefaultIdx ? '' : (rawIndex + ''));
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册