JS错误,看看里面

时间:2013-05-12 06:20:48

标签: javascript

/**
 * @const
 * @type {!storeLocator.FeatureSet}
 * @type {!storeLocator.FeatureSet}
 * @private
 */
MedicareDataSource.prototype.FEATURES_ = new storeLocator.FeatureSet(
    new storeLocator.Feature('Wheelchair-YES', 'Shoe1'),
    new storeLocator.Feature('Audio-YES', 'Shoe2')
);


/**
 * @return {!storeLocator.FeatureSet}
 */
MedicareDataSource.prototype.getFeatures = function() {
    return this.FEATURES_;
};

每次我在Audio-YES行之后添加一行代码,输出会在我的程序中消失?有什么问题?

2 个答案:

答案 0 :(得分:0)

您无法在new storeLocator.Feature('Audio-YES', 'Shoe2')之后立即添加代码。剧情: storeLocator.FeatureSet构造函数在那里编写代码,传递参数,用逗号分隔。

答案 1 :(得分:0)

也许您在插入新行之前忘记添加,

MedicareDataSource.prototype.FEATURES_ = new storeLocator.FeatureSet(
    new storeLocator.Feature('Wheelchair-YES', 'Shoe1'),
    new storeLocator.Feature('Audio-YES', 'Shoe2'), // don't forget the comma
    new storeLocator.Feature('something', 'else')
);