2
這是我的JavaScript(多剝離下來):意外的JavaScript皮棉警告 「行意外結束」
function addContent() {
var content = [];
content.append(
makeVal({
value : 1
})
); // Generates lint message
}
在這個運行的lint程序,我得到的消息
unexpected end of line; it is ambiguous whether these lines are part of the same statement
上線7.如果我連接第6行和第7行,消息就會消失。
任何人都可以解釋這個歧義的地方嗎?在我看來,第7行的括號明確地關閉了對append()的調用。
你使用哪個lint程序?聽起來像我需要爲它提交一個錯誤報告。 – Spudley 2010-11-19 12:14:05
我寧願說那個時候*內容*是不確定的。 – Gumbo 2010-11-19 12:19:41
這對我來說更具可讀性makeVal({「value」:1}) – mplungjan 2010-11-19 12:43:28