受自动分号插入影响的语句
- 空的陈述
var
声明- 表达陈述
do-while
声明continue
声明break
声明return
声明throw
声明
例子:
当遇到令牌输入流的末尾并且解析器无法将输入令牌流解析为单个完整的程序时,则在输入流的末尾自动插入分号。
a = b
++c
// is transformed to:
a = b;
++c;
x
++
y
// is transformed to:
x;
++y;
数组索引/文字
console.log("Hello, World")
[1,2,3].join()
// is transformed to:
console.log("Hello, World")[(1, 2, 3)].join();
退货声明:
return
"something";
// is transformed to
return;
"something";