12.4 Expression statement

2010-05-23

ExpressionStatement :
[lookahead !e { {, function }] Expression ;

An ExpressionStatement may not start with an opening curly brace or function because that may make it ambiguous with Block and FunctionDeclaration respectfully.

Code: (Meta Ecma)
function evaluate(Expression) {
var exprRef = evaluate(Expression);
return Completion('normal', GetValue(exprRef), undefined);
}